History

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

Linus Torvalds committed 14 years ago

Commit 6b8212a2 parents bcd5507 8abc31229 files · +436 −321Browse files

Unified · Split

29 files
  1. Documentation/ABI/testing/debugfs-olpc +16 −0
  2. arch/mips/configs/db1300_defconfig +1 −1
  3. arch/x86/configs/i386_defconfig +22 −42
  4. arch/x86/configs/x86_64_defconfig +23 −44
  5. arch/x86/include/asm/apic.h +1 −1
  6. arch/x86/include/asm/idle.h +1 −0
  7. arch/x86/include/asm/io_apic.h +9 −0
  8. arch/x86/include/asm/x2apic.h +5 −0
  9. arch/x86/kernel/acpi/boot.c +1 −1
  10. arch/x86/kernel/apic/apic.c +9 −4
  11. arch/x86/kernel/apic/apic_numachip.c +1 −2
  12. arch/x86/kernel/apic/io_apic.c +112 −47
  13. arch/x86/kernel/apic/x2apic_cluster.c +1 −1
  14. arch/x86/kernel/apic/x2apic_phys.c +1 −1
  15. arch/x86/kernel/apic/x2apic_uv_x.c +6 −1
  16. arch/x86/kernel/cpu/common.c +1 −1
  17. arch/x86/kernel/dumpstack.c +5 −2
  18. arch/x86/kernel/process.c +114 −0
  19. arch/x86/kernel/process_32.c +0 −58
  20. arch/x86/kernel/process_64.c +0 −107
  21. arch/x86/kernel/tls.c +2 −2
  22. arch/x86/mm/srat.c +1 −1
  23. arch/x86/platform/olpc/olpc.c +97 −0
  24. arch/xtensa/configs/iss_defconfig +1 −1
  25. include/linux/spinlock_api_smp.h +1 −1
  26. kernel/Kconfig.locks +2 −2
  27. kernel/Kconfig.preempt +1 −0
  28. kernel/spinlock.c +1 −1
  29. lib/Kconfig.debug +1 −0
