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

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 updates from Ingo Molnar.

This touches some non-x86 files due to the sanitized INLINE_SPIN_UNLOCK
config usage.

Fixed up trivial conflicts due to just header include changes (removing
headers due to cpu_idle() merge clashing with the <asm/system.h> split).

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/apic/amd: Be more verbose about LVT offset assignments
x86, tls: Off by one limit check
x86/ioapic: Add io_apic_ops driver layer to allow interception
x86/olpc: Add debugfs interface for EC commands
x86: Merge the x86_32 and x86_64 cpu_idle() functions
x86/kconfig: Remove CONFIG_TR=y from the defconfigs
x86: Stop recursive fault in print_context_stack after stack overflow
x86/io_apic: Move and reenable irq only when CONFIG_GENERIC_PENDING_IRQ=y
x86/apic: Add separate apic_id_valid() functions for selected apic drivers
locking/kconfig: Simplify INLINE_SPIN_UNLOCK usage
x86/kconfig: Update defconfigs
x86: Fix excessive MSR print out when show_msr is not specified

+437 -322
+16
Documentation/ABI/testing/debugfs-olpc
··· 1 + What: /sys/kernel/debug/olpc-ec/cmd 2 + Date: Dec 2011 3 + KernelVersion: 3.4 4 + Contact: devel@lists.laptop.org 5 + Description: 6 + 7 + A generic interface for executing OLPC Embedded Controller commands and 8 + reading their responses. 9 + 10 + To execute a command, write data with the format: CC:N A A A A 11 + CC is the (hex) command, N is the count of expected reply bytes, and A A A A 12 + are optional (hex) arguments. 13 + 14 + To read the response (if any), read from the generic node after executing 15 + a command. Hex reply bytes will be returned, *whether or not* they came from 16 + the immediately previous command.
+1 -1
arch/mips/configs/db1300_defconfig
··· 133 133 CONFIG_IOSCHED_NOOP=y 134 134 CONFIG_DEFAULT_NOOP=y 135 135 CONFIG_DEFAULT_IOSCHED="noop" 136 - CONFIG_INLINE_SPIN_UNLOCK=y 136 + # CONFIG_UNINLINE_SPIN_UNLOCK is not set 137 137 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y 138 138 CONFIG_INLINE_READ_UNLOCK=y 139 139 CONFIG_INLINE_READ_UNLOCK_IRQ=y
+23 -43
arch/x86/configs/i386_defconfig
··· 15 15 CONFIG_CGROUP_CPUACCT=y 16 16 CONFIG_RESOURCE_COUNTERS=y 17 17 CONFIG_CGROUP_SCHED=y 18 - CONFIG_UTS_NS=y 19 - CONFIG_IPC_NS=y 20 - CONFIG_USER_NS=y 21 - CONFIG_PID_NS=y 22 - CONFIG_NET_NS=y 23 18 CONFIG_BLK_DEV_INITRD=y 24 - CONFIG_KALLSYMS_EXTRA_PASS=y 25 19 # CONFIG_COMPAT_BRK is not set 26 20 CONFIG_PROFILING=y 27 21 CONFIG_KPROBES=y 28 22 CONFIG_MODULES=y 29 23 CONFIG_MODULE_UNLOAD=y 30 24 CONFIG_MODULE_FORCE_UNLOAD=y 25 + CONFIG_PARTITION_ADVANCED=y 26 + CONFIG_OSF_PARTITION=y 27 + CONFIG_AMIGA_PARTITION=y 28 + CONFIG_MAC_PARTITION=y 29 + CONFIG_BSD_DISKLABEL=y 30 + CONFIG_MINIX_SUBPARTITION=y 31 + CONFIG_SOLARIS_X86_PARTITION=y 32 + CONFIG_UNIXWARE_DISKLABEL=y 33 + CONFIG_SGI_PARTITION=y 34 + CONFIG_SUN_PARTITION=y 35 + CONFIG_KARMA_PARTITION=y 36 + CONFIG_EFI_PARTITION=y 31 37 CONFIG_NO_HZ=y 32 38 CONFIG_HIGH_RES_TIMERS=y 33 39 CONFIG_SMP=y 34 - CONFIG_SPARSE_IRQ=y 35 40 CONFIG_X86_GENERIC=y 36 41 CONFIG_HPET_TIMER=y 37 42 CONFIG_SCHED_SMT=y ··· 56 51 CONFIG_KEXEC=y 57 52 CONFIG_CRASH_DUMP=y 58 53 # CONFIG_COMPAT_VDSO is not set 59 - CONFIG_PM=y 54 + CONFIG_HIBERNATION=y 60 55 CONFIG_PM_DEBUG=y 61 56 CONFIG_PM_TRACE_RTC=y 62 - CONFIG_HIBERNATION=y 63 57 CONFIG_ACPI_PROCFS=y 64 58 CONFIG_ACPI_DOCK=y 65 59 CONFIG_CPU_FREQ=y 66 - CONFIG_CPU_FREQ_DEBUG=y 67 60 # CONFIG_CPU_FREQ_STAT is not set 68 61 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y 69 62 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y ··· 72 69 CONFIG_PCCARD=y 73 70 CONFIG_YENTA=y 74 71 CONFIG_HOTPLUG_PCI=y 75 - CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y 76 72 CONFIG_BINFMT_MISC=y 77 73 CONFIG_NET=y 78 74 CONFIG_PACKET=y ··· 122 120 CONFIG_IP_NF_IPTABLES=y 123 121 CONFIG_IP_NF_FILTER=y 124 122 CONFIG_IP_NF_TARGET_REJECT=y 125 - CONFIG_IP_NF_TARGET_LOG=y 126 123 CONFIG_IP_NF_TARGET_ULOG=y 127 124 CONFIG_NF_NAT=y 128 125 CONFIG_IP_NF_TARGET_MASQUERADE=y ··· 129 128 CONFIG_NF_CONNTRACK_IPV6=y 130 129 CONFIG_IP6_NF_IPTABLES=y 131 130 CONFIG_IP6_NF_MATCH_IPV6HEADER=y 132 - CONFIG_IP6_NF_TARGET_LOG=y 133 131 CONFIG_IP6_NF_FILTER=y 134 132 CONFIG_IP6_NF_TARGET_REJECT=y 135 133 CONFIG_IP6_NF_MANGLE=y ··· 169 169 CONFIG_MACINTOSH_DRIVERS=y 170 170 CONFIG_MAC_EMUMOUSEBTN=y 171 171 CONFIG_NETDEVICES=y 172 - CONFIG_NET_ETHERNET=y 173 - CONFIG_NET_VENDOR_3COM=y 172 + CONFIG_NETCONSOLE=y 173 + CONFIG_BNX2=y 174 + CONFIG_TIGON3=y 174 175 CONFIG_NET_TULIP=y 175 - CONFIG_NET_PCI=y 176 - CONFIG_FORCEDETH=y 177 176 CONFIG_E100=y 178 - CONFIG_NE2K_PCI=y 179 - CONFIG_8139TOO=y 180 - # CONFIG_8139TOO_PIO is not set 181 177 CONFIG_E1000=y 182 178 CONFIG_E1000E=y 183 - CONFIG_R8169=y 184 179 CONFIG_SKY2=y 185 - CONFIG_TIGON3=y 186 - CONFIG_BNX2=y 187 - CONFIG_TR=y 188 - CONFIG_NET_PCMCIA=y 180 + CONFIG_NE2K_PCI=y 181 + CONFIG_FORCEDETH=y 182 + CONFIG_8139TOO=y 183 + # CONFIG_8139TOO_PIO is not set 184 + CONFIG_R8169=y 189 185 CONFIG_FDDI=y 190 - CONFIG_NETCONSOLE=y 191 186 CONFIG_INPUT_POLLDEV=y 192 187 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set 193 188 CONFIG_INPUT_EVDEV=y ··· 191 196 CONFIG_INPUT_TOUCHSCREEN=y 192 197 CONFIG_INPUT_MISC=y 193 198 CONFIG_VT_HW_CONSOLE_BINDING=y 199 + # CONFIG_LEGACY_PTYS is not set 194 200 CONFIG_SERIAL_NONSTANDARD=y 195 201 CONFIG_SERIAL_8250=y 196 202 CONFIG_SERIAL_8250_CONSOLE=y ··· 201 205 CONFIG_SERIAL_8250_SHARE_IRQ=y 202 206 CONFIG_SERIAL_8250_DETECT_IRQ=y 203 207 CONFIG_SERIAL_8250_RSA=y 204 - # CONFIG_LEGACY_PTYS is not set 205 208 CONFIG_HW_RANDOM=y 206 209 CONFIG_NVRAM=y 207 210 CONFIG_HPET=y ··· 215 220 CONFIG_FB_MODE_HELPERS=y 216 221 CONFIG_FB_TILEBLITTING=y 217 222 CONFIG_FB_EFI=y 218 - CONFIG_BACKLIGHT_LCD_SUPPORT=y 219 223 # CONFIG_LCD_CLASS_DEVICE is not set 220 224 CONFIG_VGACON_SOFT_SCROLLBACK=y 221 225 CONFIG_LOGO=y ··· 277 283 CONFIG_MSDOS_FS=y 278 284 CONFIG_VFAT_FS=y 279 285 CONFIG_PROC_KCORE=y 280 - CONFIG_TMPFS=y 281 286 CONFIG_TMPFS_POSIX_ACL=y 282 287 CONFIG_HUGETLBFS=y 283 288 CONFIG_NFS_FS=y ··· 284 291 CONFIG_NFS_V3_ACL=y 285 292 CONFIG_NFS_V4=y 286 293 CONFIG_ROOT_NFS=y 287 - CONFIG_PARTITION_ADVANCED=y 288 - CONFIG_OSF_PARTITION=y 289 - CONFIG_AMIGA_PARTITION=y 290 - CONFIG_MAC_PARTITION=y 291 - CONFIG_BSD_DISKLABEL=y 292 - CONFIG_MINIX_SUBPARTITION=y 293 - CONFIG_SOLARIS_X86_PARTITION=y 294 - CONFIG_UNIXWARE_DISKLABEL=y 295 - CONFIG_SGI_PARTITION=y 296 - CONFIG_SUN_PARTITION=y 297 - CONFIG_KARMA_PARTITION=y 298 - CONFIG_EFI_PARTITION=y 299 294 CONFIG_NLS_DEFAULT="utf8" 300 295 CONFIG_NLS_CODEPAGE_437=y 301 296 CONFIG_NLS_ASCII=y ··· 298 317 # CONFIG_SCHED_DEBUG is not set 299 318 CONFIG_SCHEDSTATS=y 300 319 CONFIG_TIMER_STATS=y 301 - # CONFIG_RCU_CPU_STALL_DETECTOR is not set 320 + CONFIG_DEBUG_STACK_USAGE=y 302 321 CONFIG_SYSCTL_SYSCALL_CHECK=y 303 322 CONFIG_BLK_DEV_IO_TRACE=y 304 323 CONFIG_PROVIDE_OHCI1394_DMA_INIT=y 305 324 CONFIG_EARLY_PRINTK_DBGP=y 306 325 CONFIG_DEBUG_STACKOVERFLOW=y 307 - CONFIG_DEBUG_STACK_USAGE=y 308 326 # CONFIG_DEBUG_RODATA_TEST is not set 309 327 CONFIG_DEBUG_NX_TEST=m 310 328 CONFIG_DEBUG_BOOT_PARAMS=y
+23 -44
arch/x86/configs/x86_64_defconfig
··· 1 - CONFIG_64BIT=y 2 1 CONFIG_EXPERIMENTAL=y 3 2 # CONFIG_LOCALVERSION_AUTO is not set 4 3 CONFIG_SYSVIPC=y ··· 15 16 CONFIG_CGROUP_CPUACCT=y 16 17 CONFIG_RESOURCE_COUNTERS=y 17 18 CONFIG_CGROUP_SCHED=y 18 - CONFIG_UTS_NS=y 19 - CONFIG_IPC_NS=y 20 - CONFIG_USER_NS=y 21 - CONFIG_PID_NS=y 22 - CONFIG_NET_NS=y 23 19 CONFIG_BLK_DEV_INITRD=y 24 - CONFIG_KALLSYMS_EXTRA_PASS=y 25 20 # CONFIG_COMPAT_BRK is not set 26 21 CONFIG_PROFILING=y 27 22 CONFIG_KPROBES=y 28 23 CONFIG_MODULES=y 29 24 CONFIG_MODULE_UNLOAD=y 30 25 CONFIG_MODULE_FORCE_UNLOAD=y 26 + CONFIG_PARTITION_ADVANCED=y 27 + CONFIG_OSF_PARTITION=y 28 + CONFIG_AMIGA_PARTITION=y 29 + CONFIG_MAC_PARTITION=y 30 + CONFIG_BSD_DISKLABEL=y 31 + CONFIG_MINIX_SUBPARTITION=y 32 + CONFIG_SOLARIS_X86_PARTITION=y 33 + CONFIG_UNIXWARE_DISKLABEL=y 34 + CONFIG_SGI_PARTITION=y 35 + CONFIG_SUN_PARTITION=y 36 + CONFIG_KARMA_PARTITION=y 37 + CONFIG_EFI_PARTITION=y 31 38 CONFIG_NO_HZ=y 32 39 CONFIG_HIGH_RES_TIMERS=y 33 40 CONFIG_SMP=y 34 - CONFIG_SPARSE_IRQ=y 35 41 CONFIG_CALGARY_IOMMU=y 36 - CONFIG_AMD_IOMMU=y 37 - CONFIG_AMD_IOMMU_STATS=y 38 42 CONFIG_NR_CPUS=64 39 43 CONFIG_SCHED_SMT=y 40 44 CONFIG_PREEMPT_VOLUNTARY=y ··· 55 53 CONFIG_KEXEC=y 56 54 CONFIG_CRASH_DUMP=y 57 55 # CONFIG_COMPAT_VDSO is not set 58 - CONFIG_PM=y 56 + CONFIG_HIBERNATION=y 59 57 CONFIG_PM_DEBUG=y 60 58 CONFIG_PM_TRACE_RTC=y 61 - CONFIG_HIBERNATION=y 62 59 CONFIG_ACPI_PROCFS=y 63 60 CONFIG_ACPI_DOCK=y 64 61 CONFIG_CPU_FREQ=y 65 - CONFIG_CPU_FREQ_DEBUG=y 66 62 # CONFIG_CPU_FREQ_STAT is not set 67 63 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y 68 64 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y 69 65 CONFIG_CPU_FREQ_GOV_ONDEMAND=y 70 66 CONFIG_X86_ACPI_CPUFREQ=y 71 67 CONFIG_PCI_MMCONFIG=y 72 - CONFIG_INTEL_IOMMU=y 73 - # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set 74 68 CONFIG_PCIEPORTBUS=y 75 69 CONFIG_PCCARD=y 76 70 CONFIG_YENTA=y 77 71 CONFIG_HOTPLUG_PCI=y 78 - CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y 79 72 CONFIG_BINFMT_MISC=y 80 73 CONFIG_IA32_EMULATION=y 81 74 CONFIG_NET=y ··· 122 125 CONFIG_IP_NF_IPTABLES=y 123 126 CONFIG_IP_NF_FILTER=y 124 127 CONFIG_IP_NF_TARGET_REJECT=y 125 - CONFIG_IP_NF_TARGET_LOG=y 126 128 CONFIG_IP_NF_TARGET_ULOG=y 127 129 CONFIG_NF_NAT=y 128 130 CONFIG_IP_NF_TARGET_MASQUERADE=y ··· 129 133 CONFIG_NF_CONNTRACK_IPV6=y 130 134 CONFIG_IP6_NF_IPTABLES=y 131 135 CONFIG_IP6_NF_MATCH_IPV6HEADER=y 132 - CONFIG_IP6_NF_TARGET_LOG=y 133 136 CONFIG_IP6_NF_FILTER=y 134 137 CONFIG_IP6_NF_TARGET_REJECT=y 135 138 CONFIG_IP6_NF_MANGLE=y ··· 167 172 CONFIG_MACINTOSH_DRIVERS=y 168 173 CONFIG_MAC_EMUMOUSEBTN=y 169 174 CONFIG_NETDEVICES=y 170 - CONFIG_NET_ETHERNET=y 171 - CONFIG_NET_VENDOR_3COM=y 175 + CONFIG_NETCONSOLE=y 176 + CONFIG_TIGON3=y 172 177 CONFIG_NET_TULIP=y 173 - CONFIG_NET_PCI=y 174 - CONFIG_FORCEDETH=y 175 178 CONFIG_E100=y 176 - CONFIG_8139TOO=y 177 179 CONFIG_E1000=y 178 180 CONFIG_SKY2=y 179 - CONFIG_TIGON3=y 180 - CONFIG_TR=y 181 - CONFIG_NET_PCMCIA=y 181 + CONFIG_FORCEDETH=y 182 + CONFIG_8139TOO=y 182 183 CONFIG_FDDI=y 183 - CONFIG_NETCONSOLE=y 184 184 CONFIG_INPUT_POLLDEV=y 185 185 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set 186 186 CONFIG_INPUT_EVDEV=y ··· 184 194 CONFIG_INPUT_TOUCHSCREEN=y 185 195 CONFIG_INPUT_MISC=y 186 196 CONFIG_VT_HW_CONSOLE_BINDING=y 197 + # CONFIG_LEGACY_PTYS is not set 187 198 CONFIG_SERIAL_NONSTANDARD=y 188 199 CONFIG_SERIAL_8250=y 189 200 CONFIG_SERIAL_8250_CONSOLE=y ··· 194 203 CONFIG_SERIAL_8250_SHARE_IRQ=y 195 204 CONFIG_SERIAL_8250_DETECT_IRQ=y 196 205 CONFIG_SERIAL_8250_RSA=y 197 - # CONFIG_LEGACY_PTYS is not set 198 206 CONFIG_HW_RANDOM=y 199 207 # CONFIG_HW_RANDOM_INTEL is not set 200 208 # CONFIG_HW_RANDOM_AMD is not set ··· 211 221 CONFIG_FB_MODE_HELPERS=y 212 222 CONFIG_FB_TILEBLITTING=y 213 223 CONFIG_FB_EFI=y 214 - CONFIG_BACKLIGHT_LCD_SUPPORT=y 215 224 # CONFIG_LCD_CLASS_DEVICE is not set 216 225 CONFIG_VGACON_SOFT_SCROLLBACK=y 217 226 CONFIG_LOGO=y ··· 257 268 # CONFIG_RTC_HCTOSYS is not set 258 269 CONFIG_DMADEVICES=y 259 270 CONFIG_EEEPC_LAPTOP=y 271 + CONFIG_AMD_IOMMU=y 272 + CONFIG_AMD_IOMMU_STATS=y 273 + CONFIG_INTEL_IOMMU=y 274 + # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set 260 275 CONFIG_EFI_VARS=y 261 276 CONFIG_EXT3_FS=y 262 277 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set ··· 277 284 CONFIG_MSDOS_FS=y 278 285 CONFIG_VFAT_FS=y 279 286 CONFIG_PROC_KCORE=y 280 - CONFIG_TMPFS=y 281 287 CONFIG_TMPFS_POSIX_ACL=y 282 288 CONFIG_HUGETLBFS=y 283 289 CONFIG_NFS_FS=y ··· 284 292 CONFIG_NFS_V3_ACL=y 285 293 CONFIG_NFS_V4=y 286 294 CONFIG_ROOT_NFS=y 287 - CONFIG_PARTITION_ADVANCED=y 288 - CONFIG_OSF_PARTITION=y 289 - CONFIG_AMIGA_PARTITION=y 290 - CONFIG_MAC_PARTITION=y 291 - CONFIG_BSD_DISKLABEL=y 292 - CONFIG_MINIX_SUBPARTITION=y 293 - CONFIG_SOLARIS_X86_PARTITION=y 294 - CONFIG_UNIXWARE_DISKLABEL=y 295 - CONFIG_SGI_PARTITION=y 296 - CONFIG_SUN_PARTITION=y 297 - CONFIG_KARMA_PARTITION=y 298 - CONFIG_EFI_PARTITION=y 299 295 CONFIG_NLS_DEFAULT="utf8" 300 296 CONFIG_NLS_CODEPAGE_437=y 301 297 CONFIG_NLS_ASCII=y ··· 297 317 # CONFIG_SCHED_DEBUG is not set 298 318 CONFIG_SCHEDSTATS=y 299 319 CONFIG_TIMER_STATS=y 300 - # CONFIG_RCU_CPU_STALL_DETECTOR is not set 320 + CONFIG_DEBUG_STACK_USAGE=y 301 321 CONFIG_SYSCTL_SYSCALL_CHECK=y 302 322 CONFIG_BLK_DEV_IO_TRACE=y 303 323 CONFIG_PROVIDE_OHCI1394_DMA_INIT=y 304 324 CONFIG_EARLY_PRINTK_DBGP=y 305 325 CONFIG_DEBUG_STACKOVERFLOW=y 306 - CONFIG_DEBUG_STACK_USAGE=y 307 326 # CONFIG_DEBUG_RODATA_TEST is not set 308 327 CONFIG_DEBUG_NX_TEST=m 309 328 CONFIG_DEBUG_BOOT_PARAMS=y
+1 -1
arch/x86/include/asm/apic.h
··· 534 534 535 535 static inline int default_apic_id_valid(int apicid) 536 536 { 537 - return x2apic_mode || (apicid < 255); 537 + return (apicid < 255); 538 538 } 539 539 540 540 extern void default_setup_apic_routing(void);
+1
arch/x86/include/asm/idle.h
··· 14 14 #else /* !CONFIG_X86_64 */ 15 15 static inline void enter_idle(void) { } 16 16 static inline void exit_idle(void) { } 17 + static inline void __exit_idle(void) { } 17 18 #endif /* CONFIG_X86_64 */ 18 19 19 20 void amd_e400_remove_cpu(int cpu);
+9
arch/x86/include/asm/io_apic.h
··· 21 21 #define IO_APIC_REDIR_LEVEL_TRIGGER (1 << 15) 22 22 #define IO_APIC_REDIR_MASKED (1 << 16) 23 23 24 + struct io_apic_ops { 25 + void (*init) (void); 26 + unsigned int (*read) (unsigned int apic, unsigned int reg); 27 + void (*write) (unsigned int apic, unsigned int reg, unsigned int value); 28 + void (*modify)(unsigned int apic, unsigned int reg, unsigned int value); 29 + }; 30 + 31 + void __init set_io_apic_ops(const struct io_apic_ops *); 32 + 24 33 /* 25 34 * The structure of the IO-APIC: 26 35 */
+5
arch/x86/include/asm/x2apic.h
··· 18 18 return cpu_online_mask; 19 19 } 20 20 21 + static int x2apic_apic_id_valid(int apicid) 22 + { 23 + return 1; 24 + } 25 + 21 26 static int x2apic_apic_id_registered(void) 22 27 { 23 28 return 1;
+1 -1
arch/x86/kernel/acpi/boot.c
··· 239 239 * to not preallocating memory for all NR_CPUS 240 240 * when we use CPU hotplug. 241 241 */ 242 - if (!cpu_has_x2apic && (apic_id >= 0xff) && enabled) 242 + if (!apic->apic_id_valid(apic_id) && enabled) 243 243 printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); 244 244 else 245 245 acpi_register_lapic(apic_id, enabled);
+9 -4
arch/x86/kernel/apic/apic.c
··· 383 383 384 384 static unsigned int reserve_eilvt_offset(int offset, unsigned int new) 385 385 { 386 - unsigned int rsvd; /* 0: uninitialized */ 386 + unsigned int rsvd, vector; 387 387 388 388 if (offset >= APIC_EILVT_NR_MAX) 389 389 return ~0; 390 390 391 - rsvd = atomic_read(&eilvt_offsets[offset]) & ~APIC_EILVT_MASKED; 391 + rsvd = atomic_read(&eilvt_offsets[offset]); 392 392 do { 393 - if (rsvd && 394 - !eilvt_entry_is_changeable(rsvd, new)) 393 + vector = rsvd & ~APIC_EILVT_MASKED; /* 0: unassigned */ 394 + if (vector && !eilvt_entry_is_changeable(vector, new)) 395 395 /* may not change if vectors are different */ 396 396 return rsvd; 397 397 rsvd = atomic_cmpxchg(&eilvt_offsets[offset], rsvd, new); 398 398 } while (rsvd != new); 399 + 400 + rsvd &= ~APIC_EILVT_MASKED; 401 + if (rsvd && rsvd != vector) 402 + pr_info("LVT offset %d assigned for vector 0x%02x\n", 403 + offset, rsvd); 399 404 400 405 return new; 401 406 }
+1 -2
arch/x86/kernel/apic/apic_numachip.c
··· 229 229 } 230 230 early_initcall(numachip_system_init); 231 231 232 - static int __cpuinit numachip_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 232 + static int numachip_acpi_madt_oem_check(char *oem_id, char *oem_table_id) 233 233 { 234 234 if (!strncmp(oem_id, "NUMASC", 6)) { 235 235 numachip_system = 1; 236 - setup_force_cpu_cap(X86_FEATURE_X2APIC); 237 236 return 1; 238 237 } 239 238
+112 -47
arch/x86/kernel/apic/io_apic.c
··· 64 64 #include <asm/apic.h> 65 65 66 66 #define __apicdebuginit(type) static type __init 67 + 67 68 #define for_each_irq_pin(entry, head) \ 68 69 for (entry = head; entry; entry = entry->next) 70 + 71 + static void __init __ioapic_init_mappings(void); 72 + 73 + static unsigned int __io_apic_read (unsigned int apic, unsigned int reg); 74 + static void __io_apic_write (unsigned int apic, unsigned int reg, unsigned int val); 75 + static void __io_apic_modify(unsigned int apic, unsigned int reg, unsigned int val); 76 + 77 + static struct io_apic_ops io_apic_ops = { 78 + .init = __ioapic_init_mappings, 79 + .read = __io_apic_read, 80 + .write = __io_apic_write, 81 + .modify = __io_apic_modify, 82 + }; 83 + 84 + void __init set_io_apic_ops(const struct io_apic_ops *ops) 85 + { 86 + io_apic_ops = *ops; 87 + } 69 88 70 89 /* 71 90 * Is the SiS APIC rmw bug present ? ··· 313 294 irq_free_desc(at); 314 295 } 315 296 297 + static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) 298 + { 299 + return io_apic_ops.read(apic, reg); 300 + } 301 + 302 + static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) 303 + { 304 + io_apic_ops.write(apic, reg, value); 305 + } 306 + 307 + static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) 308 + { 309 + io_apic_ops.modify(apic, reg, value); 310 + } 311 + 312 + 316 313 struct io_apic { 317 314 unsigned int index; 318 315 unsigned int unused[3]; ··· 349 314 writel(vector, &io_apic->eoi); 350 315 } 351 316 352 - static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg) 317 + static unsigned int __io_apic_read(unsigned int apic, unsigned int reg) 353 318 { 354 319 struct io_apic __iomem *io_apic = io_apic_base(apic); 355 320 writel(reg, &io_apic->index); 356 321 return readl(&io_apic->data); 357 322 } 358 323 359 - static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) 324 + static void __io_apic_write(unsigned int apic, unsigned int reg, unsigned int value) 360 325 { 361 326 struct io_apic __iomem *io_apic = io_apic_base(apic); 327 + 362 328 writel(reg, &io_apic->index); 363 329 writel(value, &io_apic->data); 364 330 } ··· 370 334 * 371 335 * Older SiS APIC requires we rewrite the index register 372 336 */ 373 - static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) 337 + static void __io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value) 374 338 { 375 339 struct io_apic __iomem *io_apic = io_apic_base(apic); 376 340 ··· 413 377 414 378 eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); 415 379 eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); 380 + 416 381 return eu.entry; 417 382 } 418 383 ··· 421 384 { 422 385 union entry_union eu; 423 386 unsigned long flags; 387 + 424 388 raw_spin_lock_irqsave(&ioapic_lock, flags); 425 389 eu.entry = __ioapic_read_entry(apic, pin); 426 390 raw_spin_unlock_irqrestore(&ioapic_lock, flags); 391 + 427 392 return eu.entry; 428 393 } 429 394 ··· 435 396 * the interrupt, and we need to make sure the entry is fully populated 436 397 * before that happens. 437 398 */ 438 - static void 439 - __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) 399 + static void __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) 440 400 { 441 401 union entry_union eu = {{0, 0}}; 442 402 ··· 447 409 static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) 448 410 { 449 411 unsigned long flags; 412 + 450 413 raw_spin_lock_irqsave(&ioapic_lock, flags); 451 414 __ioapic_write_entry(apic, pin, e); 452 415 raw_spin_unlock_irqrestore(&ioapic_lock, flags); ··· 474 435 * shared ISA-space IRQs, so we have to support them. We are super 475 436 * fast in the common case, and fast for shared ISA-space IRQs. 476 437 */ 477 - static int 478 - __add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin) 438 + static int __add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin) 479 439 { 480 440 struct irq_pin_list **last, *entry; 481 441 ··· 559 521 * a dummy read from the IO-APIC 560 522 */ 561 523 struct io_apic __iomem *io_apic; 524 + 562 525 io_apic = io_apic_base(entry->apic); 563 526 readl(&io_apic->data); 564 527 } ··· 2551 2512 2552 2513 atomic_t irq_mis_count; 2553 2514 2515 + #ifdef CONFIG_GENERIC_PENDING_IRQ 2516 + static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg) 2517 + { 2518 + /* If we are moving the irq we need to mask it */ 2519 + if (unlikely(irqd_is_setaffinity_pending(data))) { 2520 + mask_ioapic(cfg); 2521 + return true; 2522 + } 2523 + return false; 2524 + } 2525 + 2526 + static inline void ioapic_irqd_unmask(struct irq_data *data, 2527 + struct irq_cfg *cfg, bool masked) 2528 + { 2529 + if (unlikely(masked)) { 2530 + /* Only migrate the irq if the ack has been received. 2531 + * 2532 + * On rare occasions the broadcast level triggered ack gets 2533 + * delayed going to ioapics, and if we reprogram the 2534 + * vector while Remote IRR is still set the irq will never 2535 + * fire again. 2536 + * 2537 + * To prevent this scenario we read the Remote IRR bit 2538 + * of the ioapic. This has two effects. 2539 + * - On any sane system the read of the ioapic will 2540 + * flush writes (and acks) going to the ioapic from 2541 + * this cpu. 2542 + * - We get to see if the ACK has actually been delivered. 2543 + * 2544 + * Based on failed experiments of reprogramming the 2545 + * ioapic entry from outside of irq context starting 2546 + * with masking the ioapic entry and then polling until 2547 + * Remote IRR was clear before reprogramming the 2548 + * ioapic I don't trust the Remote IRR bit to be 2549 + * completey accurate. 2550 + * 2551 + * However there appears to be no other way to plug 2552 + * this race, so if the Remote IRR bit is not 2553 + * accurate and is causing problems then it is a hardware bug 2554 + * and you can go talk to the chipset vendor about it. 2555 + */ 2556 + if (!io_apic_level_ack_pending(cfg)) 2557 + irq_move_masked_irq(data); 2558 + unmask_ioapic(cfg); 2559 + } 2560 + } 2561 + #else 2562 + static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg) 2563 + { 2564 + return false; 2565 + } 2566 + static inline void ioapic_irqd_unmask(struct irq_data *data, 2567 + struct irq_cfg *cfg, bool masked) 2568 + { 2569 + } 2570 + #endif 2571 + 2554 2572 static void ack_apic_level(struct irq_data *data) 2555 2573 { 2556 2574 struct irq_cfg *cfg = data->chip_data; 2557 - int i, do_unmask_irq = 0, irq = data->irq; 2575 + int i, irq = data->irq; 2558 2576 unsigned long v; 2577 + bool masked; 2559 2578 2560 2579 irq_complete_move(cfg); 2561 - #ifdef CONFIG_GENERIC_PENDING_IRQ 2562 - /* If we are moving the irq we need to mask it */ 2563 - if (unlikely(irqd_is_setaffinity_pending(data))) { 2564 - do_unmask_irq = 1; 2565 - mask_ioapic(cfg); 2566 - } 2567 - #endif 2580 + masked = ioapic_irqd_mask(data, cfg); 2568 2581 2569 2582 /* 2570 2583 * It appears there is an erratum which affects at least version 0x11 ··· 2672 2581 eoi_ioapic_irq(irq, cfg); 2673 2582 } 2674 2583 2675 - /* Now we can move and renable the irq */ 2676 - if (unlikely(do_unmask_irq)) { 2677 - /* Only migrate the irq if the ack has been received. 2678 - * 2679 - * On rare occasions the broadcast level triggered ack gets 2680 - * delayed going to ioapics, and if we reprogram the 2681 - * vector while Remote IRR is still set the irq will never 2682 - * fire again. 2683 - * 2684 - * To prevent this scenario we read the Remote IRR bit 2685 - * of the ioapic. This has two effects. 2686 - * - On any sane system the read of the ioapic will 2687 - * flush writes (and acks) going to the ioapic from 2688 - * this cpu. 2689 - * - We get to see if the ACK has actually been delivered. 2690 - * 2691 - * Based on failed experiments of reprogramming the 2692 - * ioapic entry from outside of irq context starting 2693 - * with masking the ioapic entry and then polling until 2694 - * Remote IRR was clear before reprogramming the 2695 - * ioapic I don't trust the Remote IRR bit to be 2696 - * completey accurate. 2697 - * 2698 - * However there appears to be no other way to plug 2699 - * this race, so if the Remote IRR bit is not 2700 - * accurate and is causing problems then it is a hardware bug 2701 - * and you can go talk to the chipset vendor about it. 2702 - */ 2703 - if (!io_apic_level_ack_pending(cfg)) 2704 - irq_move_masked_irq(data); 2705 - unmask_ioapic(cfg); 2706 - } 2584 + ioapic_irqd_unmask(data, cfg, masked); 2707 2585 } 2708 2586 2709 2587 #ifdef CONFIG_IRQ_REMAP ··· 3932 3872 } 3933 3873 3934 3874 void __init ioapic_and_gsi_init(void) 3875 + { 3876 + io_apic_ops.init(); 3877 + } 3878 + 3879 + static void __init __ioapic_init_mappings(void) 3935 3880 { 3936 3881 unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0; 3937 3882 struct resource *ioapic_res;
+1 -1
arch/x86/kernel/apic/x2apic_cluster.c
··· 213 213 .name = "cluster x2apic", 214 214 .probe = x2apic_cluster_probe, 215 215 .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, 216 - .apic_id_valid = default_apic_id_valid, 216 + .apic_id_valid = x2apic_apic_id_valid, 217 217 .apic_id_registered = x2apic_apic_id_registered, 218 218 219 219 .irq_delivery_mode = dest_LowestPrio,
+1 -1
arch/x86/kernel/apic/x2apic_phys.c
··· 119 119 .name = "physical x2apic", 120 120 .probe = x2apic_phys_probe, 121 121 .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, 122 - .apic_id_valid = default_apic_id_valid, 122 + .apic_id_valid = x2apic_apic_id_valid, 123 123 .apic_id_registered = x2apic_apic_id_registered, 124 124 125 125 .irq_delivery_mode = dest_Fixed,
+6 -1
arch/x86/kernel/apic/x2apic_uv_x.c
··· 266 266 uv_send_IPI_mask(cpu_online_mask, vector); 267 267 } 268 268 269 + static int uv_apic_id_valid(int apicid) 270 + { 271 + return 1; 272 + } 273 + 269 274 static int uv_apic_id_registered(void) 270 275 { 271 276 return 1; ··· 356 351 .name = "UV large system", 357 352 .probe = uv_probe, 358 353 .acpi_madt_oem_check = uv_acpi_madt_oem_check, 359 - .apic_id_valid = default_apic_id_valid, 354 + .apic_id_valid = uv_apic_id_valid, 360 355 .apic_id_registered = uv_apic_id_registered, 361 356 362 357 .irq_delivery_mode = dest_Fixed,
+1 -1
arch/x86/kernel/cpu/common.c
··· 999 999 else 1000 1000 printk(KERN_CONT "\n"); 1001 1001 1002 - __print_cpu_msr(); 1002 + print_cpu_msr(c); 1003 1003 } 1004 1004 1005 1005 void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c)
+5 -2
arch/x86/kernel/dumpstack.c
··· 37 37 const struct stacktrace_ops *ops, 38 38 struct thread_info *tinfo, int *graph) 39 39 { 40 - struct task_struct *task = tinfo->task; 40 + struct task_struct *task; 41 41 unsigned long ret_addr; 42 - int index = task->curr_ret_stack; 42 + int index; 43 43 44 44 if (addr != (unsigned long)return_to_handler) 45 45 return; 46 + 47 + task = tinfo->task; 48 + index = task->curr_ret_stack; 46 49 47 50 if (!task->ret_stack || index < *graph) 48 51 return;
+114
arch/x86/kernel/process.c
··· 12 12 #include <linux/user-return-notifier.h> 13 13 #include <linux/dmi.h> 14 14 #include <linux/utsname.h> 15 + #include <linux/stackprotector.h> 16 + #include <linux/tick.h> 17 + #include <linux/cpuidle.h> 15 18 #include <trace/events/power.h> 16 19 #include <linux/hw_breakpoint.h> 17 20 #include <asm/cpu.h> ··· 25 22 #include <asm/i387.h> 26 23 #include <asm/fpu-internal.h> 27 24 #include <asm/debugreg.h> 25 + #include <asm/nmi.h> 26 + 27 + #ifdef CONFIG_X86_64 28 + static DEFINE_PER_CPU(unsigned char, is_idle); 29 + static ATOMIC_NOTIFIER_HEAD(idle_notifier); 30 + 31 + void idle_notifier_register(struct notifier_block *n) 32 + { 33 + atomic_notifier_chain_register(&idle_notifier, n); 34 + } 35 + EXPORT_SYMBOL_GPL(idle_notifier_register); 36 + 37 + void idle_notifier_unregister(struct notifier_block *n) 38 + { 39 + atomic_notifier_chain_unregister(&idle_notifier, n); 40 + } 41 + EXPORT_SYMBOL_GPL(idle_notifier_unregister); 42 + #endif 28 43 29 44 struct kmem_cache *task_xstate_cachep; 30 45 EXPORT_SYMBOL_GPL(task_xstate_cachep); ··· 390 369 return 1; 391 370 } 392 371 #endif 372 + 373 + #ifndef CONFIG_SMP 374 + static inline void play_dead(void) 375 + { 376 + BUG(); 377 + } 378 + #endif 379 + 380 + #ifdef CONFIG_X86_64 381 + void enter_idle(void) 382 + { 383 + percpu_write(is_idle, 1); 384 + atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL); 385 + } 386 + 387 + static void __exit_idle(void) 388 + { 389 + if (x86_test_and_clear_bit_percpu(0, is_idle) == 0) 390 + return; 391 + atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL); 392 + } 393 + 394 + /* Called from interrupts to signify idle end */ 395 + void exit_idle(void) 396 + { 397 + /* idle loop has pid 0 */ 398 + if (current->pid) 399 + return; 400 + __exit_idle(); 401 + } 402 + #endif 403 + 404 + /* 405 + * The idle thread. There's no useful work to be 406 + * done, so just try to conserve power and have a 407 + * low exit latency (ie sit in a loop waiting for 408 + * somebody to say that they'd like to reschedule) 409 + */ 410 + void cpu_idle(void) 411 + { 412 + /* 413 + * If we're the non-boot CPU, nothing set the stack canary up 414 + * for us. CPU0 already has it initialized but no harm in 415 + * doing it again. This is a good place for updating it, as 416 + * we wont ever return from this function (so the invalid 417 + * canaries already on the stack wont ever trigger). 418 + */ 419 + boot_init_stack_canary(); 420 + current_thread_info()->status |= TS_POLLING; 421 + 422 + while (1) { 423 + tick_nohz_idle_enter(); 424 + 425 + while (!need_resched()) { 426 + rmb(); 427 + 428 + if (cpu_is_offline(smp_processor_id())) 429 + play_dead(); 430 + 431 + /* 432 + * Idle routines should keep interrupts disabled 433 + * from here on, until they go to idle. 434 + * Otherwise, idle callbacks can misfire. 435 + */ 436 + local_touch_nmi(); 437 + local_irq_disable(); 438 + 439 + enter_idle(); 440 + 441 + /* Don't trace irqs off for idle */ 442 + stop_critical_timings(); 443 + 444 + /* enter_idle() needs rcu for notifiers */ 445 + rcu_idle_enter(); 446 + 447 + if (cpuidle_idle_call()) 448 + pm_idle(); 449 + 450 + rcu_idle_exit(); 451 + start_critical_timings(); 452 + 453 + /* In many cases the interrupt that ended idle 454 + has already called exit_idle. But some idle 455 + loops can be woken up without interrupt. */ 456 + __exit_idle(); 457 + } 458 + 459 + tick_nohz_idle_exit(); 460 + preempt_enable_no_resched(); 461 + schedule(); 462 + preempt_disable(); 463 + } 464 + } 393 465 394 466 /* 395 467 * We use this if we don't have any better
-58
arch/x86/kernel/process_32.c
··· 9 9 * This file handles the architecture-dependent parts of process handling.. 10 10 */ 11 11 12 - #include <linux/stackprotector.h> 13 12 #include <linux/cpu.h> 14 13 #include <linux/errno.h> 15 14 #include <linux/sched.h> ··· 30 31 #include <linux/kallsyms.h> 31 32 #include <linux/ptrace.h> 32 33 #include <linux/personality.h> 33 - #include <linux/tick.h> 34 34 #include <linux/percpu.h> 35 35 #include <linux/prctl.h> 36 36 #include <linux/ftrace.h> 37 37 #include <linux/uaccess.h> 38 38 #include <linux/io.h> 39 39 #include <linux/kdebug.h> 40 - #include <linux/cpuidle.h> 41 40 42 41 #include <asm/pgtable.h> 43 42 #include <asm/ldt.h> ··· 54 57 #include <asm/idle.h> 55 58 #include <asm/syscalls.h> 56 59 #include <asm/debugreg.h> 57 - #include <asm/nmi.h> 58 60 #include <asm/switch_to.h> 59 61 60 62 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); ··· 64 68 unsigned long thread_saved_pc(struct task_struct *tsk) 65 69 { 66 70 return ((unsigned long *)tsk->thread.sp)[3]; 67 - } 68 - 69 - #ifndef CONFIG_SMP 70 - static inline void play_dead(void) 71 - { 72 - BUG(); 73 - } 74 - #endif 75 - 76 - /* 77 - * The idle thread. There's no useful work to be 78 - * done, so just try to conserve power and have a 79 - * low exit latency (ie sit in a loop waiting for 80 - * somebody to say that they'd like to reschedule) 81 - */ 82 - void cpu_idle(void) 83 - { 84 - int cpu = smp_processor_id(); 85 - 86 - /* 87 - * If we're the non-boot CPU, nothing set the stack canary up 88 - * for us. CPU0 already has it initialized but no harm in 89 - * doing it again. This is a good place for updating it, as 90 - * we wont ever return from this function (so the invalid 91 - * canaries already on the stack wont ever trigger). 92 - */ 93 - boot_init_stack_canary(); 94 - 95 - current_thread_info()->status |= TS_POLLING; 96 - 97 - /* endless idle loop with no priority at all */ 98 - while (1) { 99 - tick_nohz_idle_enter(); 100 - rcu_idle_enter(); 101 - while (!need_resched()) { 102 - 103 - check_pgt_cache(); 104 - rmb(); 105 - 106 - if (cpu_is_offline(cpu)) 107 - play_dead(); 108 - 109 - local_touch_nmi(); 110 - local_irq_disable(); 111 - /* Don't trace irqs off for idle */ 112 - stop_critical_timings(); 113 - if (cpuidle_idle_call()) 114 - pm_idle(); 115 - start_critical_timings(); 116 - } 117 - rcu_idle_exit(); 118 - tick_nohz_idle_exit(); 119 - schedule_preempt_disabled(); 120 - } 121 71 } 122 72 123 73 void __show_regs(struct pt_regs *regs, int all)
-107
arch/x86/kernel/process_64.c
··· 14 14 * This file handles the architecture-dependent parts of process handling.. 15 15 */ 16 16 17 - #include <linux/stackprotector.h> 18 17 #include <linux/cpu.h> 19 18 #include <linux/errno.h> 20 19 #include <linux/sched.h> ··· 31 32 #include <linux/notifier.h> 32 33 #include <linux/kprobes.h> 33 34 #include <linux/kdebug.h> 34 - #include <linux/tick.h> 35 35 #include <linux/prctl.h> 36 36 #include <linux/uaccess.h> 37 37 #include <linux/io.h> 38 38 #include <linux/ftrace.h> 39 - #include <linux/cpuidle.h> 40 39 41 40 #include <asm/pgtable.h> 42 41 #include <asm/processor.h> ··· 48 51 #include <asm/idle.h> 49 52 #include <asm/syscalls.h> 50 53 #include <asm/debugreg.h> 51 - #include <asm/nmi.h> 52 54 #include <asm/switch_to.h> 53 55 54 56 asmlinkage extern void ret_from_fork(void); 55 57 56 58 DEFINE_PER_CPU(unsigned long, old_rsp); 57 - static DEFINE_PER_CPU(unsigned char, is_idle); 58 - 59 - static ATOMIC_NOTIFIER_HEAD(idle_notifier); 60 - 61 - void idle_notifier_register(struct notifier_block *n) 62 - { 63 - atomic_notifier_chain_register(&idle_notifier, n); 64 - } 65 - EXPORT_SYMBOL_GPL(idle_notifier_register); 66 - 67 - void idle_notifier_unregister(struct notifier_block *n) 68 - { 69 - atomic_notifier_chain_unregister(&idle_notifier, n); 70 - } 71 - EXPORT_SYMBOL_GPL(idle_notifier_unregister); 72 - 73 - void enter_idle(void) 74 - { 75 - percpu_write(is_idle, 1); 76 - atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL); 77 - } 78 - 79 - static void __exit_idle(void) 80 - { 81 - if (x86_test_and_clear_bit_percpu(0, is_idle) == 0) 82 - return; 83 - atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL); 84 - } 85 - 86 - /* Called from interrupts to signify idle end */ 87 - void exit_idle(void) 88 - { 89 - /* idle loop has pid 0 */ 90 - if (current->pid) 91 - return; 92 - __exit_idle(); 93 - } 94 - 95 - #ifndef CONFIG_SMP 96 - static inline void play_dead(void) 97 - { 98 - BUG(); 99 - } 100 - #endif 101 - 102 - /* 103 - * The idle thread. There's no useful work to be 104 - * done, so just try to conserve power and have a 105 - * low exit latency (ie sit in a loop waiting for 106 - * somebody to say that they'd like to reschedule) 107 - */ 108 - void cpu_idle(void) 109 - { 110 - current_thread_info()->status |= TS_POLLING; 111 - 112 - /* 113 - * If we're the non-boot CPU, nothing set the stack canary up 114 - * for us. CPU0 already has it initialized but no harm in 115 - * doing it again. This is a good place for updating it, as 116 - * we wont ever return from this function (so the invalid 117 - * canaries already on the stack wont ever trigger). 118 - */ 119 - boot_init_stack_canary(); 120 - 121 - /* endless idle loop with no priority at all */ 122 - while (1) { 123 - tick_nohz_idle_enter(); 124 - while (!need_resched()) { 125 - 126 - rmb(); 127 - 128 - if (cpu_is_offline(smp_processor_id())) 129 - play_dead(); 130 - /* 131 - * Idle routines should keep interrupts disabled 132 - * from here on, until they go to idle. 133 - * Otherwise, idle callbacks can misfire. 134 - */ 135 - local_touch_nmi(); 136 - local_irq_disable(); 137 - enter_idle(); 138 - /* Don't trace irqs off for idle */ 139 - stop_critical_timings(); 140 - 141 - /* enter_idle() needs rcu for notifiers */ 142 - rcu_idle_enter(); 143 - 144 - if (cpuidle_idle_call()) 145 - pm_idle(); 146 - 147 - rcu_idle_exit(); 148 - start_critical_timings(); 149 - 150 - /* In many cases the interrupt that ended idle 151 - has already called exit_idle. But some idle 152 - loops can be woken up without interrupt. */ 153 - __exit_idle(); 154 - } 155 - 156 - tick_nohz_idle_exit(); 157 - schedule_preempt_disabled(); 158 - } 159 - } 160 59 161 60 /* Prints also some state that isn't saved in the pt_regs */ 162 61 void __show_regs(struct pt_regs *regs, int all)
+2 -2
arch/x86/kernel/tls.c
··· 162 162 { 163 163 const struct desc_struct *tls; 164 164 165 - if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || 165 + if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || 166 166 (pos % sizeof(struct user_desc)) != 0 || 167 167 (count % sizeof(struct user_desc)) != 0) 168 168 return -EINVAL; ··· 197 197 struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES]; 198 198 const struct user_desc *info; 199 199 200 - if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || 200 + if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || 201 201 (pos % sizeof(struct user_desc)) != 0 || 202 202 (count % sizeof(struct user_desc)) != 0) 203 203 return -EINVAL;
+1 -1
arch/x86/mm/srat.c
··· 70 70 return; 71 71 pxm = pa->proximity_domain; 72 72 apic_id = pa->apic_id; 73 - if (!cpu_has_x2apic && (apic_id >= 0xff)) { 73 + if (!apic->apic_id_valid(apic_id)) { 74 74 printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n", 75 75 pxm, apic_id); 76 76 return;
+97
arch/x86/platform/olpc/olpc.c
··· 20 20 #include <linux/platform_device.h> 21 21 #include <linux/of.h> 22 22 #include <linux/syscore_ops.h> 23 + #include <linux/debugfs.h> 24 + #include <linux/mutex.h> 23 25 24 26 #include <asm/geode.h> 25 27 #include <asm/setup.h> ··· 32 30 EXPORT_SYMBOL_GPL(olpc_platform_info); 33 31 34 32 static DEFINE_SPINLOCK(ec_lock); 33 + 34 + /* debugfs interface to EC commands */ 35 + #define EC_MAX_CMD_ARGS (5 + 1) /* cmd byte + 5 args */ 36 + #define EC_MAX_CMD_REPLY (8) 37 + 38 + static struct dentry *ec_debugfs_dir; 39 + static DEFINE_MUTEX(ec_debugfs_cmd_lock); 40 + static unsigned char ec_debugfs_resp[EC_MAX_CMD_REPLY]; 41 + static unsigned int ec_debugfs_resp_bytes; 35 42 36 43 /* EC event mask to be applied during suspend (defining wakeup sources). */ 37 44 static u16 ec_wakeup_mask; ··· 280 269 } 281 270 EXPORT_SYMBOL_GPL(olpc_ec_sci_query); 282 271 272 + static ssize_t ec_debugfs_cmd_write(struct file *file, const char __user *buf, 273 + size_t size, loff_t *ppos) 274 + { 275 + int i, m; 276 + unsigned char ec_cmd[EC_MAX_CMD_ARGS]; 277 + unsigned int ec_cmd_int[EC_MAX_CMD_ARGS]; 278 + char cmdbuf[64]; 279 + int ec_cmd_bytes; 280 + 281 + mutex_lock(&ec_debugfs_cmd_lock); 282 + 283 + size = simple_write_to_buffer(cmdbuf, sizeof(cmdbuf), ppos, buf, size); 284 + 285 + m = sscanf(cmdbuf, "%x:%u %x %x %x %x %x", &ec_cmd_int[0], 286 + &ec_debugfs_resp_bytes, 287 + &ec_cmd_int[1], &ec_cmd_int[2], &ec_cmd_int[3], 288 + &ec_cmd_int[4], &ec_cmd_int[5]); 289 + if (m < 2 || ec_debugfs_resp_bytes > EC_MAX_CMD_REPLY) { 290 + /* reset to prevent overflow on read */ 291 + ec_debugfs_resp_bytes = 0; 292 + 293 + printk(KERN_DEBUG "olpc-ec: bad ec cmd: " 294 + "cmd:response-count [arg1 [arg2 ...]]\n"); 295 + size = -EINVAL; 296 + goto out; 297 + } 298 + 299 + /* convert scanf'd ints to char */ 300 + ec_cmd_bytes = m - 2; 301 + for (i = 0; i <= ec_cmd_bytes; i++) 302 + ec_cmd[i] = ec_cmd_int[i]; 303 + 304 + printk(KERN_DEBUG "olpc-ec: debugfs cmd 0x%02x with %d args " 305 + "%02x %02x %02x %02x %02x, want %d returns\n", 306 + ec_cmd[0], ec_cmd_bytes, ec_cmd[1], ec_cmd[2], ec_cmd[3], 307 + ec_cmd[4], ec_cmd[5], ec_debugfs_resp_bytes); 308 + 309 + olpc_ec_cmd(ec_cmd[0], (ec_cmd_bytes == 0) ? NULL : &ec_cmd[1], 310 + ec_cmd_bytes, ec_debugfs_resp, ec_debugfs_resp_bytes); 311 + 312 + printk(KERN_DEBUG "olpc-ec: response " 313 + "%02x %02x %02x %02x %02x %02x %02x %02x (%d bytes expected)\n", 314 + ec_debugfs_resp[0], ec_debugfs_resp[1], ec_debugfs_resp[2], 315 + ec_debugfs_resp[3], ec_debugfs_resp[4], ec_debugfs_resp[5], 316 + ec_debugfs_resp[6], ec_debugfs_resp[7], ec_debugfs_resp_bytes); 317 + 318 + out: 319 + mutex_unlock(&ec_debugfs_cmd_lock); 320 + return size; 321 + } 322 + 323 + static ssize_t ec_debugfs_cmd_read(struct file *file, char __user *buf, 324 + size_t size, loff_t *ppos) 325 + { 326 + unsigned int i, r; 327 + char *rp; 328 + char respbuf[64]; 329 + 330 + mutex_lock(&ec_debugfs_cmd_lock); 331 + rp = respbuf; 332 + rp += sprintf(rp, "%02x", ec_debugfs_resp[0]); 333 + for (i = 1; i < ec_debugfs_resp_bytes; i++) 334 + rp += sprintf(rp, ", %02x", ec_debugfs_resp[i]); 335 + mutex_unlock(&ec_debugfs_cmd_lock); 336 + rp += sprintf(rp, "\n"); 337 + 338 + r = rp - respbuf; 339 + return simple_read_from_buffer(buf, size, ppos, respbuf, r); 340 + } 341 + 342 + static const struct file_operations ec_debugfs_genops = { 343 + .write = ec_debugfs_cmd_write, 344 + .read = ec_debugfs_cmd_read, 345 + }; 346 + 347 + static void setup_debugfs(void) 348 + { 349 + ec_debugfs_dir = debugfs_create_dir("olpc-ec", 0); 350 + if (ec_debugfs_dir == ERR_PTR(-ENODEV)) 351 + return; 352 + 353 + debugfs_create_file("cmd", 0600, ec_debugfs_dir, NULL, 354 + &ec_debugfs_genops); 355 + } 356 + 283 357 static int olpc_ec_suspend(void) 284 358 { 285 359 return olpc_ec_mask_write(ec_wakeup_mask); ··· 468 372 } 469 373 470 374 register_syscore_ops(&olpc_syscore_ops); 375 + setup_debugfs(); 471 376 472 377 return 0; 473 378 }
+1 -1
arch/xtensa/configs/iss_defconfig
··· 113 113 # CONFIG_INLINE_SPIN_LOCK_BH is not set 114 114 # CONFIG_INLINE_SPIN_LOCK_IRQ is not set 115 115 # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set 116 - CONFIG_INLINE_SPIN_UNLOCK=y 116 + # CONFIG_UNINLINE_SPIN_UNLOCK is not set 117 117 # CONFIG_INLINE_SPIN_UNLOCK_BH is not set 118 118 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y 119 119 # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
+1 -1
include/linux/spinlock_api_smp.h
··· 67 67 #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) 68 68 #endif 69 69 70 - #ifdef CONFIG_INLINE_SPIN_UNLOCK 70 + #ifndef CONFIG_UNINLINE_SPIN_UNLOCK 71 71 #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) 72 72 #endif 73 73
+2 -2
kernel/Kconfig.locks
··· 124 124 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \ 125 125 ARCH_INLINE_SPIN_LOCK_IRQSAVE 126 126 127 - config INLINE_SPIN_UNLOCK 128 - def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK) 127 + config UNINLINE_SPIN_UNLOCK 128 + bool 129 129 130 130 config INLINE_SPIN_UNLOCK_BH 131 131 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH
+1
kernel/Kconfig.preempt
··· 36 36 config PREEMPT 37 37 bool "Preemptible Kernel (Low-Latency Desktop)" 38 38 select PREEMPT_COUNT 39 + select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK 39 40 help 40 41 This option reduces the latency of the kernel by making 41 42 all kernel code (that is not executing in a critical section)
+1 -1
kernel/spinlock.c
··· 163 163 EXPORT_SYMBOL(_raw_spin_lock_bh); 164 164 #endif 165 165 166 - #ifndef CONFIG_INLINE_SPIN_UNLOCK 166 + #ifdef CONFIG_UNINLINE_SPIN_UNLOCK 167 167 void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) 168 168 { 169 169 __raw_spin_unlock(lock);
+1
lib/Kconfig.debug
··· 499 499 config DEBUG_SPINLOCK 500 500 bool "Spinlock and rw-lock debugging: basic checks" 501 501 depends on DEBUG_KERNEL 502 + select UNINLINE_SPIN_UNLOCK 502 503 help 503 504 Say Y here and build SMP to catch missing spinlock initialization 504 505 and certain other kinds of spinlock errors commonly made. This is