Commit 386eaf87 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds

[PATCH] x86-64 merge for 2.6.3

Bring the x86-64 port up to date. Lots of smaller bug fixes that have accumulated.
Also fixes another nasty bug introduced by the IA32e changes that causes BUGs at
boot for some people.

Only changes x86-64 specific files. There are some other changes that I'm sending
separately.

 - Some cleanup in NMI watchdog code
 - Fix HyperThreading CPU setup race (Suresh B. Siddha)
 - Update defconfig
 - Add a comment on why iommu_fullflush is disabled.
 - Export sys_ioctl again
 - Fix build with IA32_EMULATION=y and SYSVIPC=n
 - Remove noisy boot printks in the mptable scan.
 - Implement automatic NMI watchdog switching for real now
 - Remove redundant 32bit ioctl handlers for autofs
 - Remove CONFIG ifdefs around rtc 32bit ioctl handlers
 - Remove useless nfsctl ifdef in syscall.c (Al Viro)
 - Increase padding for prefetchw alternative
 - Check for NX bit early before setting up memory maps (Suresh B. Siddha)
 - Change Intel IA32e config description and fix help texts (Jun Nakajima)
 - Fix microcode driver build really now (Dave Jones)
 - Add nohpet option to disable HPET timer
 - Fix double semicolon in aperture.c
 - Add cmpxchg16b cpuid entry
 - Fix return value of read_pci_config_16 (Paul Menage)
 - Fix __KERNEL_COMPAT32_CS (Zachary Amsden)
 - Disable the infamous 30 minutes check in CMOS time setting
 - Update URLs in Kconfig (Petri T. Koistinen)
 - Fix ACPI interrupt source parsing for Nforce3 (Maciej W. Rozycki)
 - Fix 32bit ipc version parsing.
 - Run local APIC NMI watchdog only once a second (or less often on idle boxes)
 - Merge ACPI APIC SCI functions from i386
 - Add i8254 timer suspend code from i386
 - Merge with 2.6.2-rc3 + minor changes from i386
 - Fix empty_zero_page declaration (Greg Johnson)
 - Readd sysctls for exception/page fault trace and vsyscall32
 - Fix WCHAN
 - Fix STACK_TOP usage. Stack for 64bit processes should be at the
   top of memory now again. Also set it correctly for LINUX32_3GB.
 - Add warning fixes for gcc 3.4 and -Wdeclaration-after-statement
