diff --git a/[refs] b/[refs] index 9f8f6bda33bd..b1bb4ffbd81b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1ee5332cf67c2f5f468ad1a59033d57453bcad1a +refs/heads/master: 7781de74568bddfefbd2d32a934a8c791a2420cd diff --git a/trunk/arch/parisc/kernel/entry.S b/trunk/arch/parisc/kernel/entry.S index e552e547cb93..ae3e70cd1e14 100644 --- a/trunk/arch/parisc/kernel/entry.S +++ b/trunk/arch/parisc/kernel/entry.S @@ -553,7 +553,7 @@ * on most of those machines only handles cache transactions. */ extrd,u,*= \pte,_PAGE_NO_CACHE_BIT+32,1,%r0 - depdi 1,12,1,\prot + depi 1,12,1,\prot /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ convert_for_tlb_insert20 \pte diff --git a/trunk/arch/parisc/kernel/module.c b/trunk/arch/parisc/kernel/module.c index 61ee0eec4e69..ef5caf2e6ed0 100644 --- a/trunk/arch/parisc/kernel/module.c +++ b/trunk/arch/parisc/kernel/module.c @@ -86,12 +86,8 @@ * the bottom of the table, which has a maximum signed displacement of * 0x3fff; however, since we're only going forward, this becomes * 0x1fff, and thus, since each GOT entry is 8 bytes long we can have - * at most 1023 entries. - * To overcome this 14bit displacement with some kernel modules, we'll - * use instead the unusal 16bit displacement method (see reassemble_16a) - * which gives us a maximum positive displacement of 0x7fff, and as such - * allows us to allocate up to 4095 GOT entries. */ -#define MAX_GOTS 4095 + * at most 1023 entries */ +#define MAX_GOTS 1023 /* three functions to determine where in the module core * or init pieces the location is */ @@ -149,40 +145,12 @@ struct stub_entry { /* The reassemble_* functions prepare an immediate value for insertion into an opcode. pa-risc uses all sorts of weird bitfields in the instruction to hold the value. */ -static inline int sign_unext(int x, int len) -{ - int len_ones; - - len_ones = (1 << len) - 1; - return x & len_ones; -} - -static inline int low_sign_unext(int x, int len) -{ - int sign, temp; - - sign = (x >> (len-1)) & 1; - temp = sign_unext(x, len-1); - return (temp << 1) | sign; -} - static inline int reassemble_14(int as14) { return (((as14 & 0x1fff) << 1) | ((as14 & 0x2000) >> 13)); } -static inline int reassemble_16a(int as16) -{ - int s, t; - - /* Unusual 16-bit encoding, for wide mode only. */ - t = (as16 << 1) & 0xffff; - s = (as16 & 0x8000); - return (t ^ s ^ (s >> 1)) | (s >> 15); -} - - static inline int reassemble_17(int as17) { return (((as17 & 0x10000) >> 16) | @@ -439,7 +407,6 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend, enum elf_stub_type stub_type, Elf_Addr loc0, unsigned int targetsec) { struct stub_entry *stub; - int __maybe_unused d; /* initialize stub_offset to point in front of the section */ if (!me->arch.section[targetsec].stub_offset) { @@ -493,19 +460,12 @@ static Elf_Addr get_stub(struct module *me, unsigned long value, long addend, */ switch (stub_type) { case ELF_STUB_GOT: - d = get_got(me, value, addend); - if (d <= 15) { - /* Format 5 */ - stub->insns[0] = 0x0f6010db; /* ldd 0(%dp),%dp */ - stub->insns[0] |= low_sign_unext(d, 5) << 16; - } else { - /* Format 3 */ - stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */ - stub->insns[0] |= reassemble_16a(d); - } + stub->insns[0] = 0x537b0000; /* ldd 0(%dp),%dp */ stub->insns[1] = 0x53610020; /* ldd 10(%dp),%r1 */ stub->insns[2] = 0xe820d000; /* bve (%r1) */ stub->insns[3] = 0x537b0030; /* ldd 18(%dp),%dp */ + + stub->insns[0] |= reassemble_14(get_got(me, value, addend) & 0x3fff); break; case ELF_STUB_MILLI: stub->insns[0] = 0x20200000; /* ldil 0,%r1 */ diff --git a/trunk/arch/x86/include/asm/efi.h b/trunk/arch/x86/include/asm/efi.h index 8406ed7f9926..edc90f23e708 100644 --- a/trunk/arch/x86/include/asm/efi.h +++ b/trunk/arch/x86/include/asm/efi.h @@ -33,7 +33,7 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ efi_call_virt(f, a1, a2, a3, a4, a5, a6) -#define efi_ioremap(addr, size, type) ioremap_cache(addr, size) +#define efi_ioremap(addr, size) ioremap_cache(addr, size) #else /* !CONFIG_X86_32 */ @@ -84,8 +84,7 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3, efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) -extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, - u32 type); +extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size); #endif /* CONFIG_X86_32 */ diff --git a/trunk/arch/x86/include/asm/irqflags.h b/trunk/arch/x86/include/asm/irqflags.h index c6ccbe7e81ad..2bdab21f0898 100644 --- a/trunk/arch/x86/include/asm/irqflags.h +++ b/trunk/arch/x86/include/asm/irqflags.h @@ -12,15 +12,9 @@ static inline unsigned long native_save_fl(void) { unsigned long flags; - /* - * Note: this needs to be "=r" not "=rm", because we have the - * stack offset from what gcc expects at the time the "pop" is - * executed, and so a memory reference with respect to the stack - * would end up using the wrong address. - */ asm volatile("# __raw_save_flags\n\t" "pushf ; pop %0" - : "=r" (flags) + : "=g" (flags) : /* no input */ : "memory"); diff --git a/trunk/arch/x86/include/asm/uv/uv_hub.h b/trunk/arch/x86/include/asm/uv/uv_hub.h index 77a68505419a..341070f7ad5c 100644 --- a/trunk/arch/x86/include/asm/uv/uv_hub.h +++ b/trunk/arch/x86/include/asm/uv/uv_hub.h @@ -175,7 +175,7 @@ DECLARE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); #define UV_GLOBAL_MMR32_PNODE_BITS(p) ((p) << (UV_GLOBAL_MMR32_PNODE_SHIFT)) #define UV_GLOBAL_MMR64_PNODE_BITS(p) \ - (((unsigned long)(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT) + ((unsigned long)(UV_PNODE_TO_GNODE(p)) << UV_GLOBAL_MMR64_PNODE_SHIFT) #define UV_APIC_PNODE_SHIFT 6 @@ -327,7 +327,6 @@ struct uv_blade_info { unsigned short nr_possible_cpus; unsigned short nr_online_cpus; unsigned short pnode; - short memory_nid; }; extern struct uv_blade_info *uv_blade_info; extern short *uv_node_to_blade; @@ -364,12 +363,6 @@ static inline int uv_blade_to_pnode(int bid) return uv_blade_info[bid].pnode; } -/* Nid of memory node on blade. -1 if no blade-local memory */ -static inline int uv_blade_to_memory_nid(int bid) -{ - return uv_blade_info[bid].memory_nid; -} - /* Determine the number of possible cpus on a blade */ static inline int uv_blade_nr_possible_cpus(int bid) { diff --git a/trunk/arch/x86/kernel/apic/io_apic.c b/trunk/arch/x86/kernel/apic/io_apic.c index d2ed6c5ddc80..2284a4812b68 100644 --- a/trunk/arch/x86/kernel/apic/io_apic.c +++ b/trunk/arch/x86/kernel/apic/io_apic.c @@ -3793,9 +3793,6 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade, mmr_pnode = uv_blade_to_pnode(mmr_blade); uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); - if (cfg->move_in_progress) - send_cleanup_vector(cfg); - return irq; } diff --git a/trunk/arch/x86/kernel/apic/x2apic_cluster.c b/trunk/arch/x86/kernel/apic/x2apic_cluster.c index 2ed4e2bb3b32..8e4cbb255c38 100644 --- a/trunk/arch/x86/kernel/apic/x2apic_cluster.c +++ b/trunk/arch/x86/kernel/apic/x2apic_cluster.c @@ -170,7 +170,7 @@ static unsigned long set_apic_id(unsigned int id) static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb) { - return initial_apicid >> index_msb; + return current_cpu_data.initial_apicid >> index_msb; } static void x2apic_send_IPI_self(int vector) diff --git a/trunk/arch/x86/kernel/apic/x2apic_phys.c b/trunk/arch/x86/kernel/apic/x2apic_phys.c index 0b631c6a2e00..a284359627e7 100644 --- a/trunk/arch/x86/kernel/apic/x2apic_phys.c +++ b/trunk/arch/x86/kernel/apic/x2apic_phys.c @@ -162,7 +162,7 @@ static unsigned long set_apic_id(unsigned int id) static int x2apic_phys_pkg_id(int initial_apicid, int index_msb) { - return initial_apicid >> index_msb; + return current_cpu_data.initial_apicid >> index_msb; } static void x2apic_send_IPI_self(int vector) diff --git a/trunk/arch/x86/kernel/apic/x2apic_uv_x.c b/trunk/arch/x86/kernel/apic/x2apic_uv_x.c index 832e908adcb5..096d19aea2f7 100644 --- a/trunk/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/trunk/arch/x86/kernel/apic/x2apic_uv_x.c @@ -261,7 +261,7 @@ struct apic apic_x2apic_uv_x = { .apic_id_registered = uv_apic_id_registered, .irq_delivery_mode = dest_Fixed, - .irq_dest_mode = 0, /* physical */ + .irq_dest_mode = 1, /* logical */ .target_cpus = uv_target_cpus, .disable_esr = 0, @@ -362,6 +362,12 @@ static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) BUG(); } +static __init void map_low_mmrs(void) +{ + init_extra_mapping_uc(UV_GLOBAL_MMR32_BASE, UV_GLOBAL_MMR32_SIZE); + init_extra_mapping_uc(UV_LOCAL_MMR_BASE, UV_LOCAL_MMR_SIZE); +} + enum map_type {map_wb, map_uc}; static __init void map_high(char *id, unsigned long base, int shift, @@ -389,6 +395,26 @@ static __init void map_gru_high(int max_pnode) map_high("GRU", gru.s.base, shift, max_pnode, map_wb); } +static __init void map_config_high(int max_pnode) +{ + union uvh_rh_gam_cfg_overlay_config_mmr_u cfg; + int shift = UVH_RH_GAM_CFG_OVERLAY_CONFIG_MMR_BASE_SHFT; + + cfg.v = uv_read_local_mmr(UVH_RH_GAM_CFG_OVERLAY_CONFIG_MMR); + if (cfg.s.enable) + map_high("CONFIG", cfg.s.base, shift, max_pnode, map_uc); +} + +static __init void map_mmr_high(int max_pnode) +{ + union uvh_rh_gam_mmr_overlay_config_mmr_u mmr; + int shift = UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_BASE_SHFT; + + mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR); + if (mmr.s.enable) + map_high("MMR", mmr.s.base, shift, max_pnode, map_uc); +} + static __init void map_mmioh_high(int max_pnode) { union uvh_rh_gam_mmioh_overlay_config_mmr_u mmioh; @@ -540,6 +566,8 @@ void __init uv_system_init(void) unsigned long mmr_base, present, paddr; unsigned short pnode_mask; + map_low_mmrs(); + m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG); m_val = m_n_config.s.m_skt; n_val = m_n_config.s.n_skt; @@ -563,8 +591,6 @@ void __init uv_system_init(void) bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); uv_blade_info = kmalloc(bytes, GFP_KERNEL); BUG_ON(!uv_blade_info); - for (blade = 0; blade < uv_num_possible_blades(); blade++) - uv_blade_info[blade].memory_nid = -1; get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); @@ -603,9 +629,6 @@ void __init uv_system_init(void) lcpu = uv_blade_info[blade].nr_possible_cpus; uv_blade_info[blade].nr_possible_cpus++; - /* Any node on the blade, else will contain -1. */ - uv_blade_info[blade].memory_nid = nid; - uv_cpu_hub_info(cpu)->lowmem_remap_base = lowmem_redir_base; uv_cpu_hub_info(cpu)->lowmem_remap_top = lowmem_redir_size; uv_cpu_hub_info(cpu)->m_val = m_val; @@ -639,10 +662,11 @@ void __init uv_system_init(void) pnode = (paddr >> m_val) & pnode_mask; blade = boot_pnode_to_blade(pnode); uv_node_to_blade[nid] = blade; - max_pnode = max(pnode, max_pnode); } map_gru_high(max_pnode); + map_mmr_high(max_pnode); + map_config_high(max_pnode); map_mmioh_high(max_pnode); uv_cpu_init(); diff --git a/trunk/arch/x86/kernel/apm_32.c b/trunk/arch/x86/kernel/apm_32.c index 442b5508893f..79302e9a33a4 100644 --- a/trunk/arch/x86/kernel/apm_32.c +++ b/trunk/arch/x86/kernel/apm_32.c @@ -811,7 +811,7 @@ static int apm_do_idle(void) u8 ret = 0; int idled = 0; int polling; - int err = 0; + int err; polling = !!(current_thread_info()->status & TS_POLLING); if (polling) { diff --git a/trunk/arch/x86/kernel/efi.c b/trunk/arch/x86/kernel/efi.c index 19ccf6d0dccf..96f7ac0bbf01 100644 --- a/trunk/arch/x86/kernel/efi.c +++ b/trunk/arch/x86/kernel/efi.c @@ -512,7 +512,7 @@ void __init efi_enter_virtual_mode(void) && end_pfn <= max_pfn_mapped)) va = __va(md->phys_addr); else - va = efi_ioremap(md->phys_addr, size, md->type); + va = efi_ioremap(md->phys_addr, size); md->virt_addr = (u64) (unsigned long) va; diff --git a/trunk/arch/x86/kernel/efi_64.c b/trunk/arch/x86/kernel/efi_64.c index ac0621a7ac3d..22c3b7828c50 100644 --- a/trunk/arch/x86/kernel/efi_64.c +++ b/trunk/arch/x86/kernel/efi_64.c @@ -98,14 +98,10 @@ void __init efi_call_phys_epilog(void) early_runtime_code_mapping_set_exec(0); } -void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, - u32 type) +void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size) { unsigned long last_map_pfn; - if (type == EFI_MEMORY_MAPPED_IO) - return ioremap(phys_addr, size); - last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) return NULL; diff --git a/trunk/arch/x86/kernel/head_32.S b/trunk/arch/x86/kernel/head_32.S index 0d98a01cbdb2..8663afb56535 100644 --- a/trunk/arch/x86/kernel/head_32.S +++ b/trunk/arch/x86/kernel/head_32.S @@ -602,11 +602,7 @@ ignore_int: #endif iret -#ifndef CONFIG_HOTPLUG_CPU - __CPUINITDATA -#else - __REFDATA -#endif +.section .cpuinit.data,"wa" .align 4 ENTRY(initial_code) .long i386_start_kernel diff --git a/trunk/arch/x86/kernel/reboot.c b/trunk/arch/x86/kernel/reboot.c index 834c9da8bf9d..508e982dd072 100644 --- a/trunk/arch/x86/kernel/reboot.c +++ b/trunk/arch/x86/kernel/reboot.c @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -18,6 +17,7 @@ #include #ifdef CONFIG_X86_32 +# include # include # include #else @@ -404,38 +404,6 @@ EXPORT_SYMBOL(machine_real_restart); #endif /* CONFIG_X86_32 */ -/* - * Apple MacBook5,2 (2009 MacBook) needs reboot=p - */ -static int __init set_pci_reboot(const struct dmi_system_id *d) -{ - if (reboot_type != BOOT_CF9) { - reboot_type = BOOT_CF9; - printk(KERN_INFO "%s series board detected. " - "Selecting PCI-method for reboots.\n", d->ident); - } - return 0; -} - -static struct dmi_system_id __initdata pci_reboot_dmi_table[] = { - { /* Handle problems with rebooting on Apple MacBook5,2 */ - .callback = set_pci_reboot, - .ident = "Apple MacBook", - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,2"), - }, - }, - { } -}; - -static int __init pci_reboot_init(void) -{ - dmi_check_system(pci_reboot_dmi_table); - return 0; -} -core_initcall(pci_reboot_init); - static inline void kb_wait(void) { int i; diff --git a/trunk/arch/x86/kernel/vmlinux.lds.S b/trunk/arch/x86/kernel/vmlinux.lds.S index 78d185d797de..59f31d2dd435 100644 --- a/trunk/arch/x86/kernel/vmlinux.lds.S +++ b/trunk/arch/x86/kernel/vmlinux.lds.S @@ -393,8 +393,8 @@ SECTIONS #ifdef CONFIG_X86_32 -. = ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE), - "kernel image bigger than KERNEL_IMAGE_SIZE"); +ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE), + "kernel image bigger than KERNEL_IMAGE_SIZE") #else /* * Per-cpu symbols which need to be offset from __per_cpu_load @@ -407,12 +407,12 @@ INIT_PER_CPU(irq_stack_union); /* * Build-time check on the image size: */ -. = ASSERT((_end - _text <= KERNEL_IMAGE_SIZE), - "kernel image bigger than KERNEL_IMAGE_SIZE"); +ASSERT((_end - _text <= KERNEL_IMAGE_SIZE), + "kernel image bigger than KERNEL_IMAGE_SIZE") #ifdef CONFIG_SMP -. = ASSERT((per_cpu__irq_stack_union == 0), - "irq_stack_union is not at start of per-cpu area"); +ASSERT((per_cpu__irq_stack_union == 0), + "irq_stack_union is not at start of per-cpu area"); #endif #endif /* CONFIG_X86_32 */ @@ -420,7 +420,7 @@ INIT_PER_CPU(irq_stack_union); #ifdef CONFIG_KEXEC #include -. = ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE, - "kexec control code size is too big"); +ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE, + "kexec control code size is too big") #endif diff --git a/trunk/arch/x86/lib/msr.c b/trunk/arch/x86/lib/msr.c index caa24aca8115..1440b9c0547e 100644 --- a/trunk/arch/x86/lib/msr.c +++ b/trunk/arch/x86/lib/msr.c @@ -89,13 +89,16 @@ void rdmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs) rv.msrs = msrs; rv.msr_no = msr_no; - this_cpu = get_cpu(); - - if (cpumask_test_cpu(this_cpu, mask)) - __rdmsr_on_cpu(&rv); + preempt_disable(); + /* + * FIXME: handle the CPU we're executing on separately for now until + * smp_call_function_many has been fixed to not skip it. + */ + this_cpu = raw_smp_processor_id(); + smp_call_function_single(this_cpu, __rdmsr_on_cpu, &rv, 1); smp_call_function_many(mask, __rdmsr_on_cpu, &rv, 1); - put_cpu(); + preempt_enable(); } EXPORT_SYMBOL(rdmsr_on_cpus); @@ -118,13 +121,16 @@ void wrmsr_on_cpus(const cpumask_t *mask, u32 msr_no, struct msr *msrs) rv.msrs = msrs; rv.msr_no = msr_no; - this_cpu = get_cpu(); - - if (cpumask_test_cpu(this_cpu, mask)) - __wrmsr_on_cpu(&rv); + preempt_disable(); + /* + * FIXME: handle the CPU we're executing on separately for now until + * smp_call_function_many has been fixed to not skip it. + */ + this_cpu = raw_smp_processor_id(); + smp_call_function_single(this_cpu, __wrmsr_on_cpu, &rv, 1); smp_call_function_many(mask, __wrmsr_on_cpu, &rv, 1); - put_cpu(); + preempt_enable(); } EXPORT_SYMBOL(wrmsr_on_cpus); diff --git a/trunk/arch/x86/mm/pageattr.c b/trunk/arch/x86/mm/pageattr.c index 7e600c1962db..1b734d7a8966 100644 --- a/trunk/arch/x86/mm/pageattr.c +++ b/trunk/arch/x86/mm/pageattr.c @@ -591,12 +591,9 @@ static int __change_page_attr(struct cpa_data *cpa, int primary) unsigned int level; pte_t *kpte, old_pte; - if (cpa->flags & CPA_PAGES_ARRAY) { - struct page *page = cpa->pages[cpa->curpage]; - if (unlikely(PageHighMem(page))) - return 0; - address = (unsigned long)page_address(page); - } else if (cpa->flags & CPA_ARRAY) + if (cpa->flags & CPA_PAGES_ARRAY) + address = (unsigned long)page_address(cpa->pages[cpa->curpage]); + else if (cpa->flags & CPA_ARRAY) address = cpa->vaddr[cpa->curpage]; else address = *cpa->vaddr; @@ -700,12 +697,9 @@ static int cpa_process_alias(struct cpa_data *cpa) * No need to redo, when the primary call touched the direct * mapping already: */ - if (cpa->flags & CPA_PAGES_ARRAY) { - struct page *page = cpa->pages[cpa->curpage]; - if (unlikely(PageHighMem(page))) - return 0; - vaddr = (unsigned long)page_address(page); - } else if (cpa->flags & CPA_ARRAY) + if (cpa->flags & CPA_PAGES_ARRAY) + vaddr = (unsigned long)page_address(cpa->pages[cpa->curpage]); + else if (cpa->flags & CPA_ARRAY) vaddr = cpa->vaddr[cpa->curpage]; else vaddr = *cpa->vaddr; @@ -1003,15 +997,12 @@ EXPORT_SYMBOL(set_memory_array_uc); int _set_memory_wc(unsigned long addr, int numpages) { int ret; - unsigned long addr_copy = addr; - ret = change_page_attr_set(&addr, numpages, __pgprot(_PAGE_CACHE_UC_MINUS), 0); + if (!ret) { - ret = change_page_attr_set_clr(&addr_copy, numpages, - __pgprot(_PAGE_CACHE_WC), - __pgprot(_PAGE_CACHE_MASK), - 0, 0, NULL); + ret = change_page_attr_set(&addr, numpages, + __pgprot(_PAGE_CACHE_WC), 0); } return ret; } @@ -1128,9 +1119,7 @@ int set_pages_array_uc(struct page **pages, int addrinarray) int free_idx; for (i = 0; i < addrinarray; i++) { - if (PageHighMem(pages[i])) - continue; - start = page_to_pfn(pages[i]) << PAGE_SHIFT; + start = (unsigned long)page_address(pages[i]); end = start + PAGE_SIZE; if (reserve_memtype(start, end, _PAGE_CACHE_UC_MINUS, NULL)) goto err_out; @@ -1143,9 +1132,7 @@ int set_pages_array_uc(struct page **pages, int addrinarray) err_out: free_idx = i; for (i = 0; i < free_idx; i++) { - if (PageHighMem(pages[i])) - continue; - start = page_to_pfn(pages[i]) << PAGE_SHIFT; + start = (unsigned long)page_address(pages[i]); end = start + PAGE_SIZE; free_memtype(start, end); } @@ -1174,9 +1161,7 @@ int set_pages_array_wb(struct page **pages, int addrinarray) return retval; for (i = 0; i < addrinarray; i++) { - if (PageHighMem(pages[i])) - continue; - start = page_to_pfn(pages[i]) << PAGE_SHIFT; + start = (unsigned long)page_address(pages[i]); end = start + PAGE_SIZE; free_memtype(start, end); } diff --git a/trunk/arch/x86/mm/pgtable.c b/trunk/arch/x86/mm/pgtable.c index ed34f5e35999..af8f9650058c 100644 --- a/trunk/arch/x86/mm/pgtable.c +++ b/trunk/arch/x86/mm/pgtable.c @@ -329,6 +329,7 @@ void __init reserve_top_address(unsigned long reserve) printk(KERN_INFO "Reserving virtual address space above 0x%08x\n", (int)-reserve); __FIXADDR_TOP = -reserve - PAGE_SIZE; + __VMALLOC_RESERVE += reserve; #endif } diff --git a/trunk/drivers/char/agp/parisc-agp.c b/trunk/drivers/char/agp/parisc-agp.c index e077701ae3d9..f4bb43fb8016 100644 --- a/trunk/drivers/char/agp/parisc-agp.c +++ b/trunk/drivers/char/agp/parisc-agp.c @@ -225,7 +225,7 @@ static const struct agp_bridge_driver parisc_agp_driver = { .configure = parisc_agp_configure, .fetch_size = parisc_agp_fetch_size, .tlb_flush = parisc_agp_tlbflush, - .mask_memory = parisc_agp_page_mask_memory, + .mask_memory = parisc_agp_mask_memory, .masks = parisc_agp_masks, .agp_enable = parisc_agp_enable, .cache_flush = global_cache_flush, diff --git a/trunk/drivers/cpufreq/cpufreq.c b/trunk/drivers/cpufreq/cpufreq.c index fd69086d08d5..b90eda8b3440 100644 --- a/trunk/drivers/cpufreq/cpufreq.c +++ b/trunk/drivers/cpufreq/cpufreq.c @@ -858,8 +858,6 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) /* Check for existing affected CPUs. * They may not be aware of it due to CPU Hotplug. - * cpufreq_cpu_put is called when the device is removed - * in __cpufreq_remove_dev() */ managed_policy = cpufreq_cpu_get(j); if (unlikely(managed_policy)) { @@ -886,7 +884,7 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) ret = sysfs_create_link(&sys_dev->kobj, &managed_policy->kobj, "cpufreq"); - if (ret) + if (!ret) cpufreq_cpu_put(managed_policy); /* * Success. We only needed to be added to the mask. @@ -926,8 +924,6 @@ static int cpufreq_add_dev(struct sys_device *sys_dev) spin_lock_irqsave(&cpufreq_driver_lock, flags); for_each_cpu(j, policy->cpus) { - if (!cpu_online(j)) - continue; per_cpu(cpufreq_cpu_data, j) = policy; per_cpu(policy_cpu, j) = policy->cpu; } @@ -1248,22 +1244,13 @@ EXPORT_SYMBOL(cpufreq_get); static int cpufreq_suspend(struct sys_device *sysdev, pm_message_t pmsg) { - int ret = 0; - -#ifdef __powerpc__ int cpu = sysdev->id; + int ret = 0; unsigned int cur_freq = 0; struct cpufreq_policy *cpu_policy; dprintk("suspending cpu %u\n", cpu); - /* - * This whole bogosity is here because Powerbooks are made of fail. - * No sane platform should need any of the code below to be run. - * (it's entirely the wrong thing to do, as driver->get may - * reenable interrupts on some architectures). - */ - if (!cpu_online(cpu)) return 0; @@ -1322,7 +1309,6 @@ static int cpufreq_suspend(struct sys_device *sysdev, pm_message_t pmsg) out: cpufreq_cpu_put(cpu_policy); -#endif /* __powerpc__ */ return ret; } @@ -1336,18 +1322,12 @@ static int cpufreq_suspend(struct sys_device *sysdev, pm_message_t pmsg) */ static int cpufreq_resume(struct sys_device *sysdev) { - int ret = 0; - -#ifdef __powerpc__ int cpu = sysdev->id; + int ret = 0; struct cpufreq_policy *cpu_policy; dprintk("resuming cpu %u\n", cpu); - /* As with the ->suspend method, all the code below is - * only necessary because Powerbooks suck. - * See commit 42d4dc3f4e1e for jokes. */ - if (!cpu_online(cpu)) return 0; @@ -1411,7 +1391,6 @@ static int cpufreq_resume(struct sys_device *sysdev) schedule_work(&cpu_policy->update); fail: cpufreq_cpu_put(cpu_policy); -#endif /* __powerpc__ */ return ret; } diff --git a/trunk/drivers/cpufreq/cpufreq_conservative.c b/trunk/drivers/cpufreq/cpufreq_conservative.c index bdea7e2f94ba..57490502b21c 100644 --- a/trunk/drivers/cpufreq/cpufreq_conservative.c +++ b/trunk/drivers/cpufreq/cpufreq_conservative.c @@ -63,7 +63,6 @@ struct cpu_dbs_info_s { unsigned int down_skip; unsigned int requested_freq; int cpu; - unsigned int enable:1; /* * percpu mutex that serializes governor limit change with * do_dbs_timer invocation. We do not want do_dbs_timer to run @@ -142,9 +141,6 @@ dbs_cpufreq_notifier(struct notifier_block *nb, unsigned long val, struct cpufreq_policy *policy; - if (!this_dbs_info->enable) - return 0; - policy = this_dbs_info->cur_policy; /* @@ -501,7 +497,6 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) int delay = usecs_to_jiffies(dbs_tuners_ins.sampling_rate); delay -= jiffies % delay; - dbs_info->enable = 1; INIT_DELAYED_WORK_DEFERRABLE(&dbs_info->work, do_dbs_timer); queue_delayed_work_on(dbs_info->cpu, kconservative_wq, &dbs_info->work, delay); @@ -509,7 +504,6 @@ static inline void dbs_timer_init(struct cpu_dbs_info_s *dbs_info) static inline void dbs_timer_exit(struct cpu_dbs_info_s *dbs_info) { - dbs_info->enable = 0; cancel_delayed_work_sync(&dbs_info->work); } diff --git a/trunk/drivers/gpu/drm/drm_crtc.c b/trunk/drivers/gpu/drm/drm_crtc.c index 8fab7890a363..33be210d6723 100644 --- a/trunk/drivers/gpu/drm/drm_crtc.c +++ b/trunk/drivers/gpu/drm/drm_crtc.c @@ -1461,7 +1461,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, goto out; } - if (crtc_req->count_connectors > 0 && !mode && !fb) { + if (crtc_req->count_connectors > 0 && (!mode || !fb)) { DRM_DEBUG("Count connectors is %d but no mode or fb set\n", crtc_req->count_connectors); ret = -EINVAL; diff --git a/trunk/drivers/input/serio/hp_sdc_mlc.c b/trunk/drivers/input/serio/hp_sdc_mlc.c index 820e51673b26..b587e2d576ac 100644 --- a/trunk/drivers/input/serio/hp_sdc_mlc.c +++ b/trunk/drivers/input/serio/hp_sdc_mlc.c @@ -296,7 +296,7 @@ static void hp_sdc_mlc_out(hil_mlc *mlc) priv->tseq[3] = 0; if (mlc->opacket & HIL_CTRL_APE) { priv->tseq[3] |= HP_SDC_LPC_APE_IPF; - BUG_ON(down_trylock(&mlc->csem)); + down_trylock(&mlc->csem); } enqueue: hp_sdc_enqueue_transaction(&priv->trans); diff --git a/trunk/drivers/mfd/twl4030-irq.c b/trunk/drivers/mfd/twl4030-irq.c index 7d430835655f..bae61b22501c 100644 --- a/trunk/drivers/mfd/twl4030-irq.c +++ b/trunk/drivers/mfd/twl4030-irq.c @@ -180,9 +180,14 @@ static struct completion irq_event; static int twl4030_irq_thread(void *data) { long irq = (long)data; + struct irq_desc *desc = irq_to_desc(irq); static unsigned i2c_errors; static const unsigned max_i2c_errors = 100; + if (!desc) { + pr_err("twl4030: Invalid IRQ: %ld\n", irq); + return -EINVAL; + } current->flags |= PF_NOFREEZE; @@ -235,7 +240,7 @@ static int twl4030_irq_thread(void *data) } local_irq_enable(); - enable_irq(irq); + desc->chip->unmask(irq); } return 0; @@ -250,13 +255,25 @@ static int twl4030_irq_thread(void *data) * thread. All we do here is acknowledge and mask the interrupt and wakeup * the kernel thread. */ -static irqreturn_t handle_twl4030_pih(int irq, void *devid) +static void handle_twl4030_pih(unsigned int irq, struct irq_desc *desc) { /* Acknowledge, clear *AND* mask the interrupt... */ - disable_irq_nosync(irq); - complete(devid); - return IRQ_HANDLED; + desc->chip->ack(irq); + complete(&irq_event); +} + +static struct task_struct *start_twl4030_irq_thread(long irq) +{ + struct task_struct *thread; + + init_completion(&irq_event); + thread = kthread_run(twl4030_irq_thread, (void *)irq, "twl4030-irq"); + if (!thread) + pr_err("twl4030: could not create irq %ld thread!\n", irq); + + return thread; } + /*----------------------------------------------------------------------*/ /* @@ -717,28 +734,18 @@ int twl_init_irq(int irq_num, unsigned irq_base, unsigned irq_end) } /* install an irq handler to demultiplex the TWL4030 interrupt */ - - - init_completion(&irq_event); - - status = request_irq(irq_num, handle_twl4030_pih, IRQF_DISABLED, - "TWL4030-PIH", &irq_event); - if (status < 0) { - pr_err("twl4030: could not claim irq%d: %d\n", irq_num, status); - goto fail_rqirq; + task = start_twl4030_irq_thread(irq_num); + if (!task) { + pr_err("twl4030: irq thread FAIL\n"); + status = -ESRCH; + goto fail; } - task = kthread_run(twl4030_irq_thread, (void *)irq_num, "twl4030-irq"); - if (IS_ERR(task)) { - pr_err("twl4030: could not create irq %d thread!\n", irq_num); - status = PTR_ERR(task); - goto fail_kthread; - } + set_irq_data(irq_num, task); + set_irq_chained_handler(irq_num, handle_twl4030_pih); + return status; -fail_kthread: - free_irq(irq_num, &irq_event); -fail_rqirq: - /* clean up twl4030_sih_setup */ + fail: for (i = irq_base; i < irq_end; i++) set_irq_chip_and_handler(i, NULL, NULL); diff --git a/trunk/drivers/parisc/ccio-dma.c b/trunk/drivers/parisc/ccio-dma.c index a45b0c0d574e..0f0e0b919ef4 100644 --- a/trunk/drivers/parisc/ccio-dma.c +++ b/trunk/drivers/parisc/ccio-dma.c @@ -70,6 +70,7 @@ #undef CCIO_COLLECT_STATS #endif +#include #include /* for proc_runway_root */ #ifdef DEBUG_CCIO_INIT diff --git a/trunk/drivers/parisc/dino.c b/trunk/drivers/parisc/dino.c index d69bde6a2343..c590974e9815 100644 --- a/trunk/drivers/parisc/dino.c +++ b/trunk/drivers/parisc/dino.c @@ -614,7 +614,7 @@ dino_fixup_bus(struct pci_bus *bus) dev_name(&bus->self->dev), i, bus->self->resource[i].start, bus->self->resource[i].end); - WARN_ON(pci_assign_resource(bus->self, i)); + pci_assign_resource(bus->self, i); DBG("DEBUG %s after assign %d [0x%lx,0x%lx]\n", dev_name(&bus->self->dev), i, bus->self->resource[i].start, diff --git a/trunk/drivers/parisc/eisa_eeprom.c b/trunk/drivers/parisc/eisa_eeprom.c index 8c0b26e9b98a..685d94e69d44 100644 --- a/trunk/drivers/parisc/eisa_eeprom.c +++ b/trunk/drivers/parisc/eisa_eeprom.c @@ -55,7 +55,7 @@ static ssize_t eisa_eeprom_read(struct file * file, ssize_t ret; int i; - if (*ppos < 0 || *ppos >= HPEE_MAX_LENGTH) + if (*ppos >= HPEE_MAX_LENGTH) return 0; count = *ppos + count < HPEE_MAX_LENGTH ? count : HPEE_MAX_LENGTH - *ppos; diff --git a/trunk/drivers/parisc/hppb.c b/trunk/drivers/parisc/hppb.c index 815db175d427..13856415b432 100644 --- a/trunk/drivers/parisc/hppb.c +++ b/trunk/drivers/parisc/hppb.c @@ -62,8 +62,7 @@ static int hppb_probe(struct parisc_device *dev) } card = card->next; } - printk(KERN_INFO "Found GeckoBoa at 0x%llx\n", - (unsigned long long) dev->hpa.start); + printk(KERN_INFO "Found GeckoBoa at 0x%x\n", dev->hpa.start); card->hpa = dev->hpa.start; card->mmio_region.name = "HP-PB Bus"; @@ -74,10 +73,8 @@ static int hppb_probe(struct parisc_device *dev) status = ccio_request_resource(dev, &card->mmio_region); if(status < 0) { - printk(KERN_ERR "%s: failed to claim HP-PB " - "bus space (0x%08llx, 0x%08llx)\n", - __FILE__, (unsigned long long) card->mmio_region.start, - (unsigned long long) card->mmio_region.end); + printk(KERN_ERR "%s: failed to claim HP-PB bus space (%08x, %08x)\n", + __FILE__, card->mmio_region.start, card->mmio_region.end); } return 0; diff --git a/trunk/drivers/parisc/lba_pci.c b/trunk/drivers/parisc/lba_pci.c index 3aeb3279c92a..ede614616f8e 100644 --- a/trunk/drivers/parisc/lba_pci.c +++ b/trunk/drivers/parisc/lba_pci.c @@ -992,7 +992,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) return; io_pdc_cell = kzalloc(sizeof(pdc_pat_cell_mod_maddr_block_t), GFP_KERNEL); - if (!io_pdc_cell) { + if (!pa_pdc_cell) { kfree(pa_pdc_cell); return; } diff --git a/trunk/drivers/parisc/pdc_stable.c b/trunk/drivers/parisc/pdc_stable.c index 13a64bc081b6..f9f9a5f1bbd0 100644 --- a/trunk/drivers/parisc/pdc_stable.c +++ b/trunk/drivers/parisc/pdc_stable.c @@ -370,7 +370,7 @@ pdcspath_layer_read(struct pdcspath_entry *entry, char *buf) if (!i) /* entry is not ready */ return -ENODATA; - for (i = 0; i < 6 && devpath->layers[i]; i++) + for (i = 0; devpath->layers[i] && (likely(i < 6)); i++) out += sprintf(out, "%u ", devpath->layers[i]); out += sprintf(out, "\n"); diff --git a/trunk/drivers/video/console/sticore.c b/trunk/drivers/video/console/sticore.c index 857b3668b3ba..ef7870f5ea08 100644 --- a/trunk/drivers/video/console/sticore.c +++ b/trunk/drivers/video/console/sticore.c @@ -957,14 +957,9 @@ static int __devinit sticore_pci_init(struct pci_dev *pd, #ifdef CONFIG_PCI unsigned long fb_base, rom_base; unsigned int fb_len, rom_len; - int err; struct sti_struct *sti; - err = pci_enable_device(pd); - if (err < 0) { - dev_err(&pd->dev, "Cannot enable PCI device\n"); - return err; - } + pci_enable_device(pd); fb_base = pci_resource_start(pd, 0); fb_len = pci_resource_len(pd, 0); @@ -1053,7 +1048,7 @@ static void __devinit sti_init_roms(void) /* Register drivers for native & PCI cards */ register_parisc_driver(&pa_sti_driver); - WARN_ON(pci_register_driver(&pci_sti_driver)); + pci_register_driver(&pci_sti_driver); /* if we didn't find the given default sti, take the first one */ if (!default_sti) diff --git a/trunk/fs/cifs/CHANGES b/trunk/fs/cifs/CHANGES index e85b1e4389e0..92888aa90749 100644 --- a/trunk/fs/cifs/CHANGES +++ b/trunk/fs/cifs/CHANGES @@ -1,10 +1,3 @@ -Version 1.60 -------------- -Fix memory leak in reconnect. Fix oops in DFS mount error path. -Set s_maxbytes to smaller (the max that vfs can handle) so that -sendfile will now work over cifs mounts again. Add noforcegid -and noforceuid mount parameters. - Version 1.59 ------------ Client uses server inode numbers (which are persistent) rather than diff --git a/trunk/fs/cifs/README b/trunk/fs/cifs/README index 79c1a93400be..ad92921dbde4 100644 --- a/trunk/fs/cifs/README +++ b/trunk/fs/cifs/README @@ -262,11 +262,11 @@ A partial list of the supported mount options follows: mount. domain Set the SMB/CIFS workgroup name prepended to the username during CIFS session establishment - forceuid Set the default uid for inodes to the uid - passed in on mount. For mounts to servers + forceuid Set the default uid for inodes based on the uid + passed in. For mounts to servers which do support the CIFS Unix extensions, such as a properly configured Samba server, the server provides - the uid, gid and mode so this parameter should not be + the uid, gid and mode so this parameter should not be specified unless the server and clients uid and gid numbering differ. If the server and client are in the same domain (e.g. running winbind or nss_ldap) and @@ -278,7 +278,11 @@ A partial list of the supported mount options follows: of existing files will be the uid (gid) of the person who executed the mount (root, except when mount.cifs is configured setuid for user mounts) unless the "uid=" - (gid) mount option is specified. Also note that permission + (gid) mount option is specified. For the uid (gid) of newly + created files and directories, ie files created since + the last mount of the server share, the expected uid + (gid) is cached as long as the inode remains in + memory on the client. Also note that permission checks (authorization checks) on accesses to a file occur at the server, but there are cases in which an administrator may want to restrict at the client as well. For those @@ -286,15 +290,12 @@ A partial list of the supported mount options follows: (such as Windows), permissions can also be checked at the client, and a crude form of client side permission checking can be enabled by specifying file_mode and dir_mode on - the client. (default) - forcegid (similar to above but for the groupid instead of uid) (default) - noforceuid Fill in file owner information (uid) by requesting it from - the server if possible. With this option, the value given in - the uid= option (on mount) will only be used if the server - can not support returning uids on inodes. - noforcegid (similar to above but for the group owner, gid, instead of uid) + the client. Note that the mount.cifs helper must be + at version 1.10 or higher to support specifying the uid + (or gid) in non-numeric form. + forcegid (similar to above but for the groupid instead of uid) uid Set the default uid for inodes, and indicate to the - cifs kernel driver which local user mounted. If the server + cifs kernel driver which local user mounted . If the server supports the unix extensions the default uid is not used to fill in the owner fields of inodes (files) unless the "forceuid" parameter is specified. diff --git a/trunk/fs/cifs/cifs_dfs_ref.c b/trunk/fs/cifs/cifs_dfs_ref.c index 606912d8f2a8..3bb11be8b6a8 100644 --- a/trunk/fs/cifs/cifs_dfs_ref.c +++ b/trunk/fs/cifs/cifs_dfs_ref.c @@ -55,7 +55,7 @@ void cifs_dfs_release_automount_timer(void) * i.e. strips from UNC trailing path that is not part of share * name and fixup missing '\' in the begining of DFS node refferal * if neccessary. - * Returns pointer to share name on success or ERR_PTR on error. + * Returns pointer to share name on success or NULL on error. * Caller is responsible for freeing returned string. */ static char *cifs_get_share_name(const char *node_name) @@ -68,7 +68,7 @@ static char *cifs_get_share_name(const char *node_name) UNC = kmalloc(len+2 /*for term null and additional \ if it's missed */, GFP_KERNEL); if (!UNC) - return ERR_PTR(-ENOMEM); + return NULL; /* get share name and server name */ if (node_name[1] != '\\') { @@ -87,7 +87,7 @@ static char *cifs_get_share_name(const char *node_name) cERROR(1, ("%s: no server name end in node name: %s", __func__, node_name)); kfree(UNC); - return ERR_PTR(-EINVAL); + return NULL; } /* find sharename end */ @@ -133,12 +133,6 @@ char *cifs_compose_mount_options(const char *sb_mountdata, return ERR_PTR(-EINVAL); *devname = cifs_get_share_name(ref->node_name); - if (IS_ERR(*devname)) { - rc = PTR_ERR(*devname); - *devname = NULL; - goto compose_mount_options_err; - } - rc = dns_resolve_server_name_to_ip(*devname, &srvIP); if (rc != 0) { cERROR(1, ("%s: Failed to resolve server part of %s to IP: %d", diff --git a/trunk/fs/cifs/cifs_unicode.c b/trunk/fs/cifs/cifs_unicode.c index 714a542cbafc..60e3c4253de0 100644 --- a/trunk/fs/cifs/cifs_unicode.c +++ b/trunk/fs/cifs/cifs_unicode.c @@ -44,7 +44,7 @@ cifs_ucs2_bytes(const __le16 *from, int maxbytes, int maxwords = maxbytes / 2; char tmp[NLS_MAX_CHARSET_SIZE]; - for (i = 0; i < maxwords && from[i]; i++) { + for (i = 0; from[i] && i < maxwords; i++) { charlen = codepage->uni2char(le16_to_cpu(from[i]), tmp, NLS_MAX_CHARSET_SIZE); if (charlen > 0) diff --git a/trunk/fs/cifs/cifsfs.c b/trunk/fs/cifs/cifsfs.c index 84b75253b05a..44f30504b82d 100644 --- a/trunk/fs/cifs/cifsfs.c +++ b/trunk/fs/cifs/cifsfs.c @@ -376,14 +376,10 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) seq_printf(s, ",uid=%d", cifs_sb->mnt_uid); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_UID) seq_printf(s, ",forceuid"); - else - seq_printf(s, ",noforceuid"); seq_printf(s, ",gid=%d", cifs_sb->mnt_gid); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_OVERR_GID) seq_printf(s, ",forcegid"); - else - seq_printf(s, ",noforcegid"); cifs_show_address(s, tcon->ses->server); diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index 1f3345d7fa79..fc44d316d0bb 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -803,10 +803,6 @@ cifs_parse_mount_options(char *options, const char *devname, char *data; unsigned int temp_len, i, j; char separator[2]; - short int override_uid = -1; - short int override_gid = -1; - bool uid_specified = false; - bool gid_specified = false; separator[0] = ','; separator[1] = 0; @@ -1097,20 +1093,18 @@ cifs_parse_mount_options(char *options, const char *devname, "too long.\n"); return 1; } - } else if (!strnicmp(data, "uid", 3) && value && *value) { - vol->linux_uid = simple_strtoul(value, &value, 0); - uid_specified = true; - } else if (!strnicmp(data, "forceuid", 8)) { - override_uid = 1; - } else if (!strnicmp(data, "noforceuid", 10)) { - override_uid = 0; - } else if (!strnicmp(data, "gid", 3) && value && *value) { - vol->linux_gid = simple_strtoul(value, &value, 0); - gid_specified = true; - } else if (!strnicmp(data, "forcegid", 8)) { - override_gid = 1; - } else if (!strnicmp(data, "noforcegid", 10)) { - override_gid = 0; + } else if (strnicmp(data, "uid", 3) == 0) { + if (value && *value) + vol->linux_uid = + simple_strtoul(value, &value, 0); + } else if (strnicmp(data, "forceuid", 8) == 0) { + vol->override_uid = 1; + } else if (strnicmp(data, "gid", 3) == 0) { + if (value && *value) + vol->linux_gid = + simple_strtoul(value, &value, 0); + } else if (strnicmp(data, "forcegid", 8) == 0) { + vol->override_gid = 1; } else if (strnicmp(data, "file_mode", 4) == 0) { if (value && *value) { vol->file_mode = @@ -1361,18 +1355,6 @@ cifs_parse_mount_options(char *options, const char *devname, if (vol->UNCip == NULL) vol->UNCip = &vol->UNC[2]; - if (uid_specified) - vol->override_uid = override_uid; - else if (override_uid == 1) - printk(KERN_NOTICE "CIFS: ignoring forceuid mount option " - "specified with no uid= option.\n"); - - if (gid_specified) - vol->override_gid = override_gid; - else if (override_gid == 1) - printk(KERN_NOTICE "CIFS: ignoring forcegid mount option " - "specified with no gid= option.\n"); - return 0; } @@ -2562,20 +2544,11 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, if (mount_data != mount_data_global) kfree(mount_data); - mount_data = cifs_compose_mount_options( cifs_sb->mountdata, full_path + 1, referrals, &fake_devname); - - free_dfs_info_array(referrals, num_referrals); kfree(fake_devname); - kfree(full_path); - - if (IS_ERR(mount_data)) { - rc = PTR_ERR(mount_data); - mount_data = NULL; - goto mount_fail_check; - } + free_dfs_info_array(referrals, num_referrals); if (tcon) cifs_put_tcon(tcon); @@ -2583,6 +2556,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, cifs_put_smb_ses(pSesInfo); cleanup_volume_info(&volume_info); + FreeXid(xid); + kfree(full_path); referral_walks_count++; goto try_mount_again; } diff --git a/trunk/fs/nilfs2/mdt.c b/trunk/fs/nilfs2/mdt.c index 2dfd47714ae5..3d3ddb3f5177 100644 --- a/trunk/fs/nilfs2/mdt.c +++ b/trunk/fs/nilfs2/mdt.c @@ -412,10 +412,8 @@ nilfs_mdt_write_page(struct page *page, struct writeback_control *wbc) return 0; /* Do not request flush for shadow page cache */ if (!sb) { writer = nilfs_get_writer(NILFS_MDT(inode)->mi_nilfs); - if (!writer) { - nilfs_put_writer(NILFS_MDT(inode)->mi_nilfs); + if (!writer) return -EROFS; - } sb = writer->s_super; } diff --git a/trunk/fs/nilfs2/segment.c b/trunk/fs/nilfs2/segment.c index 51ff3d0a4ee2..8b5e4778cf28 100644 --- a/trunk/fs/nilfs2/segment.c +++ b/trunk/fs/nilfs2/segment.c @@ -1859,26 +1859,12 @@ static void nilfs_end_page_io(struct page *page, int err) if (!page) return; - if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page)) { + if (buffer_nilfs_node(page_buffers(page)) && !PageWriteback(page)) /* * For b-tree node pages, this function may be called twice * or more because they might be split in a segment. */ - if (PageDirty(page)) { - /* - * For pages holding split b-tree node buffers, dirty - * flag on the buffers may be cleared discretely. - * In that case, the page is once redirtied for - * remaining buffers, and it must be cancelled if - * all the buffers get cleaned later. - */ - lock_page(page); - if (nilfs_page_buffers_clean(page)) - __nilfs_clear_page_dirty(page); - unlock_page(page); - } return; - } __nilfs_end_page_io(page, err); } diff --git a/trunk/include/linux/perf_counter.h b/trunk/include/linux/perf_counter.h index e604e6ef72dd..bd15d7a5f5ce 100644 --- a/trunk/include/linux/perf_counter.h +++ b/trunk/include/linux/perf_counter.h @@ -181,9 +181,8 @@ struct perf_counter_attr { freq : 1, /* use freq, not period */ inherit_stat : 1, /* per task counts */ enable_on_exec : 1, /* next exec enables */ - task : 1, /* trace fork/exit */ - __reserved_1 : 50; + __reserved_1 : 51; __u32 wakeup_events; /* wakeup every n events */ __u32 __reserved_2; @@ -309,15 +308,6 @@ enum perf_event_type { */ PERF_EVENT_COMM = 3, - /* - * struct { - * struct perf_event_header header; - * u32 pid, ppid; - * u32 tid, ptid; - * }; - */ - PERF_EVENT_EXIT = 4, - /* * struct { * struct perf_event_header header; @@ -333,7 +323,6 @@ enum perf_event_type { * struct { * struct perf_event_header header; * u32 pid, ppid; - * u32 tid, ptid; * }; */ PERF_EVENT_FORK = 7, diff --git a/trunk/init/Kconfig b/trunk/init/Kconfig index 3f7e60995c80..cb2c09270226 100644 --- a/trunk/init/Kconfig +++ b/trunk/init/Kconfig @@ -940,7 +940,6 @@ menu "Performance Counters" config PERF_COUNTERS bool "Kernel Performance Counters" - default y if PROFILING depends on HAVE_PERF_COUNTERS select ANON_INODES help @@ -962,17 +961,9 @@ config PERF_COUNTERS Say Y if unsure. config EVENT_PROFILE - bool "Tracepoint profiling sources" + bool "Tracepoint profile sources" depends on PERF_COUNTERS && EVENT_TRACING default y - help - Allow the use of tracepoints as software performance counters. - - When this is enabled, you can create perf counters based on - tracepoints using PERF_TYPE_TRACEPOINT and the tracepoint ID - found in debugfs://tracing/events/*/*/id. (The -e/--events - option to the perf tool can parse and interpret symbolic - tracepoints, in the subsystem:tracepoint_name format.) endmenu diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 466531eb92cc..29b532e718f7 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -1269,7 +1269,6 @@ static struct task_struct *copy_process(unsigned long clone_flags, write_unlock_irq(&tasklist_lock); proc_fork_connector(p); cgroup_post_fork(p); - perf_counter_fork(p); return p; bad_fork_free_pid: @@ -1411,6 +1410,9 @@ long do_fork(unsigned long clone_flags, init_completion(&vfork); } + if (!(clone_flags & CLONE_THREAD)) + perf_counter_fork(p); + audit_finish_fork(p); tracehook_report_clone(regs, clone_flags, nr, p); diff --git a/trunk/kernel/panic.c b/trunk/kernel/panic.c index 512ab73b0ca3..984b3ecbd72c 100644 --- a/trunk/kernel/panic.c +++ b/trunk/kernel/panic.c @@ -301,7 +301,6 @@ int oops_may_print(void) */ void oops_enter(void) { - tracing_off(); /* can't trust the integrity of the kernel anymore: */ debug_locks_off(); do_oops_enter_exit(); diff --git a/trunk/kernel/perf_counter.c b/trunk/kernel/perf_counter.c index 199ed4771315..950931041954 100644 --- a/trunk/kernel/perf_counter.c +++ b/trunk/kernel/perf_counter.c @@ -42,7 +42,6 @@ static int perf_overcommit __read_mostly = 1; static atomic_t nr_counters __read_mostly; static atomic_t nr_mmap_counters __read_mostly; static atomic_t nr_comm_counters __read_mostly; -static atomic_t nr_task_counters __read_mostly; /* * perf counter paranoia level: @@ -1655,8 +1654,6 @@ static void free_counter(struct perf_counter *counter) atomic_dec(&nr_mmap_counters); if (counter->attr.comm) atomic_dec(&nr_comm_counters); - if (counter->attr.task) - atomic_dec(&nr_task_counters); } if (counter->destroy) @@ -1691,18 +1688,6 @@ static int perf_release(struct inode *inode, struct file *file) return 0; } -static u64 perf_counter_read_tree(struct perf_counter *counter) -{ - struct perf_counter *child; - u64 total = 0; - - total += perf_counter_read(counter); - list_for_each_entry(child, &counter->child_list, child_list) - total += perf_counter_read(child); - - return total; -} - /* * Read the performance counter - simple non blocking version for now */ @@ -1722,7 +1707,7 @@ perf_read_hw(struct perf_counter *counter, char __user *buf, size_t count) WARN_ON_ONCE(counter->ctx->parent_ctx); mutex_lock(&counter->child_mutex); - values[0] = perf_counter_read_tree(counter); + values[0] = perf_counter_read(counter); n = 1; if (counter->attr.read_format & PERF_FORMAT_TOTAL_TIME_ENABLED) values[n++] = counter->total_time_enabled + @@ -2834,12 +2819,10 @@ perf_counter_read_event(struct perf_counter *counter, } /* - * task tracking -- fork/exit - * - * enabled by: attr.comm | attr.mmap | attr.task + * fork tracking */ -struct perf_task_event { +struct perf_fork_event { struct task_struct *task; struct { @@ -2847,42 +2830,37 @@ struct perf_task_event { u32 pid; u32 ppid; - u32 tid; - u32 ptid; } event; }; -static void perf_counter_task_output(struct perf_counter *counter, - struct perf_task_event *task_event) +static void perf_counter_fork_output(struct perf_counter *counter, + struct perf_fork_event *fork_event) { struct perf_output_handle handle; - int size = task_event->event.header.size; - struct task_struct *task = task_event->task; + int size = fork_event->event.header.size; + struct task_struct *task = fork_event->task; int ret = perf_output_begin(&handle, counter, size, 0, 0); if (ret) return; - task_event->event.pid = perf_counter_pid(counter, task); - task_event->event.ppid = perf_counter_pid(counter, task->real_parent); + fork_event->event.pid = perf_counter_pid(counter, task); + fork_event->event.ppid = perf_counter_pid(counter, task->real_parent); - task_event->event.tid = perf_counter_tid(counter, task); - task_event->event.ptid = perf_counter_tid(counter, task->real_parent); - - perf_output_put(&handle, task_event->event); + perf_output_put(&handle, fork_event->event); perf_output_end(&handle); } -static int perf_counter_task_match(struct perf_counter *counter) +static int perf_counter_fork_match(struct perf_counter *counter) { - if (counter->attr.comm || counter->attr.mmap || counter->attr.task) + if (counter->attr.comm || counter->attr.mmap) return 1; return 0; } -static void perf_counter_task_ctx(struct perf_counter_context *ctx, - struct perf_task_event *task_event) +static void perf_counter_fork_ctx(struct perf_counter_context *ctx, + struct perf_fork_event *fork_event) { struct perf_counter *counter; @@ -2891,19 +2869,19 @@ static void perf_counter_task_ctx(struct perf_counter_context *ctx, rcu_read_lock(); list_for_each_entry_rcu(counter, &ctx->event_list, event_entry) { - if (perf_counter_task_match(counter)) - perf_counter_task_output(counter, task_event); + if (perf_counter_fork_match(counter)) + perf_counter_fork_output(counter, fork_event); } rcu_read_unlock(); } -static void perf_counter_task_event(struct perf_task_event *task_event) +static void perf_counter_fork_event(struct perf_fork_event *fork_event) { struct perf_cpu_context *cpuctx; struct perf_counter_context *ctx; cpuctx = &get_cpu_var(perf_cpu_context); - perf_counter_task_ctx(&cpuctx->ctx, task_event); + perf_counter_fork_ctx(&cpuctx->ctx, fork_event); put_cpu_var(perf_cpu_context); rcu_read_lock(); @@ -2913,40 +2891,32 @@ static void perf_counter_task_event(struct perf_task_event *task_event) */ ctx = rcu_dereference(current->perf_counter_ctxp); if (ctx) - perf_counter_task_ctx(ctx, task_event); + perf_counter_fork_ctx(ctx, fork_event); rcu_read_unlock(); } -static void perf_counter_task(struct task_struct *task, int new) +void perf_counter_fork(struct task_struct *task) { - struct perf_task_event task_event; + struct perf_fork_event fork_event; if (!atomic_read(&nr_comm_counters) && - !atomic_read(&nr_mmap_counters) && - !atomic_read(&nr_task_counters)) + !atomic_read(&nr_mmap_counters)) return; - task_event = (struct perf_task_event){ + fork_event = (struct perf_fork_event){ .task = task, .event = { .header = { - .type = new ? PERF_EVENT_FORK : PERF_EVENT_EXIT, + .type = PERF_EVENT_FORK, .misc = 0, - .size = sizeof(task_event.event), + .size = sizeof(fork_event.event), }, /* .pid */ /* .ppid */ - /* .tid */ - /* .ptid */ }, }; - perf_counter_task_event(&task_event); -} - -void perf_counter_fork(struct task_struct *task) -{ - perf_counter_task(task, 1); + perf_counter_fork_event(&fork_event); } /* @@ -3905,8 +3875,6 @@ perf_counter_alloc(struct perf_counter_attr *attr, atomic_inc(&nr_mmap_counters); if (counter->attr.comm) atomic_inc(&nr_comm_counters); - if (counter->attr.task) - atomic_inc(&nr_task_counters); } return counter; @@ -4268,10 +4236,8 @@ void perf_counter_exit_task(struct task_struct *child) struct perf_counter_context *child_ctx; unsigned long flags; - if (likely(!child->perf_counter_ctxp)) { - perf_counter_task(child, 0); + if (likely(!child->perf_counter_ctxp)) return; - } local_irq_save(flags); /* @@ -4289,22 +4255,15 @@ void perf_counter_exit_task(struct task_struct *child) * incremented the context's refcount before we do put_ctx below. */ spin_lock(&child_ctx->lock); + child->perf_counter_ctxp = NULL; /* * If this context is a clone; unclone it so it can't get * swapped to another process while we're removing all * the counters from it. */ unclone_ctx(child_ctx); - spin_unlock_irqrestore(&child_ctx->lock, flags); - - /* - * Report the task dead after unscheduling the counters so that we - * won't get any samples after PERF_EVENT_EXIT. We can however still - * get a few PERF_EVENT_READ events. - */ - perf_counter_task(child, 0); - - child->perf_counter_ctxp = NULL; + spin_unlock(&child_ctx->lock); + local_irq_restore(flags); /* * We can recurse on the same lock type through: diff --git a/trunk/kernel/posix-timers.c b/trunk/kernel/posix-timers.c index d089d052c4a9..052ec4d195c7 100644 --- a/trunk/kernel/posix-timers.c +++ b/trunk/kernel/posix-timers.c @@ -202,12 +202,6 @@ static int no_timer_create(struct k_itimer *new_timer) return -EOPNOTSUPP; } -static int no_nsleep(const clockid_t which_clock, int flags, - struct timespec *tsave, struct timespec __user *rmtp) -{ - return -EOPNOTSUPP; -} - /* * Return nonzero if we know a priori this clockid_t value is bogus. */ @@ -260,7 +254,6 @@ static __init int init_posix_timers(void) .clock_get = posix_get_monotonic_raw, .clock_set = do_posix_clock_nosettime, .timer_create = no_timer_create, - .nsleep = no_nsleep, }; register_posix_clock(CLOCK_REALTIME, &clock_realtime); diff --git a/trunk/kernel/sched_cpupri.c b/trunk/kernel/sched_cpupri.c index d014efbf947a..e6c251790dde 100644 --- a/trunk/kernel/sched_cpupri.c +++ b/trunk/kernel/sched_cpupri.c @@ -81,21 +81,8 @@ int cpupri_find(struct cpupri *cp, struct task_struct *p, if (cpumask_any_and(&p->cpus_allowed, vec->mask) >= nr_cpu_ids) continue; - if (lowest_mask) { + if (lowest_mask) cpumask_and(lowest_mask, &p->cpus_allowed, vec->mask); - - /* - * We have to ensure that we have at least one bit - * still set in the array, since the map could have - * been concurrently emptied between the first and - * second reads of vec->mask. If we hit this - * condition, simply act as though we never hit this - * priority level and continue on. - */ - if (cpumask_any(lowest_mask) >= nr_cpu_ids) - continue; - } - return 1; } diff --git a/trunk/kernel/sched_fair.c b/trunk/kernel/sched_fair.c index 652e8bdef9aa..9ffb2b2ceba4 100644 --- a/trunk/kernel/sched_fair.c +++ b/trunk/kernel/sched_fair.c @@ -611,13 +611,9 @@ account_entity_dequeue(struct cfs_rq *cfs_rq, struct sched_entity *se) static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) { #ifdef CONFIG_SCHEDSTATS - struct task_struct *tsk = NULL; - - if (entity_is_task(se)) - tsk = task_of(se); - if (se->sleep_start) { u64 delta = rq_of(cfs_rq)->clock - se->sleep_start; + struct task_struct *tsk = task_of(se); if ((s64)delta < 0) delta = 0; @@ -628,11 +624,11 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) se->sleep_start = 0; se->sum_sleep_runtime += delta; - if (tsk) - account_scheduler_latency(tsk, delta >> 10, 1); + account_scheduler_latency(tsk, delta >> 10, 1); } if (se->block_start) { u64 delta = rq_of(cfs_rq)->clock - se->block_start; + struct task_struct *tsk = task_of(se); if ((s64)delta < 0) delta = 0; @@ -643,19 +639,17 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) se->block_start = 0; se->sum_sleep_runtime += delta; - if (tsk) { - /* - * Blocking time is in units of nanosecs, so shift by - * 20 to get a milliseconds-range estimation of the - * amount of time that the task spent sleeping: - */ - if (unlikely(prof_on == SLEEP_PROFILING)) { - profile_hits(SLEEP_PROFILING, - (void *)get_wchan(tsk), - delta >> 20); - } - account_scheduler_latency(tsk, delta >> 10, 0); + /* + * Blocking time is in units of nanosecs, so shift by 20 to + * get a milliseconds-range estimation of the amount of + * time that the task spent sleeping: + */ + if (unlikely(prof_on == SLEEP_PROFILING)) { + + profile_hits(SLEEP_PROFILING, (void *)get_wchan(tsk), + delta >> 20); } + account_scheduler_latency(tsk, delta >> 10, 0); } #endif } diff --git a/trunk/kernel/trace/ftrace.c b/trunk/kernel/trace/ftrace.c index 1e1d23c26308..1f3ec2afa511 100644 --- a/trunk/kernel/trace/ftrace.c +++ b/trunk/kernel/trace/ftrace.c @@ -1662,7 +1662,7 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable) mutex_lock(&ftrace_regex_lock); if ((file->f_mode & FMODE_WRITE) && - (file->f_flags & O_TRUNC)) + !(file->f_flags & O_APPEND)) ftrace_filter_reset(enable); if (file->f_mode & FMODE_READ) { @@ -2577,7 +2577,7 @@ ftrace_graph_open(struct inode *inode, struct file *file) mutex_lock(&graph_lock); if ((file->f_mode & FMODE_WRITE) && - (file->f_flags & O_TRUNC)) { + !(file->f_flags & O_APPEND)) { ftrace_graph_count = 0; memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs)); } diff --git a/trunk/kernel/trace/trace.c b/trunk/kernel/trace/trace.c index 8930e39b9d8c..8bc8d8afea6a 100644 --- a/trunk/kernel/trace/trace.c +++ b/trunk/kernel/trace/trace.c @@ -2031,7 +2031,7 @@ static int tracing_open(struct inode *inode, struct file *file) /* If this file was open for write, then erase contents */ if ((file->f_mode & FMODE_WRITE) && - (file->f_flags & O_TRUNC)) { + !(file->f_flags & O_APPEND)) { long cpu = (long) inode->i_private; if (cpu == TRACE_PIPE_ALL_CPU) @@ -3085,8 +3085,7 @@ tracing_fill_pipe_page(size_t rem, struct trace_iterator *iter) break; } - if (ret != TRACE_TYPE_NO_CONSUME) - trace_consume(iter); + trace_consume(iter); rem -= count; if (!find_next_entry_inc(iter)) { rem = 0; @@ -4234,11 +4233,8 @@ static void __ftrace_dump(bool disable_tracing) iter.pos = -1; if (find_next_entry_inc(&iter) != NULL) { - int ret; - - ret = print_trace_line(&iter); - if (ret != TRACE_TYPE_NO_CONSUME) - trace_consume(&iter); + print_trace_line(&iter); + trace_consume(&iter); } trace_printk_seq(&iter.seq); diff --git a/trunk/kernel/trace/trace_events.c b/trunk/kernel/trace/trace_events.c index 23d2972b22d6..53c8fd376a88 100644 --- a/trunk/kernel/trace/trace_events.c +++ b/trunk/kernel/trace/trace_events.c @@ -376,7 +376,7 @@ ftrace_event_seq_open(struct inode *inode, struct file *file) const struct seq_operations *seq_ops; if ((file->f_mode & FMODE_WRITE) && - (file->f_flags & O_TRUNC)) + !(file->f_flags & O_APPEND)) ftrace_clear_events(); seq_ops = inode->i_private; diff --git a/trunk/kernel/trace/trace_functions_graph.c b/trunk/kernel/trace/trace_functions_graph.c index 420ec3487579..d2249abafb53 100644 --- a/trunk/kernel/trace/trace_functions_graph.c +++ b/trunk/kernel/trace/trace_functions_graph.c @@ -843,16 +843,9 @@ print_graph_function(struct trace_iterator *iter) switch (entry->type) { case TRACE_GRAPH_ENT: { - /* - * print_graph_entry() may consume the current event, - * thus @field may become invalid, so we need to save it. - * sizeof(struct ftrace_graph_ent_entry) is very small, - * it can be safely saved at the stack. - */ - struct ftrace_graph_ent_entry *field, saved; + struct ftrace_graph_ent_entry *field; trace_assign_type(field, entry); - saved = *field; - return print_graph_entry(&saved, s, iter); + return print_graph_entry(field, s, iter); } case TRACE_GRAPH_RET: { struct ftrace_graph_ret_entry *field; diff --git a/trunk/kernel/trace/trace_printk.c b/trunk/kernel/trace/trace_printk.c index 687699d365ae..7b6278110827 100644 --- a/trunk/kernel/trace/trace_printk.c +++ b/trunk/kernel/trace/trace_printk.c @@ -176,7 +176,7 @@ static int t_show(struct seq_file *m, void *v) const char *str = *fmt; int i; - seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt); + seq_printf(m, "0x%lx : \"", (unsigned long)fmt); /* * Tabs and new lines need to be converted. diff --git a/trunk/lib/flex_array.c b/trunk/lib/flex_array.c index 08f1636d296a..0e7894ce8882 100644 --- a/trunk/lib/flex_array.c +++ b/trunk/lib/flex_array.c @@ -254,6 +254,7 @@ void *flex_array_get(struct flex_array *fa, int element_nr) { int part_nr = fa_element_to_part_nr(fa, element_nr); struct flex_array_part *part; + int index; if (element_nr >= fa->total_nr_elements) return NULL; @@ -263,5 +264,6 @@ void *flex_array_get(struct flex_array *fa, int element_nr) part = (struct flex_array_part *)&fa->parts[0]; else part = fa->parts[part_nr]; + index = index_inside_part(fa, element_nr); return &part->elements[index_inside_part(fa, element_nr)]; } diff --git a/trunk/scripts/recordmcount.pl b/trunk/scripts/recordmcount.pl index d29baa2e063a..7109e2b5bc0a 100755 --- a/trunk/scripts/recordmcount.pl +++ b/trunk/scripts/recordmcount.pl @@ -403,6 +403,7 @@ sub update_funcs # section found, now is this a start of a function? } elsif ($read_function && /$function_regex/) { $text_found = 1; + $offset = hex $1; $text = $2; # if this is either a local function or a weak function @@ -411,12 +412,10 @@ sub update_funcs if (!defined($locals{$text}) && !defined($weak{$text})) { $ref_func = $text; $read_function = 0; - $offset = hex $1; } else { # if we already have a function, and this is weak, skip it - if (!defined($ref_func) && !defined($weak{$text})) { + if (!defined($ref_func) || !defined($weak{$text})) { $ref_func = $text; - $offset = hex $1; } } } elsif ($read_headers && /$mcount_section/) { diff --git a/trunk/tools/perf/Makefile b/trunk/tools/perf/Makefile index 4b20fa47c3ab..a5e9b876ca09 100644 --- a/trunk/tools/perf/Makefile +++ b/trunk/tools/perf/Makefile @@ -345,7 +345,7 @@ BUILTIN_OBJS += builtin-stat.o BUILTIN_OBJS += builtin-top.o PERFLIBS = $(LIB_FILE) -EXTLIBS = -lbfd -liberty +EXTLIBS = -lbfd # # Platform specific tweaks diff --git a/trunk/tools/perf/builtin-report.c b/trunk/tools/perf/builtin-report.c index ce4f28645e64..b20a4b6e31b7 100644 --- a/trunk/tools/perf/builtin-report.c +++ b/trunk/tools/perf/builtin-report.c @@ -99,7 +99,6 @@ struct comm_event { struct fork_event { struct perf_event_header header; u32 pid, ppid; - u32 tid, ptid; }; struct lost_event { @@ -253,7 +252,7 @@ static int strcommon(const char *pathname) { int n = 0; - while (n < cwdlen && pathname[n] == cwd[n]) + while (pathname[n] == cwd[n] && n < cwdlen) ++n; return n; @@ -1609,27 +1608,15 @@ process_comm_event(event_t *event, unsigned long offset, unsigned long head) } static int -process_task_event(event_t *event, unsigned long offset, unsigned long head) +process_fork_event(event_t *event, unsigned long offset, unsigned long head) { struct thread *thread = threads__findnew(event->fork.pid); struct thread *parent = threads__findnew(event->fork.ppid); - dprintf("%p [%p]: PERF_EVENT_%s: (%d:%d):(%d:%d)\n", + dprintf("%p [%p]: PERF_EVENT_FORK: %d:%d\n", (void *)(offset + head), (void *)(long)(event->header.size), - event->header.type == PERF_EVENT_FORK ? "FORK" : "EXIT", - event->fork.pid, event->fork.tid, - event->fork.ppid, event->fork.ptid); - - /* - * A thread clone will have the same PID for both - * parent and child. - */ - if (thread == parent) - return 0; - - if (event->header.type == PERF_EVENT_EXIT) - return 0; + event->fork.pid, event->fork.ppid); if (!thread || !parent || thread__fork(thread, parent)) { dprintf("problem processing PERF_EVENT_FORK, skipping event.\n"); @@ -1719,8 +1706,7 @@ process_event(event_t *event, unsigned long offset, unsigned long head) return process_comm_event(event, offset, head); case PERF_EVENT_FORK: - case PERF_EVENT_EXIT: - return process_task_event(event, offset, head); + return process_fork_event(event, offset, head); case PERF_EVENT_LOST: return process_lost_event(event, offset, head); diff --git a/trunk/tools/perf/builtin-top.c b/trunk/tools/perf/builtin-top.c index f139f1ab9333..c0a423004e15 100644 --- a/trunk/tools/perf/builtin-top.c +++ b/trunk/tools/perf/builtin-top.c @@ -285,7 +285,6 @@ static const char *skip_symbols[] = { "enter_idle", "exit_idle", "mwait_idle", - "mwait_idle_with_hints", "ppc64_runlatch_off", "pseries_dedicated_idle_sleep", NULL diff --git a/trunk/tools/perf/util/quote.c b/trunk/tools/perf/util/quote.c index 2726fe40eb5d..c6e5dc0dc82f 100644 --- a/trunk/tools/perf/util/quote.c +++ b/trunk/tools/perf/util/quote.c @@ -318,7 +318,7 @@ char *quote_path_relative(const char *in, int len, strbuf_addch(out, '"'); if (prefix) { int off = 0; - while (off < len && prefix[off] && prefix[off] == in[off]) + while (prefix[off] && off < len && prefix[off] == in[off]) if (prefix[off] == '/') { prefix += off + 1; in += off + 1; diff --git a/trunk/tools/perf/util/symbol.c b/trunk/tools/perf/util/symbol.c index b4fe0579bd6b..28106059bf12 100644 --- a/trunk/tools/perf/util/symbol.c +++ b/trunk/tools/perf/util/symbol.c @@ -565,7 +565,7 @@ static int dso__load_sym(struct dso *self, int fd, const char *name, goto out_elf_end; secstrs = elf_getdata(sec_strndx, NULL); - if (secstrs == NULL) + if (symstrs == NULL) goto out_elf_end; nr_syms = shdr.sh_size / shdr.sh_entsize;