Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branches 'x86-fixes-for-linus', 'sched-fixes-for-linus', 'timers-fixes-for-linus', 'irq-fixes-for-linus' and 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86-32, fpu: Fix FPU exception handling on non-SSE systems
x86, hibernate: Initialize mmu_cr4_features during boot
x86-32, NUMA: Fix ACPI NUMA init broken by recent x86-64 change
x86: visws: Fixup irq overhaul fallout

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
sched: Clean up rebalance_domains() load-balance interval calculation

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86/mrst/vrtc: Fix boot crash in mrst_rtc_init()
rtc, x86/mrst/vrtc: Fix boot crash in rtc_read_alarm()

* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
genirq: Fix cpumask leak in __setup_irq()

* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
perf probe: Fix listing incorrect line number with inline function
perf probe: Fix to find recursively inlined function
perf probe: Fix multiple --vars options behavior
perf probe: Fix to remove redundant close
perf probe: Fix to ensure function declared file

+152 -90
+1 -1
arch/x86/include/asm/i387.h
··· 237 237 } else if (use_fxsr()) { 238 238 fpu_fxsave(fpu); 239 239 } else { 240 - asm volatile("fsave %[fx]; fwait" 240 + asm volatile("fnsave %[fx]; fwait" 241 241 : [fx] "=m" (fpu->state->fsave)); 242 242 return; 243 243 }
+5
arch/x86/kernel/setup.c
··· 976 976 paging_init(); 977 977 x86_init.paging.pagetable_setup_done(swapper_pg_dir); 978 978 979 + if (boot_cpu_data.cpuid_level >= 0) { 980 + /* A CPU has %cr4 if and only if it has CPUID */ 981 + mmu_cr4_features = read_cr4(); 982 + } 983 + 979 984 #ifdef CONFIG_X86_32 980 985 /* sync back kernel address range */ 981 986 clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY,
+3 -1
arch/x86/mm/srat_32.c
··· 211 211 { 212 212 int i, j, nid; 213 213 214 - 215 214 if (srat_disabled()) 215 + goto out_fail; 216 + 217 + if (acpi_numa_init() < 0) 216 218 goto out_fail; 217 219 218 220 if (num_memory_chunks == 0) {
+3 -1
arch/x86/platform/mrst/vrtc.c
··· 100 100 101 101 void __init mrst_rtc_init(void) 102 102 { 103 - unsigned long vrtc_paddr = sfi_mrtc_array[0].phys_addr; 103 + unsigned long vrtc_paddr; 104 104 105 105 sfi_table_parse(SFI_SIG_MRTC, NULL, NULL, sfi_parse_mrtc); 106 + 107 + vrtc_paddr = sfi_mrtc_array[0].phys_addr; 106 108 if (!sfi_mrtc_num || !vrtc_paddr) 107 109 return; 108 110
+6 -14
arch/x86/platform/visws/visws_quirks.c
··· 471 471 { 472 472 legacy_pic->init(0); 473 473 enable_cobalt_irq(data); 474 - } 475 - 476 - static void end_piix4_master_irq(struct irq_data *data) 477 - { 478 - unsigned long flags; 479 - 480 - spin_lock_irqsave(&cobalt_lock, flags); 481 - enable_cobalt_irq(data); 482 - spin_unlock_irqrestore(&cobalt_lock, flags); 474 + return 0; 483 475 } 484 476 485 477 static struct irq_chip piix4_master_irq_type = { ··· 484 492 485 493 static struct irq_chip piix4_virtual_irq_type = { 486 494 .name = "PIIX4-virtual", 487 - .mask = pii4_mask, 495 + .irq_mask = pii4_mask, 488 496 }; 489 497 490 498 /* ··· 572 580 573 581 static inline void set_piix4_virtual_irq_type(void) 574 582 { 575 - piix4_virtual_irq_type.enable = i8259A_chip.unmask; 576 - piix4_virtual_irq_type.disable = i8259A_chip.mask; 577 - piix4_virtual_irq_type.unmask = i8259A_chip.unmask; 583 + piix4_virtual_irq_type.irq_enable = i8259A_chip.irq_unmask; 584 + piix4_virtual_irq_type.irq_disable = i8259A_chip.irq_mask; 585 + piix4_virtual_irq_type.irq_unmask = i8259A_chip.irq_unmask; 578 586 } 579 587 580 588 static void __init visws_pre_intr_init(void) ··· 591 599 else if (i == CO_IRQ_IDE0) 592 600 chip = &cobalt_irq_type; 593 601 else if (i == CO_IRQ_IDE1) 594 - >chip = &cobalt_irq_type; 602 + chip = &cobalt_irq_type; 595 603 else if (i == CO_IRQ_8259) 596 604 chip = &piix4_master_irq_type; 597 605 else if (i < CO_IRQ_APIC0)
+4 -3
drivers/rtc/rtc-mrst.c
··· 342 342 343 343 mrst_rtc.irq = rtc_irq; 344 344 mrst_rtc.iomem = iomem; 345 + mrst_rtc.dev = dev; 346 + dev_set_drvdata(dev, &mrst_rtc); 345 347 346 348 mrst_rtc.rtc = rtc_device_register(driver_name, dev, 347 349 &mrst_rtc_ops, THIS_MODULE); ··· 352 350 goto cleanup0; 353 351 } 354 352 355 - mrst_rtc.dev = dev; 356 - dev_set_drvdata(dev, &mrst_rtc); 357 353 rename_region(iomem, dev_name(&mrst_rtc.rtc->dev)); 358 354 359 355 spin_lock_irq(&rtc_lock); ··· 376 376 return 0; 377 377 378 378 cleanup1: 379 - mrst_rtc.dev = NULL; 380 379 rtc_device_unregister(mrst_rtc.rtc); 381 380 cleanup0: 381 + dev_set_drvdata(dev, NULL); 382 + mrst_rtc.dev = NULL; 382 383 release_region(iomem->start, iomem->end + 1 - iomem->start); 383 384 dev_err(dev, "rtc-mrst: unable to initialise\n"); 384 385 return retval;
+1
kernel/irq/manage.c
··· 1051 1051 register_irq_proc(irq, desc); 1052 1052 new->dir = NULL; 1053 1053 register_handler_proc(irq, new); 1054 + free_cpumask_var(mask); 1054 1055 1055 1056 return 0; 1056 1057
+3
kernel/sched.c
··· 6331 6331 break; 6332 6332 #endif 6333 6333 } 6334 + 6335 + update_max_interval(); 6336 + 6334 6337 return NOTIFY_OK; 6335 6338 } 6336 6339
+12 -4
kernel/sched_fair.c
··· 3820 3820 3821 3821 static DEFINE_SPINLOCK(balancing); 3822 3822 3823 + static unsigned long __read_mostly max_load_balance_interval = HZ/10; 3824 + 3825 + /* 3826 + * Scale the max load_balance interval with the number of CPUs in the system. 3827 + * This trades load-balance latency on larger machines for less cross talk. 3828 + */ 3829 + static void update_max_interval(void) 3830 + { 3831 + max_load_balance_interval = HZ*num_online_cpus()/10; 3832 + } 3833 + 3823 3834 /* 3824 3835 * It checks each scheduling domain to see if it is due to be balanced, 3825 3836 * and initiates a balancing operation if so. ··· 3860 3849 3861 3850 /* scale ms to jiffies */ 3862 3851 interval = msecs_to_jiffies(interval); 3863 - if (unlikely(!interval)) 3864 - interval = 1; 3865 - if (interval > HZ*num_online_cpus()/10) 3866 - interval = HZ*num_online_cpus()/10; 3852 + interval = clamp(interval, 1UL, max_load_balance_interval); 3867 3853 3868 3854 need_serialize = sd->flags & SD_SERIALIZE; 3869 3855
+8 -11
tools/perf/util/probe-event.c
··· 234 234 235 235 /* Searching trace events corresponding to probe event */ 236 236 ntevs = find_probe_trace_events(fd, pev, tevs, max_tevs); 237 - close(fd); 238 237 239 238 if (ntevs > 0) { /* Succeeded to find trace events */ 240 239 pr_debug("find %d probe_trace_events.\n", ntevs); ··· 387 388 } 388 389 389 390 ret = find_line_range(fd, lr); 390 - close(fd); 391 391 if (ret == 0) { 392 392 pr_warning("Specified source line is not found.\n"); 393 393 return -ENOENT; ··· 510 512 if (ret < 0) 511 513 return ret; 512 514 513 - fd = open_vmlinux(module); 514 - if (fd < 0) { 515 - pr_warning("Failed to open debug information file.\n"); 516 - return fd; 517 - } 518 - 519 515 setup_pager(); 520 516 521 - for (i = 0; i < npevs && ret >= 0; i++) 517 + for (i = 0; i < npevs && ret >= 0; i++) { 518 + fd = open_vmlinux(module); 519 + if (fd < 0) { 520 + pr_warning("Failed to open debug information file.\n"); 521 + ret = fd; 522 + break; 523 + } 522 524 ret = show_available_vars_at(fd, &pevs[i], max_vls, _filter, 523 525 externs); 524 - 525 - close(fd); 526 + } 526 527 return ret; 527 528 } 528 529
+106 -55
tools/perf/util/probe-finder.c
··· 273 273 return dwarf_formstring(&attr); 274 274 } 275 275 276 + /* Get a line number and file name for given address */ 277 + static int cu_find_lineinfo(Dwarf_Die *cudie, unsigned long addr, 278 + const char **fname, int *lineno) 279 + { 280 + Dwarf_Line *line; 281 + Dwarf_Addr laddr; 282 + 283 + line = dwarf_getsrc_die(cudie, (Dwarf_Addr)addr); 284 + if (line && dwarf_lineaddr(line, &laddr) == 0 && 285 + addr == (unsigned long)laddr && dwarf_lineno(line, lineno) == 0) { 286 + *fname = dwarf_linesrc(line, NULL, NULL); 287 + if (!*fname) 288 + /* line number is useless without filename */ 289 + *lineno = 0; 290 + } 291 + 292 + return *lineno ?: -ENOENT; 293 + } 294 + 276 295 /* Compare diename and tname */ 277 296 static bool die_compare_name(Dwarf_Die *dw_die, const char *tname) 278 297 { ··· 516 497 static Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, 517 498 Dwarf_Die *die_mem) 518 499 { 519 - return die_find_child(sp_die, __die_find_inline_cb, &addr, die_mem); 500 + Dwarf_Die tmp_die; 501 + 502 + sp_die = die_find_child(sp_die, __die_find_inline_cb, &addr, &tmp_die); 503 + if (!sp_die) 504 + return NULL; 505 + 506 + /* Inlined function could be recursive. Trace it until fail */ 507 + while (sp_die) { 508 + memcpy(die_mem, sp_die, sizeof(Dwarf_Die)); 509 + sp_die = die_find_child(sp_die, __die_find_inline_cb, &addr, 510 + &tmp_die); 511 + } 512 + 513 + return die_mem; 520 514 } 521 515 522 516 /* Walker on lines (Note: line number will not be sorted) */ ··· 1427 1395 !die_compare_name(sp_die, pp->function)) 1428 1396 return DWARF_CB_OK; 1429 1397 1398 + /* Check declared file */ 1399 + if (pp->file && strtailcmp(pp->file, dwarf_decl_file(sp_die))) 1400 + return DWARF_CB_OK; 1401 + 1430 1402 pf->fname = dwarf_decl_file(sp_die); 1431 1403 if (pp->line) { /* Function relative line */ 1432 1404 dwarf_decl_line(sp_die, &pf->lno); ··· 1487 1451 if (!dbg) { 1488 1452 pr_warning("No debug information found in the vmlinux - " 1489 1453 "please rebuild with CONFIG_DEBUG_INFO=y.\n"); 1454 + close(fd); /* Without dwfl_end(), fd isn't closed. */ 1490 1455 return -EBADF; 1491 1456 } 1492 1457 ··· 1723 1686 Dwarf_Die cudie, spdie, indie; 1724 1687 Dwarf *dbg = NULL; 1725 1688 Dwfl *dwfl = NULL; 1726 - Dwarf_Line *line; 1727 - Dwarf_Addr laddr, eaddr, bias = 0; 1728 - const char *tmp; 1729 - int lineno, ret = 0; 1730 - bool found = false; 1689 + Dwarf_Addr _addr, baseaddr, bias = 0; 1690 + const char *fname = NULL, *func = NULL, *tmp; 1691 + int baseline = 0, lineno = 0, ret = 0; 1731 1692 1732 1693 /* Open the live linux kernel */ 1733 1694 dbg = dwfl_init_live_kernel_dwarf(addr, &dwfl, &bias); ··· 1746 1711 goto end; 1747 1712 } 1748 1713 1749 - /* Find a corresponding line */ 1750 - line = dwarf_getsrc_die(&cudie, (Dwarf_Addr)addr); 1751 - if (line) { 1752 - if (dwarf_lineaddr(line, &laddr) == 0 && 1753 - (Dwarf_Addr)addr == laddr && 1754 - dwarf_lineno(line, &lineno) == 0) { 1755 - tmp = dwarf_linesrc(line, NULL, NULL); 1756 - if (tmp) { 1757 - ppt->line = lineno; 1758 - ppt->file = strdup(tmp); 1759 - if (ppt->file == NULL) { 1760 - ret = -ENOMEM; 1761 - goto end; 1762 - } 1763 - found = true; 1714 + /* Find a corresponding line (filename and lineno) */ 1715 + cu_find_lineinfo(&cudie, addr, &fname, &lineno); 1716 + /* Don't care whether it failed or not */ 1717 + 1718 + /* Find a corresponding function (name, baseline and baseaddr) */ 1719 + if (die_find_real_subprogram(&cudie, (Dwarf_Addr)addr, &spdie)) { 1720 + /* Get function entry information */ 1721 + tmp = dwarf_diename(&spdie); 1722 + if (!tmp || 1723 + dwarf_entrypc(&spdie, &baseaddr) != 0 || 1724 + dwarf_decl_line(&spdie, &baseline) != 0) 1725 + goto post; 1726 + func = tmp; 1727 + 1728 + if (addr == (unsigned long)baseaddr) 1729 + /* Function entry - Relative line number is 0 */ 1730 + lineno = baseline; 1731 + else if (die_find_inlinefunc(&spdie, (Dwarf_Addr)addr, 1732 + &indie)) { 1733 + if (dwarf_entrypc(&indie, &_addr) == 0 && 1734 + _addr == addr) 1735 + /* 1736 + * addr is at an inline function entry. 1737 + * In this case, lineno should be the call-site 1738 + * line number. 1739 + */ 1740 + lineno = die_get_call_lineno(&indie); 1741 + else { 1742 + /* 1743 + * addr is in an inline function body. 1744 + * Since lineno points one of the lines 1745 + * of the inline function, baseline should 1746 + * be the entry line of the inline function. 1747 + */ 1748 + tmp = dwarf_diename(&indie); 1749 + if (tmp && 1750 + dwarf_decl_line(&spdie, &baseline) == 0) 1751 + func = tmp; 1764 1752 } 1765 1753 } 1766 1754 } 1767 1755 1768 - /* Find a corresponding function */ 1769 - if (die_find_real_subprogram(&cudie, (Dwarf_Addr)addr, &spdie)) { 1770 - tmp = dwarf_diename(&spdie); 1771 - if (!tmp || dwarf_entrypc(&spdie, &eaddr) != 0) 1772 - goto end; 1756 + post: 1757 + /* Make a relative line number or an offset */ 1758 + if (lineno) 1759 + ppt->line = lineno - baseline; 1760 + else if (func) 1761 + ppt->offset = addr - (unsigned long)baseaddr; 1773 1762 1774 - if (ppt->line) { 1775 - if (die_find_inlinefunc(&spdie, (Dwarf_Addr)addr, 1776 - &indie)) { 1777 - /* addr in an inline function */ 1778 - tmp = dwarf_diename(&indie); 1779 - if (!tmp) 1780 - goto end; 1781 - ret = dwarf_decl_line(&indie, &lineno); 1782 - } else { 1783 - if (eaddr == addr) { /* Function entry */ 1784 - lineno = ppt->line; 1785 - ret = 0; 1786 - } else 1787 - ret = dwarf_decl_line(&spdie, &lineno); 1788 - } 1789 - if (ret == 0) { 1790 - /* Make a relative line number */ 1791 - ppt->line -= lineno; 1792 - goto found; 1793 - } 1794 - } 1795 - /* We don't have a line number, let's use offset */ 1796 - ppt->offset = addr - (unsigned long)eaddr; 1797 - found: 1798 - ppt->function = strdup(tmp); 1763 + /* Duplicate strings */ 1764 + if (func) { 1765 + ppt->function = strdup(func); 1799 1766 if (ppt->function == NULL) { 1800 1767 ret = -ENOMEM; 1801 1768 goto end; 1802 1769 } 1803 - found = true; 1804 1770 } 1805 - 1771 + if (fname) { 1772 + ppt->file = strdup(fname); 1773 + if (ppt->file == NULL) { 1774 + if (ppt->function) { 1775 + free(ppt->function); 1776 + ppt->function = NULL; 1777 + } 1778 + ret = -ENOMEM; 1779 + goto end; 1780 + } 1781 + } 1806 1782 end: 1807 1783 if (dwfl) 1808 1784 dwfl_end(dwfl); 1809 - if (ret >= 0) 1810 - ret = found ? 1 : 0; 1785 + if (ret == 0 && (fname || func)) 1786 + ret = 1; /* Found a point */ 1811 1787 return ret; 1812 1788 } 1813 1789 ··· 1886 1840 struct line_finder *lf = param->data; 1887 1841 struct line_range *lr = lf->lr; 1888 1842 1843 + /* Check declared file */ 1844 + if (lr->file && strtailcmp(lr->file, dwarf_decl_file(sp_die))) 1845 + return DWARF_CB_OK; 1846 + 1889 1847 if (dwarf_tag(sp_die) == DW_TAG_subprogram && 1890 1848 die_compare_name(sp_die, lr->function)) { 1891 1849 lf->fname = dwarf_decl_file(sp_die); ··· 1942 1892 if (!dbg) { 1943 1893 pr_warning("No debug information found in the vmlinux - " 1944 1894 "please rebuild with CONFIG_DEBUG_INFO=y.\n"); 1895 + close(fd); /* Without dwfl_end(), fd isn't closed. */ 1945 1896 return -EBADF; 1946 1897 } 1947 1898