diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 17:28:26 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-29 17:28:26 -0400 |
| commit | 6b8212a313dae341ef3a2e413dfec5c4dea59617 (patch) | |
| tree | bbca09d88f61f999c7714fe82710bdfe6ee0e98b | |
| parent | bcd550745fc54f789c14e7526e0633222c505faa (diff) | |
| parent | 8abc3122aa02567bfe626cd13f4d34853c9b1225 (diff) | |
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
29 files changed, 436 insertions, 321 deletions
diff --git a/Documentation/ABI/testing/debugfs-olpc b/Documentation/ABI/testing/debugfs-olpc new file mode 100644 index 000000000000..bd76cc6d55f9 --- /dev/null +++ b/Documentation/ABI/testing/debugfs-olpc | |||
| @@ -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. | ||
diff --git a/arch/mips/configs/db1300_defconfig b/arch/mips/configs/db1300_defconfig index c38b190151c4..3590ab5d9791 100644 --- a/arch/mips/configs/db1300_defconfig +++ b/arch/mips/configs/db1300_defconfig | |||
| @@ -133,7 +133,7 @@ CONFIG_BLK_DEV_BSG=y | |||
| 133 | CONFIG_IOSCHED_NOOP=y | 133 | CONFIG_IOSCHED_NOOP=y |
| 134 | CONFIG_DEFAULT_NOOP=y | 134 | CONFIG_DEFAULT_NOOP=y |
| 135 | CONFIG_DEFAULT_IOSCHED="noop" | 135 | CONFIG_DEFAULT_IOSCHED="noop" |
| 136 | CONFIG_INLINE_SPIN_UNLOCK=y | 136 | # CONFIG_UNINLINE_SPIN_UNLOCK is not set |
| 137 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y | 137 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y |
| 138 | CONFIG_INLINE_READ_UNLOCK=y | 138 | CONFIG_INLINE_READ_UNLOCK=y |
| 139 | CONFIG_INLINE_READ_UNLOCK_IRQ=y | 139 | CONFIG_INLINE_READ_UNLOCK_IRQ=y |
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig index 2bf18059fbea..119db67dcb03 100644 --- a/arch/x86/configs/i386_defconfig +++ b/arch/x86/configs/i386_defconfig | |||
| @@ -15,23 +15,28 @@ CONFIG_CPUSETS=y | |||
| 15 | CONFIG_CGROUP_CPUACCT=y | 15 | CONFIG_CGROUP_CPUACCT=y |
| 16 | CONFIG_RESOURCE_COUNTERS=y | 16 | CONFIG_RESOURCE_COUNTERS=y |
| 17 | CONFIG_CGROUP_SCHED=y | 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 | CONFIG_BLK_DEV_INITRD=y | 18 | CONFIG_BLK_DEV_INITRD=y |
| 24 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
| 25 | # CONFIG_COMPAT_BRK is not set | 19 | # CONFIG_COMPAT_BRK is not set |
| 26 | CONFIG_PROFILING=y | 20 | CONFIG_PROFILING=y |
| 27 | CONFIG_KPROBES=y | 21 | CONFIG_KPROBES=y |
| 28 | CONFIG_MODULES=y | 22 | CONFIG_MODULES=y |
| 29 | CONFIG_MODULE_UNLOAD=y | 23 | CONFIG_MODULE_UNLOAD=y |
| 30 | CONFIG_MODULE_FORCE_UNLOAD=y | 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 | CONFIG_NO_HZ=y | 37 | CONFIG_NO_HZ=y |
| 32 | CONFIG_HIGH_RES_TIMERS=y | 38 | CONFIG_HIGH_RES_TIMERS=y |
| 33 | CONFIG_SMP=y | 39 | CONFIG_SMP=y |
| 34 | CONFIG_SPARSE_IRQ=y | ||
| 35 | CONFIG_X86_GENERIC=y | 40 | CONFIG_X86_GENERIC=y |
| 36 | CONFIG_HPET_TIMER=y | 41 | CONFIG_HPET_TIMER=y |
| 37 | CONFIG_SCHED_SMT=y | 42 | CONFIG_SCHED_SMT=y |
| @@ -51,14 +56,12 @@ CONFIG_HZ_1000=y | |||
| 51 | CONFIG_KEXEC=y | 56 | CONFIG_KEXEC=y |
| 52 | CONFIG_CRASH_DUMP=y | 57 | CONFIG_CRASH_DUMP=y |
| 53 | # CONFIG_COMPAT_VDSO is not set | 58 | # CONFIG_COMPAT_VDSO is not set |
| 54 | CONFIG_PM=y | 59 | CONFIG_HIBERNATION=y |
| 55 | CONFIG_PM_DEBUG=y | 60 | CONFIG_PM_DEBUG=y |
| 56 | CONFIG_PM_TRACE_RTC=y | 61 | CONFIG_PM_TRACE_RTC=y |
| 57 | CONFIG_HIBERNATION=y | ||
| 58 | CONFIG_ACPI_PROCFS=y | 62 | CONFIG_ACPI_PROCFS=y |
| 59 | CONFIG_ACPI_DOCK=y | 63 | CONFIG_ACPI_DOCK=y |
| 60 | CONFIG_CPU_FREQ=y | 64 | CONFIG_CPU_FREQ=y |
| 61 | CONFIG_CPU_FREQ_DEBUG=y | ||
| 62 | # CONFIG_CPU_FREQ_STAT is not set | 65 | # CONFIG_CPU_FREQ_STAT is not set |
| 63 | CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y | 66 | CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y |
| 64 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y | 67 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y |
| @@ -69,7 +72,6 @@ CONFIG_PCI_MSI=y | |||
| 69 | CONFIG_PCCARD=y | 72 | CONFIG_PCCARD=y |
| 70 | CONFIG_YENTA=y | 73 | CONFIG_YENTA=y |
| 71 | CONFIG_HOTPLUG_PCI=y | 74 | CONFIG_HOTPLUG_PCI=y |
| 72 | CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y | ||
| 73 | CONFIG_BINFMT_MISC=y | 75 | CONFIG_BINFMT_MISC=y |
| 74 | CONFIG_NET=y | 76 | CONFIG_NET=y |
| 75 | CONFIG_PACKET=y | 77 | CONFIG_PACKET=y |
| @@ -120,7 +122,6 @@ CONFIG_NF_CONNTRACK_IPV4=y | |||
| 120 | CONFIG_IP_NF_IPTABLES=y | 122 | CONFIG_IP_NF_IPTABLES=y |
| 121 | CONFIG_IP_NF_FILTER=y | 123 | CONFIG_IP_NF_FILTER=y |
| 122 | CONFIG_IP_NF_TARGET_REJECT=y | 124 | CONFIG_IP_NF_TARGET_REJECT=y |
| 123 | CONFIG_IP_NF_TARGET_LOG=y | ||
| 124 | CONFIG_IP_NF_TARGET_ULOG=y | 125 | CONFIG_IP_NF_TARGET_ULOG=y |
| 125 | CONFIG_NF_NAT=y | 126 | CONFIG_NF_NAT=y |
| 126 | CONFIG_IP_NF_TARGET_MASQUERADE=y | 127 | CONFIG_IP_NF_TARGET_MASQUERADE=y |
| @@ -128,7 +129,6 @@ CONFIG_IP_NF_MANGLE=y | |||
| 128 | CONFIG_NF_CONNTRACK_IPV6=y | 129 | CONFIG_NF_CONNTRACK_IPV6=y |
| 129 | CONFIG_IP6_NF_IPTABLES=y | 130 | CONFIG_IP6_NF_IPTABLES=y |
| 130 | CONFIG_IP6_NF_MATCH_IPV6HEADER=y | 131 | CONFIG_IP6_NF_MATCH_IPV6HEADER=y |
| 131 | CONFIG_IP6_NF_TARGET_LOG=y | ||
| 132 | CONFIG_IP6_NF_FILTER=y | 132 | CONFIG_IP6_NF_FILTER=y |
| 133 | CONFIG_IP6_NF_TARGET_REJECT=y | 133 | CONFIG_IP6_NF_TARGET_REJECT=y |
| 134 | CONFIG_IP6_NF_MANGLE=y | 134 | CONFIG_IP6_NF_MANGLE=y |
| @@ -169,25 +169,20 @@ CONFIG_DM_ZERO=y | |||
| 169 | CONFIG_MACINTOSH_DRIVERS=y | 169 | CONFIG_MACINTOSH_DRIVERS=y |
| 170 | CONFIG_MAC_EMUMOUSEBTN=y | 170 | CONFIG_MAC_EMUMOUSEBTN=y |
| 171 | CONFIG_NETDEVICES=y | 171 | CONFIG_NETDEVICES=y |
| 172 | CONFIG_NET_ETHERNET=y | 172 | CONFIG_NETCONSOLE=y |
| 173 | CONFIG_NET_VENDOR_3COM=y | 173 | CONFIG_BNX2=y |
| 174 | CONFIG_TIGON3=y | ||
| 174 | CONFIG_NET_TULIP=y | 175 | CONFIG_NET_TULIP=y |
| 175 | CONFIG_NET_PCI=y | ||
| 176 | CONFIG_FORCEDETH=y | ||
| 177 | CONFIG_E100=y | 176 | CONFIG_E100=y |
| 177 | CONFIG_E1000=y | ||
| 178 | CONFIG_E1000E=y | ||
| 179 | CONFIG_SKY2=y | ||
| 178 | CONFIG_NE2K_PCI=y | 180 | CONFIG_NE2K_PCI=y |
| 181 | CONFIG_FORCEDETH=y | ||
| 179 | CONFIG_8139TOO=y | 182 | CONFIG_8139TOO=y |
| 180 | # CONFIG_8139TOO_PIO is not set | 183 | # CONFIG_8139TOO_PIO is not set |
| 181 | CONFIG_E1000=y | ||
| 182 | CONFIG_E1000E=y | ||
| 183 | CONFIG_R8169=y | 184 | CONFIG_R8169=y |
| 184 | CONFIG_SKY2=y | ||
| 185 | CONFIG_TIGON3=y | ||
| 186 | CONFIG_BNX2=y | ||
| 187 | CONFIG_TR=y | ||
| 188 | CONFIG_NET_PCMCIA=y | ||
| 189 | CONFIG_FDDI=y | 185 | CONFIG_FDDI=y |
| 190 | CONFIG_NETCONSOLE=y | ||
| 191 | CONFIG_INPUT_POLLDEV=y | 186 | CONFIG_INPUT_POLLDEV=y |
| 192 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | 187 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set |
| 193 | CONFIG_INPUT_EVDEV=y | 188 | CONFIG_INPUT_EVDEV=y |
| @@ -196,6 +191,7 @@ CONFIG_INPUT_TABLET=y | |||
| 196 | CONFIG_INPUT_TOUCHSCREEN=y | 191 | CONFIG_INPUT_TOUCHSCREEN=y |
| 197 | CONFIG_INPUT_MISC=y | 192 | CONFIG_INPUT_MISC=y |
| 198 | CONFIG_VT_HW_CONSOLE_BINDING=y | 193 | CONFIG_VT_HW_CONSOLE_BINDING=y |
| 194 | # CONFIG_LEGACY_PTYS is not set | ||
| 199 | CONFIG_SERIAL_NONSTANDARD=y | 195 | CONFIG_SERIAL_NONSTANDARD=y |
| 200 | CONFIG_SERIAL_8250=y | 196 | CONFIG_SERIAL_8250=y |
| 201 | CONFIG_SERIAL_8250_CONSOLE=y | 197 | CONFIG_SERIAL_8250_CONSOLE=y |
| @@ -205,7 +201,6 @@ CONFIG_SERIAL_8250_MANY_PORTS=y | |||
| 205 | CONFIG_SERIAL_8250_SHARE_IRQ=y | 201 | CONFIG_SERIAL_8250_SHARE_IRQ=y |
| 206 | CONFIG_SERIAL_8250_DETECT_IRQ=y | 202 | CONFIG_SERIAL_8250_DETECT_IRQ=y |
| 207 | CONFIG_SERIAL_8250_RSA=y | 203 | CONFIG_SERIAL_8250_RSA=y |
| 208 | # CONFIG_LEGACY_PTYS is not set | ||
| 209 | CONFIG_HW_RANDOM=y | 204 | CONFIG_HW_RANDOM=y |
| 210 | CONFIG_NVRAM=y | 205 | CONFIG_NVRAM=y |
| 211 | CONFIG_HPET=y | 206 | CONFIG_HPET=y |
| @@ -220,7 +215,6 @@ CONFIG_DRM_I915=y | |||
| 220 | CONFIG_FB_MODE_HELPERS=y | 215 | CONFIG_FB_MODE_HELPERS=y |
| 221 | CONFIG_FB_TILEBLITTING=y | 216 | CONFIG_FB_TILEBLITTING=y |
| 222 | CONFIG_FB_EFI=y | 217 | CONFIG_FB_EFI=y |
| 223 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 224 | # CONFIG_LCD_CLASS_DEVICE is not set | 218 | # CONFIG_LCD_CLASS_DEVICE is not set |
| 225 | CONFIG_VGACON_SOFT_SCROLLBACK=y | 219 | CONFIG_VGACON_SOFT_SCROLLBACK=y |
| 226 | CONFIG_LOGO=y | 220 | CONFIG_LOGO=y |
| @@ -283,7 +277,6 @@ CONFIG_ZISOFS=y | |||
| 283 | CONFIG_MSDOS_FS=y | 277 | CONFIG_MSDOS_FS=y |
| 284 | CONFIG_VFAT_FS=y | 278 | CONFIG_VFAT_FS=y |
| 285 | CONFIG_PROC_KCORE=y | 279 | CONFIG_PROC_KCORE=y |
| 286 | CONFIG_TMPFS=y | ||
| 287 | CONFIG_TMPFS_POSIX_ACL=y | 280 | CONFIG_TMPFS_POSIX_ACL=y |
| 288 | CONFIG_HUGETLBFS=y | 281 | CONFIG_HUGETLBFS=y |
| 289 | CONFIG_NFS_FS=y | 282 | CONFIG_NFS_FS=y |
| @@ -291,18 +284,6 @@ CONFIG_NFS_V3=y | |||
| 291 | CONFIG_NFS_V3_ACL=y | 284 | CONFIG_NFS_V3_ACL=y |
| 292 | CONFIG_NFS_V4=y | 285 | CONFIG_NFS_V4=y |
| 293 | CONFIG_ROOT_NFS=y | 286 | 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 | ||
| 306 | CONFIG_NLS_DEFAULT="utf8" | 287 | CONFIG_NLS_DEFAULT="utf8" |
| 307 | CONFIG_NLS_CODEPAGE_437=y | 288 | CONFIG_NLS_CODEPAGE_437=y |
| 308 | CONFIG_NLS_ASCII=y | 289 | CONFIG_NLS_ASCII=y |
| @@ -317,13 +298,12 @@ CONFIG_DEBUG_KERNEL=y | |||
| 317 | # CONFIG_SCHED_DEBUG is not set | 298 | # CONFIG_SCHED_DEBUG is not set |
| 318 | CONFIG_SCHEDSTATS=y | 299 | CONFIG_SCHEDSTATS=y |
| 319 | CONFIG_TIMER_STATS=y | 300 | CONFIG_TIMER_STATS=y |
| 320 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | 301 | CONFIG_DEBUG_STACK_USAGE=y |
| 321 | CONFIG_SYSCTL_SYSCALL_CHECK=y | 302 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
| 322 | CONFIG_BLK_DEV_IO_TRACE=y | 303 | CONFIG_BLK_DEV_IO_TRACE=y |
| 323 | CONFIG_PROVIDE_OHCI1394_DMA_INIT=y | 304 | CONFIG_PROVIDE_OHCI1394_DMA_INIT=y |
| 324 | CONFIG_EARLY_PRINTK_DBGP=y | 305 | CONFIG_EARLY_PRINTK_DBGP=y |
| 325 | CONFIG_DEBUG_STACKOVERFLOW=y | 306 | CONFIG_DEBUG_STACKOVERFLOW=y |
| 326 | CONFIG_DEBUG_STACK_USAGE=y | ||
| 327 | # CONFIG_DEBUG_RODATA_TEST is not set | 307 | # CONFIG_DEBUG_RODATA_TEST is not set |
| 328 | CONFIG_DEBUG_NX_TEST=m | 308 | CONFIG_DEBUG_NX_TEST=m |
| 329 | CONFIG_DEBUG_BOOT_PARAMS=y | 309 | CONFIG_DEBUG_BOOT_PARAMS=y |
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig index 058a35b8286c..76eb2903809f 100644 --- a/arch/x86/configs/x86_64_defconfig +++ b/arch/x86/configs/x86_64_defconfig | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | CONFIG_64BIT=y | ||
| 2 | CONFIG_EXPERIMENTAL=y | 1 | CONFIG_EXPERIMENTAL=y |
| 3 | # CONFIG_LOCALVERSION_AUTO is not set | 2 | # CONFIG_LOCALVERSION_AUTO is not set |
| 4 | CONFIG_SYSVIPC=y | 3 | CONFIG_SYSVIPC=y |
| @@ -16,26 +15,29 @@ CONFIG_CPUSETS=y | |||
| 16 | CONFIG_CGROUP_CPUACCT=y | 15 | CONFIG_CGROUP_CPUACCT=y |
| 17 | CONFIG_RESOURCE_COUNTERS=y | 16 | CONFIG_RESOURCE_COUNTERS=y |
| 18 | CONFIG_CGROUP_SCHED=y | 17 | 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 | ||
| 24 | CONFIG_BLK_DEV_INITRD=y | 18 | CONFIG_BLK_DEV_INITRD=y |
| 25 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
| 26 | # CONFIG_COMPAT_BRK is not set | 19 | # CONFIG_COMPAT_BRK is not set |
| 27 | CONFIG_PROFILING=y | 20 | CONFIG_PROFILING=y |
| 28 | CONFIG_KPROBES=y | 21 | CONFIG_KPROBES=y |
| 29 | CONFIG_MODULES=y | 22 | CONFIG_MODULES=y |
| 30 | CONFIG_MODULE_UNLOAD=y | 23 | CONFIG_MODULE_UNLOAD=y |
| 31 | CONFIG_MODULE_FORCE_UNLOAD=y | 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 | ||
| 32 | CONFIG_NO_HZ=y | 37 | CONFIG_NO_HZ=y |
| 33 | CONFIG_HIGH_RES_TIMERS=y | 38 | CONFIG_HIGH_RES_TIMERS=y |
| 34 | CONFIG_SMP=y | 39 | CONFIG_SMP=y |
| 35 | CONFIG_SPARSE_IRQ=y | ||
| 36 | CONFIG_CALGARY_IOMMU=y | 40 | CONFIG_CALGARY_IOMMU=y |
| 37 | CONFIG_AMD_IOMMU=y | ||
| 38 | CONFIG_AMD_IOMMU_STATS=y | ||
| 39 | CONFIG_NR_CPUS=64 | 41 | CONFIG_NR_CPUS=64 |
| 40 | CONFIG_SCHED_SMT=y | 42 | CONFIG_SCHED_SMT=y |
| 41 | CONFIG_PREEMPT_VOLUNTARY=y | 43 | CONFIG_PREEMPT_VOLUNTARY=y |
| @@ -53,27 +55,22 @@ CONFIG_HZ_1000=y | |||
| 53 | CONFIG_KEXEC=y | 55 | CONFIG_KEXEC=y |
| 54 | CONFIG_CRASH_DUMP=y | 56 | CONFIG_CRASH_DUMP=y |
| 55 | # CONFIG_COMPAT_VDSO is not set | 57 | # CONFIG_COMPAT_VDSO is not set |
| 56 | CONFIG_PM=y | 58 | CONFIG_HIBERNATION=y |
| 57 | CONFIG_PM_DEBUG=y | 59 | CONFIG_PM_DEBUG=y |
| 58 | CONFIG_PM_TRACE_RTC=y | 60 | CONFIG_PM_TRACE_RTC=y |
| 59 | CONFIG_HIBERNATION=y | ||
| 60 | CONFIG_ACPI_PROCFS=y | 61 | CONFIG_ACPI_PROCFS=y |
| 61 | CONFIG_ACPI_DOCK=y | 62 | CONFIG_ACPI_DOCK=y |
| 62 | CONFIG_CPU_FREQ=y | 63 | CONFIG_CPU_FREQ=y |
| 63 | CONFIG_CPU_FREQ_DEBUG=y | ||
| 64 | # CONFIG_CPU_FREQ_STAT is not set | 64 | # CONFIG_CPU_FREQ_STAT is not set |
| 65 | CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y | 65 | CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y |
| 66 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y | 66 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y |
| 67 | CONFIG_CPU_FREQ_GOV_ONDEMAND=y | 67 | CONFIG_CPU_FREQ_GOV_ONDEMAND=y |
| 68 | CONFIG_X86_ACPI_CPUFREQ=y | 68 | CONFIG_X86_ACPI_CPUFREQ=y |
| 69 | CONFIG_PCI_MMCONFIG=y | 69 | CONFIG_PCI_MMCONFIG=y |
| 70 | CONFIG_INTEL_IOMMU=y | ||
| 71 | # CONFIG_INTEL_IOMMU_DEFAULT_ON is not set | ||
| 72 | CONFIG_PCIEPORTBUS=y | 70 | CONFIG_PCIEPORTBUS=y |
| 73 | CONFIG_PCCARD=y | 71 | CONFIG_PCCARD=y |
| 74 | CONFIG_YENTA=y | 72 | CONFIG_YENTA=y |
| 75 | CONFIG_HOTPLUG_PCI=y | 73 | CONFIG_HOTPLUG_PCI=y |
| 76 | CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y | ||
| 77 | CONFIG_BINFMT_MISC=y | 74 | CONFIG_BINFMT_MISC=y |
| 78 | CONFIG_IA32_EMULATION=y | 75 | CONFIG_IA32_EMULATION=y |
| 79 | CONFIG_NET=y | 76 | CONFIG_NET=y |
| @@ -125,7 +122,6 @@ CONFIG_NF_CONNTRACK_IPV4=y | |||
| 125 | CONFIG_IP_NF_IPTABLES=y | 122 | CONFIG_IP_NF_IPTABLES=y |
| 126 | CONFIG_IP_NF_FILTER=y | 123 | CONFIG_IP_NF_FILTER=y |
| 127 | CONFIG_IP_NF_TARGET_REJECT=y | 124 | CONFIG_IP_NF_TARGET_REJECT=y |
| 128 | CONFIG_IP_NF_TARGET_LOG=y | ||
| 129 | CONFIG_IP_NF_TARGET_ULOG=y | 125 | CONFIG_IP_NF_TARGET_ULOG=y |
| 130 | CONFIG_NF_NAT=y | 126 | CONFIG_NF_NAT=y |
| 131 | CONFIG_IP_NF_TARGET_MASQUERADE=y | 127 | CONFIG_IP_NF_TARGET_MASQUERADE=y |
| @@ -133,7 +129,6 @@ CONFIG_IP_NF_MANGLE=y | |||
| 133 | CONFIG_NF_CONNTRACK_IPV6=y | 129 | CONFIG_NF_CONNTRACK_IPV6=y |
| 134 | CONFIG_IP6_NF_IPTABLES=y | 130 | CONFIG_IP6_NF_IPTABLES=y |
| 135 | CONFIG_IP6_NF_MATCH_IPV6HEADER=y | 131 | CONFIG_IP6_NF_MATCH_IPV6HEADER=y |
| 136 | CONFIG_IP6_NF_TARGET_LOG=y | ||
| 137 | CONFIG_IP6_NF_FILTER=y | 132 | CONFIG_IP6_NF_FILTER=y |
| 138 | CONFIG_IP6_NF_TARGET_REJECT=y | 133 | CONFIG_IP6_NF_TARGET_REJECT=y |
| 139 | CONFIG_IP6_NF_MANGLE=y | 134 | CONFIG_IP6_NF_MANGLE=y |
| @@ -172,20 +167,15 @@ CONFIG_DM_ZERO=y | |||
| 172 | CONFIG_MACINTOSH_DRIVERS=y | 167 | CONFIG_MACINTOSH_DRIVERS=y |
| 173 | CONFIG_MAC_EMUMOUSEBTN=y | 168 | CONFIG_MAC_EMUMOUSEBTN=y |
| 174 | CONFIG_NETDEVICES=y | 169 | CONFIG_NETDEVICES=y |
| 175 | CONFIG_NET_ETHERNET=y | 170 | CONFIG_NETCONSOLE=y |
| 176 | CONFIG_NET_VENDOR_3COM=y | 171 | CONFIG_TIGON3=y |
| 177 | CONFIG_NET_TULIP=y | 172 | CONFIG_NET_TULIP=y |
| 178 | CONFIG_NET_PCI=y | ||
| 179 | CONFIG_FORCEDETH=y | ||
| 180 | CONFIG_E100=y | 173 | CONFIG_E100=y |
| 181 | CONFIG_8139TOO=y | ||
| 182 | CONFIG_E1000=y | 174 | CONFIG_E1000=y |
| 183 | CONFIG_SKY2=y | 175 | CONFIG_SKY2=y |
| 184 | CONFIG_TIGON3=y | 176 | CONFIG_FORCEDETH=y |
| 185 | CONFIG_TR=y | 177 | CONFIG_8139TOO=y |
| 186 | CONFIG_NET_PCMCIA=y | ||
| 187 | CONFIG_FDDI=y | 178 | CONFIG_FDDI=y |
| 188 | CONFIG_NETCONSOLE=y | ||
| 189 | CONFIG_INPUT_POLLDEV=y | 179 | CONFIG_INPUT_POLLDEV=y |
| 190 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | 180 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set |
| 191 | CONFIG_INPUT_EVDEV=y | 181 | CONFIG_INPUT_EVDEV=y |
| @@ -194,6 +184,7 @@ CONFIG_INPUT_TABLET=y | |||
| 194 | CONFIG_INPUT_TOUCHSCREEN=y | 184 | CONFIG_INPUT_TOUCHSCREEN=y |
| 195 | CONFIG_INPUT_MISC=y | 185 | CONFIG_INPUT_MISC=y |
| 196 | CONFIG_VT_HW_CONSOLE_BINDING=y | 186 | CONFIG_VT_HW_CONSOLE_BINDING=y |
| 187 | # CONFIG_LEGACY_PTYS is not set | ||
| 197 | CONFIG_SERIAL_NONSTANDARD=y | 188 | CONFIG_SERIAL_NONSTANDARD=y |
| 198 | CONFIG_SERIAL_8250=y | 189 | CONFIG_SERIAL_8250=y |
| 199 | CONFIG_SERIAL_8250_CONSOLE=y | 190 | CONFIG_SERIAL_8250_CONSOLE=y |
| @@ -203,7 +194,6 @@ CONFIG_SERIAL_8250_MANY_PORTS=y | |||
| 203 | CONFIG_SERIAL_8250_SHARE_IRQ=y | 194 | CONFIG_SERIAL_8250_SHARE_IRQ=y |
| 204 | CONFIG_SERIAL_8250_DETECT_IRQ=y | 195 | CONFIG_SERIAL_8250_DETECT_IRQ=y |
| 205 | CONFIG_SERIAL_8250_RSA=y | 196 | CONFIG_SERIAL_8250_RSA=y |
| 206 | # CONFIG_LEGACY_PTYS is not set | ||
| 207 | CONFIG_HW_RANDOM=y | 197 | CONFIG_HW_RANDOM=y |
| 208 | # CONFIG_HW_RANDOM_INTEL is not set | 198 | # CONFIG_HW_RANDOM_INTEL is not set |
| 209 | # CONFIG_HW_RANDOM_AMD is not set | 199 | # CONFIG_HW_RANDOM_AMD is not set |
| @@ -221,7 +211,6 @@ CONFIG_DRM_I915_KMS=y | |||
| 221 | CONFIG_FB_MODE_HELPERS=y | 211 | CONFIG_FB_MODE_HELPERS=y |
| 222 | CONFIG_FB_TILEBLITTING=y | 212 | CONFIG_FB_TILEBLITTING=y |
| 223 | CONFIG_FB_EFI=y | 213 | CONFIG_FB_EFI=y |
| 224 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 225 | # CONFIG_LCD_CLASS_DEVICE is not set | 214 | # CONFIG_LCD_CLASS_DEVICE is not set |
| 226 | CONFIG_VGACON_SOFT_SCROLLBACK=y | 215 | CONFIG_VGACON_SOFT_SCROLLBACK=y |
| 227 | CONFIG_LOGO=y | 216 | CONFIG_LOGO=y |
| @@ -268,6 +257,10 @@ CONFIG_RTC_CLASS=y | |||
| 268 | # CONFIG_RTC_HCTOSYS is not set | 257 | # CONFIG_RTC_HCTOSYS is not set |
| 269 | CONFIG_DMADEVICES=y | 258 | CONFIG_DMADEVICES=y |
| 270 | CONFIG_EEEPC_LAPTOP=y | 259 | 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 | ||
| 271 | CONFIG_EFI_VARS=y | 264 | CONFIG_EFI_VARS=y |
| 272 | CONFIG_EXT3_FS=y | 265 | CONFIG_EXT3_FS=y |
| 273 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set | 266 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
| @@ -284,7 +277,6 @@ CONFIG_ZISOFS=y | |||
| 284 | CONFIG_MSDOS_FS=y | 277 | CONFIG_MSDOS_FS=y |
| 285 | CONFIG_VFAT_FS=y | 278 | CONFIG_VFAT_FS=y |
| 286 | CONFIG_PROC_KCORE=y | 279 | CONFIG_PROC_KCORE=y |
| 287 | CONFIG_TMPFS=y | ||
| 288 | CONFIG_TMPFS_POSIX_ACL=y | 280 | CONFIG_TMPFS_POSIX_ACL=y |
| 289 | CONFIG_HUGETLBFS=y | 281 | CONFIG_HUGETLBFS=y |
| 290 | CONFIG_NFS_FS=y | 282 | CONFIG_NFS_FS=y |
| @@ -292,18 +284,6 @@ CONFIG_NFS_V3=y | |||
| 292 | CONFIG_NFS_V3_ACL=y | 284 | CONFIG_NFS_V3_ACL=y |
| 293 | CONFIG_NFS_V4=y | 285 | CONFIG_NFS_V4=y |
| 294 | CONFIG_ROOT_NFS=y | 286 | 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 | ||
| 307 | CONFIG_NLS_DEFAULT="utf8" | 287 | CONFIG_NLS_DEFAULT="utf8" |
| 308 | CONFIG_NLS_CODEPAGE_437=y | 288 | CONFIG_NLS_CODEPAGE_437=y |
| 309 | CONFIG_NLS_ASCII=y | 289 | CONFIG_NLS_ASCII=y |
| @@ -317,13 +297,12 @@ CONFIG_DEBUG_KERNEL=y | |||
| 317 | # CONFIG_SCHED_DEBUG is not set | 297 | # CONFIG_SCHED_DEBUG is not set |
| 318 | CONFIG_SCHEDSTATS=y | 298 | CONFIG_SCHEDSTATS=y |
| 319 | CONFIG_TIMER_STATS=y | 299 | CONFIG_TIMER_STATS=y |
| 320 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | 300 | CONFIG_DEBUG_STACK_USAGE=y |
| 321 | CONFIG_SYSCTL_SYSCALL_CHECK=y | 301 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
| 322 | CONFIG_BLK_DEV_IO_TRACE=y | 302 | CONFIG_BLK_DEV_IO_TRACE=y |
| 323 | CONFIG_PROVIDE_OHCI1394_DMA_INIT=y | 303 | CONFIG_PROVIDE_OHCI1394_DMA_INIT=y |
| 324 | CONFIG_EARLY_PRINTK_DBGP=y | 304 | CONFIG_EARLY_PRINTK_DBGP=y |
| 325 | CONFIG_DEBUG_STACKOVERFLOW=y | 305 | CONFIG_DEBUG_STACKOVERFLOW=y |
| 326 | CONFIG_DEBUG_STACK_USAGE=y | ||
| 327 | # CONFIG_DEBUG_RODATA_TEST is not set | 306 | # CONFIG_DEBUG_RODATA_TEST is not set |
| 328 | CONFIG_DEBUG_NX_TEST=m | 307 | CONFIG_DEBUG_NX_TEST=m |
| 329 | CONFIG_DEBUG_BOOT_PARAMS=y | 308 | CONFIG_DEBUG_BOOT_PARAMS=y |
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index 4b2caeefe1a2..d85410171260 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
| @@ -534,7 +534,7 @@ static inline unsigned int read_apic_id(void) | |||
| 534 | 534 | ||
| 535 | static inline int default_apic_id_valid(int apicid) | 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 | extern void default_setup_apic_routing(void); | 540 | extern void default_setup_apic_routing(void); |
diff --git a/arch/x86/include/asm/idle.h b/arch/x86/include/asm/idle.h index f49253d75710..c5d1785373ed 100644 --- a/arch/x86/include/asm/idle.h +++ b/arch/x86/include/asm/idle.h | |||
| @@ -14,6 +14,7 @@ void exit_idle(void); | |||
| 14 | #else /* !CONFIG_X86_64 */ | 14 | #else /* !CONFIG_X86_64 */ |
| 15 | static inline void enter_idle(void) { } | 15 | static inline void enter_idle(void) { } |
| 16 | static inline void exit_idle(void) { } | 16 | static inline void exit_idle(void) { } |
| 17 | static inline void __exit_idle(void) { } | ||
| 17 | #endif /* CONFIG_X86_64 */ | 18 | #endif /* CONFIG_X86_64 */ |
| 18 | 19 | ||
| 19 | void amd_e400_remove_cpu(int cpu); | 20 | void amd_e400_remove_cpu(int cpu); |
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index 690d1cc9a877..2c4943de5150 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
| @@ -21,6 +21,15 @@ | |||
| 21 | #define IO_APIC_REDIR_LEVEL_TRIGGER (1 << 15) | 21 | #define IO_APIC_REDIR_LEVEL_TRIGGER (1 << 15) |
| 22 | #define IO_APIC_REDIR_MASKED (1 << 16) | 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 | * The structure of the IO-APIC: | 34 | * The structure of the IO-APIC: |
| 26 | */ | 35 | */ |
diff --git a/arch/x86/include/asm/x2apic.h b/arch/x86/include/asm/x2apic.h index 6bf5b8e478c0..92e54abf89e0 100644 --- a/arch/x86/include/asm/x2apic.h +++ b/arch/x86/include/asm/x2apic.h | |||
| @@ -18,6 +18,11 @@ static const struct cpumask *x2apic_target_cpus(void) | |||
| 18 | return cpu_online_mask; | 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 | static int x2apic_apic_id_registered(void) | 26 | static int x2apic_apic_id_registered(void) |
| 22 | { | 27 | { |
| 23 | return 1; | 28 | return 1; |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 406ed77216d0..0f42c2f44311 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -239,7 +239,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) | |||
| 239 | * to not preallocating memory for all NR_CPUS | 239 | * to not preallocating memory for all NR_CPUS |
| 240 | * when we use CPU hotplug. | 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 | printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); | 243 | printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); |
| 244 | else | 244 | else |
| 245 | acpi_register_lapic(apic_id, enabled); | 245 | acpi_register_lapic(apic_id, enabled); |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 2eec05b6d1b8..11544d8f1e97 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
| @@ -383,20 +383,25 @@ static inline int eilvt_entry_is_changeable(unsigned int old, unsigned int new) | |||
| 383 | 383 | ||
| 384 | static unsigned int reserve_eilvt_offset(int offset, unsigned int new) | 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 | if (offset >= APIC_EILVT_NR_MAX) | 388 | if (offset >= APIC_EILVT_NR_MAX) |
| 389 | return ~0; | 389 | return ~0; |
| 390 | 390 | ||
| 391 | rsvd = atomic_read(&eilvt_offsets[offset]) & ~APIC_EILVT_MASKED; | 391 | rsvd = atomic_read(&eilvt_offsets[offset]); |
| 392 | do { | 392 | do { |
| 393 | if (rsvd && | 393 | vector = rsvd & ~APIC_EILVT_MASKED; /* 0: unassigned */ |
| 394 | !eilvt_entry_is_changeable(rsvd, new)) | 394 | if (vector && !eilvt_entry_is_changeable(vector, new)) |
| 395 | /* may not change if vectors are different */ | 395 | /* may not change if vectors are different */ |
| 396 | return rsvd; | 396 | return rsvd; |
| 397 | rsvd = atomic_cmpxchg(&eilvt_offsets[offset], rsvd, new); | 397 | rsvd = atomic_cmpxchg(&eilvt_offsets[offset], rsvd, new); |
| 398 | } while (rsvd != new); | 398 | } while (rsvd != new); |
| 399 | 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); | ||
| 404 | |||
| 400 | return new; | 405 | return new; |
| 401 | } | 406 | } |
| 402 | 407 | ||
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c index d9ea5f331ac5..899803e03214 100644 --- a/arch/x86/kernel/apic/apic_numachip.c +++ b/arch/x86/kernel/apic/apic_numachip.c | |||
| @@ -229,11 +229,10 @@ static int __init numachip_system_init(void) | |||
| 229 | } | 229 | } |
| 230 | early_initcall(numachip_system_init); | 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 | if (!strncmp(oem_id, "NUMASC", 6)) { | 234 | if (!strncmp(oem_id, "NUMASC", 6)) { |
| 235 | numachip_system = 1; | 235 | numachip_system = 1; |
| 236 | setup_force_cpu_cap(X86_FEATURE_X2APIC); | ||
| 237 | return 1; | 236 | return 1; |
| 238 | } | 237 | } |
| 239 | 238 | ||
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 6d10a66fc5a9..e88300d8e80a 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -64,9 +64,28 @@ | |||
| 64 | #include <asm/apic.h> | 64 | #include <asm/apic.h> |
| 65 | 65 | ||
| 66 | #define __apicdebuginit(type) static type __init | 66 | #define __apicdebuginit(type) static type __init |
| 67 | |||
| 67 | #define for_each_irq_pin(entry, head) \ | 68 | #define for_each_irq_pin(entry, head) \ |
| 68 | for (entry = head; entry; entry = entry->next) | 69 | for (entry = head; entry; entry = entry->next) |
| 69 | 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 | } | ||
| 88 | |||
| 70 | /* | 89 | /* |
| 71 | * Is the SiS APIC rmw bug present ? | 90 | * Is the SiS APIC rmw bug present ? |
| 72 | * -1 = don't know, 0 = no, 1 = yes | 91 | * -1 = don't know, 0 = no, 1 = yes |
| @@ -294,6 +313,22 @@ static void free_irq_at(unsigned int at, struct irq_cfg *cfg) | |||
| 294 | irq_free_desc(at); | 313 | irq_free_desc(at); |
| 295 | } | 314 | } |
| 296 | 315 | ||
| 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 | |||
| 297 | struct io_apic { | 332 | struct io_apic { |
| 298 | unsigned int index; | 333 | unsigned int index; |
| 299 | unsigned int unused[3]; | 334 | unsigned int unused[3]; |
| @@ -314,16 +349,17 @@ static inline void io_apic_eoi(unsigned int apic, unsigned int vector) | |||
| 314 | writel(vector, &io_apic->eoi); | 349 | writel(vector, &io_apic->eoi); |
| 315 | } | 350 | } |
| 316 | 351 | ||
| 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) |
| 318 | { | 353 | { |
| 319 | struct io_apic __iomem *io_apic = io_apic_base(apic); | 354 | struct io_apic __iomem *io_apic = io_apic_base(apic); |
| 320 | writel(reg, &io_apic->index); | 355 | writel(reg, &io_apic->index); |
| 321 | return readl(&io_apic->data); | 356 | return readl(&io_apic->data); |
| 322 | } | 357 | } |
| 323 | 358 | ||
| 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) |
| 325 | { | 360 | { |
| 326 | struct io_apic __iomem *io_apic = io_apic_base(apic); | 361 | struct io_apic __iomem *io_apic = io_apic_base(apic); |
| 362 | |||
| 327 | writel(reg, &io_apic->index); | 363 | writel(reg, &io_apic->index); |
| 328 | writel(value, &io_apic->data); | 364 | writel(value, &io_apic->data); |
| 329 | } | 365 | } |
| @@ -334,7 +370,7 @@ static inline void io_apic_write(unsigned int apic, unsigned int reg, unsigned i | |||
| 334 | * | 370 | * |
| 335 | * Older SiS APIC requires we rewrite the index register | 371 | * Older SiS APIC requires we rewrite the index register |
| 336 | */ | 372 | */ |
| 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) |
| 338 | { | 374 | { |
| 339 | struct io_apic __iomem *io_apic = io_apic_base(apic); | 375 | struct io_apic __iomem *io_apic = io_apic_base(apic); |
| 340 | 376 | ||
| @@ -377,6 +413,7 @@ static struct IO_APIC_route_entry __ioapic_read_entry(int apic, int pin) | |||
| 377 | 413 | ||
| 378 | eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); | 414 | eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); |
| 379 | eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); | 415 | eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); |
| 416 | |||
| 380 | return eu.entry; | 417 | return eu.entry; |
| 381 | } | 418 | } |
| 382 | 419 | ||
| @@ -384,9 +421,11 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) | |||
| 384 | { | 421 | { |
| 385 | union entry_union eu; | 422 | union entry_union eu; |
| 386 | unsigned long flags; | 423 | unsigned long flags; |
| 424 | |||
| 387 | raw_spin_lock_irqsave(&ioapic_lock, flags); | 425 | raw_spin_lock_irqsave(&ioapic_lock, flags); |
| 388 | eu.entry = __ioapic_read_entry(apic, pin); | 426 | eu.entry = __ioapic_read_entry(apic, pin); |
| 389 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); | 427 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); |
| 428 | |||
| 390 | return eu.entry; | 429 | return eu.entry; |
| 391 | } | 430 | } |
| 392 | 431 | ||
| @@ -396,8 +435,7 @@ static struct IO_APIC_route_entry ioapic_read_entry(int apic, int pin) | |||
| 396 | * the interrupt, and we need to make sure the entry is fully populated | 435 | * the interrupt, and we need to make sure the entry is fully populated |
| 397 | * before that happens. | 436 | * before that happens. |
| 398 | */ | 437 | */ |
| 399 | static void | 438 | static void __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) |
| 400 | __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) | ||
| 401 | { | 439 | { |
| 402 | union entry_union eu = {{0, 0}}; | 440 | union entry_union eu = {{0, 0}}; |
| 403 | 441 | ||
| @@ -409,6 +447,7 @@ __ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) | |||
| 409 | static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) | 447 | static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) |
| 410 | { | 448 | { |
| 411 | unsigned long flags; | 449 | unsigned long flags; |
| 450 | |||
| 412 | raw_spin_lock_irqsave(&ioapic_lock, flags); | 451 | raw_spin_lock_irqsave(&ioapic_lock, flags); |
| 413 | __ioapic_write_entry(apic, pin, e); | 452 | __ioapic_write_entry(apic, pin, e); |
| 414 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); | 453 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); |
| @@ -435,8 +474,7 @@ static void ioapic_mask_entry(int apic, int pin) | |||
| 435 | * shared ISA-space IRQs, so we have to support them. We are super | 474 | * shared ISA-space IRQs, so we have to support them. We are super |
| 436 | * fast in the common case, and fast for shared ISA-space IRQs. | 475 | * fast in the common case, and fast for shared ISA-space IRQs. |
| 437 | */ | 476 | */ |
| 438 | static int | 477 | static int __add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin) |
| 439 | __add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin) | ||
| 440 | { | 478 | { |
| 441 | struct irq_pin_list **last, *entry; | 479 | struct irq_pin_list **last, *entry; |
| 442 | 480 | ||
| @@ -521,6 +559,7 @@ static void io_apic_sync(struct irq_pin_list *entry) | |||
| 521 | * a dummy read from the IO-APIC | 559 | * a dummy read from the IO-APIC |
| 522 | */ | 560 | */ |
| 523 | struct io_apic __iomem *io_apic; | 561 | struct io_apic __iomem *io_apic; |
| 562 | |||
| 524 | io_apic = io_apic_base(entry->apic); | 563 | io_apic = io_apic_base(entry->apic); |
| 525 | readl(&io_apic->data); | 564 | readl(&io_apic->data); |
| 526 | } | 565 | } |
| @@ -2512,21 +2551,73 @@ static void ack_apic_edge(struct irq_data *data) | |||
| 2512 | 2551 | ||
| 2513 | atomic_t irq_mis_count; | 2552 | atomic_t irq_mis_count; |
| 2514 | 2553 | ||
| 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); | ||
| 2522 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 2554 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
| 2555 | static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg) | ||
| 2556 | { | ||
| 2523 | /* If we are moving the irq we need to mask it */ | 2557 | /* If we are moving the irq we need to mask it */ |
| 2524 | if (unlikely(irqd_is_setaffinity_pending(data))) { | 2558 | if (unlikely(irqd_is_setaffinity_pending(data))) { |
| 2525 | do_unmask_irq = 1; | ||
| 2526 | mask_ioapic(cfg); | 2559 | mask_ioapic(cfg); |
| 2560 | return true; | ||
| 2527 | } | 2561 | } |
| 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 | } | ||
| 2528 | #endif | 2609 | #endif |
| 2529 | 2610 | ||
| 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 | |||
| 2530 | /* | 2621 | /* |
| 2531 | * It appears there is an erratum which affects at least version 0x11 | 2622 | * It appears there is an erratum which affects at least version 0x11 |
| 2532 | * of I/O APIC (that's the 82093AA and cores integrated into various | 2623 | * 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) | |||
| 2581 | eoi_ioapic_irq(irq, cfg); | 2672 | eoi_ioapic_irq(irq, cfg); |
| 2582 | } | 2673 | } |
| 2583 | 2674 | ||
| 2584 | /* Now we can move and renable the irq */ | 2675 | ioapic_irqd_unmask(data, cfg, masked); |
| 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 | } | ||
| 2616 | } | 2676 | } |
| 2617 | 2677 | ||
| 2618 | #ifdef CONFIG_IRQ_REMAP | 2678 | #ifdef CONFIG_IRQ_REMAP |
| @@ -3873,6 +3933,11 @@ static struct resource * __init ioapic_setup_resources(int nr_ioapics) | |||
| 3873 | 3933 | ||
| 3874 | void __init ioapic_and_gsi_init(void) | 3934 | void __init ioapic_and_gsi_init(void) |
| 3875 | { | 3935 | { |
| 3936 | io_apic_ops.init(); | ||
| 3937 | } | ||
| 3938 | |||
| 3939 | static void __init __ioapic_init_mappings(void) | ||
| 3940 | { | ||
| 3876 | unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0; | 3941 | unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0; |
| 3877 | struct resource *ioapic_res; | 3942 | struct resource *ioapic_res; |
| 3878 | int i; | 3943 | int i; |
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index 9193713060a9..48f3103b3c93 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
| @@ -213,7 +213,7 @@ static struct apic apic_x2apic_cluster = { | |||
| 213 | .name = "cluster x2apic", | 213 | .name = "cluster x2apic", |
| 214 | .probe = x2apic_cluster_probe, | 214 | .probe = x2apic_cluster_probe, |
| 215 | .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, | 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 | .apic_id_registered = x2apic_apic_id_registered, | 217 | .apic_id_registered = x2apic_apic_id_registered, |
| 218 | 218 | ||
| 219 | .irq_delivery_mode = dest_LowestPrio, | 219 | .irq_delivery_mode = dest_LowestPrio, |
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index bcd1db6eaca9..8a778db45e3a 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c | |||
| @@ -119,7 +119,7 @@ static struct apic apic_x2apic_phys = { | |||
| 119 | .name = "physical x2apic", | 119 | .name = "physical x2apic", |
| 120 | .probe = x2apic_phys_probe, | 120 | .probe = x2apic_phys_probe, |
| 121 | .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, | 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 | .apic_id_registered = x2apic_apic_id_registered, | 123 | .apic_id_registered = x2apic_apic_id_registered, |
| 124 | 124 | ||
| 125 | .irq_delivery_mode = dest_Fixed, | 125 | .irq_delivery_mode = dest_Fixed, |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index fc4771425852..87bfa69e216e 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
| @@ -266,6 +266,11 @@ static void uv_send_IPI_all(int vector) | |||
| 266 | uv_send_IPI_mask(cpu_online_mask, vector); | 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 | static int uv_apic_id_registered(void) | 274 | static int uv_apic_id_registered(void) |
| 270 | { | 275 | { |
| 271 | return 1; | 276 | return 1; |
| @@ -351,7 +356,7 @@ static struct apic __refdata apic_x2apic_uv_x = { | |||
| 351 | .name = "UV large system", | 356 | .name = "UV large system", |
| 352 | .probe = uv_probe, | 357 | .probe = uv_probe, |
| 353 | .acpi_madt_oem_check = uv_acpi_madt_oem_check, | 358 | .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, |
| 355 | .apic_id_registered = uv_apic_id_registered, | 360 | .apic_id_registered = uv_apic_id_registered, |
| 356 | 361 | ||
| 357 | .irq_delivery_mode = dest_Fixed, | 362 | .irq_delivery_mode = dest_Fixed, |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index e49477444fff..67e258362a3d 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
| @@ -999,7 +999,7 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) | |||
| 999 | else | 999 | else |
| 1000 | printk(KERN_CONT "\n"); | 1000 | printk(KERN_CONT "\n"); |
| 1001 | 1001 | ||
| 1002 | __print_cpu_msr(); | 1002 | print_cpu_msr(c); |
| 1003 | } | 1003 | } |
| 1004 | 1004 | ||
| 1005 | void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c) | 1005 | void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c) |
diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c index 4025fe4f928f..90bf130f09bc 100644 --- a/arch/x86/kernel/dumpstack.c +++ b/arch/x86/kernel/dumpstack.c | |||
| @@ -37,13 +37,16 @@ print_ftrace_graph_addr(unsigned long addr, void *data, | |||
| 37 | const struct stacktrace_ops *ops, | 37 | const struct stacktrace_ops *ops, |
| 38 | struct thread_info *tinfo, int *graph) | 38 | struct thread_info *tinfo, int *graph) |
| 39 | { | 39 | { |
| 40 | struct task_struct *task = tinfo->task; | 40 | struct task_struct *task; |
| 41 | unsigned long ret_addr; | 41 | unsigned long ret_addr; |
| 42 | int index = task->curr_ret_stack; | 42 | int index; |
| 43 | 43 | ||
| 44 | if (addr != (unsigned long)return_to_handler) | 44 | if (addr != (unsigned long)return_to_handler) |
| 45 | return; | 45 | return; |
| 46 | 46 | ||
| 47 | task = tinfo->task; | ||
| 48 | index = task->curr_ret_stack; | ||
| 49 | |||
| 47 | if (!task->ret_stack || index < *graph) | 50 | if (!task->ret_stack || index < *graph) |
| 48 | return; | 51 | return; |
| 49 | 52 | ||
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 9b24f36eb55f..a33afaa5ddb7 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
| @@ -12,6 +12,9 @@ | |||
| 12 | #include <linux/user-return-notifier.h> | 12 | #include <linux/user-return-notifier.h> |
| 13 | #include <linux/dmi.h> | 13 | #include <linux/dmi.h> |
| 14 | #include <linux/utsname.h> | 14 | #include <linux/utsname.h> |
| 15 | #include <linux/stackprotector.h> | ||
| 16 | #include <linux/tick.h> | ||
| 17 | #include <linux/cpuidle.h> | ||
| 15 | #include <trace/events/power.h> | 18 | #include <trace/events/power.h> |
| 16 | #include <linux/hw_breakpoint.h> | 19 | #include <linux/hw_breakpoint.h> |
| 17 | #include <asm/cpu.h> | 20 | #include <asm/cpu.h> |
| @@ -22,6 +25,24 @@ | |||
| 22 | #include <asm/i387.h> | 25 | #include <asm/i387.h> |
| 23 | #include <asm/fpu-internal.h> | 26 | #include <asm/fpu-internal.h> |
| 24 | #include <asm/debugreg.h> | 27 | #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 | ||
| 25 | 46 | ||
| 26 | struct kmem_cache *task_xstate_cachep; | 47 | struct kmem_cache *task_xstate_cachep; |
| 27 | EXPORT_SYMBOL_GPL(task_xstate_cachep); | 48 | EXPORT_SYMBOL_GPL(task_xstate_cachep); |
| @@ -370,6 +391,99 @@ static inline int hlt_use_halt(void) | |||
| 370 | } | 391 | } |
| 371 | #endif | 392 | #endif |
| 372 | 393 | ||
| 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 | |||
| 373 | /* | 487 | /* |
| 374 | * We use this if we don't have any better | 488 | * We use this if we don't have any better |
| 375 | * idle routine.. | 489 | * idle routine.. |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index aae4f4bbbe88..ae6847303e26 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | * This file handles the architecture-dependent parts of process handling.. | 9 | * This file handles the architecture-dependent parts of process handling.. |
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/stackprotector.h> | ||
| 13 | #include <linux/cpu.h> | 12 | #include <linux/cpu.h> |
| 14 | #include <linux/errno.h> | 13 | #include <linux/errno.h> |
| 15 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| @@ -31,14 +30,12 @@ | |||
| 31 | #include <linux/kallsyms.h> | 30 | #include <linux/kallsyms.h> |
| 32 | #include <linux/ptrace.h> | 31 | #include <linux/ptrace.h> |
| 33 | #include <linux/personality.h> | 32 | #include <linux/personality.h> |
| 34 | #include <linux/tick.h> | ||
| 35 | #include <linux/percpu.h> | 33 | #include <linux/percpu.h> |
| 36 | #include <linux/prctl.h> | 34 | #include <linux/prctl.h> |
| 37 | #include <linux/ftrace.h> | 35 | #include <linux/ftrace.h> |
| 38 | #include <linux/uaccess.h> | 36 | #include <linux/uaccess.h> |
| 39 | #include <linux/io.h> | 37 | #include <linux/io.h> |
| 40 | #include <linux/kdebug.h> | 38 | #include <linux/kdebug.h> |
| 41 | #include <linux/cpuidle.h> | ||
| 42 | 39 | ||
| 43 | #include <asm/pgtable.h> | 40 | #include <asm/pgtable.h> |
| 44 | #include <asm/ldt.h> | 41 | #include <asm/ldt.h> |
| @@ -57,7 +54,6 @@ | |||
| 57 | #include <asm/idle.h> | 54 | #include <asm/idle.h> |
| 58 | #include <asm/syscalls.h> | 55 | #include <asm/syscalls.h> |
| 59 | #include <asm/debugreg.h> | 56 | #include <asm/debugreg.h> |
| 60 | #include <asm/nmi.h> | ||
| 61 | #include <asm/switch_to.h> | 57 | #include <asm/switch_to.h> |
| 62 | 58 | ||
| 63 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); | 59 | asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); |
| @@ -70,60 +66,6 @@ unsigned long thread_saved_pc(struct task_struct *tsk) | |||
| 70 | return ((unsigned long *)tsk->thread.sp)[3]; | 66 | return ((unsigned long *)tsk->thread.sp)[3]; |
| 71 | } | 67 | } |
| 72 | 68 | ||
| 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 | |||
| 127 | void __show_regs(struct pt_regs *regs, int all) | 69 | void __show_regs(struct pt_regs *regs, int all) |
| 128 | { | 70 | { |
| 129 | unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; | 71 | unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 61270e8d428a..2b154da0b6d3 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | * This file handles the architecture-dependent parts of process handling.. | 14 | * This file handles the architecture-dependent parts of process handling.. |
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include <linux/stackprotector.h> | ||
| 18 | #include <linux/cpu.h> | 17 | #include <linux/cpu.h> |
| 19 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
| 20 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
| @@ -32,12 +31,10 @@ | |||
| 32 | #include <linux/notifier.h> | 31 | #include <linux/notifier.h> |
| 33 | #include <linux/kprobes.h> | 32 | #include <linux/kprobes.h> |
| 34 | #include <linux/kdebug.h> | 33 | #include <linux/kdebug.h> |
| 35 | #include <linux/tick.h> | ||
| 36 | #include <linux/prctl.h> | 34 | #include <linux/prctl.h> |
| 37 | #include <linux/uaccess.h> | 35 | #include <linux/uaccess.h> |
| 38 | #include <linux/io.h> | 36 | #include <linux/io.h> |
| 39 | #include <linux/ftrace.h> | 37 | #include <linux/ftrace.h> |
| 40 | #include <linux/cpuidle.h> | ||
| 41 | 38 | ||
| 42 | #include <asm/pgtable.h> | 39 | #include <asm/pgtable.h> |
| 43 | #include <asm/processor.h> | 40 | #include <asm/processor.h> |
| @@ -51,115 +48,11 @@ | |||
| 51 | #include <asm/idle.h> | 48 | #include <asm/idle.h> |
| 52 | #include <asm/syscalls.h> | 49 | #include <asm/syscalls.h> |
| 53 | #include <asm/debugreg.h> | 50 | #include <asm/debugreg.h> |
| 54 | #include <asm/nmi.h> | ||
| 55 | #include <asm/switch_to.h> | 51 | #include <asm/switch_to.h> |
| 56 | 52 | ||
| 57 | asmlinkage extern void ret_from_fork(void); | 53 | asmlinkage extern void ret_from_fork(void); |
| 58 | 54 | ||
| 59 | DEFINE_PER_CPU(unsigned long, old_rsp); | 55 | 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 | } | ||
| 163 | 56 | ||
| 164 | /* Prints also some state that isn't saved in the pt_regs */ | 57 | /* Prints also some state that isn't saved in the pt_regs */ |
| 165 | void __show_regs(struct pt_regs *regs, int all) | 58 | void __show_regs(struct pt_regs *regs, int all) |
diff --git a/arch/x86/kernel/tls.c b/arch/x86/kernel/tls.c index 73920e4c6dc5..9d9d2f9e77a5 100644 --- a/arch/x86/kernel/tls.c +++ b/arch/x86/kernel/tls.c | |||
| @@ -162,7 +162,7 @@ int regset_tls_get(struct task_struct *target, const struct user_regset *regset, | |||
| 162 | { | 162 | { |
| 163 | const struct desc_struct *tls; | 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 | (pos % sizeof(struct user_desc)) != 0 || | 166 | (pos % sizeof(struct user_desc)) != 0 || |
| 167 | (count % sizeof(struct user_desc)) != 0) | 167 | (count % sizeof(struct user_desc)) != 0) |
| 168 | return -EINVAL; | 168 | return -EINVAL; |
| @@ -197,7 +197,7 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset, | |||
| 197 | struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES]; | 197 | struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES]; |
| 198 | const struct user_desc *info; | 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 | (pos % sizeof(struct user_desc)) != 0 || | 201 | (pos % sizeof(struct user_desc)) != 0 || |
| 202 | (count % sizeof(struct user_desc)) != 0) | 202 | (count % sizeof(struct user_desc)) != 0) |
| 203 | return -EINVAL; | 203 | return -EINVAL; |
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index 1c1c4f46a7c1..efb5b4b93711 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c | |||
| @@ -70,7 +70,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) | |||
| 70 | return; | 70 | return; |
| 71 | pxm = pa->proximity_domain; | 71 | pxm = pa->proximity_domain; |
| 72 | apic_id = pa->apic_id; | 72 | apic_id = pa->apic_id; |
| 73 | if (!cpu_has_x2apic && (apic_id >= 0xff)) { | 73 | if (!apic->apic_id_valid(apic_id)) { |
| 74 | printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n", | 74 | printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n", |
| 75 | pxm, apic_id); | 75 | pxm, apic_id); |
| 76 | return; | 76 | return; |
diff --git a/arch/x86/platform/olpc/olpc.c b/arch/x86/platform/olpc/olpc.c index 7cce722667b8..a4bee53c2e54 100644 --- a/arch/x86/platform/olpc/olpc.c +++ b/arch/x86/platform/olpc/olpc.c | |||
| @@ -20,6 +20,8 @@ | |||
| 20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
| 21 | #include <linux/of.h> | 21 | #include <linux/of.h> |
| 22 | #include <linux/syscore_ops.h> | 22 | #include <linux/syscore_ops.h> |
| 23 | #include <linux/debugfs.h> | ||
| 24 | #include <linux/mutex.h> | ||
| 23 | 25 | ||
| 24 | #include <asm/geode.h> | 26 | #include <asm/geode.h> |
| 25 | #include <asm/setup.h> | 27 | #include <asm/setup.h> |
| @@ -31,6 +33,15 @@ EXPORT_SYMBOL_GPL(olpc_platform_info); | |||
| 31 | 33 | ||
| 32 | static DEFINE_SPINLOCK(ec_lock); | 34 | static DEFINE_SPINLOCK(ec_lock); |
| 33 | 35 | ||
| 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 | |||
| 34 | /* EC event mask to be applied during suspend (defining wakeup sources). */ | 45 | /* EC event mask to be applied during suspend (defining wakeup sources). */ |
| 35 | static u16 ec_wakeup_mask; | 46 | static u16 ec_wakeup_mask; |
| 36 | 47 | ||
| @@ -269,6 +280,91 @@ int olpc_ec_sci_query(u16 *sci_value) | |||
| 269 | } | 280 | } |
| 270 | EXPORT_SYMBOL_GPL(olpc_ec_sci_query); | 281 | EXPORT_SYMBOL_GPL(olpc_ec_sci_query); |
| 271 | 282 | ||
| 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 | |||
| 272 | static int olpc_ec_suspend(void) | 368 | static int olpc_ec_suspend(void) |
| 273 | { | 369 | { |
| 274 | return olpc_ec_mask_write(ec_wakeup_mask); | 370 | return olpc_ec_mask_write(ec_wakeup_mask); |
| @@ -372,6 +468,7 @@ static int __init olpc_init(void) | |||
| 372 | } | 468 | } |
| 373 | 469 | ||
| 374 | register_syscore_ops(&olpc_syscore_ops); | 470 | register_syscore_ops(&olpc_syscore_ops); |
| 471 | setup_debugfs(); | ||
| 375 | 472 | ||
| 376 | return 0; | 473 | return 0; |
| 377 | } | 474 | } |
diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig index f932b30b47fb..ddab37b24741 100644 --- a/arch/xtensa/configs/iss_defconfig +++ b/arch/xtensa/configs/iss_defconfig | |||
| @@ -113,7 +113,7 @@ CONFIG_DEFAULT_IOSCHED="noop" | |||
| 113 | # CONFIG_INLINE_SPIN_LOCK_BH is not set | 113 | # CONFIG_INLINE_SPIN_LOCK_BH is not set |
| 114 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set | 114 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set |
| 115 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set | 115 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set |
| 116 | CONFIG_INLINE_SPIN_UNLOCK=y | 116 | # CONFIG_UNINLINE_SPIN_UNLOCK is not set |
| 117 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set | 117 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set |
| 118 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y | 118 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y |
| 119 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set | 119 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index e253ccd7a604..51df117abe46 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -67,7 +67,7 @@ _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags) | |||
| 67 | #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) | 67 | #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) |
| 68 | #endif | 68 | #endif |
| 69 | 69 | ||
| 70 | #ifdef CONFIG_INLINE_SPIN_UNLOCK | 70 | #ifndef CONFIG_UNINLINE_SPIN_UNLOCK |
| 71 | #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) | 71 | #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) |
| 72 | #endif | 72 | #endif |
| 73 | 73 | ||
diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks index 5068e2a4e75f..2251882daf53 100644 --- a/kernel/Kconfig.locks +++ b/kernel/Kconfig.locks | |||
| @@ -124,8 +124,8 @@ config INLINE_SPIN_LOCK_IRQSAVE | |||
| 124 | def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \ | 124 | def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \ |
| 125 | ARCH_INLINE_SPIN_LOCK_IRQSAVE | 125 | ARCH_INLINE_SPIN_LOCK_IRQSAVE |
| 126 | 126 | ||
| 127 | config INLINE_SPIN_UNLOCK | 127 | config UNINLINE_SPIN_UNLOCK |
| 128 | def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK) | 128 | bool |
| 129 | 129 | ||
| 130 | config INLINE_SPIN_UNLOCK_BH | 130 | config INLINE_SPIN_UNLOCK_BH |
| 131 | def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH | 131 | def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH |
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt index 24e7cb0ba26a..3f9c97419f02 100644 --- a/kernel/Kconfig.preempt +++ b/kernel/Kconfig.preempt | |||
| @@ -36,6 +36,7 @@ config PREEMPT_VOLUNTARY | |||
| 36 | config PREEMPT | 36 | config PREEMPT |
| 37 | bool "Preemptible Kernel (Low-Latency Desktop)" | 37 | bool "Preemptible Kernel (Low-Latency Desktop)" |
| 38 | select PREEMPT_COUNT | 38 | select PREEMPT_COUNT |
| 39 | select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK | ||
| 39 | help | 40 | help |
| 40 | This option reduces the latency of the kernel by making | 41 | This option reduces the latency of the kernel by making |
| 41 | all kernel code (that is not executing in a critical section) | 42 | all kernel code (that is not executing in a critical section) |
diff --git a/kernel/spinlock.c b/kernel/spinlock.c index 84c7d96918bf..5cdd8065a3ce 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c | |||
| @@ -163,7 +163,7 @@ void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock) | |||
| 163 | EXPORT_SYMBOL(_raw_spin_lock_bh); | 163 | EXPORT_SYMBOL(_raw_spin_lock_bh); |
| 164 | #endif | 164 | #endif |
| 165 | 165 | ||
| 166 | #ifndef CONFIG_INLINE_SPIN_UNLOCK | 166 | #ifdef CONFIG_UNINLINE_SPIN_UNLOCK |
| 167 | void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) | 167 | void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) |
| 168 | { | 168 | { |
| 169 | __raw_spin_unlock(lock); | 169 | __raw_spin_unlock(lock); |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index f7af95d304c5..6777153f18f3 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
| @@ -499,6 +499,7 @@ config RT_MUTEX_TESTER | |||
| 499 | config DEBUG_SPINLOCK | 499 | config DEBUG_SPINLOCK |
| 500 | bool "Spinlock and rw-lock debugging: basic checks" | 500 | bool "Spinlock and rw-lock debugging: basic checks" |
| 501 | depends on DEBUG_KERNEL | 501 | depends on DEBUG_KERNEL |
| 502 | select UNINLINE_SPIN_UNLOCK | ||
| 502 | help | 503 | help |
| 503 | Say Y here and build SMP to catch missing spinlock initialization | 504 | Say Y here and build SMP to catch missing spinlock initialization |
| 504 | and certain other kinds of spinlock errors commonly made. This is | 505 | and certain other kinds of spinlock errors commonly made. This is |