Documentation/ABI/testing/debugfs-olpc+16−0
@@ -0,0 +1,16 @@
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.
arch/mips/configs/db1300_defconfig+1−1
@@ -133,7 +133,7 @@ CONFIG_BLK_DEV_BSG=y · 132 unmodified lines
133133 CONFIG_IOSCHED_NOOP=y
134134 CONFIG_DEFAULT_NOOP=y
135135 CONFIG_DEFAULT_IOSCHED="noop"
136−CONFIG_INLINE_SPIN_UNLOCK=y
136+# CONFIG_UNINLINE_SPIN_UNLOCK is not set
137137 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
138138 CONFIG_INLINE_READ_UNLOCK=y
139139 CONFIG_INLINE_READ_UNLOCK_IRQ=y
arch/x86/configs/i386_defconfig+22−42
@@ -15,23 +15,28 @@ CONFIG_CPUSETS=y · 14 unmodified lines
1515 CONFIG_CGROUP_CPUACCT=y
1616 CONFIG_RESOURCE_COUNTERS=y
1717 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
2318 CONFIG_BLK_DEV_INITRD=y
24−CONFIG_KALLSYMS_EXTRA_PASS=y
2519 # CONFIG_COMPAT_BRK is not set
2620 CONFIG_PROFILING=y
2721 CONFIG_KPROBES=y
2822 CONFIG_MODULES=y
2923 CONFIG_MODULE_UNLOAD=y
3024 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
3137 CONFIG_NO_HZ=y
3238 CONFIG_HIGH_RES_TIMERS=y
3339 CONFIG_SMP=y
34−CONFIG_SPARSE_IRQ=y
3540 CONFIG_X86_GENERIC=y
3641 CONFIG_HPET_TIMER=y
3742 CONFIG_SCHED_SMT=y
@@ -51,14 +56,12 @@ CONFIG_HZ_1000=y · 13 unmodified lines
5156 CONFIG_KEXEC=y
5257 CONFIG_CRASH_DUMP=y
5358 # CONFIG_COMPAT_VDSO is not set
54−CONFIG_PM=y
59+CONFIG_HIBERNATION=y
5560 CONFIG_PM_DEBUG=y
5661 CONFIG_PM_TRACE_RTC=y
57−CONFIG_HIBERNATION=y
5862 CONFIG_ACPI_PROCFS=y
5963 CONFIG_ACPI_DOCK=y
6064 CONFIG_CPU_FREQ=y
61−CONFIG_CPU_FREQ_DEBUG=y
6265 # CONFIG_CPU_FREQ_STAT is not set
6366 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
6467 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
@@ -69,7 +72,6 @@ CONFIG_PCI_MSI=y · 4 unmodified lines
6972 CONFIG_PCCARD=y
7073 CONFIG_YENTA=y
7174 CONFIG_HOTPLUG_PCI=y
72−CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
7375 CONFIG_BINFMT_MISC=y
7476 CONFIG_NET=y
7577 CONFIG_PACKET=y
@@ -120,7 +122,6 @@ CONFIG_NF_CONNTRACK_IPV4=y · 44 unmodified lines
120122 CONFIG_IP_NF_IPTABLES=y
121123 CONFIG_IP_NF_FILTER=y
122124 CONFIG_IP_NF_TARGET_REJECT=y
123−CONFIG_IP_NF_TARGET_LOG=y
124125 CONFIG_IP_NF_TARGET_ULOG=y
125126 CONFIG_NF_NAT=y
126127 CONFIG_IP_NF_TARGET_MASQUERADE=y
@@ -128,7 +129,6 @@ CONFIG_IP_NF_MANGLE=y · 1 unmodified line
128129 CONFIG_NF_CONNTRACK_IPV6=y
129130 CONFIG_IP6_NF_IPTABLES=y
130131 CONFIG_IP6_NF_MATCH_IPV6HEADER=y
131−CONFIG_IP6_NF_TARGET_LOG=y
132132 CONFIG_IP6_NF_FILTER=y
133133 CONFIG_IP6_NF_TARGET_REJECT=y
134134 CONFIG_IP6_NF_MANGLE=y
@@ -169,25 +169,20 @@ CONFIG_DM_ZERO=y · 34 unmodified lines
169169 CONFIG_MACINTOSH_DRIVERS=y
170170 CONFIG_MAC_EMUMOUSEBTN=y
171171 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
174175 CONFIG_NET_TULIP=y
175−CONFIG_NET_PCI=y
176−CONFIG_FORCEDETH=y
177176 CONFIG_E100=y
177+CONFIG_E1000=y
178+CONFIG_E1000E=y
179+CONFIG_SKY2=y
178180 CONFIG_NE2K_PCI=y
181+CONFIG_FORCEDETH=y
179182 CONFIG_8139TOO=y
180183 # CONFIG_8139TOO_PIO is not set
181−CONFIG_E1000=y
182−CONFIG_E1000E=y
183184 CONFIG_R8169=y
184−CONFIG_SKY2=y
185−CONFIG_TIGON3=y
186−CONFIG_BNX2=y
187−CONFIG_TR=y
188−CONFIG_NET_PCMCIA=y
189185 CONFIG_FDDI=y
190−CONFIG_NETCONSOLE=y
191186 CONFIG_INPUT_POLLDEV=y
192187 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
193188 CONFIG_INPUT_EVDEV=y
@@ -196,6 +191,7 @@ CONFIG_INPUT_TABLET=y · 2 unmodified lines
196191 CONFIG_INPUT_TOUCHSCREEN=y
197192 CONFIG_INPUT_MISC=y
198193 CONFIG_VT_HW_CONSOLE_BINDING=y
194+# CONFIG_LEGACY_PTYS is not set
199195 CONFIG_SERIAL_NONSTANDARD=y
200196 CONFIG_SERIAL_8250=y
201197 CONFIG_SERIAL_8250_CONSOLE=y
@@ -205,7 +201,6 @@ CONFIG_SERIAL_8250_MANY_PORTS=y · 3 unmodified lines
205201 CONFIG_SERIAL_8250_SHARE_IRQ=y
206202 CONFIG_SERIAL_8250_DETECT_IRQ=y
207203 CONFIG_SERIAL_8250_RSA=y
208−# CONFIG_LEGACY_PTYS is not set
209204 CONFIG_HW_RANDOM=y
210205 CONFIG_NVRAM=y
211206 CONFIG_HPET=y
@@ -220,7 +215,6 @@ CONFIG_DRM_I915=y · 8 unmodified lines
220215 CONFIG_FB_MODE_HELPERS=y
221216 CONFIG_FB_TILEBLITTING=y
222217 CONFIG_FB_EFI=y
223−CONFIG_BACKLIGHT_LCD_SUPPORT=y
224218 # CONFIG_LCD_CLASS_DEVICE is not set
225219 CONFIG_VGACON_SOFT_SCROLLBACK=y
226220 CONFIG_LOGO=y
@@ -283,7 +277,6 @@ CONFIG_ZISOFS=y · 56 unmodified lines
283277 CONFIG_MSDOS_FS=y
284278 CONFIG_VFAT_FS=y
285279 CONFIG_PROC_KCORE=y
286−CONFIG_TMPFS=y
287280 CONFIG_TMPFS_POSIX_ACL=y
288281 CONFIG_HUGETLBFS=y
289282 CONFIG_NFS_FS=y
@@ -291,18 +284,6 @@ CONFIG_NFS_V3=y · 1 unmodified line
291284 CONFIG_NFS_V3_ACL=y
292285 CONFIG_NFS_V4=y
293286 CONFIG_ROOT_NFS=y
294−CONFIG_PARTITION_ADVANCED=y
295−CONFIG_OSF_PARTITION=y
296−CONFIG_AMIGA_PARTITION=y
297−CONFIG_MAC_PARTITION=y
298−CONFIG_BSD_DISKLABEL=y
299−CONFIG_MINIX_SUBPARTITION=y
300−CONFIG_SOLARIS_X86_PARTITION=y
301−CONFIG_UNIXWARE_DISKLABEL=y
302−CONFIG_SGI_PARTITION=y
303−CONFIG_SUN_PARTITION=y
304−CONFIG_KARMA_PARTITION=y
305−CONFIG_EFI_PARTITION=y
306287 CONFIG_NLS_DEFAULT="utf8"
307288 CONFIG_NLS_CODEPAGE_437=y
308289 CONFIG_NLS_ASCII=y
@@ -317,13 +298,12 @@ CONFIG_DEBUG_KERNEL=y · 8 unmodified lines
317298 # CONFIG_SCHED_DEBUG is not set
318299 CONFIG_SCHEDSTATS=y
319300 CONFIG_TIMER_STATS=y
320−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
301+CONFIG_DEBUG_STACK_USAGE=y
321302 CONFIG_SYSCTL_SYSCALL_CHECK=y
322303 CONFIG_BLK_DEV_IO_TRACE=y
323304 CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
324305 CONFIG_EARLY_PRINTK_DBGP=y
325306 CONFIG_DEBUG_STACKOVERFLOW=y
326−CONFIG_DEBUG_STACK_USAGE=y
327307 # CONFIG_DEBUG_RODATA_TEST is not set
328308 CONFIG_DEBUG_NX_TEST=m
329309 CONFIG_DEBUG_BOOT_PARAMS=y
arch/x86/configs/x86_64_defconfig+23−44
@@ -1,4 +1,3 @@
1−CONFIG_64BIT=y
21 CONFIG_EXPERIMENTAL=y
32 # CONFIG_LOCALVERSION_AUTO is not set
43 CONFIG_SYSVIPC=y
@@ -16,26 +15,29 @@ CONFIG_CPUSETS=y · 11 unmodified lines
1615 CONFIG_CGROUP_CPUACCT=y
1716 CONFIG_RESOURCE_COUNTERS=y
1817 CONFIG_CGROUP_SCHED=y
19−CONFIG_UTS_NS=y
20−CONFIG_IPC_NS=y
21−CONFIG_USER_NS=y
22−CONFIG_PID_NS=y
23−CONFIG_NET_NS=y
2418 CONFIG_BLK_DEV_INITRD=y
25−CONFIG_KALLSYMS_EXTRA_PASS=y
2619 # CONFIG_COMPAT_BRK is not set
2720 CONFIG_PROFILING=y
2821 CONFIG_KPROBES=y
2922 CONFIG_MODULES=y
3023 CONFIG_MODULE_UNLOAD=y
3124 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
3237 CONFIG_NO_HZ=y
3338 CONFIG_HIGH_RES_TIMERS=y
3439 CONFIG_SMP=y
35−CONFIG_SPARSE_IRQ=y
3640 CONFIG_CALGARY_IOMMU=y
37−CONFIG_AMD_IOMMU=y
38−CONFIG_AMD_IOMMU_STATS=y
3941 CONFIG_NR_CPUS=64
4042 CONFIG_SCHED_SMT=y
4143 CONFIG_PREEMPT_VOLUNTARY=y
@@ -53,27 +55,22 @@ CONFIG_HZ_1000=y · 11 unmodified lines
5355 CONFIG_KEXEC=y
5456 CONFIG_CRASH_DUMP=y
5557 # CONFIG_COMPAT_VDSO is not set
56−CONFIG_PM=y
58+CONFIG_HIBERNATION=y
5759 CONFIG_PM_DEBUG=y
5860 CONFIG_PM_TRACE_RTC=y
59−CONFIG_HIBERNATION=y
6061 CONFIG_ACPI_PROCFS=y
6162 CONFIG_ACPI_DOCK=y
6263 CONFIG_CPU_FREQ=y
63−CONFIG_CPU_FREQ_DEBUG=y
6464 # CONFIG_CPU_FREQ_STAT is not set
6565 CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y
6666 CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
6767 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
6868 CONFIG_X86_ACPI_CPUFREQ=y
6969 CONFIG_PCI_MMCONFIG=y
70−CONFIG_INTEL_IOMMU=y
71−# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
7270 CONFIG_PCIEPORTBUS=y
7371 CONFIG_PCCARD=y
7472 CONFIG_YENTA=y
7573 CONFIG_HOTPLUG_PCI=y
76−CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
7774 CONFIG_BINFMT_MISC=y
7875 CONFIG_IA32_EMULATION=y
7976 CONFIG_NET=y
@@ -125,7 +122,6 @@ CONFIG_NF_CONNTRACK_IPV4=y · 45 unmodified lines
125122 CONFIG_IP_NF_IPTABLES=y
126123 CONFIG_IP_NF_FILTER=y
127124 CONFIG_IP_NF_TARGET_REJECT=y
128−CONFIG_IP_NF_TARGET_LOG=y
129125 CONFIG_IP_NF_TARGET_ULOG=y
130126 CONFIG_NF_NAT=y
131127 CONFIG_IP_NF_TARGET_MASQUERADE=y
@@ -133,7 +129,6 @@ CONFIG_IP_NF_MANGLE=y · 1 unmodified line
133129 CONFIG_NF_CONNTRACK_IPV6=y
134130 CONFIG_IP6_NF_IPTABLES=y
135131 CONFIG_IP6_NF_MATCH_IPV6HEADER=y
136−CONFIG_IP6_NF_TARGET_LOG=y
137132 CONFIG_IP6_NF_FILTER=y
138133 CONFIG_IP6_NF_TARGET_REJECT=y
139134 CONFIG_IP6_NF_MANGLE=y
@@ -172,20 +167,15 @@ CONFIG_DM_ZERO=y · 32 unmodified lines
172167 CONFIG_MACINTOSH_DRIVERS=y
173168 CONFIG_MAC_EMUMOUSEBTN=y
174169 CONFIG_NETDEVICES=y
175−CONFIG_NET_ETHERNET=y
176−CONFIG_NET_VENDOR_3COM=y
170+CONFIG_NETCONSOLE=y
171+CONFIG_TIGON3=y
177172 CONFIG_NET_TULIP=y
178−CONFIG_NET_PCI=y
179−CONFIG_FORCEDETH=y
180173 CONFIG_E100=y
181−CONFIG_8139TOO=y
182174 CONFIG_E1000=y
183175 CONFIG_SKY2=y
184−CONFIG_TIGON3=y
185−CONFIG_TR=y
186−CONFIG_NET_PCMCIA=y
176+CONFIG_FORCEDETH=y
177+CONFIG_8139TOO=y
187178 CONFIG_FDDI=y
188−CONFIG_NETCONSOLE=y
189179 CONFIG_INPUT_POLLDEV=y
190180 # CONFIG_INPUT_MOUSEDEV_PSAUX is not set
191181 CONFIG_INPUT_EVDEV=y
@@ -194,6 +184,7 @@ CONFIG_INPUT_TABLET=y · 2 unmodified lines
194184 CONFIG_INPUT_TOUCHSCREEN=y
195185 CONFIG_INPUT_MISC=y
196186 CONFIG_VT_HW_CONSOLE_BINDING=y
187+# CONFIG_LEGACY_PTYS is not set
197188 CONFIG_SERIAL_NONSTANDARD=y
198189 CONFIG_SERIAL_8250=y
199190 CONFIG_SERIAL_8250_CONSOLE=y
@@ -203,7 +194,6 @@ CONFIG_SERIAL_8250_MANY_PORTS=y · 3 unmodified lines
203194 CONFIG_SERIAL_8250_SHARE_IRQ=y
204195 CONFIG_SERIAL_8250_DETECT_IRQ=y
205196 CONFIG_SERIAL_8250_RSA=y
206−# CONFIG_LEGACY_PTYS is not set
207197 CONFIG_HW_RANDOM=y
208198 # CONFIG_HW_RANDOM_INTEL is not set
209199 # CONFIG_HW_RANDOM_AMD is not set
@@ -221,7 +211,6 @@ CONFIG_DRM_I915_KMS=y · 11 unmodified lines
221211 CONFIG_FB_MODE_HELPERS=y
222212 CONFIG_FB_TILEBLITTING=y
223213 CONFIG_FB_EFI=y
224−CONFIG_BACKLIGHT_LCD_SUPPORT=y
225214 # CONFIG_LCD_CLASS_DEVICE is not set
226215 CONFIG_VGACON_SOFT_SCROLLBACK=y
227216 CONFIG_LOGO=y
@@ -268,6 +257,10 @@ CONFIG_RTC_CLASS=y · 40 unmodified lines
268257 # CONFIG_RTC_HCTOSYS is not set
269258 CONFIG_DMADEVICES=y
270259 CONFIG_EEEPC_LAPTOP=y
260+CONFIG_AMD_IOMMU=y
261+CONFIG_AMD_IOMMU_STATS=y
262+CONFIG_INTEL_IOMMU=y
263+# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set
271264 CONFIG_EFI_VARS=y
272265 CONFIG_EXT3_FS=y
273266 # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
@@ -284,7 +277,6 @@ CONFIG_ZISOFS=y · 10 unmodified lines
284277 CONFIG_MSDOS_FS=y
285278 CONFIG_VFAT_FS=y
286279 CONFIG_PROC_KCORE=y
287−CONFIG_TMPFS=y
288280 CONFIG_TMPFS_POSIX_ACL=y
289281 CONFIG_HUGETLBFS=y
290282 CONFIG_NFS_FS=y
@@ -292,18 +284,6 @@ CONFIG_NFS_V3=y · 1 unmodified line
292284 CONFIG_NFS_V3_ACL=y
293285 CONFIG_NFS_V4=y
294286 CONFIG_ROOT_NFS=y
295−CONFIG_PARTITION_ADVANCED=y
296−CONFIG_OSF_PARTITION=y
297−CONFIG_AMIGA_PARTITION=y
298−CONFIG_MAC_PARTITION=y
299−CONFIG_BSD_DISKLABEL=y
300−CONFIG_MINIX_SUBPARTITION=y
301−CONFIG_SOLARIS_X86_PARTITION=y
302−CONFIG_UNIXWARE_DISKLABEL=y
303−CONFIG_SGI_PARTITION=y
304−CONFIG_SUN_PARTITION=y
305−CONFIG_KARMA_PARTITION=y
306−CONFIG_EFI_PARTITION=y
307287 CONFIG_NLS_DEFAULT="utf8"
308288 CONFIG_NLS_CODEPAGE_437=y
309289 CONFIG_NLS_ASCII=y
@@ -317,13 +297,12 @@ CONFIG_DEBUG_KERNEL=y · 7 unmodified lines
317297 # CONFIG_SCHED_DEBUG is not set
318298 CONFIG_SCHEDSTATS=y
319299 CONFIG_TIMER_STATS=y
320−# CONFIG_RCU_CPU_STALL_DETECTOR is not set
300+CONFIG_DEBUG_STACK_USAGE=y
321301 CONFIG_SYSCTL_SYSCALL_CHECK=y
322302 CONFIG_BLK_DEV_IO_TRACE=y
323303 CONFIG_PROVIDE_OHCI1394_DMA_INIT=y
324304 CONFIG_EARLY_PRINTK_DBGP=y
325305 CONFIG_DEBUG_STACKOVERFLOW=y
326−CONFIG_DEBUG_STACK_USAGE=y
327306 # CONFIG_DEBUG_RODATA_TEST is not set
328307 CONFIG_DEBUG_NX_TEST=m
329308 CONFIG_DEBUG_BOOT_PARAMS=y
arch/x86/include/asm/apic.h+1−1
@@ -534,7 +534,7 @@ static inline unsigned int read_apic_id(void) · 533 unmodified lines
534534
535535 static inline int default_apic_id_valid(int apicid)
536536 {
537− return x2apic_mode || (apicid < 255);
537+ return (apicid < 255);
538538 }
539539
540540 extern void default_setup_apic_routing(void);
arch/x86/include/asm/idle.h+1−0
@@ -14,6 +14,7 @@ void exit_idle(void); · 13 unmodified lines
1414 #else /* !CONFIG_X86_64 */
1515 static inline void enter_idle(void) { }
1616 static inline void exit_idle(void) { }
17+static inline void __exit_idle(void) { }
1718 #endif /* CONFIG_X86_64 */
1819
1920 void amd_e400_remove_cpu(int cpu);
arch/x86/include/asm/io_apic.h+9−0
@@ -21,6 +21,15 @@ · 20 unmodified lines
2121 #define IO_APIC_REDIR_LEVEL_TRIGGER (1 << 15)
2222 #define IO_APIC_REDIR_MASKED (1 << 16)
2323
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+
2433 /*
2534 * The structure of the IO-APIC:
2635 */
arch/x86/include/asm/x2apic.h+5−0
@@ -18,6 +18,11 @@ static const struct cpumask *x2apic_target_cpus(void) · 17 unmodified lines
1818 return cpu_online_mask;
1919 }
2020
21+static int x2apic_apic_id_valid(int apicid)
22+{
23+ return 1;
24+}
25+
2126 static int x2apic_apic_id_registered(void)
2227 {
2328 return 1;
arch/x86/kernel/acpi/boot.c+1−1
@@ -239,7 +239,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) · 238 unmodified lines
239239 * to not preallocating memory for all NR_CPUS
240240 * when we use CPU hotplug.
241241 */
242− if (!cpu_has_x2apic && (apic_id >= 0xff) && enabled)
242+ if (!apic->apic_id_valid(apic_id) && enabled)
243243 printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
244244 else
245245 acpi_register_lapic(apic_id, enabled);
arch/x86/kernel/apic/apic.c+9−4
@@ -383,20 +383,25 @@ static inline int eilvt_entry_is_changeable(unsigned int old, unsigned int new) · 382 unmodified lines
383383
384384 static unsigned int reserve_eilvt_offset(int offset, unsigned int new)
385385 {
386− unsigned int rsvd; /* 0: uninitialized */
386+ unsigned int rsvd, vector;
387387
388388 if (offset >= APIC_EILVT_NR_MAX)
389389 return ~0;
390390
391− rsvd = atomic_read(&eilvt_offsets[offset]) & ~APIC_EILVT_MASKED;
391+ rsvd = atomic_read(&eilvt_offsets[offset]);
392392 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))
395395 /* may not change if vectors are different */
396396 return rsvd;
397397 rsvd = atomic_cmpxchg(&eilvt_offsets[offset], rsvd, new);
398398 } while (rsvd != new);
399399
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);
404+
400405 return new;
401406 }
402407
arch/x86/kernel/apic/apic_numachip.c+1−2
@@ -229,11 +229,10 @@ static int __init numachip_system_init(void) · 228 unmodified lines
229229 }
230230 early_initcall(numachip_system_init);
231231
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)
233233 {
234234 if (!strncmp(oem_id, "NUMASC", 6)) {
235235 numachip_system = 1;
236− setup_force_cpu_cap(X86_FEATURE_X2APIC);
237236 return 1;
238237 }
239238
arch/x86/kernel/apic/io_apic.c+112−47
@@ -64,9 +64,28 @@ · 63 unmodified lines
6464 #include <asm/apic.h>
6565
6666 #define __apicdebuginit(type) static type __init
67+
6768 #define for_each_irq_pin(entry, head) \
6869 for (entry = head; entry; entry = entry->next)
6970
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+}
88+
7089 /*
7190 * Is the SiS APIC rmw bug present ?
7291 * -1 = don't know, 0 = no, 1 = yes
@@ -294,6 +313,22 @@ static void free_irq_at(unsigned int at, struct irq_cfg *cfg) · 221 unmodified lines
294313 irq_free_desc(at);
295314 }
296315
316+static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
317+{
318+ return io_apic_ops.read(apic, reg);
319+}
320+
321+static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
322+{
323+ io_apic_ops.write(apic, reg, value);
324+}
325+
326+static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
327+{
328+ io_apic_ops.modify(apic, reg, value);
329+}
330+
331+
297332 struct io_apic {
298333 unsigned int index;
299334 unsigned int unused[3];
@@ -314,16 +349,17 @@ static inline void io_apic_eoi(unsigned int apic, unsigned int vector) · 14 unmodified lines
314349 writel(vector, &io_apic->eoi);
315350 }
316351
317−static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
352+static unsigned int __io_apic_read(unsigned int apic, unsigned int reg)
318353 {
319354 struct io_apic __iomem *io_apic = io_apic_base(apic);
320355 writel(reg, &io_apic->index);
321356 return readl(&io_apic->data);
322357 }
323358
324−static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
359+static void __io_apic_write(unsigned int apic, unsigned int reg, unsigned int value)
325360 {
326361 struct io_apic __iomem *io_apic = io_apic_base(apic);
362+
327363 writel(reg, &io_apic->index);
328364 writel(value, &io_apic->data);
329365 }
@@ -334,7 +370,7 @@ static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i · 4 unmodified lines
334370 *
335371 * Older SiS APIC requires we rewrite the index register
336372 */
337−static inline void io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
373+static void __io_apic_modify(unsigned int apic, unsigned int reg, unsigned int value)
338374 {
339375 struct io_apic __iomem *io_apic = io_apic_base(apic);
340376
@@ -377,6 +413,7 @@ static struct IO_APIC_route_entry __ioapic_read_entry(int apic, int pin) · 36 unmodified lines
377413
378414 eu.w1 = io_apic_read(apic, 0x10 + 2 * pin);
379415 eu.w2 = io_apic_read(apic, 0x11 + 2 * pin);
416+
380417 return eu.entry;
381418 }
382419
@@ -384,9 +421,11 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) · 1 unmodified line
384421 {
385422 union entry_union eu;
386423 unsigned long flags;
424+
387425 raw_spin_lock_irqsave(&ioapic_lock, flags);
388426 eu.entry = __ioapic_read_entry(apic, pin);
389427 raw_spin_unlock_irqrestore(&ioapic_lock, flags);
428+
390429 return eu.entry;
391430 }
392431
@@ -396,8 +435,7 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) · 3 unmodified lines
396435 * the interrupt, and we need to make sure the entry is fully populated
397436 * before that happens.
398437 */
399−static void
400−__ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)
438+static void __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)
401439 {
402440 union entry_union eu = {{0, 0}};
403441
@@ -409,6 +447,7 @@ __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) · 5 unmodified lines
409447 static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e)
410448 {
411449 unsigned long flags;
450+
412451 raw_spin_lock_irqsave(&ioapic_lock, flags);
413452 __ioapic_write_entry(apic, pin, e);
414453 raw_spin_unlock_irqrestore(&ioapic_lock, flags);
@@ -435,8 +474,7 @@ static void ioapic_mask_entry(int apic, int pin) · 20 unmodified lines
435474 * shared ISA-space IRQs, so we have to support them. We are super
436475 * fast in the common case, and fast for shared ISA-space IRQs.
437476 */
438−static int
439−__add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin)
477+static int __add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin)
440478 {
441479 struct irq_pin_list **last, *entry;
442480
@@ -521,6 +559,7 @@ static void io_apic_sync(struct irq_pin_list *entry) · 78 unmodified lines
521559 * a dummy read from the IO-APIC
522560 */
523561 struct io_apic __iomem *io_apic;
562+
524563 io_apic = io_apic_base(entry->apic);
525564 readl(&io_apic->data);
526565 }
@@ -2512,21 +2551,73 @@ static void ack_apic_edge(struct irq_data *data) · 1985 unmodified lines
25122551
25132552 atomic_t irq_mis_count;
25142553
2515−static void ack_apic_level(struct irq_data *data)
2516−{
2517− struct irq_cfg *cfg = data->chip_data;
2518− int i, do_unmask_irq = 0, irq = data->irq;
2519− unsigned long v;
2520−
2521− irq_complete_move(cfg);
25222554 #ifdef CONFIG_GENERIC_PENDING_IRQ
2555+static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg)
2556+{
25232557 /* If we are moving the irq we need to mask it */
25242558 if (unlikely(irqd_is_setaffinity_pending(data))) {
2525− do_unmask_irq = 1;
25262559 mask_ioapic(cfg);
2560+ return true;
25272561 }
2562+ return false;
2563+}
2564+
2565+static inline void ioapic_irqd_unmask(struct irq_data *data,
2566+ struct irq_cfg *cfg, bool masked)
2567+{
2568+ if (unlikely(masked)) {
2569+ /* Only migrate the irq if the ack has been received.
2570+ *
2571+ * On rare occasions the broadcast level triggered ack gets
2572+ * delayed going to ioapics, and if we reprogram the
2573+ * vector while Remote IRR is still set the irq will never
2574+ * fire again.
2575+ *
2576+ * To prevent this scenario we read the Remote IRR bit
2577+ * of the ioapic. This has two effects.
2578+ * - On any sane system the read of the ioapic will
2579+ * flush writes (and acks) going to the ioapic from
2580+ * this cpu.
2581+ * - We get to see if the ACK has actually been delivered.
2582+ *
2583+ * Based on failed experiments of reprogramming the
2584+ * ioapic entry from outside of irq context starting
2585+ * with masking the ioapic entry and then polling until
2586+ * Remote IRR was clear before reprogramming the
2587+ * ioapic I don't trust the Remote IRR bit to be
2588+ * completey accurate.
2589+ *
2590+ * However there appears to be no other way to plug
2591+ * this race, so if the Remote IRR bit is not
2592+ * accurate and is causing problems then it is a hardware bug
2593+ * and you can go talk to the chipset vendor about it.
2594+ */
2595+ if (!io_apic_level_ack_pending(cfg))
2596+ irq_move_masked_irq(data);
2597+ unmask_ioapic(cfg);
2598+ }
2599+}
2600+#else
2601+static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg)
2602+{
2603+ return false;
2604+}
2605+static inline void ioapic_irqd_unmask(struct irq_data *data,
2606+ struct irq_cfg *cfg, bool masked)
2607+{
2608+}
25282609 #endif
25292610
2611+static void ack_apic_level(struct irq_data *data)
2612+{
2613+ struct irq_cfg *cfg = data->chip_data;
2614+ int i, irq = data->irq;
2615+ unsigned long v;
2616+ bool masked;
2617+
2618+ irq_complete_move(cfg);
2619+ masked = ioapic_irqd_mask(data, cfg);
2620+
25302621 /*
25312622 * It appears there is an erratum which affects at least version 0x11
25322623 * of I/O APIC (that's the 82093AA and cores integrated into various
@@ -2581,38 +2672,7 @@ static void ack_apic_level(struct irq_data *data) · 48 unmodified lines
25812672 eoi_ioapic_irq(irq, cfg);
25822673 }
25832674
2584− /* Now we can move and renable the irq */
2585− if (unlikely(do_unmask_irq)) {
2586− /* Only migrate the irq if the ack has been received.
2587− *
2588− * On rare occasions the broadcast level triggered ack gets
2589− * delayed going to ioapics, and if we reprogram the
2590− * vector while Remote IRR is still set the irq will never
2591− * fire again.
2592− *
2593− * To prevent this scenario we read the Remote IRR bit
2594− * of the ioapic. This has two effects.
2595− * - On any sane system the read of the ioapic will
2596− * flush writes (and acks) going to the ioapic from
2597− * this cpu.
2598− * - We get to see if the ACK has actually been delivered.
2599− *
2600− * Based on failed experiments of reprogramming the
2601− * ioapic entry from outside of irq context starting
2602− * with masking the ioapic entry and then polling until
2603− * Remote IRR was clear before reprogramming the
2604− * ioapic I don't trust the Remote IRR bit to be
2605− * completey accurate.
2606− *
2607− * However there appears to be no other way to plug
2608− * this race, so if the Remote IRR bit is not
2609− * accurate and is causing problems then it is a hardware bug
2610− * and you can go talk to the chipset vendor about it.
2611− */
2612− if (!io_apic_level_ack_pending(cfg))
2613− irq_move_masked_irq(data);
2614− unmask_ioapic(cfg);
2615− }
2675+ ioapic_irqd_unmask(data, cfg, masked);
26162676 }
26172677
26182678 #ifdef CONFIG_IRQ_REMAP
@@ -3872,6 +3932,11 @@ static struct resource * __init ioapic_setup_resources(int nr_ioapics) · 1253 unmodified lines
38723932 }
38733933
38743934 void __init ioapic_and_gsi_init(void)
3935+{
3936+ io_apic_ops.init();
3937+}
3938+
3939+static void __init __ioapic_init_mappings(void)
38753940 {
38763941 unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0;
38773942 struct resource *ioapic_res;
arch/x86/kernel/apic/x2apic_cluster.c+1−1
@@ -213,7 +213,7 @@ static struct apic apic_x2apic_cluster = { · 212 unmodified lines
213213 .name = "cluster x2apic",
214214 .probe = x2apic_cluster_probe,
215215 .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,
217217 .apic_id_registered = x2apic_apic_id_registered,
218218
219219 .irq_delivery_mode = dest_LowestPrio,
arch/x86/kernel/apic/x2apic_phys.c+1−1
@@ -119,7 +119,7 @@ static struct apic apic_x2apic_phys = { · 118 unmodified lines
119119 .name = "physical x2apic",
120120 .probe = x2apic_phys_probe,
121121 .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,
123123 .apic_id_registered = x2apic_apic_id_registered,
124124
125125 .irq_delivery_mode = dest_Fixed,
arch/x86/kernel/apic/x2apic_uv_x.c+6−1
@@ -266,6 +266,11 @@ static void uv_send_IPI_all(int vector) · 265 unmodified lines
266266 uv_send_IPI_mask(cpu_online_mask, vector);
267267 }
268268
269+static int uv_apic_id_valid(int apicid)
270+{
271+ return 1;
272+}
273+
269274 static int uv_apic_id_registered(void)
270275 {
271276 return 1;
@@ -351,7 +356,7 @@ static struct apic __refdata apic_x2apic_uv_x = { · 79 unmodified lines
351356 .name = "UV large system",
352357 .probe = uv_probe,
353358 .acpi_madt_oem_check = uv_acpi_madt_oem_check,
354− .apic_id_valid = default_apic_id_valid,
359+ .apic_id_valid = uv_apic_id_valid,
355360 .apic_id_registered = uv_apic_id_registered,
356361
357362 .irq_delivery_mode = dest_Fixed,
arch/x86/kernel/cpu/common.c+1−1
@@ -999,7 +999,7 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) · 998 unmodified lines
999999 else
10001000 printk(KERN_CONT "\n");
10011001
1002− __print_cpu_msr();
1002+ print_cpu_msr(c);
10031003 }
10041004
10051005 void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c)
arch/x86/kernel/dumpstack.c+5−2
@@ -37,13 +37,16 @@ print_ftrace_graph_addr(unsigned long addr, void *data, · 36 unmodified lines
3737 const struct stacktrace_ops *ops,
3838 struct thread_info *tinfo, int *graph)
3939 {
40− struct task_struct *task = tinfo->task;
40+ struct task_struct *task;
4141 unsigned long ret_addr;
42− int index = task->curr_ret_stack;
42+ int index;
4343
4444 if (addr != (unsigned long)return_to_handler)
4545 return;
4646
47+ task = tinfo->task;
48+ index = task->curr_ret_stack;
49+
4750 if (!task->ret_stack || index < *graph)
4851 return;
4952
arch/x86/kernel/process.c+114−0
@@ -12,6 +12,9 @@ · 11 unmodified lines
1212 #include <linux/user-return-notifier.h>
1313 #include <linux/dmi.h>
1414 #include <linux/utsname.h>
15+#include <linux/stackprotector.h>
16+#include <linux/tick.h>
17+#include <linux/cpuidle.h>
1518 #include <trace/events/power.h>
1619 #include <linux/hw_breakpoint.h>
1720 #include <asm/cpu.h>
@@ -22,6 +25,24 @@ · 4 unmodified lines
2225 #include <asm/i387.h>
2326 #include <asm/fpu-internal.h>
2427 #include <asm/debugreg.h>
28+#include <asm/nmi.h>
29+
30+#ifdef CONFIG_X86_64
31+static DEFINE_PER_CPU(unsigned char, is_idle);
32+static ATOMIC_NOTIFIER_HEAD(idle_notifier);
33+
34+void idle_notifier_register(struct notifier_block *n)
35+{
36+ atomic_notifier_chain_register(&idle_notifier, n);
37+}
38+EXPORT_SYMBOL_GPL(idle_notifier_register);
39+
40+void idle_notifier_unregister(struct notifier_block *n)
41+{
42+ atomic_notifier_chain_unregister(&idle_notifier, n);
43+}
44+EXPORT_SYMBOL_GPL(idle_notifier_unregister);
45+#endif
2546
2647 struct kmem_cache *task_xstate_cachep;
2748 EXPORT_SYMBOL_GPL(task_xstate_cachep);
@@ -370,6 +391,99 @@ static inline int hlt_use_halt(void) · 342 unmodified lines
370391 }
371392 #endif
372393
394+#ifndef CONFIG_SMP
395+static inline void play_dead(void)
396+{
397+ BUG();
398+}
399+#endif
400+
401+#ifdef CONFIG_X86_64
402+void enter_idle(void)
403+{
404+ percpu_write(is_idle, 1);
405+ atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
406+}
407+
408+static void __exit_idle(void)
409+{
410+ if (x86_test_and_clear_bit_percpu(0, is_idle) == 0)
411+ return;
412+ atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
413+}
414+
415+/* Called from interrupts to signify idle end */
416+void exit_idle(void)
417+{
418+ /* idle loop has pid 0 */
419+ if (current->pid)
420+ return;
421+ __exit_idle();
422+}
423+#endif
424+
425+/*
426+ * The idle thread. There's no useful work to be
427+ * done, so just try to conserve power and have a
428+ * low exit latency (ie sit in a loop waiting for
429+ * somebody to say that they'd like to reschedule)
430+ */
431+void cpu_idle(void)
432+{
433+ /*
434+ * If we're the non-boot CPU, nothing set the stack canary up
435+ * for us. CPU0 already has it initialized but no harm in
436+ * doing it again. This is a good place for updating it, as
437+ * we wont ever return from this function (so the invalid
438+ * canaries already on the stack wont ever trigger).
439+ */
440+ boot_init_stack_canary();
441+ current_thread_info()->status |= TS_POLLING;
442+
443+ while (1) {
444+ tick_nohz_idle_enter();
445+
446+ while (!need_resched()) {
447+ rmb();
448+
449+ if (cpu_is_offline(smp_processor_id()))
450+ play_dead();
451+
452+ /*
453+ * Idle routines should keep interrupts disabled
454+ * from here on, until they go to idle.
455+ * Otherwise, idle callbacks can misfire.
456+ */
457+ local_touch_nmi();
458+ local_irq_disable();
459+
460+ enter_idle();
461+
462+ /* Don't trace irqs off for idle */
463+ stop_critical_timings();
464+
465+ /* enter_idle() needs rcu for notifiers */
466+ rcu_idle_enter();
467+
468+ if (cpuidle_idle_call())
469+ pm_idle();
470+
471+ rcu_idle_exit();
472+ start_critical_timings();
473+
474+ /* In many cases the interrupt that ended idle
475+ has already called exit_idle. But some idle
476+ loops can be woken up without interrupt. */
477+ __exit_idle();
478+ }
479+
480+ tick_nohz_idle_exit();
481+ preempt_enable_no_resched();
482+ schedule();
483+ preempt_disable();
484+ }
485+}
486+
373487 /*
374488 * We use this if we don't have any better
375489 * idle routine..
arch/x86/kernel/process_32.c+0−58
@@ -9,7 +9,6 @@ · 8 unmodified lines
99 * This file handles the architecture-dependent parts of process handling..
1010 */
1111
12−#include <linux/stackprotector.h>
1312 #include <linux/cpu.h>
1413 #include <linux/errno.h>
1514 #include <linux/sched.h>
@@ -31,14 +30,12 @@ · 15 unmodified lines
3130 #include <linux/kallsyms.h>
3231 #include <linux/ptrace.h>
3332 #include <linux/personality.h>
34−#include <linux/tick.h>
3533 #include <linux/percpu.h>
3634 #include <linux/prctl.h>
3735 #include <linux/ftrace.h>
3836 #include <linux/uaccess.h>
3937 #include <linux/io.h>
4038 #include <linux/kdebug.h>
41−#include <linux/cpuidle.h>
4239
4340 #include <asm/pgtable.h>
4441 #include <asm/ldt.h>
@@ -57,7 +54,6 @@ · 12 unmodified lines
5754 #include <asm/idle.h>
5855 #include <asm/syscalls.h>
5956 #include <asm/debugreg.h>
60−#include <asm/nmi.h>
6157 #include <asm/switch_to.h>
6258
6359 asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
@@ -70,60 +66,6 @@ unsigned long thread_saved_pc(struct task_struct *tsk) · 6 unmodified lines
7066 return ((unsigned long *)tsk->thread.sp)[3];
7167 }
7268
73−#ifndef CONFIG_SMP
74−static inline void play_dead(void)
75−{
76− BUG();
77−}
78−#endif
79−
80−/*
81− * The idle thread. There's no useful work to be
82− * done, so just try to conserve power and have a
83− * low exit latency (ie sit in a loop waiting for
84− * somebody to say that they'd like to reschedule)
85− */
86−void cpu_idle(void)
87−{
88− int cpu = smp_processor_id();
89−
90− /*
91− * If we're the non-boot CPU, nothing set the stack canary up
92− * for us. CPU0 already has it initialized but no harm in
93− * doing it again. This is a good place for updating it, as
94− * we wont ever return from this function (so the invalid
95− * canaries already on the stack wont ever trigger).
96− */
97− boot_init_stack_canary();
98−
99− current_thread_info()->status |= TS_POLLING;
100−
101− /* endless idle loop with no priority at all */
102− while (1) {
103− tick_nohz_idle_enter();
104− rcu_idle_enter();
105− while (!need_resched()) {
106−
107− check_pgt_cache();
108− rmb();
109−
110− if (cpu_is_offline(cpu))
111− play_dead();
112−
113− local_touch_nmi();
114− local_irq_disable();
115− /* Don't trace irqs off for idle */
116− stop_critical_timings();
117− if (cpuidle_idle_call())
118− pm_idle();
119− start_critical_timings();
120− }
121− rcu_idle_exit();
122− tick_nohz_idle_exit();
123− schedule_preempt_disabled();
124− }
125−}
126−
12769 void __show_regs(struct pt_regs *regs, int all)
12870 {
12971 unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L;
arch/x86/kernel/process_64.c+0−107
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 * This file handles the architecture-dependent parts of process handling..
1515 */
1616
17−#include <linux/stackprotector.h>
1817 #include <linux/cpu.h>
1918 #include <linux/errno.h>
2019 #include <linux/sched.h>
@@ -32,12 +31,10 @@ · 11 unmodified lines
3231 #include <linux/notifier.h>
3332 #include <linux/kprobes.h>
3433 #include <linux/kdebug.h>
35−#include <linux/tick.h>
3634 #include <linux/prctl.h>
3735 #include <linux/uaccess.h>
3836 #include <linux/io.h>
3937 #include <linux/ftrace.h>
40−#include <linux/cpuidle.h>
4138
4239 #include <asm/pgtable.h>
4340 #include <asm/processor.h>
@@ -51,115 +48,11 @@ · 7 unmodified lines
5148 #include <asm/idle.h>
5249 #include <asm/syscalls.h>
5350 #include <asm/debugreg.h>
54−#include <asm/nmi.h>
5551 #include <asm/switch_to.h>
5652
5753 asmlinkage extern void ret_from_fork(void);
5854
5955 DEFINE_PER_CPU(unsigned long, old_rsp);
60−static DEFINE_PER_CPU(unsigned char, is_idle);
61−
62−static ATOMIC_NOTIFIER_HEAD(idle_notifier);
63−
64−void idle_notifier_register(struct notifier_block *n)
65−{
66− atomic_notifier_chain_register(&idle_notifier, n);
67−}
68−EXPORT_SYMBOL_GPL(idle_notifier_register);
69−
70−void idle_notifier_unregister(struct notifier_block *n)
71−{
72− atomic_notifier_chain_unregister(&idle_notifier, n);
73−}
74−EXPORT_SYMBOL_GPL(idle_notifier_unregister);
75−
76−void enter_idle(void)
77−{
78− percpu_write(is_idle, 1);
79− atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
80−}
81−
82−static void __exit_idle(void)
83−{
84− if (x86_test_and_clear_bit_percpu(0, is_idle) == 0)
85− return;
86− atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
87−}
88−
89−/* Called from interrupts to signify idle end */
90−void exit_idle(void)
91−{
92− /* idle loop has pid 0 */
93− if (current->pid)
94− return;
95− __exit_idle();
96−}
97−
98−#ifndef CONFIG_SMP
99−static inline void play_dead(void)
100−{
101− BUG();
102−}
103−#endif
104−
105−/*
106− * The idle thread. There's no useful work to be
107− * done, so just try to conserve power and have a
108− * low exit latency (ie sit in a loop waiting for
109− * somebody to say that they'd like to reschedule)
110− */
111−void cpu_idle(void)
112−{
113− current_thread_info()->status |= TS_POLLING;
114−
115− /*
116− * If we're the non-boot CPU, nothing set the stack canary up
117− * for us. CPU0 already has it initialized but no harm in
118− * doing it again. This is a good place for updating it, as
119− * we wont ever return from this function (so the invalid
120− * canaries already on the stack wont ever trigger).
121− */
122− boot_init_stack_canary();
123−
124− /* endless idle loop with no priority at all */
125− while (1) {
126− tick_nohz_idle_enter();
127− while (!need_resched()) {
128−
129− rmb();
130−
131− if (cpu_is_offline(smp_processor_id()))
132− play_dead();
133− /*
134− * Idle routines should keep interrupts disabled
135− * from here on, until they go to idle.
136− * Otherwise, idle callbacks can misfire.
137− */
138− local_touch_nmi();
139− local_irq_disable();
140− enter_idle();
141− /* Don't trace irqs off for idle */
142− stop_critical_timings();
143−
144− /* enter_idle() needs rcu for notifiers */
145− rcu_idle_enter();
146−
147− if (cpuidle_idle_call())
148− pm_idle();
149−
150− rcu_idle_exit();
151− start_critical_timings();
152−
153− /* In many cases the interrupt that ended idle
154− has already called exit_idle. But some idle
155− loops can be woken up without interrupt. */
156− __exit_idle();
157− }
158−
159− tick_nohz_idle_exit();
160− schedule_preempt_disabled();
161− }
162−}
16356
16457 /* Prints also some state that isn't saved in the pt_regs */
16558 void __show_regs(struct pt_regs *regs, int all)
arch/x86/kernel/tls.c+2−2
@@ -162,7 +162,7 @@ int regset_tls_get(struct task_struct *target, const struct user_regset *regset, · 161 unmodified lines
162162 {
163163 const struct desc_struct *tls;
164164
165− if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
165+ if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
166166 (pos % sizeof(struct user_desc)) != 0 ||
167167 (count % sizeof(struct user_desc)) != 0)
168168 return -EINVAL;
@@ -197,7 +197,7 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset, · 28 unmodified lines
197197 struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES];
198198 const struct user_desc *info;
199199
200− if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
200+ if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) ||
201201 (pos % sizeof(struct user_desc)) != 0 ||
202202 (count % sizeof(struct user_desc)) != 0)
203203 return -EINVAL;
arch/x86/mm/srat.c+1−1
@@ -70,7 +70,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) · 69 unmodified lines
7070 return;
7171 pxm = pa->proximity_domain;
7272 apic_id = pa->apic_id;
73− if (!cpu_has_x2apic && (apic_id >= 0xff)) {
73+ if (!apic->apic_id_valid(apic_id)) {
7474 printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n",
7575 pxm, apic_id);
7676 return;
arch/x86/platform/olpc/olpc.c+97−0
@@ -20,6 +20,8 @@ · 19 unmodified lines
2020 #include <linux/platform_device.h>
2121 #include <linux/of.h>
2222 #include <linux/syscore_ops.h>
23+#include <linux/debugfs.h>
24+#include <linux/mutex.h>
2325
2426 #include <asm/geode.h>
2527 #include <asm/setup.h>
@@ -31,6 +33,15 @@ EXPORT_SYMBOL_GPL(olpc_platform_info); · 5 unmodified lines
3133
3234 static DEFINE_SPINLOCK(ec_lock);
3335
36+/* debugfs interface to EC commands */
37+#define EC_MAX_CMD_ARGS (5 + 1) /* cmd byte + 5 args */
38+#define EC_MAX_CMD_REPLY (8)
39+
40+static struct dentry *ec_debugfs_dir;
41+static DEFINE_MUTEX(ec_debugfs_cmd_lock);
42+static unsigned char ec_debugfs_resp[EC_MAX_CMD_REPLY];
43+static unsigned int ec_debugfs_resp_bytes;
44+
3445 /* EC event mask to be applied during suspend (defining wakeup sources). */
3546 static u16 ec_wakeup_mask;
3647
@@ -269,6 +280,91 @@ int olpc_ec_sci_query(u16 *sci_value) · 232 unmodified lines
269280 }
270281 EXPORT_SYMBOL_GPL(olpc_ec_sci_query);
271282
283+static ssize_t ec_debugfs_cmd_write(struct file *file, const char __user *buf,
284+ size_t size, loff_t *ppos)
285+{
286+ int i, m;
287+ unsigned char ec_cmd[EC_MAX_CMD_ARGS];
288+ unsigned int ec_cmd_int[EC_MAX_CMD_ARGS];
289+ char cmdbuf[64];
290+ int ec_cmd_bytes;
291+
292+ mutex_lock(&ec_debugfs_cmd_lock);
293+
294+ size = simple_write_to_buffer(cmdbuf, sizeof(cmdbuf), ppos, buf, size);
295+
296+ m = sscanf(cmdbuf, "%x:%u %x %x %x %x %x", &ec_cmd_int[0],
297+ &ec_debugfs_resp_bytes,
298+ &ec_cmd_int[1], &ec_cmd_int[2], &ec_cmd_int[3],
299+ &ec_cmd_int[4], &ec_cmd_int[5]);
300+ if (m < 2 || ec_debugfs_resp_bytes > EC_MAX_CMD_REPLY) {
301+ /* reset to prevent overflow on read */
302+ ec_debugfs_resp_bytes = 0;
303+
304+ printk(KERN_DEBUG "olpc-ec: bad ec cmd: "
305+ "cmd:response-count [arg1 [arg2 ...]]\n");
306+ size = -EINVAL;
307+ goto out;
308+ }
309+
310+ /* convert scanf'd ints to char */
311+ ec_cmd_bytes = m - 2;
312+ for (i = 0; i <= ec_cmd_bytes; i++)
313+ ec_cmd[i] = ec_cmd_int[i];
314+
315+ printk(KERN_DEBUG "olpc-ec: debugfs cmd 0x%02x with %d args "
316+ "%02x %02x %02x %02x %02x, want %d returns\n",
317+ ec_cmd[0], ec_cmd_bytes, ec_cmd[1], ec_cmd[2], ec_cmd[3],
318+ ec_cmd[4], ec_cmd[5], ec_debugfs_resp_bytes);
319+
320+ olpc_ec_cmd(ec_cmd[0], (ec_cmd_bytes == 0) ? NULL : &ec_cmd[1],
321+ ec_cmd_bytes, ec_debugfs_resp, ec_debugfs_resp_bytes);
322+
323+ printk(KERN_DEBUG "olpc-ec: response "
324+ "%02x %02x %02x %02x %02x %02x %02x %02x (%d bytes expected)\n",
325+ ec_debugfs_resp[0], ec_debugfs_resp[1], ec_debugfs_resp[2],
326+ ec_debugfs_resp[3], ec_debugfs_resp[4], ec_debugfs_resp[5],
327+ ec_debugfs_resp[6], ec_debugfs_resp[7], ec_debugfs_resp_bytes);
328+
329+out:
330+ mutex_unlock(&ec_debugfs_cmd_lock);
331+ return size;
332+}
333+
334+static ssize_t ec_debugfs_cmd_read(struct file *file, char __user *buf,
335+ size_t size, loff_t *ppos)
336+{
337+ unsigned int i, r;
338+ char *rp;
339+ char respbuf[64];
340+
341+ mutex_lock(&ec_debugfs_cmd_lock);
342+ rp = respbuf;
343+ rp += sprintf(rp, "%02x", ec_debugfs_resp[0]);
344+ for (i = 1; i < ec_debugfs_resp_bytes; i++)
345+ rp += sprintf(rp, ", %02x", ec_debugfs_resp[i]);
346+ mutex_unlock(&ec_debugfs_cmd_lock);
347+ rp += sprintf(rp, "\n");
348+
349+ r = rp - respbuf;
350+ return simple_read_from_buffer(buf, size, ppos, respbuf, r);
351+}
352+
353+static const struct file_operations ec_debugfs_genops = {
354+ .write = ec_debugfs_cmd_write,
355+ .read = ec_debugfs_cmd_read,
356+};
357+
358+static void setup_debugfs(void)
359+{
360+ ec_debugfs_dir = debugfs_create_dir("olpc-ec", 0);
361+ if (ec_debugfs_dir == ERR_PTR(-ENODEV))
362+ return;
363+
364+ debugfs_create_file("cmd", 0600, ec_debugfs_dir, NULL,
365+ &ec_debugfs_genops);
366+}
367+
272368 static int olpc_ec_suspend(void)
273369 {
274370 return olpc_ec_mask_write(ec_wakeup_mask);
@@ -372,6 +468,7 @@ static int __init olpc_init(void) · 97 unmodified lines
372468 }
373469
374470 register_syscore_ops(&olpc_syscore_ops);
471+ setup_debugfs();
375472
376473 return 0;
377474 }
arch/xtensa/configs/iss_defconfig+1−1
@@ -113,7 +113,7 @@ CONFIG_DEFAULT_IOSCHED="noop" · 112 unmodified lines
113113 # CONFIG_INLINE_SPIN_LOCK_BH is not set
114114 # CONFIG_INLINE_SPIN_LOCK_IRQ is not set
115115 # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set
116−CONFIG_INLINE_SPIN_UNLOCK=y
116+# CONFIG_UNINLINE_SPIN_UNLOCK is not set
117117 # CONFIG_INLINE_SPIN_UNLOCK_BH is not set
118118 CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
119119 # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set
include/linux/spinlock_api_smp.h+1−1
@@ -67,7 +67,7 @@ _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags) · 66 unmodified lines
6767 #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock)
6868 #endif
6969
70−#ifdef CONFIG_INLINE_SPIN_UNLOCK
70+#ifndef CONFIG_UNINLINE_SPIN_UNLOCK
7171 #define _raw_spin_unlock(lock) __raw_spin_unlock(lock)
7272 #endif
7373
kernel/Kconfig.locks+2−2
@@ -124,8 +124,8 @@ config INLINE_SPIN_LOCK_IRQSAVE · 123 unmodified lines
124124 def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \
125125 ARCH_INLINE_SPIN_LOCK_IRQSAVE
126126
127−config INLINE_SPIN_UNLOCK
128− def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK)
127+config UNINLINE_SPIN_UNLOCK
128+ bool
129129
130130 config INLINE_SPIN_UNLOCK_BH
131131 def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH
kernel/Kconfig.preempt+1−0
@@ -36,6 +36,7 @@ config PREEMPT_VOLUNTARY · 35 unmodified lines
3636 config PREEMPT
3737 bool "Preemptible Kernel (Low-Latency Desktop)"
3838 select PREEMPT_COUNT
39+ select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
3940 help
4041 This option reduces the latency of the kernel by making
4142 all kernel code (that is not executing in a critical section)
kernel/spinlock.c+1−1
@@ -163,7 +163,7 @@ void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock) · 162 unmodified lines
163163 EXPORT_SYMBOL(_raw_spin_lock_bh);
164164 #endif
165165
166−#ifndef CONFIG_INLINE_SPIN_UNLOCK
166+#ifdef CONFIG_UNINLINE_SPIN_UNLOCK
167167 void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock)
168168 {
169169 __raw_spin_unlock(lock);
lib/Kconfig.debug+1−0
@@ -499,6 +499,7 @@ config RT_MUTEX_TESTER · 498 unmodified lines
499499 config DEBUG_SPINLOCK
500500 bool "Spinlock and rw-lock debugging: basic checks"
501501 depends on DEBUG_KERNEL
502+ select UNINLINE_SPIN_UNLOCK
502503 help
503504 Say Y here and build SMP to catch missing spinlock initialization
504505 and certain other kinds of spinlock errors commonly made. This is

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t