diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-06 13:57:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-05-06 13:57:37 -0400 |
commit | 3d54ac9e35a69d19381420bb2fa1702d5bf73846 (patch) | |
tree | 7dd5ef57cfc4c7771ef5250abaef2072a69c8a3b | |
parent | d8fce2db7220fc46067c825fc417fb295eac7d0a (diff) | |
parent | c88d47480d300eaad80c213d50c9bf6077fc49bc (diff) |
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar:
"EFI fixes, and FPU fix, a ticket spinlock boundary condition fix and
two build fixes"
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/fpu: Always restore_xinit_state() when use_eager_cpu()
x86: Make cpu_tss available to external modules
efi: Fix error handling in add_sysfs_runtime_map_entry()
x86/spinlocks: Fix regression in spinlock contention detection
x86/mm: Clean up types in xlate_dev_mem_ptr()
x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr
efivarfs: Ensure VariableName is NUL-terminated
-rw-r--r-- | arch/x86/boot/compressed/eboot.c | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/spinlock.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 14 | ||||
-rw-r--r-- | arch/x86/mm/ioremap.c | 14 | ||||
-rw-r--r-- | drivers/firmware/efi/runtime-map.c | 6 | ||||
-rw-r--r-- | fs/efivarfs/super.c | 2 |
6 files changed, 23 insertions, 17 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index ef17683484e9..48304b89b601 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c | |||
@@ -1109,6 +1109,8 @@ struct boot_params *make_boot_params(struct efi_config *c) | |||
1109 | if (!cmdline_ptr) | 1109 | if (!cmdline_ptr) |
1110 | goto fail; | 1110 | goto fail; |
1111 | hdr->cmd_line_ptr = (unsigned long)cmdline_ptr; | 1111 | hdr->cmd_line_ptr = (unsigned long)cmdline_ptr; |
1112 | /* Fill in upper bits of command line address, NOP on 32 bit */ | ||
1113 | boot_params->ext_cmd_line_ptr = (u64)(unsigned long)cmdline_ptr >> 32; | ||
1112 | 1114 | ||
1113 | hdr->ramdisk_image = 0; | 1115 | hdr->ramdisk_image = 0; |
1114 | hdr->ramdisk_size = 0; | 1116 | hdr->ramdisk_size = 0; |
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h index cf87de3fc390..64b611782ef0 100644 --- a/arch/x86/include/asm/spinlock.h +++ b/arch/x86/include/asm/spinlock.h | |||
@@ -169,7 +169,7 @@ static inline int arch_spin_is_contended(arch_spinlock_t *lock) | |||
169 | struct __raw_tickets tmp = READ_ONCE(lock->tickets); | 169 | struct __raw_tickets tmp = READ_ONCE(lock->tickets); |
170 | 170 | ||
171 | tmp.head &= ~TICKET_SLOWPATH_FLAG; | 171 | tmp.head &= ~TICKET_SLOWPATH_FLAG; |
172 | return (tmp.tail - tmp.head) > TICKET_LOCK_INC; | 172 | return (__ticket_t)(tmp.tail - tmp.head) > TICKET_LOCK_INC; |
173 | } | 173 | } |
174 | #define arch_spin_is_contended arch_spin_is_contended | 174 | #define arch_spin_is_contended arch_spin_is_contended |
175 | 175 | ||
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 8213da62b1b7..6e338e3b1dc0 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -57,7 +57,7 @@ __visible DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, cpu_tss) = { | |||
57 | .io_bitmap = { [0 ... IO_BITMAP_LONGS] = ~0 }, | 57 | .io_bitmap = { [0 ... IO_BITMAP_LONGS] = ~0 }, |
58 | #endif | 58 | #endif |
59 | }; | 59 | }; |
60 | EXPORT_PER_CPU_SYMBOL_GPL(cpu_tss); | 60 | EXPORT_PER_CPU_SYMBOL(cpu_tss); |
61 | 61 | ||
62 | #ifdef CONFIG_X86_64 | 62 | #ifdef CONFIG_X86_64 |
63 | static DEFINE_PER_CPU(unsigned char, is_idle); | 63 | static DEFINE_PER_CPU(unsigned char, is_idle); |
@@ -156,11 +156,13 @@ void flush_thread(void) | |||
156 | /* FPU state will be reallocated lazily at the first use. */ | 156 | /* FPU state will be reallocated lazily at the first use. */ |
157 | drop_fpu(tsk); | 157 | drop_fpu(tsk); |
158 | free_thread_xstate(tsk); | 158 | free_thread_xstate(tsk); |
159 | } else if (!used_math()) { | 159 | } else { |
160 | /* kthread execs. TODO: cleanup this horror. */ | 160 | if (!tsk_used_math(tsk)) { |
161 | if (WARN_ON(init_fpu(tsk))) | 161 | /* kthread execs. TODO: cleanup this horror. */ |
162 | force_sig(SIGKILL, tsk); | 162 | if (WARN_ON(init_fpu(tsk))) |
163 | user_fpu_begin(); | 163 | force_sig(SIGKILL, tsk); |
164 | user_fpu_begin(); | ||
165 | } | ||
164 | restore_init_xstate(); | 166 | restore_init_xstate(); |
165 | } | 167 | } |
166 | } | 168 | } |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 5ead4d6cf3a7..70e7444c6835 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -351,18 +351,20 @@ int arch_ioremap_pmd_supported(void) | |||
351 | */ | 351 | */ |
352 | void *xlate_dev_mem_ptr(phys_addr_t phys) | 352 | void *xlate_dev_mem_ptr(phys_addr_t phys) |
353 | { | 353 | { |
354 | void *addr; | 354 | unsigned long start = phys & PAGE_MASK; |
355 | unsigned long start = phys & PAGE_MASK; | 355 | unsigned long offset = phys & ~PAGE_MASK; |
356 | unsigned long vaddr; | ||
356 | 357 | ||
357 | /* If page is RAM, we can use __va. Otherwise ioremap and unmap. */ | 358 | /* If page is RAM, we can use __va. Otherwise ioremap and unmap. */ |
358 | if (page_is_ram(start >> PAGE_SHIFT)) | 359 | if (page_is_ram(start >> PAGE_SHIFT)) |
359 | return __va(phys); | 360 | return __va(phys); |
360 | 361 | ||
361 | addr = (void __force *)ioremap_cache(start, PAGE_SIZE); | 362 | vaddr = (unsigned long)ioremap_cache(start, PAGE_SIZE); |
362 | if (addr) | 363 | /* Only add the offset on success and return NULL if the ioremap() failed: */ |
363 | addr = (void *)((unsigned long)addr | (phys & ~PAGE_MASK)); | 364 | if (vaddr) |
365 | vaddr += offset; | ||
364 | 366 | ||
365 | return addr; | 367 | return (void *)vaddr; |
366 | } | 368 | } |
367 | 369 | ||
368 | void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) | 370 | void unxlate_dev_mem_ptr(phys_addr_t phys, void *addr) |
diff --git a/drivers/firmware/efi/runtime-map.c b/drivers/firmware/efi/runtime-map.c index 87b8e3b900d2..5c55227a34c8 100644 --- a/drivers/firmware/efi/runtime-map.c +++ b/drivers/firmware/efi/runtime-map.c | |||
@@ -120,7 +120,8 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr) | |||
120 | entry = kzalloc(sizeof(*entry), GFP_KERNEL); | 120 | entry = kzalloc(sizeof(*entry), GFP_KERNEL); |
121 | if (!entry) { | 121 | if (!entry) { |
122 | kset_unregister(map_kset); | 122 | kset_unregister(map_kset); |
123 | return entry; | 123 | map_kset = NULL; |
124 | return ERR_PTR(-ENOMEM); | ||
124 | } | 125 | } |
125 | 126 | ||
126 | memcpy(&entry->md, efi_runtime_map + nr * efi_memdesc_size, | 127 | memcpy(&entry->md, efi_runtime_map + nr * efi_memdesc_size, |
@@ -132,6 +133,7 @@ add_sysfs_runtime_map_entry(struct kobject *kobj, int nr) | |||
132 | if (ret) { | 133 | if (ret) { |
133 | kobject_put(&entry->kobj); | 134 | kobject_put(&entry->kobj); |
134 | kset_unregister(map_kset); | 135 | kset_unregister(map_kset); |
136 | map_kset = NULL; | ||
135 | return ERR_PTR(ret); | 137 | return ERR_PTR(ret); |
136 | } | 138 | } |
137 | 139 | ||
@@ -195,8 +197,6 @@ out_add_entry: | |||
195 | entry = *(map_entries + j); | 197 | entry = *(map_entries + j); |
196 | kobject_put(&entry->kobj); | 198 | kobject_put(&entry->kobj); |
197 | } | 199 | } |
198 | if (map_kset) | ||
199 | kset_unregister(map_kset); | ||
200 | out: | 200 | out: |
201 | return ret; | 201 | return ret; |
202 | } | 202 | } |
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 59fedbcf8798..86a2121828c3 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c | |||
@@ -121,7 +121,7 @@ static int efivarfs_callback(efi_char16_t *name16, efi_guid_t vendor, | |||
121 | int len, i; | 121 | int len, i; |
122 | int err = -ENOMEM; | 122 | int err = -ENOMEM; |
123 | 123 | ||
124 | entry = kmalloc(sizeof(*entry), GFP_KERNEL); | 124 | entry = kzalloc(sizeof(*entry), GFP_KERNEL); |
125 | if (!entry) | 125 | if (!entry) |
126 | return err; | 126 | return err; |
127 | 127 | ||