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
Unified · Split
| @@ -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. | |
| @@ -133,7 +133,7 @@ CONFIG_BLK_DEV_BSG=y · 132 unmodified lines | ||
| 133 | 133 | CONFIG_IOSCHED_NOOP=y |
| 134 | 134 | CONFIG_DEFAULT_NOOP=y |
| 135 | 135 | CONFIG_DEFAULT_IOSCHED="noop" |
| 136 | −CONFIG_INLINE_SPIN_UNLOCK=y | |
| 136 | +# CONFIG_UNINLINE_SPIN_UNLOCK is not set | |
| 137 | 137 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y |
| 138 | 138 | CONFIG_INLINE_READ_UNLOCK=y |
| 139 | 139 | CONFIG_INLINE_READ_UNLOCK_IRQ=y |
| @@ -15,23 +15,28 @@ CONFIG_CPUSETS=y · 14 unmodified lines | ||
| 15 | 15 | CONFIG_CGROUP_CPUACCT=y |
| 16 | 16 | CONFIG_RESOURCE_COUNTERS=y |
| 17 | 17 | CONFIG_CGROUP_SCHED=y |
| 18 | −CONFIG_UTS_NS=y | |
| 19 | −CONFIG_IPC_NS=y | |
| 20 | −CONFIG_USER_NS=y | |
| 21 | −CONFIG_PID_NS=y | |
| 22 | −CONFIG_NET_NS=y | |
| 23 | 18 | CONFIG_BLK_DEV_INITRD=y |
| 24 | −CONFIG_KALLSYMS_EXTRA_PASS=y | |
| 25 | 19 | # CONFIG_COMPAT_BRK is not set |
| 26 | 20 | CONFIG_PROFILING=y |
| 27 | 21 | CONFIG_KPROBES=y |
| 28 | 22 | CONFIG_MODULES=y |
| 29 | 23 | CONFIG_MODULE_UNLOAD=y |
| 30 | 24 | CONFIG_MODULE_FORCE_UNLOAD=y |
| 25 | +CONFIG_PARTITION_ADVANCED=y | |
| 26 | +CONFIG_OSF_PARTITION=y | |
| 27 | +CONFIG_AMIGA_PARTITION=y | |
| 28 | +CONFIG_MAC_PARTITION=y | |
| 29 | +CONFIG_BSD_DISKLABEL=y | |
| 30 | +CONFIG_MINIX_SUBPARTITION=y | |
| 31 | +CONFIG_SOLARIS_X86_PARTITION=y | |
| 32 | +CONFIG_UNIXWARE_DISKLABEL=y | |
| 33 | +CONFIG_SGI_PARTITION=y | |
| 34 | +CONFIG_SUN_PARTITION=y | |
| 35 | +CONFIG_KARMA_PARTITION=y | |
| 36 | +CONFIG_EFI_PARTITION=y | |
| 31 | 37 | CONFIG_NO_HZ=y |
| 32 | 38 | CONFIG_HIGH_RES_TIMERS=y |
| 33 | 39 | CONFIG_SMP=y |
| 34 | −CONFIG_SPARSE_IRQ=y | |
| 35 | 40 | CONFIG_X86_GENERIC=y |
| 36 | 41 | CONFIG_HPET_TIMER=y |
| 37 | 42 | CONFIG_SCHED_SMT=y |
| @@ -51,14 +56,12 @@ CONFIG_HZ_1000=y · 13 unmodified lines | ||
| 51 | 56 | CONFIG_KEXEC=y |
| 52 | 57 | CONFIG_CRASH_DUMP=y |
| 53 | 58 | # CONFIG_COMPAT_VDSO is not set |
| 54 | −CONFIG_PM=y | |
| 59 | +CONFIG_HIBERNATION=y | |
| 55 | 60 | CONFIG_PM_DEBUG=y |
| 56 | 61 | CONFIG_PM_TRACE_RTC=y |
| 57 | −CONFIG_HIBERNATION=y | |
| 58 | 62 | CONFIG_ACPI_PROCFS=y |
| 59 | 63 | CONFIG_ACPI_DOCK=y |
| 60 | 64 | CONFIG_CPU_FREQ=y |
| 61 | −CONFIG_CPU_FREQ_DEBUG=y | |
| 62 | 65 | # CONFIG_CPU_FREQ_STAT is not set |
| 63 | 66 | CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y |
| 64 | 67 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y |
| @@ -69,7 +72,6 @@ CONFIG_PCI_MSI=y · 4 unmodified lines | ||
| 69 | 72 | CONFIG_PCCARD=y |
| 70 | 73 | CONFIG_YENTA=y |
| 71 | 74 | CONFIG_HOTPLUG_PCI=y |
| 72 | −CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y | |
| 73 | 75 | CONFIG_BINFMT_MISC=y |
| 74 | 76 | CONFIG_NET=y |
| 75 | 77 | CONFIG_PACKET=y |
| @@ -120,7 +122,6 @@ CONFIG_NF_CONNTRACK_IPV4=y · 44 unmodified lines | ||
| 120 | 122 | CONFIG_IP_NF_IPTABLES=y |
| 121 | 123 | CONFIG_IP_NF_FILTER=y |
| 122 | 124 | CONFIG_IP_NF_TARGET_REJECT=y |
| 123 | −CONFIG_IP_NF_TARGET_LOG=y | |
| 124 | 125 | CONFIG_IP_NF_TARGET_ULOG=y |
| 125 | 126 | CONFIG_NF_NAT=y |
| 126 | 127 | CONFIG_IP_NF_TARGET_MASQUERADE=y |
| @@ -128,7 +129,6 @@ CONFIG_IP_NF_MANGLE=y · 1 unmodified line | ||
| 128 | 129 | CONFIG_NF_CONNTRACK_IPV6=y |
| 129 | 130 | CONFIG_IP6_NF_IPTABLES=y |
| 130 | 131 | CONFIG_IP6_NF_MATCH_IPV6HEADER=y |
| 131 | −CONFIG_IP6_NF_TARGET_LOG=y | |
| 132 | 132 | CONFIG_IP6_NF_FILTER=y |
| 133 | 133 | CONFIG_IP6_NF_TARGET_REJECT=y |
| 134 | 134 | CONFIG_IP6_NF_MANGLE=y |
| @@ -169,25 +169,20 @@ CONFIG_DM_ZERO=y · 34 unmodified lines | ||
| 169 | 169 | CONFIG_MACINTOSH_DRIVERS=y |
| 170 | 170 | CONFIG_MAC_EMUMOUSEBTN=y |
| 171 | 171 | CONFIG_NETDEVICES=y |
| 172 | −CONFIG_NET_ETHERNET=y | |
| 173 | −CONFIG_NET_VENDOR_3COM=y | |
| 172 | +CONFIG_NETCONSOLE=y | |
| 173 | +CONFIG_BNX2=y | |
| 174 | +CONFIG_TIGON3=y | |
| 174 | 175 | CONFIG_NET_TULIP=y |
| 175 | −CONFIG_NET_PCI=y | |
| 176 | −CONFIG_FORCEDETH=y | |
| 177 | 176 | CONFIG_E100=y |
| 177 | +CONFIG_E1000=y | |
| 178 | +CONFIG_E1000E=y | |
| 179 | +CONFIG_SKY2=y | |
| 178 | 180 | CONFIG_NE2K_PCI=y |
| 181 | +CONFIG_FORCEDETH=y | |
| 179 | 182 | CONFIG_8139TOO=y |
| 180 | 183 | # CONFIG_8139TOO_PIO is not set |
| 181 | −CONFIG_E1000=y | |
| 182 | −CONFIG_E1000E=y | |
| 183 | 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 | 185 | CONFIG_FDDI=y |
| 190 | −CONFIG_NETCONSOLE=y | |
| 191 | 186 | CONFIG_INPUT_POLLDEV=y |
| 192 | 187 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set |
| 193 | 188 | CONFIG_INPUT_EVDEV=y |
| @@ -196,6 +191,7 @@ CONFIG_INPUT_TABLET=y · 2 unmodified lines | ||
| 196 | 191 | CONFIG_INPUT_TOUCHSCREEN=y |
| 197 | 192 | CONFIG_INPUT_MISC=y |
| 198 | 193 | CONFIG_VT_HW_CONSOLE_BINDING=y |
| 194 | +# CONFIG_LEGACY_PTYS is not set | |
| 199 | 195 | CONFIG_SERIAL_NONSTANDARD=y |
| 200 | 196 | CONFIG_SERIAL_8250=y |
| 201 | 197 | CONFIG_SERIAL_8250_CONSOLE=y |
| @@ -205,7 +201,6 @@ CONFIG_SERIAL_8250_MANY_PORTS=y · 3 unmodified lines | ||
| 205 | 201 | CONFIG_SERIAL_8250_SHARE_IRQ=y |
| 206 | 202 | CONFIG_SERIAL_8250_DETECT_IRQ=y |
| 207 | 203 | CONFIG_SERIAL_8250_RSA=y |
| 208 | −# CONFIG_LEGACY_PTYS is not set | |
| 209 | 204 | CONFIG_HW_RANDOM=y |
| 210 | 205 | CONFIG_NVRAM=y |
| 211 | 206 | CONFIG_HPET=y |
| @@ -220,7 +215,6 @@ CONFIG_DRM_I915=y · 8 unmodified lines | ||
| 220 | 215 | CONFIG_FB_MODE_HELPERS=y |
| 221 | 216 | CONFIG_FB_TILEBLITTING=y |
| 222 | 217 | CONFIG_FB_EFI=y |
| 223 | −CONFIG_BACKLIGHT_LCD_SUPPORT=y | |
| 224 | 218 | # CONFIG_LCD_CLASS_DEVICE is not set |
| 225 | 219 | CONFIG_VGACON_SOFT_SCROLLBACK=y |
| 226 | 220 | CONFIG_LOGO=y |
| @@ -283,7 +277,6 @@ CONFIG_ZISOFS=y · 56 unmodified lines | ||
| 283 | 277 | CONFIG_MSDOS_FS=y |
| 284 | 278 | CONFIG_VFAT_FS=y |
| 285 | 279 | CONFIG_PROC_KCORE=y |
| 286 | −CONFIG_TMPFS=y | |
| 287 | 280 | CONFIG_TMPFS_POSIX_ACL=y |
| 288 | 281 | CONFIG_HUGETLBFS=y |
| 289 | 282 | CONFIG_NFS_FS=y |
| @@ -291,18 +284,6 @@ CONFIG_NFS_V3=y · 1 unmodified line | ||
| 291 | 284 | CONFIG_NFS_V3_ACL=y |
| 292 | 285 | CONFIG_NFS_V4=y |
| 293 | 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 | 287 | CONFIG_NLS_DEFAULT="utf8" |
| 307 | 288 | CONFIG_NLS_CODEPAGE_437=y |
| 308 | 289 | CONFIG_NLS_ASCII=y |
| @@ -317,13 +298,12 @@ CONFIG_DEBUG_KERNEL=y · 8 unmodified lines | ||
| 317 | 298 | # CONFIG_SCHED_DEBUG is not set |
| 318 | 299 | CONFIG_SCHEDSTATS=y |
| 319 | 300 | CONFIG_TIMER_STATS=y |
| 320 | −# CONFIG_RCU_CPU_STALL_DETECTOR is not set | |
| 301 | +CONFIG_DEBUG_STACK_USAGE=y | |
| 321 | 302 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
| 322 | 303 | CONFIG_BLK_DEV_IO_TRACE=y |
| 323 | 304 | CONFIG_PROVIDE_OHCI1394_DMA_INIT=y |
| 324 | 305 | CONFIG_EARLY_PRINTK_DBGP=y |
| 325 | 306 | CONFIG_DEBUG_STACKOVERFLOW=y |
| 326 | −CONFIG_DEBUG_STACK_USAGE=y | |
| 327 | 307 | # CONFIG_DEBUG_RODATA_TEST is not set |
| 328 | 308 | CONFIG_DEBUG_NX_TEST=m |
| 329 | 309 | CONFIG_DEBUG_BOOT_PARAMS=y |
| @@ -1,4 +1,3 @@ | ||
| 1 | −CONFIG_64BIT=y | |
| 2 | 1 | CONFIG_EXPERIMENTAL=y |
| 3 | 2 | # CONFIG_LOCALVERSION_AUTO is not set |
| 4 | 3 | CONFIG_SYSVIPC=y |
| @@ -16,26 +15,29 @@ CONFIG_CPUSETS=y · 11 unmodified lines | ||
| 16 | 15 | CONFIG_CGROUP_CPUACCT=y |
| 17 | 16 | CONFIG_RESOURCE_COUNTERS=y |
| 18 | 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 | 18 | CONFIG_BLK_DEV_INITRD=y |
| 25 | −CONFIG_KALLSYMS_EXTRA_PASS=y | |
| 26 | 19 | # CONFIG_COMPAT_BRK is not set |
| 27 | 20 | CONFIG_PROFILING=y |
| 28 | 21 | CONFIG_KPROBES=y |
| 29 | 22 | CONFIG_MODULES=y |
| 30 | 23 | CONFIG_MODULE_UNLOAD=y |
| 31 | 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 | 37 | CONFIG_NO_HZ=y |
| 33 | 38 | CONFIG_HIGH_RES_TIMERS=y |
| 34 | 39 | CONFIG_SMP=y |
| 35 | −CONFIG_SPARSE_IRQ=y | |
| 36 | 40 | CONFIG_CALGARY_IOMMU=y |
| 37 | −CONFIG_AMD_IOMMU=y | |
| 38 | −CONFIG_AMD_IOMMU_STATS=y | |
| 39 | 41 | CONFIG_NR_CPUS=64 |
| 40 | 42 | CONFIG_SCHED_SMT=y |
| 41 | 43 | CONFIG_PREEMPT_VOLUNTARY=y |
| @@ -53,27 +55,22 @@ CONFIG_HZ_1000=y · 11 unmodified lines | ||
| 53 | 55 | CONFIG_KEXEC=y |
| 54 | 56 | CONFIG_CRASH_DUMP=y |
| 55 | 57 | # CONFIG_COMPAT_VDSO is not set |
| 56 | −CONFIG_PM=y | |
| 58 | +CONFIG_HIBERNATION=y | |
| 57 | 59 | CONFIG_PM_DEBUG=y |
| 58 | 60 | CONFIG_PM_TRACE_RTC=y |
| 59 | −CONFIG_HIBERNATION=y | |
| 60 | 61 | CONFIG_ACPI_PROCFS=y |
| 61 | 62 | CONFIG_ACPI_DOCK=y |
| 62 | 63 | CONFIG_CPU_FREQ=y |
| 63 | −CONFIG_CPU_FREQ_DEBUG=y | |
| 64 | 64 | # CONFIG_CPU_FREQ_STAT is not set |
| 65 | 65 | CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y |
| 66 | 66 | CONFIG_CPU_FREQ_GOV_PERFORMANCE=y |
| 67 | 67 | CONFIG_CPU_FREQ_GOV_ONDEMAND=y |
| 68 | 68 | CONFIG_X86_ACPI_CPUFREQ=y |
| 69 | 69 | CONFIG_PCI_MMCONFIG=y |
| 70 | −CONFIG_INTEL_IOMMU=y | |
| 71 | −# CONFIG_INTEL_IOMMU_DEFAULT_ON is not set | |
| 72 | 70 | CONFIG_PCIEPORTBUS=y |
| 73 | 71 | CONFIG_PCCARD=y |
| 74 | 72 | CONFIG_YENTA=y |
| 75 | 73 | CONFIG_HOTPLUG_PCI=y |
| 76 | −CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y | |
| 77 | 74 | CONFIG_BINFMT_MISC=y |
| 78 | 75 | CONFIG_IA32_EMULATION=y |
| 79 | 76 | CONFIG_NET=y |
| @@ -125,7 +122,6 @@ CONFIG_NF_CONNTRACK_IPV4=y · 45 unmodified lines | ||
| 125 | 122 | CONFIG_IP_NF_IPTABLES=y |
| 126 | 123 | CONFIG_IP_NF_FILTER=y |
| 127 | 124 | CONFIG_IP_NF_TARGET_REJECT=y |
| 128 | −CONFIG_IP_NF_TARGET_LOG=y | |
| 129 | 125 | CONFIG_IP_NF_TARGET_ULOG=y |
| 130 | 126 | CONFIG_NF_NAT=y |
| 131 | 127 | CONFIG_IP_NF_TARGET_MASQUERADE=y |
| @@ -133,7 +129,6 @@ CONFIG_IP_NF_MANGLE=y · 1 unmodified line | ||
| 133 | 129 | CONFIG_NF_CONNTRACK_IPV6=y |
| 134 | 130 | CONFIG_IP6_NF_IPTABLES=y |
| 135 | 131 | CONFIG_IP6_NF_MATCH_IPV6HEADER=y |
| 136 | −CONFIG_IP6_NF_TARGET_LOG=y | |
| 137 | 132 | CONFIG_IP6_NF_FILTER=y |
| 138 | 133 | CONFIG_IP6_NF_TARGET_REJECT=y |
| 139 | 134 | CONFIG_IP6_NF_MANGLE=y |
| @@ -172,20 +167,15 @@ CONFIG_DM_ZERO=y · 32 unmodified lines | ||
| 172 | 167 | CONFIG_MACINTOSH_DRIVERS=y |
| 173 | 168 | CONFIG_MAC_EMUMOUSEBTN=y |
| 174 | 169 | CONFIG_NETDEVICES=y |
| 175 | −CONFIG_NET_ETHERNET=y | |
| 176 | −CONFIG_NET_VENDOR_3COM=y | |
| 170 | +CONFIG_NETCONSOLE=y | |
| 171 | +CONFIG_TIGON3=y | |
| 177 | 172 | CONFIG_NET_TULIP=y |
| 178 | −CONFIG_NET_PCI=y | |
| 179 | −CONFIG_FORCEDETH=y | |
| 180 | 173 | CONFIG_E100=y |
| 181 | −CONFIG_8139TOO=y | |
| 182 | 174 | CONFIG_E1000=y |
| 183 | 175 | CONFIG_SKY2=y |
| 184 | −CONFIG_TIGON3=y | |
| 185 | −CONFIG_TR=y | |
| 186 | −CONFIG_NET_PCMCIA=y | |
| 176 | +CONFIG_FORCEDETH=y | |
| 177 | +CONFIG_8139TOO=y | |
| 187 | 178 | CONFIG_FDDI=y |
| 188 | −CONFIG_NETCONSOLE=y | |
| 189 | 179 | CONFIG_INPUT_POLLDEV=y |
| 190 | 180 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set |
| 191 | 181 | CONFIG_INPUT_EVDEV=y |
| @@ -194,6 +184,7 @@ CONFIG_INPUT_TABLET=y · 2 unmodified lines | ||
| 194 | 184 | CONFIG_INPUT_TOUCHSCREEN=y |
| 195 | 185 | CONFIG_INPUT_MISC=y |
| 196 | 186 | CONFIG_VT_HW_CONSOLE_BINDING=y |
| 187 | +# CONFIG_LEGACY_PTYS is not set | |
| 197 | 188 | CONFIG_SERIAL_NONSTANDARD=y |
| 198 | 189 | CONFIG_SERIAL_8250=y |
| 199 | 190 | CONFIG_SERIAL_8250_CONSOLE=y |
| @@ -203,7 +194,6 @@ CONFIG_SERIAL_8250_MANY_PORTS=y · 3 unmodified lines | ||
| 203 | 194 | CONFIG_SERIAL_8250_SHARE_IRQ=y |
| 204 | 195 | CONFIG_SERIAL_8250_DETECT_IRQ=y |
| 205 | 196 | CONFIG_SERIAL_8250_RSA=y |
| 206 | −# CONFIG_LEGACY_PTYS is not set | |
| 207 | 197 | CONFIG_HW_RANDOM=y |
| 208 | 198 | # CONFIG_HW_RANDOM_INTEL is not set |
| 209 | 199 | # CONFIG_HW_RANDOM_AMD is not set |
| @@ -221,7 +211,6 @@ CONFIG_DRM_I915_KMS=y · 11 unmodified lines | ||
| 221 | 211 | CONFIG_FB_MODE_HELPERS=y |
| 222 | 212 | CONFIG_FB_TILEBLITTING=y |
| 223 | 213 | CONFIG_FB_EFI=y |
| 224 | −CONFIG_BACKLIGHT_LCD_SUPPORT=y | |
| 225 | 214 | # CONFIG_LCD_CLASS_DEVICE is not set |
| 226 | 215 | CONFIG_VGACON_SOFT_SCROLLBACK=y |
| 227 | 216 | CONFIG_LOGO=y |
| @@ -268,6 +257,10 @@ CONFIG_RTC_CLASS=y · 40 unmodified lines | ||
| 268 | 257 | # CONFIG_RTC_HCTOSYS is not set |
| 269 | 258 | CONFIG_DMADEVICES=y |
| 270 | 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 | 264 | CONFIG_EFI_VARS=y |
| 272 | 265 | CONFIG_EXT3_FS=y |
| 273 | 266 | # CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set |
| @@ -284,7 +277,6 @@ CONFIG_ZISOFS=y · 10 unmodified lines | ||
| 284 | 277 | CONFIG_MSDOS_FS=y |
| 285 | 278 | CONFIG_VFAT_FS=y |
| 286 | 279 | CONFIG_PROC_KCORE=y |
| 287 | −CONFIG_TMPFS=y | |
| 288 | 280 | CONFIG_TMPFS_POSIX_ACL=y |
| 289 | 281 | CONFIG_HUGETLBFS=y |
| 290 | 282 | CONFIG_NFS_FS=y |
| @@ -292,18 +284,6 @@ CONFIG_NFS_V3=y · 1 unmodified line | ||
| 292 | 284 | CONFIG_NFS_V3_ACL=y |
| 293 | 285 | CONFIG_NFS_V4=y |
| 294 | 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 | 287 | CONFIG_NLS_DEFAULT="utf8" |
| 308 | 288 | CONFIG_NLS_CODEPAGE_437=y |
| 309 | 289 | CONFIG_NLS_ASCII=y |
| @@ -317,13 +297,12 @@ CONFIG_DEBUG_KERNEL=y · 7 unmodified lines | ||
| 317 | 297 | # CONFIG_SCHED_DEBUG is not set |
| 318 | 298 | CONFIG_SCHEDSTATS=y |
| 319 | 299 | CONFIG_TIMER_STATS=y |
| 320 | −# CONFIG_RCU_CPU_STALL_DETECTOR is not set | |
| 300 | +CONFIG_DEBUG_STACK_USAGE=y | |
| 321 | 301 | CONFIG_SYSCTL_SYSCALL_CHECK=y |
| 322 | 302 | CONFIG_BLK_DEV_IO_TRACE=y |
| 323 | 303 | CONFIG_PROVIDE_OHCI1394_DMA_INIT=y |
| 324 | 304 | CONFIG_EARLY_PRINTK_DBGP=y |
| 325 | 305 | CONFIG_DEBUG_STACKOVERFLOW=y |
| 326 | −CONFIG_DEBUG_STACK_USAGE=y | |
| 327 | 306 | # CONFIG_DEBUG_RODATA_TEST is not set |
| 328 | 307 | CONFIG_DEBUG_NX_TEST=m |
| 329 | 308 | CONFIG_DEBUG_BOOT_PARAMS=y |
| @@ -534,7 +534,7 @@ static inline unsigned int read_apic_id(void) · 533 unmodified lines | ||
| 534 | 534 | |
| 535 | 535 | static inline int default_apic_id_valid(int apicid) |
| 536 | 536 | { |
| 537 | − return x2apic_mode || (apicid < 255); | |
| 537 | + return (apicid < 255); | |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | extern void default_setup_apic_routing(void); |
| @@ -14,6 +14,7 @@ void exit_idle(void); · 13 unmodified lines | ||
| 14 | 14 | #else /* !CONFIG_X86_64 */ |
| 15 | 15 | static inline void enter_idle(void) { } |
| 16 | 16 | static inline void exit_idle(void) { } |
| 17 | +static inline void __exit_idle(void) { } | |
| 17 | 18 | #endif /* CONFIG_X86_64 */ |
| 18 | 19 | |
| 19 | 20 | void amd_e400_remove_cpu(int cpu); |
| @@ -21,6 +21,15 @@ · 20 unmodified lines | ||
| 21 | 21 | #define IO_APIC_REDIR_LEVEL_TRIGGER (1 << 15) |
| 22 | 22 | #define IO_APIC_REDIR_MASKED (1 << 16) |
| 23 | 23 | |
| 24 | +struct io_apic_ops { | |
| 25 | + void (*init) (void); | |
| 26 | + unsigned int (*read) (unsigned int apic, unsigned int reg); | |
| 27 | + void (*write) (unsigned int apic, unsigned int reg, unsigned int value); | |
| 28 | + void (*modify)(unsigned int apic, unsigned int reg, unsigned int value); | |
| 29 | +}; | |
| 30 | + | |
| 31 | +void __init set_io_apic_ops(const struct io_apic_ops *); | |
| 32 | + | |
| 24 | 33 | /* |
| 25 | 34 | * The structure of the IO-APIC: |
| 26 | 35 | */ |
| @@ -18,6 +18,11 @@ static const struct cpumask *x2apic_target_cpus(void) · 17 unmodified lines | ||
| 18 | 18 | return cpu_online_mask; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | +static int x2apic_apic_id_valid(int apicid) | |
| 22 | +{ | |
| 23 | + return 1; | |
| 24 | +} | |
| 25 | + | |
| 21 | 26 | static int x2apic_apic_id_registered(void) |
| 22 | 27 | { |
| 23 | 28 | return 1; |
| @@ -239,7 +239,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) · 238 unmodified lines | ||
| 239 | 239 | * to not preallocating memory for all NR_CPUS |
| 240 | 240 | * when we use CPU hotplug. |
| 241 | 241 | */ |
| 242 | − if (!cpu_has_x2apic && (apic_id >= 0xff) && enabled) | |
| 242 | + if (!apic->apic_id_valid(apic_id) && enabled) | |
| 243 | 243 | printk(KERN_WARNING PREFIX "x2apic entry ignored\n"); |
| 244 | 244 | else |
| 245 | 245 | acpi_register_lapic(apic_id, enabled); |
| @@ -383,20 +383,25 @@ static inline int eilvt_entry_is_changeable(unsigned int old, unsigned int new) · 382 unmodified lines | ||
| 383 | 383 | |
| 384 | 384 | static unsigned int reserve_eilvt_offset(int offset, unsigned int new) |
| 385 | 385 | { |
| 386 | − unsigned int rsvd; /* 0: uninitialized */ | |
| 386 | + unsigned int rsvd, vector; | |
| 387 | 387 | |
| 388 | 388 | if (offset >= APIC_EILVT_NR_MAX) |
| 389 | 389 | return ~0; |
| 390 | 390 | |
| 391 | − rsvd = atomic_read(&eilvt_offsets[offset]) & ~APIC_EILVT_MASKED; | |
| 391 | + rsvd = atomic_read(&eilvt_offsets[offset]); | |
| 392 | 392 | do { |
| 393 | − if (rsvd && | |
| 394 | − !eilvt_entry_is_changeable(rsvd, new)) | |
| 393 | + vector = rsvd & ~APIC_EILVT_MASKED; /* 0: unassigned */ | |
| 394 | + if (vector && !eilvt_entry_is_changeable(vector, new)) | |
| 395 | 395 | /* may not change if vectors are different */ |
| 396 | 396 | return rsvd; |
| 397 | 397 | rsvd = atomic_cmpxchg(&eilvt_offsets[offset], rsvd, new); |
| 398 | 398 | } while (rsvd != new); |
| 399 | 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 | 405 | return new; |
| 401 | 406 | } |
| 402 | 407 | |
| @@ -229,11 +229,10 @@ static int __init numachip_system_init(void) · 228 unmodified lines | ||
| 229 | 229 | } |
| 230 | 230 | early_initcall(numachip_system_init); |
| 231 | 231 | |
| 232 | −static int __cpuinit numachip_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |
| 232 | +static int numachip_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |
| 233 | 233 | { |
| 234 | 234 | if (!strncmp(oem_id, "NUMASC", 6)) { |
| 235 | 235 | numachip_system = 1; |
| 236 | − setup_force_cpu_cap(X86_FEATURE_X2APIC); | |
| 237 | 236 | return 1; |
| 238 | 237 | } |
| 239 | 238 | |
| @@ -64,9 +64,28 @@ · 63 unmodified lines | ||
| 64 | 64 | #include <asm/apic.h> |
| 65 | 65 | |
| 66 | 66 | #define __apicdebuginit(type) static type __init |
| 67 | + | |
| 67 | 68 | #define for_each_irq_pin(entry, head) \ |
| 68 | 69 | for (entry = head; entry; entry = entry->next) |
| 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 | 90 | * Is the SiS APIC rmw bug present ? |
| 72 | 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) · 221 unmodified lines | ||
| 294 | 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 | 332 | struct io_apic { |
| 298 | 333 | unsigned int index; |
| 299 | 334 | unsigned int unused[3]; |
| @@ -314,16 +349,17 @@ static inline void io_apic_eoi(unsigned int apic, unsigned int vector) · 14 unmodified lines | ||
| 314 | 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 | 354 | struct io_apic __iomem *io_apic = io_apic_base(apic); |
| 320 | 355 | writel(reg, &io_apic->index); |
| 321 | 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 | 361 | struct io_apic __iomem *io_apic = io_apic_base(apic); |
| 362 | + | |
| 327 | 363 | writel(reg, &io_apic->index); |
| 328 | 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 · 4 unmodified lines | ||
| 334 | 370 | * |
| 335 | 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 | 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) · 36 unmodified lines | ||
| 377 | 413 | |
| 378 | 414 | eu.w1 = io_apic_read(apic, 0x10 + 2 * pin); |
| 379 | 415 | eu.w2 = io_apic_read(apic, 0x11 + 2 * pin); |
| 416 | + | |
| 380 | 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) · 1 unmodified line | ||
| 384 | 421 | { |
| 385 | 422 | union entry_union eu; |
| 386 | 423 | unsigned long flags; |
| 424 | + | |
| 387 | 425 | raw_spin_lock_irqsave(&ioapic_lock, flags); |
| 388 | 426 | eu.entry = __ioapic_read_entry(apic, pin); |
| 389 | 427 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); |
| 428 | + | |
| 390 | 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) · 3 unmodified lines | ||
| 396 | 435 | * the interrupt, and we need to make sure the entry is fully populated |
| 397 | 436 | * before that happens. |
| 398 | 437 | */ |
| 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) | |
| 401 | 439 | { |
| 402 | 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) · 5 unmodified lines | ||
| 409 | 447 | static void ioapic_write_entry(int apic, int pin, struct IO_APIC_route_entry e) |
| 410 | 448 | { |
| 411 | 449 | unsigned long flags; |
| 450 | + | |
| 412 | 451 | raw_spin_lock_irqsave(&ioapic_lock, flags); |
| 413 | 452 | __ioapic_write_entry(apic, pin, e); |
| 414 | 453 | raw_spin_unlock_irqrestore(&ioapic_lock, flags); |
| @@ -435,8 +474,7 @@ static void ioapic_mask_entry(int apic, int pin) · 20 unmodified lines | ||
| 435 | 474 | * shared ISA-space IRQs, so we have to support them. We are super |
| 436 | 475 | * fast in the common case, and fast for shared ISA-space IRQs. |
| 437 | 476 | */ |
| 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) | |
| 440 | 478 | { |
| 441 | 479 | struct irq_pin_list **last, *entry; |
| 442 | 480 | |
| @@ -521,6 +559,7 @@ static void io_apic_sync(struct irq_pin_list *entry) · 78 unmodified lines | ||
| 521 | 559 | * a dummy read from the IO-APIC |
| 522 | 560 | */ |
| 523 | 561 | struct io_apic __iomem *io_apic; |
| 562 | + | |
| 524 | 563 | io_apic = io_apic_base(entry->apic); |
| 525 | 564 | readl(&io_apic->data); |
| 526 | 565 | } |
| @@ -2512,21 +2551,73 @@ static void ack_apic_edge(struct irq_data *data) · 1985 unmodified lines | ||
| 2512 | 2551 | |
| 2513 | 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 | 2554 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
| 2555 | +static inline bool ioapic_irqd_mask(struct irq_data *data, struct irq_cfg *cfg) | |
| 2556 | +{ | |
| 2523 | 2557 | /* If we are moving the irq we need to mask it */ |
| 2524 | 2558 | if (unlikely(irqd_is_setaffinity_pending(data))) { |
| 2525 | − do_unmask_irq = 1; | |
| 2526 | 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 | 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 | 2622 | * It appears there is an erratum which affects at least version 0x11 |
| 2532 | 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) · 48 unmodified lines | ||
| 2581 | 2672 | eoi_ioapic_irq(irq, cfg); |
| 2582 | 2673 | } |
| 2583 | 2674 | |
| 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); | |
| 2616 | 2676 | } |
| 2617 | 2677 | |
| 2618 | 2678 | #ifdef CONFIG_IRQ_REMAP |
| @@ -3872,6 +3932,11 @@ static struct resource * __init ioapic_setup_resources(int nr_ioapics) · 1253 unmodified lines | ||
| 3872 | 3932 | } |
| 3873 | 3933 | |
| 3874 | 3934 | void __init ioapic_and_gsi_init(void) |
| 3935 | +{ | |
| 3936 | + io_apic_ops.init(); | |
| 3937 | +} | |
| 3938 | + | |
| 3939 | +static void __init __ioapic_init_mappings(void) | |
| 3875 | 3940 | { |
| 3876 | 3941 | unsigned long ioapic_phys, idx = FIX_IO_APIC_BASE_0; |
| 3877 | 3942 | struct resource *ioapic_res; |
| @@ -213,7 +213,7 @@ static struct apic apic_x2apic_cluster = { · 212 unmodified lines | ||
| 213 | 213 | .name = "cluster x2apic", |
| 214 | 214 | .probe = x2apic_cluster_probe, |
| 215 | 215 | .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, |
| 216 | − .apic_id_valid = default_apic_id_valid, | |
| 216 | + .apic_id_valid = x2apic_apic_id_valid, | |
| 217 | 217 | .apic_id_registered = x2apic_apic_id_registered, |
| 218 | 218 | |
| 219 | 219 | .irq_delivery_mode = dest_LowestPrio, |
| @@ -119,7 +119,7 @@ static struct apic apic_x2apic_phys = { · 118 unmodified lines | ||
| 119 | 119 | .name = "physical x2apic", |
| 120 | 120 | .probe = x2apic_phys_probe, |
| 121 | 121 | .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, |
| 122 | − .apic_id_valid = default_apic_id_valid, | |
| 122 | + .apic_id_valid = x2apic_apic_id_valid, | |
| 123 | 123 | .apic_id_registered = x2apic_apic_id_registered, |
| 124 | 124 | |
| 125 | 125 | .irq_delivery_mode = dest_Fixed, |
| @@ -266,6 +266,11 @@ static void uv_send_IPI_all(int vector) · 265 unmodified lines | ||
| 266 | 266 | uv_send_IPI_mask(cpu_online_mask, vector); |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | +static int uv_apic_id_valid(int apicid) | |
| 270 | +{ | |
| 271 | + return 1; | |
| 272 | +} | |
| 273 | + | |
| 269 | 274 | static int uv_apic_id_registered(void) |
| 270 | 275 | { |
| 271 | 276 | return 1; |
| @@ -351,7 +356,7 @@ static struct apic __refdata apic_x2apic_uv_x = { · 79 unmodified lines | ||
| 351 | 356 | .name = "UV large system", |
| 352 | 357 | .probe = uv_probe, |
| 353 | 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 | 360 | .apic_id_registered = uv_apic_id_registered, |
| 356 | 361 | |
| 357 | 362 | .irq_delivery_mode = dest_Fixed, |
| @@ -999,7 +999,7 @@ void __cpuinit print_cpu_info(struct cpuinfo_x86 *c) · 998 unmodified lines | ||
| 999 | 999 | else |
| 1000 | 1000 | printk(KERN_CONT "\n"); |
| 1001 | 1001 | |
| 1002 | − __print_cpu_msr(); | |
| 1002 | + print_cpu_msr(c); | |
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c) |
| @@ -37,13 +37,16 @@ print_ftrace_graph_addr(unsigned long addr, void *data, · 36 unmodified lines | ||
| 37 | 37 | const struct stacktrace_ops *ops, |
| 38 | 38 | struct thread_info *tinfo, int *graph) |
| 39 | 39 | { |
| 40 | − struct task_struct *task = tinfo->task; | |
| 40 | + struct task_struct *task; | |
| 41 | 41 | unsigned long ret_addr; |
| 42 | − int index = task->curr_ret_stack; | |
| 42 | + int index; | |
| 43 | 43 | |
| 44 | 44 | if (addr != (unsigned long)return_to_handler) |
| 45 | 45 | return; |
| 46 | 46 | |
| 47 | + task = tinfo->task; | |
| 48 | + index = task->curr_ret_stack; | |
| 49 | + | |
| 47 | 50 | if (!task->ret_stack || index < *graph) |
| 48 | 51 | return; |
| 49 | 52 | |
| @@ -12,6 +12,9 @@ · 11 unmodified lines | ||
| 12 | 12 | #include <linux/user-return-notifier.h> |
| 13 | 13 | #include <linux/dmi.h> |
| 14 | 14 | #include <linux/utsname.h> |
| 15 | +#include <linux/stackprotector.h> | |
| 16 | +#include <linux/tick.h> | |
| 17 | +#include <linux/cpuidle.h> | |
| 15 | 18 | #include <trace/events/power.h> |
| 16 | 19 | #include <linux/hw_breakpoint.h> |
| 17 | 20 | #include <asm/cpu.h> |
| @@ -22,6 +25,24 @@ · 4 unmodified lines | ||
| 22 | 25 | #include <asm/i387.h> |
| 23 | 26 | #include <asm/fpu-internal.h> |
| 24 | 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 | 47 | struct kmem_cache *task_xstate_cachep; |
| 27 | 48 | EXPORT_SYMBOL_GPL(task_xstate_cachep); |
| @@ -370,6 +391,99 @@ static inline int hlt_use_halt(void) · 342 unmodified lines | ||
| 370 | 391 | } |
| 371 | 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 | 488 | * We use this if we don't have any better |
| 375 | 489 | * idle routine.. |
| @@ -9,7 +9,6 @@ · 8 unmodified lines | ||
| 9 | 9 | * This file handles the architecture-dependent parts of process handling.. |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | −#include <linux/stackprotector.h> | |
| 13 | 12 | #include <linux/cpu.h> |
| 14 | 13 | #include <linux/errno.h> |
| 15 | 14 | #include <linux/sched.h> |
| @@ -31,14 +30,12 @@ · 15 unmodified lines | ||
| 31 | 30 | #include <linux/kallsyms.h> |
| 32 | 31 | #include <linux/ptrace.h> |
| 33 | 32 | #include <linux/personality.h> |
| 34 | −#include <linux/tick.h> | |
| 35 | 33 | #include <linux/percpu.h> |
| 36 | 34 | #include <linux/prctl.h> |
| 37 | 35 | #include <linux/ftrace.h> |
| 38 | 36 | #include <linux/uaccess.h> |
| 39 | 37 | #include <linux/io.h> |
| 40 | 38 | #include <linux/kdebug.h> |
| 41 | −#include <linux/cpuidle.h> | |
| 42 | 39 | |
| 43 | 40 | #include <asm/pgtable.h> |
| 44 | 41 | #include <asm/ldt.h> |
| @@ -57,7 +54,6 @@ · 12 unmodified lines | ||
| 57 | 54 | #include <asm/idle.h> |
| 58 | 55 | #include <asm/syscalls.h> |
| 59 | 56 | #include <asm/debugreg.h> |
| 60 | −#include <asm/nmi.h> | |
| 61 | 57 | #include <asm/switch_to.h> |
| 62 | 58 | |
| 63 | 59 | 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 | ||
| 70 | 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 | 69 | void __show_regs(struct pt_regs *regs, int all) |
| 128 | 70 | { |
| 129 | 71 | unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; |
| @@ -14,7 +14,6 @@ · 13 unmodified lines | ||
| 14 | 14 | * This file handles the architecture-dependent parts of process handling.. |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | −#include <linux/stackprotector.h> | |
| 18 | 17 | #include <linux/cpu.h> |
| 19 | 18 | #include <linux/errno.h> |
| 20 | 19 | #include <linux/sched.h> |
| @@ -32,12 +31,10 @@ · 11 unmodified lines | ||
| 32 | 31 | #include <linux/notifier.h> |
| 33 | 32 | #include <linux/kprobes.h> |
| 34 | 33 | #include <linux/kdebug.h> |
| 35 | −#include <linux/tick.h> | |
| 36 | 34 | #include <linux/prctl.h> |
| 37 | 35 | #include <linux/uaccess.h> |
| 38 | 36 | #include <linux/io.h> |
| 39 | 37 | #include <linux/ftrace.h> |
| 40 | −#include <linux/cpuidle.h> | |
| 41 | 38 | |
| 42 | 39 | #include <asm/pgtable.h> |
| 43 | 40 | #include <asm/processor.h> |
| @@ -51,115 +48,11 @@ · 7 unmodified lines | ||
| 51 | 48 | #include <asm/idle.h> |
| 52 | 49 | #include <asm/syscalls.h> |
| 53 | 50 | #include <asm/debugreg.h> |
| 54 | −#include <asm/nmi.h> | |
| 55 | 51 | #include <asm/switch_to.h> |
| 56 | 52 | |
| 57 | 53 | asmlinkage extern void ret_from_fork(void); |
| 58 | 54 | |
| 59 | 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 | 57 | /* Prints also some state that isn't saved in the pt_regs */ |
| 165 | 58 | void __show_regs(struct pt_regs *regs, int all) |
| @@ -162,7 +162,7 @@ int regset_tls_get(struct task_struct *target, const struct user_regset *regset, · 161 unmodified lines | ||
| 162 | 162 | { |
| 163 | 163 | const struct desc_struct *tls; |
| 164 | 164 | |
| 165 | − if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || | |
| 165 | + if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || | |
| 166 | 166 | (pos % sizeof(struct user_desc)) != 0 || |
| 167 | 167 | (count % sizeof(struct user_desc)) != 0) |
| 168 | 168 | return -EINVAL; |
| @@ -197,7 +197,7 @@ int regset_tls_set(struct task_struct *target, const struct user_regset *regset, · 28 unmodified lines | ||
| 197 | 197 | struct user_desc infobuf[GDT_ENTRY_TLS_ENTRIES]; |
| 198 | 198 | const struct user_desc *info; |
| 199 | 199 | |
| 200 | − if (pos > GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || | |
| 200 | + if (pos >= GDT_ENTRY_TLS_ENTRIES * sizeof(struct user_desc) || | |
| 201 | 201 | (pos % sizeof(struct user_desc)) != 0 || |
| 202 | 202 | (count % sizeof(struct user_desc)) != 0) |
| 203 | 203 | return -EINVAL; |
| @@ -70,7 +70,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) · 69 unmodified lines | ||
| 70 | 70 | return; |
| 71 | 71 | pxm = pa->proximity_domain; |
| 72 | 72 | apic_id = pa->apic_id; |
| 73 | − if (!cpu_has_x2apic && (apic_id >= 0xff)) { | |
| 73 | + if (!apic->apic_id_valid(apic_id)) { | |
| 74 | 74 | printk(KERN_INFO "SRAT: PXM %u -> X2APIC 0x%04x ignored\n", |
| 75 | 75 | pxm, apic_id); |
| 76 | 76 | return; |
| @@ -20,6 +20,8 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <linux/platform_device.h> |
| 21 | 21 | #include <linux/of.h> |
| 22 | 22 | #include <linux/syscore_ops.h> |
| 23 | +#include <linux/debugfs.h> | |
| 24 | +#include <linux/mutex.h> | |
| 23 | 25 | |
| 24 | 26 | #include <asm/geode.h> |
| 25 | 27 | #include <asm/setup.h> |
| @@ -31,6 +33,15 @@ EXPORT_SYMBOL_GPL(olpc_platform_info); · 5 unmodified lines | ||
| 31 | 33 | |
| 32 | 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 | 45 | /* EC event mask to be applied during suspend (defining wakeup sources). */ |
| 35 | 46 | static u16 ec_wakeup_mask; |
| 36 | 47 | |
| @@ -269,6 +280,91 @@ int olpc_ec_sci_query(u16 *sci_value) · 232 unmodified lines | ||
| 269 | 280 | } |
| 270 | 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 | 368 | static int olpc_ec_suspend(void) |
| 273 | 369 | { |
| 274 | 370 | return olpc_ec_mask_write(ec_wakeup_mask); |
| @@ -372,6 +468,7 @@ static int __init olpc_init(void) · 97 unmodified lines | ||
| 372 | 468 | } |
| 373 | 469 | |
| 374 | 470 | register_syscore_ops(&olpc_syscore_ops); |
| 471 | + setup_debugfs(); | |
| 375 | 472 | |
| 376 | 473 | return 0; |
| 377 | 474 | } |
| @@ -113,7 +113,7 @@ CONFIG_DEFAULT_IOSCHED="noop" · 112 unmodified lines | ||
| 113 | 113 | # CONFIG_INLINE_SPIN_LOCK_BH is not set |
| 114 | 114 | # CONFIG_INLINE_SPIN_LOCK_IRQ is not set |
| 115 | 115 | # CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set |
| 116 | −CONFIG_INLINE_SPIN_UNLOCK=y | |
| 116 | +# CONFIG_UNINLINE_SPIN_UNLOCK is not set | |
| 117 | 117 | # CONFIG_INLINE_SPIN_UNLOCK_BH is not set |
| 118 | 118 | CONFIG_INLINE_SPIN_UNLOCK_IRQ=y |
| 119 | 119 | # CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set |
| @@ -67,7 +67,7 @@ _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags) · 66 unmodified lines | ||
| 67 | 67 | #define _raw_spin_trylock_bh(lock) __raw_spin_trylock_bh(lock) |
| 68 | 68 | #endif |
| 69 | 69 | |
| 70 | −#ifdef CONFIG_INLINE_SPIN_UNLOCK | |
| 70 | +#ifndef CONFIG_UNINLINE_SPIN_UNLOCK | |
| 71 | 71 | #define _raw_spin_unlock(lock) __raw_spin_unlock(lock) |
| 72 | 72 | #endif |
| 73 | 73 | |
| @@ -124,8 +124,8 @@ config INLINE_SPIN_LOCK_IRQSAVE · 123 unmodified lines | ||
| 124 | 124 | def_bool !DEBUG_SPINLOCK && !GENERIC_LOCKBREAK && \ |
| 125 | 125 | ARCH_INLINE_SPIN_LOCK_IRQSAVE |
| 126 | 126 | |
| 127 | −config INLINE_SPIN_UNLOCK | |
| 128 | − def_bool !DEBUG_SPINLOCK && (!PREEMPT || ARCH_INLINE_SPIN_UNLOCK) | |
| 127 | +config UNINLINE_SPIN_UNLOCK | |
| 128 | + bool | |
| 129 | 129 | |
| 130 | 130 | config INLINE_SPIN_UNLOCK_BH |
| 131 | 131 | def_bool !DEBUG_SPINLOCK && ARCH_INLINE_SPIN_UNLOCK_BH |
| @@ -36,6 +36,7 @@ config PREEMPT_VOLUNTARY · 35 unmodified lines | ||
| 36 | 36 | config PREEMPT |
| 37 | 37 | bool "Preemptible Kernel (Low-Latency Desktop)" |
| 38 | 38 | select PREEMPT_COUNT |
| 39 | + select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK | |
| 39 | 40 | help |
| 40 | 41 | This option reduces the latency of the kernel by making |
| 41 | 42 | all kernel code (that is not executing in a critical section) |
| @@ -163,7 +163,7 @@ void __lockfunc _raw_spin_lock_bh(raw_spinlock_t *lock) · 162 unmodified lines | ||
| 163 | 163 | EXPORT_SYMBOL(_raw_spin_lock_bh); |
| 164 | 164 | #endif |
| 165 | 165 | |
| 166 | −#ifndef CONFIG_INLINE_SPIN_UNLOCK | |
| 166 | +#ifdef CONFIG_UNINLINE_SPIN_UNLOCK | |
| 167 | 167 | void __lockfunc _raw_spin_unlock(raw_spinlock_t *lock) |
| 168 | 168 | { |
| 169 | 169 | __raw_spin_unlock(lock); |
| @@ -499,6 +499,7 @@ config RT_MUTEX_TESTER · 498 unmodified lines | ||
| 499 | 499 | config DEBUG_SPINLOCK |
| 500 | 500 | bool "Spinlock and rw-lock debugging: basic checks" |
| 501 | 501 | depends on DEBUG_KERNEL |
| 502 | + select UNINLINE_SPIN_UNLOCK | |
| 502 | 503 | help |
| 503 | 504 | Say Y here and build SMP to catch missing spinlock initialization |
| 504 | 505 | and certain other kinds of spinlock errors commonly made. This is |