parent b7a19c51
...@@ -14,7 +14,8 @@ config X86_64 ...@@ -14,7 +14,8 @@ config X86_64
default y default y
help help
Port to the x86-64 architecture. x86-64 is a 64-bit extension to the Port to the x86-64 architecture. x86-64 is a 64-bit extension to the
classical 32-bit x86 architecture. For details see http://www.x86-64.org classical 32-bit x86 architecture. For details see
<http://www.x86-64.org/>.
config 64BIT config 64BIT
def_bool y def_bool y
...@@ -92,7 +93,10 @@ config MK8 ...@@ -92,7 +93,10 @@ config MK8
Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs. Optimize for AMD Opteron/Athlon64/Hammer/K8 CPUs.
config MPSC config MPSC
bool "Prescott/Nocona" bool "Intel x86-64"
help
Optimize for Intel IA32 with 64bit extension CPUs
(Prescott/Nocona/Potomac)
config GENERIC_CPU config GENERIC_CPU
bool "Generic-x86-64" bool "Generic-x86-64"
......
...@@ -37,8 +37,6 @@ LDFLAGS := -m elf_x86_64 ...@@ -37,8 +37,6 @@ LDFLAGS := -m elf_x86_64
OBJCOPYFLAGS := -O binary -R .note -R .comment -S OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux := -e stext LDFLAGS_vmlinux := -e stext
check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1 ; then echo "$(1)"; else echo "$(2)"; fi)
cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,) cflags-$(CONFIG_MK8) += $(call check_gcc,-march=k8,)
cflags-$(CONFIG_MPSC) += $(call check_gcc,-march=pentium4,) cflags-$(CONFIG_MPSC) += $(call check_gcc,-march=pentium4,)
CFLAGS += $(cflags-y) CFLAGS += $(cflags-y)
...@@ -49,16 +47,15 @@ CFLAGS += -pipe ...@@ -49,16 +47,15 @@ CFLAGS += -pipe
# this makes reading assembly source easier, but produces worse code # this makes reading assembly source easier, but produces worse code
# actually it makes the kernel smaller too. # actually it makes the kernel smaller too.
CFLAGS += -fno-reorder-blocks CFLAGS += -fno-reorder-blocks
# should lower this a lot and see how much .text is saves
# CFLAGS += -finline-limit=2000
CFLAGS += -Wno-sign-compare CFLAGS += -Wno-sign-compare
# don't enable this when you use kgdb:
ifneq ($(CONFIG_DEBUG_INFO),y) ifneq ($(CONFIG_DEBUG_INFO),y)
CFLAGS += -fno-asynchronous-unwind-tables CFLAGS += -fno-asynchronous-unwind-tables
# -fweb shrinks the kernel a bit, but the difference is very small
# it also messes up debugging, so don't use it for now.
#CFLAGS += $(call check_gcc,-fweb,)
endif endif
# -funit-at-a-time shrinks the kernel .text considerably
# Enable unit-at-a-time mode when possible. It shrinks the # unfortunately it makes reading oopses harder.
# kernel considerably.
CFLAGS += $(call check_gcc,-funit-at-a-time,) CFLAGS += $(call check_gcc,-funit-at-a-time,)
head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o
......
...@@ -51,14 +51,17 @@ CONFIG_OBSOLETE_MODPARM=y ...@@ -51,14 +51,17 @@ CONFIG_OBSOLETE_MODPARM=y
# #
# Processor type and features # Processor type and features
# #
CONFIG_MK8=y # CONFIG_MK8 is not set
# CONFIG_GENERIC_CPU is not set # CONFIG_MPSC is not set
CONFIG_X86_L1_CACHE_BYTES=64 CONFIG_GENERIC_CPU=y
CONFIG_X86_L1_CACHE_SHIFT=6 CONFIG_X86_L1_CACHE_BYTES=128
CONFIG_X86_L1_CACHE_SHIFT=7
CONFIG_X86_TSC=y CONFIG_X86_TSC=y
CONFIG_X86_GOOD_APIC=y CONFIG_X86_GOOD_APIC=y
# CONFIG_MICROCODE is not set
CONFIG_X86_MSR=y CONFIG_X86_MSR=y
CONFIG_X86_CPUID=y CONFIG_X86_CPUID=y
CONFIG_X86_HT=y
CONFIG_X86_IO_APIC=y CONFIG_X86_IO_APIC=y
CONFIG_X86_LOCAL_APIC=y CONFIG_X86_LOCAL_APIC=y
CONFIG_MTRR=y CONFIG_MTRR=y
...@@ -70,6 +73,7 @@ CONFIG_NUMA=y ...@@ -70,6 +73,7 @@ CONFIG_NUMA=y
CONFIG_HAVE_DEC_LOCK=y CONFIG_HAVE_DEC_LOCK=y
CONFIG_NR_CPUS=8 CONFIG_NR_CPUS=8
CONFIG_GART_IOMMU=y CONFIG_GART_IOMMU=y
CONFIG_SWIOTLB=y
CONFIG_X86_MCE=y CONFIG_X86_MCE=y
# #
...@@ -77,6 +81,7 @@ CONFIG_X86_MCE=y ...@@ -77,6 +81,7 @@ CONFIG_X86_MCE=y
# #
CONFIG_PM=y CONFIG_PM=y
CONFIG_SOFTWARE_SUSPEND=y CONFIG_SOFTWARE_SUSPEND=y
# CONFIG_PM_DISK is not set
# #
# ACPI (Advanced Configuration and Power Interface) Support # ACPI (Advanced Configuration and Power Interface) Support
...@@ -112,7 +117,6 @@ CONFIG_ACPI_SYSTEM=y ...@@ -112,7 +117,6 @@ CONFIG_ACPI_SYSTEM=y
# #
CONFIG_PCI=y CONFIG_PCI=y
CONFIG_PCI_DIRECT=y CONFIG_PCI_DIRECT=y
# CONFIG_PCI_USE_VECTOR is not set
# CONFIG_PCI_LEGACY_PROC is not set # CONFIG_PCI_LEGACY_PROC is not set
# CONFIG_PCI_NAMES is not set # CONFIG_PCI_NAMES is not set
# CONFIG_HOTPLUG is not set # CONFIG_HOTPLUG is not set
...@@ -127,6 +131,10 @@ CONFIG_IA32_EMULATION=y ...@@ -127,6 +131,10 @@ CONFIG_IA32_EMULATION=y
CONFIG_COMPAT=y CONFIG_COMPAT=y
CONFIG_UID16=y CONFIG_UID16=y
#
# Device Drivers
#
# #
# Generic Driver Options # Generic Driver Options
# #
...@@ -141,6 +149,10 @@ CONFIG_UID16=y ...@@ -141,6 +149,10 @@ CONFIG_UID16=y
# #
# CONFIG_PARPORT is not set # CONFIG_PARPORT is not set
#
# Plug and Play support
#
# #
# Block devices # Block devices
# #
...@@ -180,6 +192,7 @@ CONFIG_BLK_DEV_IDECD=y ...@@ -180,6 +192,7 @@ CONFIG_BLK_DEV_IDECD=y
# #
# IDE chipset support/bugfixes # IDE chipset support/bugfixes
# #
CONFIG_IDE_GENERIC=y
# CONFIG_BLK_DEV_CMD640 is not set # CONFIG_BLK_DEV_CMD640 is not set
CONFIG_BLK_DEV_IDEPCI=y CONFIG_BLK_DEV_IDEPCI=y
# CONFIG_IDEPCI_SHARE_IRQ is not set # CONFIG_IDEPCI_SHARE_IRQ is not set
...@@ -203,7 +216,7 @@ CONFIG_BLK_DEV_AMD74XX=y ...@@ -203,7 +216,7 @@ CONFIG_BLK_DEV_AMD74XX=y
# CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT34X is not set
# CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_HPT366 is not set
# CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_SC1200 is not set
# CONFIG_BLK_DEV_PIIX is not set CONFIG_BLK_DEV_PIIX=y
# CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_NS87415 is not set
# CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set
# CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set
...@@ -261,12 +274,19 @@ CONFIG_BLK_DEV_SD=y ...@@ -261,12 +274,19 @@ CONFIG_BLK_DEV_SD=y
# CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_EATA_PIO is not set
# CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set
# CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_GDTH is not set
CONFIG_SCSI_IPS=m # CONFIG_SCSI_IPS is not set
# CONFIG_SCSI_INIA100 is not set # CONFIG_SCSI_INIA100 is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set # CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_ISP is not set
# CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_FC is not set
# CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLOGIC_1280 is not set
CONFIG_SCSI_QLA2XXX=y
# CONFIG_SCSI_QLA21XX is not set
# CONFIG_SCSI_QLA22XX is not set
# CONFIG_SCSI_QLA2300 is not set
# CONFIG_SCSI_QLA2322 is not set
# CONFIG_SCSI_QLA6312 is not set
# CONFIG_SCSI_QLA6322 is not set
# CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC395x is not set
# CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DC390T is not set
# CONFIG_SCSI_DEBUG is not set # CONFIG_SCSI_DEBUG is not set
...@@ -276,11 +296,6 @@ CONFIG_SCSI_IPS=m ...@@ -276,11 +296,6 @@ CONFIG_SCSI_IPS=m
# #
# CONFIG_MD is not set # CONFIG_MD is not set
#
# Telephony Support
#
# CONFIG_PHONE is not set
# #
# Fusion MPT device support # Fusion MPT device support
# #
...@@ -295,6 +310,14 @@ CONFIG_FUSION_MAX_SGE=40 ...@@ -295,6 +310,14 @@ CONFIG_FUSION_MAX_SGE=40
# #
# CONFIG_IEEE1394 is not set # CONFIG_IEEE1394 is not set
#
# I2O device support
#
#
# Macintosh device drivers
#
# #
# Networking support # Networking support
# #
...@@ -388,6 +411,7 @@ CONFIG_NET_PCI=y ...@@ -388,6 +411,7 @@ CONFIG_NET_PCI=y
CONFIG_AMD8111_ETH=y CONFIG_AMD8111_ETH=y
# CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_ADAPTEC_STARFIRE is not set
# CONFIG_B44 is not set # CONFIG_B44 is not set
CONFIG_FORCEDETH=y
# CONFIG_DGRS is not set # CONFIG_DGRS is not set
# CONFIG_EEPRO100 is not set # CONFIG_EEPRO100 is not set
# CONFIG_E100 is not set # CONFIG_E100 is not set
...@@ -400,6 +424,7 @@ CONFIG_8139TOO=m ...@@ -400,6 +424,7 @@ CONFIG_8139TOO=m
# CONFIG_8139TOO_TUNE_TWISTER is not set # CONFIG_8139TOO_TUNE_TWISTER is not set
# CONFIG_8139TOO_8129 is not set # CONFIG_8139TOO_8129 is not set
# CONFIG_8139_OLD_RX_RESET is not set # CONFIG_8139_OLD_RX_RESET is not set
CONFIG_8139_RXBUF_IDX=2
# CONFIG_SIS900 is not set # CONFIG_SIS900 is not set
# CONFIG_EPIC100 is not set # CONFIG_EPIC100 is not set
# CONFIG_SUNDANCE is not set # CONFIG_SUNDANCE is not set
...@@ -410,7 +435,7 @@ CONFIG_8139TOO=m ...@@ -410,7 +435,7 @@ CONFIG_8139TOO=m
# #
# CONFIG_ACENIC is not set # CONFIG_ACENIC is not set
# CONFIG_DL2K is not set # CONFIG_DL2K is not set
CONFIG_E1000=m CONFIG_E1000=y
# CONFIG_E1000_NAPI is not set # CONFIG_E1000_NAPI is not set
# CONFIG_NS83820 is not set # CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set # CONFIG_HAMACHI is not set
...@@ -466,6 +491,11 @@ CONFIG_TIGON3=y ...@@ -466,6 +491,11 @@ CONFIG_TIGON3=y
# #
# CONFIG_ISDN_BOOL is not set # CONFIG_ISDN_BOOL is not set
#
# Telephony Support
#
# CONFIG_PHONE is not set
# #
# Input device support # Input device support
# #
...@@ -534,24 +564,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y ...@@ -534,24 +564,6 @@ CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTYS=y
CONFIG_UNIX98_PTY_COUNT=256 CONFIG_UNIX98_PTY_COUNT=256
#
# I2C support
#
# CONFIG_I2C is not set
#
# I2C Algorithms
#
#
# I2C Hardware Bus support
#
#
# I2C Hardware Sensors Chip support
#
# CONFIG_I2C_SENSOR is not set
# #
# Mice # Mice
# #
...@@ -579,6 +591,7 @@ CONFIG_RTC=y ...@@ -579,6 +591,7 @@ CONFIG_RTC=y
# #
CONFIG_AGP=y CONFIG_AGP=y
CONFIG_AGP_AMD64=y CONFIG_AGP_AMD64=y
CONFIG_AGP_INTEL=y
# CONFIG_DRM is not set # CONFIG_DRM is not set
# CONFIG_MWAVE is not set # CONFIG_MWAVE is not set
CONFIG_RAW_DRIVER=y CONFIG_RAW_DRIVER=y
...@@ -586,8 +599,9 @@ CONFIG_MAX_RAW_DEVS=256 ...@@ -586,8 +599,9 @@ CONFIG_MAX_RAW_DEVS=256
CONFIG_HANGCHECK_TIMER=y CONFIG_HANGCHECK_TIMER=y
# #
# Misc devices # I2C support
# #
# CONFIG_I2C is not set
# #
# Multimedia devices # Multimedia devices
...@@ -599,6 +613,65 @@ CONFIG_HANGCHECK_TIMER=y ...@@ -599,6 +613,65 @@ CONFIG_HANGCHECK_TIMER=y
# #
# CONFIG_DVB is not set # CONFIG_DVB is not set
#
# Graphics support
#
# CONFIG_FB is not set
# CONFIG_VIDEO_SELECT is not set
#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_MDA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
#
# Sound
#
CONFIG_SOUND=y
#
# Advanced Linux Sound Architecture
#
# CONFIG_SND is not set
#
# Open Sound System
#
CONFIG_SOUND_PRIME=y
# CONFIG_SOUND_BT878 is not set
# CONFIG_SOUND_CMPCI is not set
# CONFIG_SOUND_EMU10K1 is not set
# CONFIG_SOUND_FUSION is not set
# CONFIG_SOUND_CS4281 is not set
# CONFIG_SOUND_ES1370 is not set
# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_ESSSOLO1 is not set
# CONFIG_SOUND_MAESTRO is not set
# CONFIG_SOUND_MAESTRO3 is not set
CONFIG_SOUND_ICH=y
# CONFIG_SOUND_SONICVIBES is not set
# CONFIG_SOUND_TRIDENT is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
# CONFIG_SOUND_VIA82CXXX is not set
# CONFIG_SOUND_OSS is not set
# CONFIG_SOUND_ALI5455 is not set
# CONFIG_SOUND_FORTE is not set
# CONFIG_SOUND_RME96XX is not set
# CONFIG_SOUND_AD1980 is not set
#
# USB support
#
# CONFIG_USB is not set
#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set
# #
# File systems # File systems
# #
...@@ -648,8 +721,8 @@ CONFIG_PROC_KCORE=y ...@@ -648,8 +721,8 @@ CONFIG_PROC_KCORE=y
CONFIG_DEVPTS_FS=y CONFIG_DEVPTS_FS=y
# CONFIG_DEVPTS_FS_XATTR is not set # CONFIG_DEVPTS_FS_XATTR is not set
CONFIG_TMPFS=y CONFIG_TMPFS=y
# CONFIG_HUGETLBFS is not set CONFIG_HUGETLBFS=y
# CONFIG_HUGETLB_PAGE is not set CONFIG_HUGETLB_PAGE=y
CONFIG_RAMFS=y CONFIG_RAMFS=y
# #
...@@ -702,61 +775,6 @@ CONFIG_MSDOS_PARTITION=y ...@@ -702,61 +775,6 @@ CONFIG_MSDOS_PARTITION=y
# #
# CONFIG_NLS is not set # CONFIG_NLS is not set
#
# Graphics support
#
# CONFIG_FB is not set
# CONFIG_VIDEO_SELECT is not set
#
# Console display driver support
#
CONFIG_VGA_CONSOLE=y
# CONFIG_MDA_CONSOLE is not set
CONFIG_DUMMY_CONSOLE=y
#
# Sound
#
CONFIG_SOUND=y
#
# Advanced Linux Sound Architecture
#
# CONFIG_SND is not set
#
# Open Sound System
#
CONFIG_SOUND_PRIME=y
# CONFIG_SOUND_BT878 is not set
# CONFIG_SOUND_CMPCI is not set
# CONFIG_SOUND_EMU10K1 is not set
# CONFIG_SOUND_FUSION is not set
# CONFIG_SOUND_CS4281 is not set
# CONFIG_SOUND_ES1370 is not set
# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_ESSSOLO1 is not set
# CONFIG_SOUND_MAESTRO is not set
# CONFIG_SOUND_MAESTRO3 is not set
CONFIG_SOUND_ICH=y
# CONFIG_SOUND_SONICVIBES is not set
# CONFIG_SOUND_TRIDENT is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
# CONFIG_SOUND_VIA82CXXX is not set
# CONFIG_SOUND_OSS is not set
# CONFIG_SOUND_ALI5455 is not set
# CONFIG_SOUND_FORTE is not set
# CONFIG_SOUND_RME96XX is not set
# CONFIG_SOUND_AD1980 is not set
#
# USB support
#
# CONFIG_USB is not set
# CONFIG_USB_GADGET is not set
# #
# Profiling support # Profiling support
# #
......
...@@ -4,7 +4,10 @@ ...@@ -4,7 +4,10 @@
obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \ obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_ioctl.o \
ia32_signal.o tls32.o \ ia32_signal.o tls32.o \
ia32_binfmt.o fpu32.o ptrace32.o ipc32.o syscall32.o ia32_binfmt.o fpu32.o ptrace32.o syscall32.o
sysv-$(CONFIG_SYSVIPC) := ipc32.o
obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
obj-$(CONFIG_IA32_AOUT) += ia32_aout.o obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
......
...@@ -398,3 +398,26 @@ elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int p ...@@ -398,3 +398,26 @@ elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int p
return(map_addr); return(map_addr);
} }
#ifdef CONFIG_SYSCTL
/* Register vsyscall32 into the ABI table */
#include <linux/sysctl.h>
static ctl_table abi_table2[] = {
{ 99, "vsyscall32", &sysctl_vsyscall32, sizeof(int), 0644, NULL,
proc_dointvec },
{ 0, }
};
static ctl_table abi_root_table2[] = {
{ .ctl_name = CTL_ABI, .procname = "abi", .mode = 0555,
.child = abi_table2 },
{ 0 },
};
static __init int ia32_binfmt_init(void)
{
register_sysctl_table(abi_root_table2, 1);
return 0;
}
__initcall(ia32_binfmt_init);
#endif
...@@ -174,16 +174,6 @@ COMPATIBLE_IOCTL(BLKRASET) ...@@ -174,16 +174,6 @@ COMPATIBLE_IOCTL(BLKRASET)
COMPATIBLE_IOCTL(BLKFRASET) COMPATIBLE_IOCTL(BLKFRASET)
COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */ COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */ COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
#ifdef CONFIG_AUTOFS_FS
COMPATIBLE_IOCTL(AUTOFS_IOC_READY)
COMPATIBLE_IOCTL(AUTOFS_IOC_FAIL)
COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC)
COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER)
COMPATIBLE_IOCTL(AUTOFS_IOC_SETTIMEOUT)
COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE)
COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
#endif
#ifdef CONFIG_RTC
COMPATIBLE_IOCTL(RTC_AIE_ON) COMPATIBLE_IOCTL(RTC_AIE_ON)
COMPATIBLE_IOCTL(RTC_AIE_OFF) COMPATIBLE_IOCTL(RTC_AIE_OFF)
COMPATIBLE_IOCTL(RTC_UIE_ON) COMPATIBLE_IOCTL(RTC_UIE_ON)
...@@ -198,7 +188,6 @@ COMPATIBLE_IOCTL(RTC_RD_TIME) ...@@ -198,7 +188,6 @@ COMPATIBLE_IOCTL(RTC_RD_TIME)
COMPATIBLE_IOCTL(RTC_SET_TIME) COMPATIBLE_IOCTL(RTC_SET_TIME)
COMPATIBLE_IOCTL(RTC_WKALM_SET) COMPATIBLE_IOCTL(RTC_WKALM_SET)
COMPATIBLE_IOCTL(RTC_WKALM_RD) COMPATIBLE_IOCTL(RTC_WKALM_RD)
#endif
COMPATIBLE_IOCTL(HCIUARTSETPROTO) COMPATIBLE_IOCTL(HCIUARTSETPROTO)
COMPATIBLE_IOCTL(HCIUARTGETPROTO) COMPATIBLE_IOCTL(HCIUARTGETPROTO)
COMPATIBLE_IOCTL(RFCOMMCREATEDEV) COMPATIBLE_IOCTL(RFCOMMCREATEDEV)
......
...@@ -1874,6 +1874,8 @@ long sys32_quotactl(void) ...@@ -1874,6 +1874,8 @@ long sys32_quotactl(void)
return -ENOSYS; return -ENOSYS;
} }
cond_syscall(sys32_ipc)
struct exec_domain ia32_exec_domain = { struct exec_domain ia32_exec_domain = {
.name = "linux/x86", .name = "linux/x86",
.pers_low = PER_LINUX32, .pers_low = PER_LINUX32,
......
...@@ -33,4 +33,4 @@ bootflag-y += ../../i386/kernel/bootflag.o ...@@ -33,4 +33,4 @@ bootflag-y += ../../i386/kernel/bootflag.o
cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o
topology-y += ../../i386/mach-default/topology.o topology-y += ../../i386/mach-default/topology.o
swiotlb-$(CONFIG_SWIOTLB) += ../../ia64/lib/swiotlb.o swiotlb-$(CONFIG_SWIOTLB) += ../../ia64/lib/swiotlb.o
microcode-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/microcode.o microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o
...@@ -208,7 +208,7 @@ void __init iommu_hole_init(void) ...@@ -208,7 +208,7 @@ void __init iommu_hole_init(void)
if (read_pci_config(0, num, 3, 0x00) != NB_ID_3) if (read_pci_config(0, num, 3, 0x00) != NB_ID_3)
continue; continue;
iommu_aperture = 1;; iommu_aperture = 1;
aper_order = (read_pci_config(0, num, 3, 0x90) >> 1) & 7; aper_order = (read_pci_config(0, num, 3, 0x90) >> 1) & 7;
aper_size = (32 * 1024 * 1024) << aper_order; aper_size = (32 * 1024 * 1024) << aper_order;
......
...@@ -435,6 +435,7 @@ void __init setup_local_APIC (void) ...@@ -435,6 +435,7 @@ void __init setup_local_APIC (void)
printk("No ESR for 82489DX.\n"); printk("No ESR for 82489DX.\n");
} }
nmi_watchdog_default();
if (nmi_watchdog == NMI_LOCAL_APIC) if (nmi_watchdog == NMI_LOCAL_APIC)
setup_apic_nmi_watchdog(); setup_apic_nmi_watchdog();
apic_pm_activate(); apic_pm_activate();
...@@ -579,9 +580,6 @@ static int __init detect_init_APIC (void) ...@@ -579,9 +580,6 @@ static int __init detect_init_APIC (void)
mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
boot_cpu_id = 0; boot_cpu_id = 0;
if (nmi_watchdog != NMI_NONE)
nmi_watchdog = NMI_LOCAL_APIC;
return 0; return 0;
} }
...@@ -646,11 +644,13 @@ void __init init_apic_mappings(void) ...@@ -646,11 +644,13 @@ void __init init_apic_mappings(void)
void __setup_APIC_LVTT(unsigned int clocks) void __setup_APIC_LVTT(unsigned int clocks)
{ {
unsigned int lvtt1_value, tmp_value; unsigned int lvtt_value, tmp_value, ver;
lvtt1_value = SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV) | ver = GET_APIC_VERSION(apic_read(APIC_LVR));
APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR; lvtt_value = APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR;
apic_write_around(APIC_LVTT, lvtt1_value); if (!APIC_INTEGRATED(ver))
lvtt_value |= SET_APIC_TIMER_BASE(APIC_TIMER_BASE_DIV);
apic_write_around(APIC_LVTT, lvtt_value);
/* /*
* Divide PICLK by 16 * Divide PICLK by 16
...@@ -994,8 +994,6 @@ int __init APIC_init_uniprocessor (void) ...@@ -994,8 +994,6 @@ int __init APIC_init_uniprocessor (void)
setup_local_APIC(); setup_local_APIC();
if (nmi_watchdog == NMI_LOCAL_APIC)
check_nmi_watchdog();
#ifdef CONFIG_X86_IO_APIC #ifdef CONFIG_X86_IO_APIC
if (smp_found_config && !skip_ioapic_setup && nr_ioapics) if (smp_found_config && !skip_ioapic_setup && nr_ioapics)
setup_IO_APIC(); setup_IO_APIC();
......
...@@ -11,8 +11,8 @@ config CPU_FREQ ...@@ -11,8 +11,8 @@ config CPU_FREQ
fly. This is a nice method to save battery power on notebooks, fly. This is a nice method to save battery power on notebooks,
because the lower the clock speed, the less power the CPU consumes. because the lower the clock speed, the less power the CPU consumes.
For more information, take a look at linux/Documentation/cpu-freq or For more information, take a look at <file:Documentation/cpu-freq/>
at <http://www.brodo.de/cpufreq/> or at <http://www.codemonkey.org.uk/projects/cpufreq/>
If in doubt, say N. If in doubt, say N.
...@@ -37,7 +37,7 @@ config X86_POWERNOW_K8 ...@@ -37,7 +37,7 @@ config X86_POWERNOW_K8
help help
This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors. This adds the CPUFreq driver for mobile AMD Opteron/Athlon64 processors.
For details, take a look at linux/Documentation/cpu-freq. For details, take a look at <file:Documentation/cpu-freq/>.
If in doubt, say N. If in doubt, say N.
......
...@@ -341,7 +341,7 @@ gdt32_end: ...@@ -341,7 +341,7 @@ gdt32_end:
ENTRY(cpu_gdt_table) ENTRY(cpu_gdt_table)
.quad 0x0000000000000000 /* NULL descriptor */ .quad 0x0000000000000000 /* NULL descriptor */
.quad 0x00af9a000000ffff ^ (1<<21) /* __KERNEL_COMPAT32_CS */ .quad 0x008f9a000000ffff /* __KERNEL_COMPAT32_CS */
.quad 0x00af9a000000ffff /* __KERNEL_CS */ .quad 0x00af9a000000ffff /* __KERNEL_CS */
.quad 0x00cf92000000ffff /* __KERNEL_DS */ .quad 0x00cf92000000ffff /* __KERNEL_DS */
.quad 0x00cffe000000ffff /* __USER32_CS */ .quad 0x00cffe000000ffff /* __USER32_CS */
......
...@@ -1653,6 +1653,7 @@ static inline void check_timer(void) ...@@ -1653,6 +1653,7 @@ static inline void check_timer(void)
*/ */
unmask_IO_APIC_irq(0); unmask_IO_APIC_irq(0);
if (timer_irq_works()) { if (timer_irq_works()) {
nmi_watchdog_default();
if (nmi_watchdog == NMI_IO_APIC) { if (nmi_watchdog == NMI_IO_APIC) {
disable_8259A_irq(0); disable_8259A_irq(0);
setup_nmi(); setup_nmi();
...@@ -1674,6 +1675,7 @@ static inline void check_timer(void) ...@@ -1674,6 +1675,7 @@ static inline void check_timer(void)
setup_ExtINT_IRQ0_pin(pin2, vector); setup_ExtINT_IRQ0_pin(pin2, vector);
if (timer_irq_works()) { if (timer_irq_works()) {
printk("works.\n"); printk("works.\n");
nmi_watchdog_default();
if (nmi_watchdog == NMI_IO_APIC) { if (nmi_watchdog == NMI_IO_APIC) {
setup_nmi(); setup_nmi();
check_nmi_watchdog(); check_nmi_watchdog();
...@@ -1759,23 +1761,6 @@ void __init setup_IO_APIC(void) ...@@ -1759,23 +1761,6 @@ void __init setup_IO_APIC(void)
print_IO_APIC(); print_IO_APIC();
} }
/* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
void __init mp_config_ioapic_for_sci(int irq)
{
#if 0 /* fixme */
int ioapic;
int ioapic_pin;
ioapic = mp_find_ioapic(irq);
ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
io_apic_set_pci_routing(ioapic, ioapic_pin, irq);
#endif
}
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
ACPI-based IOAPIC Configuration ACPI-based IOAPIC Configuration
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
......
...@@ -573,8 +573,6 @@ static int __init smp_scan_config (unsigned long base, unsigned long length) ...@@ -573,8 +573,6 @@ static int __init smp_scan_config (unsigned long base, unsigned long length)
|| (mpf->mpf_specification == 4)) ) { || (mpf->mpf_specification == 4)) ) {
smp_found_config = 1; smp_found_config = 1;
printk(KERN_INFO "found SMP MP-table at %08lx\n",
virt_to_phys(mpf));
reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE); reserve_bootmem_generic(virt_to_phys(mpf), PAGE_SIZE);
if (mpf->mpf_physptr) if (mpf->mpf_physptr)
reserve_bootmem_generic(mpf->mpf_physptr, PAGE_SIZE); reserve_bootmem_generic(mpf->mpf_physptr, PAGE_SIZE);
...@@ -584,6 +582,7 @@ static int __init smp_scan_config (unsigned long base, unsigned long length) ...@@ -584,6 +582,7 @@ static int __init smp_scan_config (unsigned long base, unsigned long length)
bp += 4; bp += 4;
length -= 16; length -= 16;
} }
printk(KERN_INFO "No mptable found.\n");
return 0; return 0;
} }
...@@ -876,6 +875,72 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -876,6 +875,72 @@ void __init mp_config_acpi_legacy_irqs (void)
return; return;
} }
extern FADT_DESCRIPTOR acpi_fadt;
void __init mp_config_ioapic_for_sci(int irq)
{
int ioapic;
int ioapic_pin;
struct acpi_table_madt *madt;
struct acpi_table_int_src_ovr *entry = NULL;
acpi_interrupt_flags flags;
void *madt_end;
acpi_status status;
/*
* Ensure that if there is an interrupt source override entry
* for the ACPI SCI, we leave it as is. Unfortunately this involves
* walking the MADT again.
*/
status = acpi_get_firmware_table("APIC", 1, ACPI_LOGICAL_ADDRESSING,
(struct acpi_table_header **) &madt);
if (ACPI_SUCCESS(status)) {
madt_end = (void *) (unsigned long)madt + madt->header.length;
entry = (struct acpi_table_int_src_ovr *)
((unsigned long) madt + sizeof(struct acpi_table_madt));
while ((void *) entry < madt_end) {
if (entry->header.type == ACPI_MADT_INT_SRC_OVR &&
acpi_fadt.sci_int == entry->bus_irq)
goto found;
entry = (struct acpi_table_int_src_ovr *)
((unsigned long) entry + entry->header.length);
}
}
/*
* Although the ACPI spec says that the SCI should be level/low
* don't reprogram it unless there is an explicit MADT OVR entry
* instructing us to do so -- otherwise we break Tyan boards which
* have the SCI wired edge/high but no MADT OVR.
*/
return;
found:
/*
* See the note at the end of ACPI 2.0b section
* 5.2.10.8 for what this is about.
*/
flags = entry->flags;
acpi_fadt.sci_int = entry->global_irq;
irq = entry->global_irq;
ioapic = mp_find_ioapic(irq);
ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
/*
* MPS INTI flags:
* trigger: 0=default, 1=edge, 3=level
* polarity: 0=default, 1=high, 3=low
* Per ACPI spec, default for SCI means level/low.
*/
io_apic_set_pci_routing(ioapic, ioapic_pin, irq,
(flags.trigger == 1 ? 0 : 1), (flags.polarity == 1 ? 0 : 1));
}
#ifdef CONFIG_ACPI_PCI #ifdef CONFIG_ACPI_PCI
void __init mp_parse_prt (void) void __init mp_parse_prt (void)
......
...@@ -42,10 +42,12 @@ ...@@ -42,10 +42,12 @@
int nmi_active; /* oprofile uses this */ int nmi_active; /* oprofile uses this */
static int panic_on_timeout; static int panic_on_timeout;
unsigned int nmi_watchdog = NMI_LOCAL_APIC; unsigned int nmi_watchdog = NMI_DEFAULT;
static unsigned int nmi_hz = HZ; static unsigned int nmi_hz = HZ;
unsigned int nmi_perfctr_msr; /* the MSR to reset in NMI handler */ unsigned int nmi_perfctr_msr; /* the MSR to reset in NMI handler */
int nmi_watchdog_disabled;
/* Note that these events don't tick when the CPU idles. This means
the frequency varies with CPU load. */
#define K7_EVNTSEL_ENABLE (1 << 22) #define K7_EVNTSEL_ENABLE (1 << 22)
#define K7_EVNTSEL_INT (1 << 20) #define K7_EVNTSEL_INT (1 << 20)
...@@ -61,6 +63,27 @@ int nmi_watchdog_disabled; ...@@ -61,6 +63,27 @@ int nmi_watchdog_disabled;
#define P6_EVENT_CPU_CLOCKS_NOT_HALTED 0x79 #define P6_EVENT_CPU_CLOCKS_NOT_HALTED 0x79
#define P6_NMI_EVENT P6_EVENT_CPU_CLOCKS_NOT_HALTED #define P6_NMI_EVENT P6_EVENT_CPU_CLOCKS_NOT_HALTED
/* Run after command line and cpu_init init, but before all other checks */
void __init nmi_watchdog_default(void)
{
if (nmi_watchdog != NMI_DEFAULT)
return;
/* For some reason the IO APIC watchdog doesn't work on the AMD
8111 chipset. For now switch to local APIC mode using
perfctr0 there. On Intel CPUs we don't have code to handle
the perfctr and the IO-APIC seems to work, so use that. */
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) {
nmi_watchdog = NMI_LOCAL_APIC;
printk(KERN_INFO
"Using local APIC NMI watchdog using perfctr0\n");
} else {
printk(KERN_INFO "Using IO APIC NMI watchdog\n");
nmi_watchdog = NMI_IO_APIC;
}
}
/* Why is there no CPUID flag for this? */ /* Why is there no CPUID flag for this? */
static __init int cpu_has_lapic(void) static __init int cpu_has_lapic(void)
{ {
...@@ -112,7 +135,7 @@ int __init check_nmi_watchdog (void) ...@@ -112,7 +135,7 @@ int __init check_nmi_watchdog (void)
return 0; return 0;
} }
static int __init setup_nmi_watchdog(char *str) int __init setup_nmi_watchdog(char *str)
{ {
int nmi; int nmi;
...@@ -236,6 +259,9 @@ static void setup_k7_watchdog(void) ...@@ -236,6 +259,9 @@ static void setup_k7_watchdog(void)
int i; int i;
unsigned int evntsel; unsigned int evntsel;
/* No check, so can start with slow frequency */
nmi_hz = 1;
/* XXX should check these in EFER */ /* XXX should check these in EFER */
nmi_perfctr_msr = MSR_K7_PERFCTR0; nmi_perfctr_msr = MSR_K7_PERFCTR0;
...@@ -253,14 +279,13 @@ static void setup_k7_watchdog(void) ...@@ -253,14 +279,13 @@ static void setup_k7_watchdog(void)
| K7_NMI_EVENT; | K7_NMI_EVENT;
wrmsr(MSR_K7_EVNTSEL0, evntsel, 0); wrmsr(MSR_K7_EVNTSEL0, evntsel, 0);
printk(KERN_INFO "watchdog: setting K7_PERFCTR0 to %08x\n", -(cpu_khz/nmi_hz*1000)); wrmsrl(MSR_K7_PERFCTR0, -((u64)cpu_khz*1000) / nmi_hz);
wrmsr(MSR_K7_PERFCTR0, -(cpu_khz/nmi_hz*1000), -1);
apic_write(APIC_LVTPC, APIC_DM_NMI); apic_write(APIC_LVTPC, APIC_DM_NMI);
evntsel |= K7_EVNTSEL_ENABLE; evntsel |= K7_EVNTSEL_ENABLE;
wrmsr(MSR_K7_EVNTSEL0, evntsel, 0); wrmsr(MSR_K7_EVNTSEL0, evntsel, 0);
} }
void setup_apic_nmi_watchdog (void) void setup_apic_nmi_watchdog(void)
{ {
switch (boot_cpu_data.x86_vendor) { switch (boot_cpu_data.x86_vendor) {
case X86_VENDOR_AMD: case X86_VENDOR_AMD:
...@@ -311,11 +336,9 @@ void touch_nmi_watchdog (void) ...@@ -311,11 +336,9 @@ void touch_nmi_watchdog (void)
void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason)
{ {
int sum, cpu = safe_smp_processor_id(); int sum, cpu;
if (nmi_watchdog_disabled)
return;
cpu = safe_smp_processor_id();
sum = read_pda(apic_timer_irqs); sum = read_pda(apic_timer_irqs);
if (last_irq_sums[cpu] == sum) { if (last_irq_sums[cpu] == sum) {
/* /*
...@@ -336,7 +359,7 @@ void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) ...@@ -336,7 +359,7 @@ void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason)
bust_spinlocks(1); bust_spinlocks(1);
printk("NMI Watchdog detected LOCKUP on CPU%d, registers:\n", cpu); printk("NMI Watchdog detected LOCKUP on CPU%d, registers:\n", cpu);
show_registers(regs); show_registers(regs);
if (panic_on_timeout) if (panic_on_timeout || panic_on_oops)
panic("nmi watchdog"); panic("nmi watchdog");
printk("console shuts up ...\n"); printk("console shuts up ...\n");
console_silent(); console_silent();
......
...@@ -583,16 +583,18 @@ extern void scheduling_functions_end_here(void); ...@@ -583,16 +583,18 @@ extern void scheduling_functions_end_here(void);
unsigned long get_wchan(struct task_struct *p) unsigned long get_wchan(struct task_struct *p)
{ {
unsigned long stack;
u64 fp,rip; u64 fp,rip;
int count = 0; int count = 0;
if (!p || p == current || p->state==TASK_RUNNING) if (!p || p == current || p->state==TASK_RUNNING)
return 0; return 0;
if (p->thread.rsp < (u64)p || p->thread.rsp > (u64)p + THREAD_SIZE) stack = (unsigned long)p->thread_info;
if (p->thread.rsp < stack || p->thread.rsp > stack+THREAD_SIZE)
return 0; return 0;
fp = *(u64 *)(p->thread.rsp); fp = *(u64 *)(p->thread.rsp);
do { do {
if (fp < (unsigned long)p || fp > (unsigned long)p+THREAD_SIZE) if (fp < (unsigned long)stack || fp > (unsigned long)stack+THREAD_SIZE)
return 0; return 0;
rip = *(u64 *)(fp+8); rip = *(u64 *)(fp+8);
if (rip < first_sched || rip >= last_sched) if (rip < first_sched || rip >= last_sched)
......
...@@ -380,6 +380,8 @@ void __init setup_arch(char **cmdline_p) ...@@ -380,6 +380,8 @@ void __init setup_arch(char **cmdline_p)
*/ */
end_pfn = e820_end_of_ram(); end_pfn = e820_end_of_ram();
check_efer();
init_memory_mapping(); init_memory_mapping();
#ifdef CONFIG_DISCONTIGMEM #ifdef CONFIG_DISCONTIGMEM
...@@ -892,6 +894,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c) ...@@ -892,6 +894,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
boot_cpu_data.x86_capability[i] &= c->x86_capability[i]; boot_cpu_data.x86_capability[i] &= c->x86_capability[i];
} }
mcheck_init(c);
} }
...@@ -949,7 +952,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) ...@@ -949,7 +952,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
/* Intel-defined (#2) */ /* Intel-defined (#2) */
"pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "tm2", "pni", NULL, NULL, "monitor", "ds_cpl", NULL, NULL, "tm2",
"est", NULL, "cid", NULL, NULL, NULL, NULL, NULL, "est", NULL, "cid", NULL, NULL, "cmpxchg16b", NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
}; };
......
...@@ -191,7 +191,7 @@ void pda_init(int cpu) ...@@ -191,7 +191,7 @@ void pda_init(int cpu)
char boot_exception_stacks[N_EXCEPTION_STACKS * EXCEPTION_STKSZ]; char boot_exception_stacks[N_EXCEPTION_STACKS * EXCEPTION_STKSZ];
void syscall_init(void) void __init syscall_init(void)
{ {
/* /*
* LSTAR and STAR live in a bit strange symbiosis. * LSTAR and STAR live in a bit strange symbiosis.
...@@ -209,6 +209,16 @@ void syscall_init(void) ...@@ -209,6 +209,16 @@ void syscall_init(void)
wrmsrl(MSR_SYSCALL_MASK, EF_TF|EF_DF|EF_IE|0x3000); wrmsrl(MSR_SYSCALL_MASK, EF_TF|EF_DF|EF_IE|0x3000);
} }
void __init check_efer(void)
{
unsigned long efer;
rdmsrl(MSR_EFER, efer);
if (!(efer & EFER_NX) || do_not_nx) {
__supported_pte_mask &= ~_PAGE_NX;
}
}
/* /*
* cpu_init() initializes state that is per-CPU. Some data is already * cpu_init() initializes state that is per-CPU. Some data is already
* initialized (naturally) in the bootstrap process, such as the GDT * initialized (naturally) in the bootstrap process, such as the GDT
...@@ -224,7 +234,7 @@ void __init cpu_init (void) ...@@ -224,7 +234,7 @@ void __init cpu_init (void)
int cpu = smp_processor_id(); int cpu = smp_processor_id();
#endif #endif
struct tss_struct * t = &init_tss[cpu]; struct tss_struct * t = &init_tss[cpu];
unsigned long v, efer; unsigned long v;
char *estacks = NULL; char *estacks = NULL;
struct task_struct *me; struct task_struct *me;
...@@ -270,10 +280,7 @@ void __init cpu_init (void) ...@@ -270,10 +280,7 @@ void __init cpu_init (void)
wrmsrl(MSR_KERNEL_GS_BASE, 0); wrmsrl(MSR_KERNEL_GS_BASE, 0);
barrier(); barrier();
rdmsrl(MSR_EFER, efer); check_efer();
if (!(efer & EFER_NX) || do_not_nx) {
__supported_pte_mask &= ~_PAGE_NX;
}
/* /*
* set up and load the per-CPU TSS * set up and load the per-CPU TSS
......
...@@ -264,7 +264,7 @@ void __init smp_callin(void) ...@@ -264,7 +264,7 @@ void __init smp_callin(void)
*/ */
phys_id = GET_APIC_ID(apic_read(APIC_ID)); phys_id = GET_APIC_ID(apic_read(APIC_ID));
cpuid = smp_processor_id(); cpuid = smp_processor_id();
if (cpu_test_and_set(cpuid, cpu_callin_map)) { if (cpu_isset(cpuid, cpu_callin_map)) {
panic("smp_callin: phys CPU#%d, CPU#%d already present??\n", panic("smp_callin: phys CPU#%d, CPU#%d already present??\n",
phys_id, cpuid); phys_id, cpuid);
} }
...@@ -651,7 +651,6 @@ static void __init do_boot_cpu (int apicid) ...@@ -651,7 +651,6 @@ static void __init do_boot_cpu (int apicid)
if (cpu_isset(cpu, cpu_callin_map)) { if (cpu_isset(cpu, cpu_callin_map)) {
/* number CPUs logically, starting from 1 (BSP is 0) */ /* number CPUs logically, starting from 1 (BSP is 0) */
Dprintk("OK.\n"); Dprintk("OK.\n");
printk(KERN_INFO "CPU%d: ", cpu);
print_cpu_info(&cpu_data[cpu]); print_cpu_info(&cpu_data[cpu]);
Dprintk("CPU has booted.\n"); Dprintk("CPU has booted.\n");
} else { } else {
...@@ -730,6 +729,8 @@ static void __init smp_boot_cpus(unsigned int max_cpus) ...@@ -730,6 +729,8 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
{ {
unsigned apicid, cpu; unsigned apicid, cpu;
nmi_watchdog_default();
/* /*
* Setup boot CPU information * Setup boot CPU information
*/ */
......
...@@ -5,12 +5,6 @@ ...@@ -5,12 +5,6 @@
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/config.h> #include <linux/config.h>
/* No comment. */
#if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)
#else
#define sys_nfsservctl sys_ni_syscall
#endif
#define __NO_STUBS #define __NO_STUBS
#define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ;
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/sysdev.h>
#include <linux/bcd.h> #include <linux/bcd.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/vsyscall.h> #include <asm/vsyscall.h>
...@@ -44,6 +45,8 @@ extern int using_apic_timer; ...@@ -44,6 +45,8 @@ extern int using_apic_timer;
spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED; spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED;
static int nohpet __initdata = 0;
#undef HPET_HACK_ENABLE_DANGEROUS #undef HPET_HACK_ENABLE_DANGEROUS
...@@ -217,14 +220,22 @@ static void set_rtc_mmss(unsigned long nowtime) ...@@ -217,14 +220,22 @@ static void set_rtc_mmss(unsigned long nowtime)
real_minutes += 30; /* correct for half hour time zone */ real_minutes += 30; /* correct for half hour time zone */
real_minutes %= 60; real_minutes %= 60;
if (abs(real_minutes - cmos_minutes) < 30) { #if 0
/* AMD 8111 is a really bad time keeper and hits this regularly.
It probably was an attempt to avoid screwing up DST, but ignore
that for now. */
if (abs(real_minutes - cmos_minutes) >= 30) {
printk(KERN_WARNING "time.c: can't update CMOS clock "
"from %d to %d\n", cmos_minutes, real_minutes);
} else
#endif
{
BIN_TO_BCD(real_seconds); BIN_TO_BCD(real_seconds);
BIN_TO_BCD(real_minutes); BIN_TO_BCD(real_minutes);
CMOS_WRITE(real_seconds, RTC_SECONDS); CMOS_WRITE(real_seconds, RTC_SECONDS);
CMOS_WRITE(real_minutes, RTC_MINUTES); CMOS_WRITE(real_minutes, RTC_MINUTES);
} else }
printk(KERN_WARNING "time.c: can't update CMOS clock "
"from %d to %d\n", cmos_minutes, real_minutes);
/* /*
* The following flags have to be released exactly in this order, otherwise the * The following flags have to be released exactly in this order, otherwise the
...@@ -683,6 +694,8 @@ void __init time_init(void) ...@@ -683,6 +694,8 @@ void __init time_init(void)
"at %#lx.\n", hpet_address); "at %#lx.\n", hpet_address);
} }
#endif #endif
if (nohpet)
vxtime.hpet_address = 0;
xtime.tv_sec = get_cmos_time(); xtime.tv_sec = get_cmos_time();
xtime.tv_nsec = 0; xtime.tv_nsec = 0;
...@@ -736,6 +749,51 @@ void __init time_init_smp(void) ...@@ -736,6 +749,51 @@ void __init time_init_smp(void)
__setup("report_lost_ticks", time_setup); __setup("report_lost_ticks", time_setup);
static long clock_cmos_diff;
static int time_suspend(struct sys_device *dev, u32 state)
{
/*
* Estimate time zone so that set_time can update the clock
*/
clock_cmos_diff = -get_cmos_time();
clock_cmos_diff += get_seconds();
return 0;
}
static int time_resume(struct sys_device *dev)
{
unsigned long sec = get_cmos_time() + clock_cmos_diff;
write_seqlock_irq(&xtime_lock);
xtime.tv_sec = sec;
xtime.tv_nsec = 0;
write_sequnlock_irq(&xtime_lock);
return 0;
}
static struct sysdev_class pit_sysclass = {
.resume = time_resume,
.suspend = time_suspend,
set_kset_name("pit"),
};
/* XXX this driverfs stuff should probably go elsewhere later -john */
static struct sys_device device_i8253 = {
.id = 0,
.cls = &pit_sysclass,
};
static int time_init_device(void)
{
int error = sysdev_class_register(&pit_sysclass);
if (!error)
error = sys_device_register(&device_i8253);
return error;
}
device_initcall(time_init_device);
#ifdef CONFIG_HPET_EMULATE_RTC #ifdef CONFIG_HPET_EMULATE_RTC
/* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET /* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
* is enabled, we support RTC interrupt functionality in software. * is enabled, we support RTC interrupt functionality in software.
...@@ -961,3 +1019,11 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -961,3 +1019,11 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#endif #endif
static int __init nohpet_setup(char *s)
{
nohpet = 1;
return 0;
}
__setup("nohpet", nohpet_setup);
...@@ -556,7 +556,7 @@ asmlinkage void default_do_nmi(struct pt_regs * regs) ...@@ -556,7 +556,7 @@ asmlinkage void default_do_nmi(struct pt_regs * regs)
* Ok, so this is none of the documented NMI sources, * Ok, so this is none of the documented NMI sources,
* so it must be the NMI watchdog. * so it must be the NMI watchdog.
*/ */
if (nmi_watchdog) { if (nmi_watchdog > 0) {
nmi_watchdog_tick(regs,reason); nmi_watchdog_tick(regs,reason);
return; return;
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/syscalls.h> #include <linux/syscalls.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/ioctl32.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/processor.h> #include <asm/processor.h>
...@@ -221,3 +222,5 @@ EXPORT_SYMBOL(clear_page); ...@@ -221,3 +222,5 @@ EXPORT_SYMBOL(clear_page);
EXPORT_SYMBOL(flush_tlb_page); EXPORT_SYMBOL(flush_tlb_page);
EXPORT_SYMBOL_GPL(flush_tlb_all); EXPORT_SYMBOL_GPL(flush_tlb_all);
#endif #endif
EXPORT_SYMBOL(sys_ioctl);
...@@ -548,3 +548,32 @@ int kern_addr_valid(unsigned long addr) ...@@ -548,3 +548,32 @@ int kern_addr_valid(unsigned long addr)
return 0; return 0;
return pfn_valid(pte_pfn(*pte)); return pfn_valid(pte_pfn(*pte));
} }
#ifdef CONFIG_SYSCTL
#include <linux/sysctl.h>
extern int exception_trace, page_fault_trace;
static ctl_table debug_table2[] = {
{ 99, "exception-trace", &exception_trace, sizeof(int), 0644, NULL,
proc_dointvec },
#ifdef CONFIG_CHECKING
{ 100, "page-fault-trace", &page_fault_trace, sizeof(int), 0644, NULL,
proc_dointvec },
#endif
{ 0, }
};
static ctl_table debug_root_table2[] = {
{ .ctl_name = CTL_DEBUG, .procname = "debug", .mode = 0555,
.child = debug_table2 },
{ 0 },
};
static __init int x8664_sysctl_init(void)
{
register_sysctl_table(debug_root_table2, 1);
return 0;
}
__initcall(x8664_sysctl_init);
#endif
...@@ -48,6 +48,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end) ...@@ -48,6 +48,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
int nodeid, i, nb; int nodeid, i, nb;
int found = 0; int found = 0;
u32 reg; u32 reg;
int rr;
nb = find_northbridge(); nb = find_northbridge();
if (nb < 0) if (nb < 0)
...@@ -160,7 +161,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end) ...@@ -160,7 +161,7 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
mapping. To avoid this fill in the mapping for all possible mapping. To avoid this fill in the mapping for all possible
CPUs, as the number of CPUs is not known yet. CPUs, as the number of CPUs is not known yet.
We round robin the existing nodes. */ We round robin the existing nodes. */
int rr = 0; rr = 0;
for (i = 0; i < MAXNODE; i++) { for (i = 0; i < MAXNODE; i++) {
if (nodes_present & (1UL<<i)) if (nodes_present & (1UL<<i))
continue; continue;
......
...@@ -20,9 +20,8 @@ struct exec ...@@ -20,9 +20,8 @@ struct exec
#define N_SYMSIZE(a) ((a).a_syms) #define N_SYMSIZE(a) ((a).a_syms)
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/thread_info.h>
#define STACK_TOP 0xc0000000 #define STACK_TOP (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE)
#endif #endif
#endif /* __A_OUT_GNU_H__ */ #endif /* __A_OUT_GNU_H__ */
...@@ -84,9 +84,12 @@ extern int APIC_init_uniprocessor (void); ...@@ -84,9 +84,12 @@ extern int APIC_init_uniprocessor (void);
extern void disable_APIC_timer(void); extern void disable_APIC_timer(void);
extern void enable_APIC_timer(void); extern void enable_APIC_timer(void);
extern int check_nmi_watchdog (void); extern int check_nmi_watchdog(void);
extern void nmi_watchdog_default(void);
extern int setup_nmi_watchdog(char *);
extern unsigned int nmi_watchdog; extern unsigned int nmi_watchdog;
#define NMI_DEFAULT -1
#define NMI_NONE 0 #define NMI_NONE 0
#define NMI_IO_APIC 1 #define NMI_IO_APIC 1
#define NMI_LOCAL_APIC 2 #define NMI_LOCAL_APIC 2
......
...@@ -28,7 +28,7 @@ static inline u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset) ...@@ -28,7 +28,7 @@ static inline u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset)
return v; return v;
} }
static inline u8 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset) static inline u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset)
{ {
u16 v; u16 v;
outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8);
......
...@@ -36,7 +36,7 @@ extern unsigned long pgkern_mask; ...@@ -36,7 +36,7 @@ extern unsigned long pgkern_mask;
* ZERO_PAGE is a global shared page that is always zero: used * ZERO_PAGE is a global shared page that is always zero: used
* for zero-mapped memory areas etc.. * for zero-mapped memory areas etc..
*/ */
extern unsigned long empty_zero_page[1024]; extern unsigned long empty_zero_page[PAGE_SIZE/sizeof(unsigned long)];
#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
#define PML4_SHIFT 39 #define PML4_SHIFT 39
......
...@@ -388,7 +388,7 @@ static inline void prefetch(void *x) ...@@ -388,7 +388,7 @@ static inline void prefetch(void *x)
#define ARCH_HAS_PREFETCHW 1 #define ARCH_HAS_PREFETCHW 1
static inline void prefetchw(void *x) static inline void prefetchw(void *x)
{ {
alternative_input(ASM_NOP4, alternative_input(ASM_NOP5,
"prefetchw (%1)", "prefetchw (%1)",
X86_FEATURE_3DNOW, X86_FEATURE_3DNOW,
"r" (x)); "r" (x));
......
...@@ -72,6 +72,7 @@ extern char *syscall32_page; ...@@ -72,6 +72,7 @@ extern char *syscall32_page;
extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end); extern void setup_node_bootmem(int nodeid, unsigned long start, unsigned long end);
extern void check_ioapic(void); extern void check_ioapic(void);
extern void check_efer(void);
extern int unhandled_signal(struct task_struct *tsk, int sig); extern int unhandled_signal(struct task_struct *tsk, int sig);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment