aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/Kconfig16
-rw-r--r--arch/ia64/Kconfig.debug11
-rw-r--r--arch/ia64/configs/sn2_defconfig12
-rw-r--r--arch/ia64/configs/tiger_defconfig54
-rw-r--r--arch/ia64/configs/zx1_defconfig166
-rw-r--r--arch/ia64/defconfig146
-rw-r--r--arch/ia64/hp/common/sba_iommu.c4
-rw-r--r--arch/ia64/hp/sim/simeth.c6
-rw-r--r--arch/ia64/hp/sim/simserial.c23
-rw-r--r--arch/ia64/ia32/ia32priv.h2
-rw-r--r--arch/ia64/kernel/Makefile3
-rw-r--r--arch/ia64/kernel/acpi.c34
-rw-r--r--arch/ia64/kernel/domain.c78
-rw-r--r--arch/ia64/kernel/efi.c32
-rw-r--r--arch/ia64/kernel/entry.S118
-rw-r--r--arch/ia64/kernel/entry.h2
-rw-r--r--arch/ia64/kernel/fsys.S147
-rw-r--r--arch/ia64/kernel/gate.S62
-rw-r--r--arch/ia64/kernel/ia64_ksyms.c3
-rw-r--r--arch/ia64/kernel/iosapic.c147
-rw-r--r--arch/ia64/kernel/irq_ia64.c15
-rw-r--r--arch/ia64/kernel/ivt.S211
-rw-r--r--arch/ia64/kernel/jprobes.S61
-rw-r--r--arch/ia64/kernel/kprobes.c721
-rw-r--r--arch/ia64/kernel/numa.c57
-rw-r--r--arch/ia64/kernel/perfmon.c1
-rw-r--r--arch/ia64/kernel/process.c16
-rw-r--r--arch/ia64/kernel/ptrace.c37
-rw-r--r--arch/ia64/kernel/setup.c12
-rw-r--r--arch/ia64/kernel/signal.c7
-rw-r--r--arch/ia64/kernel/smp.c5
-rw-r--r--arch/ia64/kernel/smpboot.c45
-rw-r--r--arch/ia64/kernel/traps.c39
-rw-r--r--arch/ia64/kernel/uncached.c246
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S7
-rw-r--r--arch/ia64/mm/discontig.c441
-rw-r--r--arch/ia64/mm/fault.c8
-rw-r--r--arch/ia64/mm/hugetlbpage.c158
-rw-r--r--arch/ia64/mm/init.c3
-rw-r--r--arch/ia64/pci/pci.c58
-rw-r--r--arch/ia64/sn/include/pci/pcibr_provider.h151
-rw-r--r--arch/ia64/sn/include/pci/pic.h261
-rw-r--r--arch/ia64/sn/include/pci/tiocp.h256
-rw-r--r--arch/ia64/sn/include/xtalk/hubdev.h2
-rw-r--r--arch/ia64/sn/kernel/io_init.c187
-rw-r--r--arch/ia64/sn/kernel/iomv.c6
-rw-r--r--arch/ia64/sn/kernel/irq.c255
-rw-r--r--arch/ia64/sn/kernel/setup.c56
-rw-r--r--arch/ia64/sn/kernel/sn2/ptc_deadlock.S1
-rw-r--r--arch/ia64/sn/kernel/tiocx.c44
-rw-r--r--arch/ia64/sn/kernel/xpc.h12
-rw-r--r--arch/ia64/sn/kernel/xpc_channel.c12
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c16
-rw-r--r--arch/ia64/sn/kernel/xpc_partition.c8
-rw-r--r--arch/ia64/sn/pci/pci_dma.c3
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_ate.c2
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_dma.c15
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_provider.c48
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_reg.c8
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c11
60 files changed, 2710 insertions, 1858 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 3ad2c4af099c..2e08942339ad 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -50,6 +50,10 @@ config SCHED_NO_NO_OMIT_FRAME_POINTER
50 bool 50 bool
51 default y 51 default y
52 52
53config IA64_UNCACHED_ALLOCATOR
54 bool
55 select GENERIC_ALLOCATOR
56
53choice 57choice
54 prompt "System type" 58 prompt "System type"
55 default IA64_GENERIC 59 default IA64_GENERIC
@@ -157,6 +161,8 @@ config IA64_PAGE_SIZE_64KB
157 161
158endchoice 162endchoice
159 163
164source kernel/Kconfig.hz
165
160config IA64_BRL_EMU 166config IA64_BRL_EMU
161 bool 167 bool
162 depends on ITANIUM 168 depends on ITANIUM
@@ -193,7 +199,7 @@ config HOLES_IN_ZONE
193 bool 199 bool
194 default y if VIRTUAL_MEM_MAP 200 default y if VIRTUAL_MEM_MAP
195 201
196config DISCONTIGMEM 202config ARCH_DISCONTIGMEM_ENABLE
197 bool "Discontiguous memory support" 203 bool "Discontiguous memory support"
198 depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB) && NUMA && VIRTUAL_MEM_MAP 204 depends on (IA64_DIG || IA64_SGI_SN2 || IA64_GENERIC || IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB) && NUMA && VIRTUAL_MEM_MAP
199 default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA 205 default y if (IA64_SGI_SN2 || IA64_GENERIC) && NUMA
@@ -216,14 +222,14 @@ config IOSAPIC
216 222
217config IA64_SGI_SN_SIM 223config IA64_SGI_SN_SIM
218 bool "SGI Medusa Simulator Support" 224 bool "SGI Medusa Simulator Support"
219 depends on IA64_SGI_SN2 225 depends on IA64_SGI_SN2 || IA64_GENERIC
220 help 226 help
221 If you are compiling a kernel that will run under SGI's IA-64 227 If you are compiling a kernel that will run under SGI's IA-64
222 simulator (Medusa) then say Y, otherwise say N. 228 simulator (Medusa) then say Y, otherwise say N.
223 229
224config IA64_SGI_SN_XP 230config IA64_SGI_SN_XP
225 tristate "Support communication between SGI SSIs" 231 tristate "Support communication between SGI SSIs"
226 depends on MSPEC 232 select IA64_UNCACHED_ALLOCATOR
227 help 233 help
228 An SGI machine can be divided into multiple Single System 234 An SGI machine can be divided into multiple Single System
229 Images which act independently of each other and have 235 Images which act independently of each other and have
@@ -296,6 +302,8 @@ config PREEMPT
296 Say Y here if you are building a kernel for a desktop, embedded 302 Say Y here if you are building a kernel for a desktop, embedded
297 or real-time system. Say N if you are unsure. 303 or real-time system. Say N if you are unsure.
298 304
305source "mm/Kconfig"
306
299config HAVE_DEC_LOCK 307config HAVE_DEC_LOCK
300 bool 308 bool
301 depends on (SMP || PREEMPT) 309 depends on (SMP || PREEMPT)
@@ -415,6 +423,8 @@ endmenu
415 423
416endif 424endif
417 425
426source "net/Kconfig"
427
418source "drivers/Kconfig" 428source "drivers/Kconfig"
419 429
420source "fs/Kconfig" 430source "fs/Kconfig"
diff --git a/arch/ia64/Kconfig.debug b/arch/ia64/Kconfig.debug
index de9d507ba0fd..fda67ac993d7 100644
--- a/arch/ia64/Kconfig.debug
+++ b/arch/ia64/Kconfig.debug
@@ -2,6 +2,17 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5config KPROBES
6 bool "Kprobes"
7 depends on DEBUG_KERNEL
8 help
9 Kprobes allows you to trap at almost any kernel address and
10 execute a callback function. register_kprobe() establishes
11 a probepoint and specifies the callback. Kprobes is useful
12 for kernel debugging, non-intrusive instrumentation and testing.
13 If in doubt, say "N".
14
15
5choice 16choice
6 prompt "Physical memory granularity" 17 prompt "Physical memory granularity"
7 default IA64_GRANULE_64MB 18 default IA64_GRANULE_64MB
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index 6ff7107fee4d..c05613980300 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -78,7 +78,7 @@ CONFIG_IA64_L1_CACHE_SHIFT=7
78CONFIG_NUMA=y 78CONFIG_NUMA=y
79CONFIG_VIRTUAL_MEM_MAP=y 79CONFIG_VIRTUAL_MEM_MAP=y
80CONFIG_HOLES_IN_ZONE=y 80CONFIG_HOLES_IN_ZONE=y
81CONFIG_DISCONTIGMEM=y 81CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
82# CONFIG_IA64_CYCLONE is not set 82# CONFIG_IA64_CYCLONE is not set
83CONFIG_IOSAPIC=y 83CONFIG_IOSAPIC=y
84CONFIG_IA64_SGI_SN_SIM=y 84CONFIG_IA64_SGI_SN_SIM=y
@@ -99,7 +99,7 @@ CONFIG_ACPI_DEALLOCATE_IRQ=y
99# Firmware Drivers 99# Firmware Drivers
100# 100#
101CONFIG_EFI_VARS=y 101CONFIG_EFI_VARS=y
102# CONFIG_EFI_PCDP is not set 102CONFIG_EFI_PCDP=y
103CONFIG_BINFMT_ELF=y 103CONFIG_BINFMT_ELF=y
104# CONFIG_BINFMT_MISC is not set 104# CONFIG_BINFMT_MISC is not set
105 105
@@ -588,6 +588,7 @@ CONFIG_SGI_MBCS=m
588CONFIG_SERIAL_CORE=y 588CONFIG_SERIAL_CORE=y
589CONFIG_SERIAL_CORE_CONSOLE=y 589CONFIG_SERIAL_CORE_CONSOLE=y
590CONFIG_SERIAL_SGI_L1_CONSOLE=y 590CONFIG_SERIAL_SGI_L1_CONSOLE=y
591CONFIG_SERIAL_SGI_IOC4=y
591CONFIG_UNIX98_PTYS=y 592CONFIG_UNIX98_PTYS=y
592CONFIG_LEGACY_PTYS=y 593CONFIG_LEGACY_PTYS=y
593CONFIG_LEGACY_PTY_COUNT=256 594CONFIG_LEGACY_PTY_COUNT=256
@@ -649,7 +650,7 @@ CONFIG_MMTIMER=y
649# 650#
650# Console display driver support 651# Console display driver support
651# 652#
652# CONFIG_VGA_CONSOLE is not set 653CONFIG_VGA_CONSOLE=y
653CONFIG_DUMMY_CONSOLE=y 654CONFIG_DUMMY_CONSOLE=y
654 655
655# 656#
@@ -788,6 +789,11 @@ CONFIG_INFINIBAND_IPOIB=m
788# CONFIG_INFINIBAND_IPOIB_DEBUG is not set 789# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
789 790
790# 791#
792# SN Devices
793#
794CONFIG_SGI_IOC4=y
795
796#
791# File systems 797# File systems
792# 798#
793CONFIG_EXT2_FS=y 799CONFIG_EXT2_FS=y
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig
index 9086b789f6ac..73454eee26f1 100644
--- a/arch/ia64/configs/tiger_defconfig
+++ b/arch/ia64/configs/tiger_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc3 3# Linux kernel version: 2.6.13-rc1-20050629
4# Tue May 3 15:55:04 2005 4# Wed Jun 29 15:28:12 2005
5# 5#
6 6
7# 7#
@@ -67,6 +67,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
67CONFIG_TIME_INTERPOLATION=y 67CONFIG_TIME_INTERPOLATION=y
68CONFIG_EFI=y 68CONFIG_EFI=y
69CONFIG_GENERIC_IOMAP=y 69CONFIG_GENERIC_IOMAP=y
70CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
70# CONFIG_IA64_GENERIC is not set 71# CONFIG_IA64_GENERIC is not set
71CONFIG_IA64_DIG=y 72CONFIG_IA64_DIG=y
72# CONFIG_IA64_HP_ZX1 is not set 73# CONFIG_IA64_HP_ZX1 is not set
@@ -79,18 +80,29 @@ CONFIG_MCKINLEY=y
79# CONFIG_IA64_PAGE_SIZE_8KB is not set 80# CONFIG_IA64_PAGE_SIZE_8KB is not set
80CONFIG_IA64_PAGE_SIZE_16KB=y 81CONFIG_IA64_PAGE_SIZE_16KB=y
81# CONFIG_IA64_PAGE_SIZE_64KB is not set 82# CONFIG_IA64_PAGE_SIZE_64KB is not set
83# CONFIG_HZ_100 is not set
84CONFIG_HZ_250=y
85# CONFIG_HZ_1000 is not set
86CONFIG_HZ=250
82CONFIG_IA64_L1_CACHE_SHIFT=7 87CONFIG_IA64_L1_CACHE_SHIFT=7
83# CONFIG_NUMA is not set 88# CONFIG_NUMA is not set
84CONFIG_VIRTUAL_MEM_MAP=y 89CONFIG_VIRTUAL_MEM_MAP=y
85CONFIG_HOLES_IN_ZONE=y 90CONFIG_HOLES_IN_ZONE=y
86CONFIG_IA64_CYCLONE=y 91CONFIG_IA64_CYCLONE=y
87CONFIG_IOSAPIC=y 92CONFIG_IOSAPIC=y
93# CONFIG_IA64_SGI_SN_XP is not set
88CONFIG_FORCE_MAX_ZONEORDER=18 94CONFIG_FORCE_MAX_ZONEORDER=18
89CONFIG_SMP=y 95CONFIG_SMP=y
90CONFIG_NR_CPUS=4 96CONFIG_NR_CPUS=4
91CONFIG_HOTPLUG_CPU=y 97CONFIG_HOTPLUG_CPU=y
92# CONFIG_SCHED_SMT is not set 98# CONFIG_SCHED_SMT is not set
93# CONFIG_PREEMPT is not set 99# CONFIG_PREEMPT is not set
100CONFIG_SELECT_MEMORY_MODEL=y
101CONFIG_FLATMEM_MANUAL=y
102# CONFIG_DISCONTIGMEM_MANUAL is not set
103# CONFIG_SPARSEMEM_MANUAL is not set
104CONFIG_FLATMEM=y
105CONFIG_FLAT_NODE_MEM_MAP=y
94CONFIG_HAVE_DEC_LOCK=y 106CONFIG_HAVE_DEC_LOCK=y
95CONFIG_IA32_SUPPORT=y 107CONFIG_IA32_SUPPORT=y
96CONFIG_COMPAT=y 108CONFIG_COMPAT=y
@@ -256,6 +268,7 @@ CONFIG_BLK_DEV_CMD64X=y
256# CONFIG_BLK_DEV_HPT366 is not set 268# CONFIG_BLK_DEV_HPT366 is not set
257# CONFIG_BLK_DEV_SC1200 is not set 269# CONFIG_BLK_DEV_SC1200 is not set
258CONFIG_BLK_DEV_PIIX=y 270CONFIG_BLK_DEV_PIIX=y
271# CONFIG_BLK_DEV_IT821X is not set
259# CONFIG_BLK_DEV_NS87415 is not set 272# CONFIG_BLK_DEV_NS87415 is not set
260# CONFIG_BLK_DEV_PDC202XX_OLD is not set 273# CONFIG_BLK_DEV_PDC202XX_OLD is not set
261# CONFIG_BLK_DEV_PDC202XX_NEW is not set 274# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -285,6 +298,7 @@ CONFIG_CHR_DEV_ST=m
285CONFIG_BLK_DEV_SR=m 298CONFIG_BLK_DEV_SR=m
286# CONFIG_BLK_DEV_SR_VENDOR is not set 299# CONFIG_BLK_DEV_SR_VENDOR is not set
287CONFIG_CHR_DEV_SG=m 300CONFIG_CHR_DEV_SG=m
301# CONFIG_CHR_DEV_SCH is not set
288 302
289# 303#
290# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 304# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -313,11 +327,8 @@ CONFIG_SCSI_FC_ATTRS=y
313# CONFIG_MEGARAID_NEWGEN is not set 327# CONFIG_MEGARAID_NEWGEN is not set
314# CONFIG_MEGARAID_LEGACY is not set 328# CONFIG_MEGARAID_LEGACY is not set
315# CONFIG_SCSI_SATA is not set 329# CONFIG_SCSI_SATA is not set
316# CONFIG_SCSI_BUSLOGIC is not set
317# CONFIG_SCSI_DMX3191D is not set 330# CONFIG_SCSI_DMX3191D is not set
318# CONFIG_SCSI_EATA is not set
319# CONFIG_SCSI_FUTURE_DOMAIN is not set 331# CONFIG_SCSI_FUTURE_DOMAIN is not set
320# CONFIG_SCSI_GDTH is not set
321# CONFIG_SCSI_IPS is not set 332# CONFIG_SCSI_IPS is not set
322# CONFIG_SCSI_INITIO is not set 333# CONFIG_SCSI_INITIO is not set
323# CONFIG_SCSI_INIA100 is not set 334# CONFIG_SCSI_INIA100 is not set
@@ -366,8 +377,10 @@ CONFIG_DM_ZERO=m
366# Fusion MPT device support 377# Fusion MPT device support
367# 378#
368CONFIG_FUSION=y 379CONFIG_FUSION=y
369CONFIG_FUSION_MAX_SGE=40 380CONFIG_FUSION_SPI=y
370# CONFIG_FUSION_CTL is not set 381CONFIG_FUSION_FC=y
382CONFIG_FUSION_MAX_SGE=128
383CONFIG_FUSION_CTL=y
371 384
372# 385#
373# IEEE 1394 (FireWire) support 386# IEEE 1394 (FireWire) support
@@ -394,6 +407,7 @@ CONFIG_UNIX=y
394CONFIG_INET=y 407CONFIG_INET=y
395CONFIG_IP_MULTICAST=y 408CONFIG_IP_MULTICAST=y
396# CONFIG_IP_ADVANCED_ROUTER is not set 409# CONFIG_IP_ADVANCED_ROUTER is not set
410CONFIG_IP_FIB_HASH=y
397# CONFIG_IP_PNP is not set 411# CONFIG_IP_PNP is not set
398# CONFIG_NET_IPIP is not set 412# CONFIG_NET_IPIP is not set
399# CONFIG_NET_IPGRE is not set 413# CONFIG_NET_IPGRE is not set
@@ -406,6 +420,8 @@ CONFIG_SYN_COOKIES=y
406# CONFIG_INET_TUNNEL is not set 420# CONFIG_INET_TUNNEL is not set
407CONFIG_IP_TCPDIAG=y 421CONFIG_IP_TCPDIAG=y
408# CONFIG_IP_TCPDIAG_IPV6 is not set 422# CONFIG_IP_TCPDIAG_IPV6 is not set
423# CONFIG_TCP_CONG_ADVANCED is not set
424CONFIG_TCP_CONG_BIC=y
409# CONFIG_IPV6 is not set 425# CONFIG_IPV6 is not set
410# CONFIG_NETFILTER is not set 426# CONFIG_NETFILTER is not set
411 427
@@ -506,9 +522,11 @@ CONFIG_E1000=y
506# CONFIG_HAMACHI is not set 522# CONFIG_HAMACHI is not set
507# CONFIG_YELLOWFIN is not set 523# CONFIG_YELLOWFIN is not set
508# CONFIG_R8169 is not set 524# CONFIG_R8169 is not set
525# CONFIG_SKGE is not set
509# CONFIG_SK98LIN is not set 526# CONFIG_SK98LIN is not set
510# CONFIG_VIA_VELOCITY is not set 527# CONFIG_VIA_VELOCITY is not set
511CONFIG_TIGON3=y 528CONFIG_TIGON3=y
529# CONFIG_BNX2 is not set
512 530
513# 531#
514# Ethernet (10000 Mbit) 532# Ethernet (10000 Mbit)
@@ -595,10 +613,7 @@ CONFIG_GAMEPORT=m
595# CONFIG_GAMEPORT_NS558 is not set 613# CONFIG_GAMEPORT_NS558 is not set
596# CONFIG_GAMEPORT_L4 is not set 614# CONFIG_GAMEPORT_L4 is not set
597# CONFIG_GAMEPORT_EMU10K1 is not set 615# CONFIG_GAMEPORT_EMU10K1 is not set
598# CONFIG_GAMEPORT_VORTEX is not set
599# CONFIG_GAMEPORT_FM801 is not set 616# CONFIG_GAMEPORT_FM801 is not set
600# CONFIG_GAMEPORT_CS461X is not set
601CONFIG_SOUND_GAMEPORT=m
602 617
603# 618#
604# Character devices 619# Character devices
@@ -611,7 +626,6 @@ CONFIG_SERIAL_NONSTANDARD=y
611# CONFIG_CYCLADES is not set 626# CONFIG_CYCLADES is not set
612# CONFIG_MOXA_SMARTIO is not set 627# CONFIG_MOXA_SMARTIO is not set
613# CONFIG_ISI is not set 628# CONFIG_ISI is not set
614# CONFIG_SYNCLINK is not set
615# CONFIG_SYNCLINKMP is not set 629# CONFIG_SYNCLINKMP is not set
616# CONFIG_N_HDLC is not set 630# CONFIG_N_HDLC is not set
617# CONFIG_SPECIALIX is not set 631# CONFIG_SPECIALIX is not set
@@ -628,7 +642,6 @@ CONFIG_SERIAL_8250_NR_UARTS=6
628CONFIG_SERIAL_8250_EXTENDED=y 642CONFIG_SERIAL_8250_EXTENDED=y
629CONFIG_SERIAL_8250_SHARE_IRQ=y 643CONFIG_SERIAL_8250_SHARE_IRQ=y
630# CONFIG_SERIAL_8250_DETECT_IRQ is not set 644# CONFIG_SERIAL_8250_DETECT_IRQ is not set
631# CONFIG_SERIAL_8250_MULTIPORT is not set
632# CONFIG_SERIAL_8250_RSA is not set 645# CONFIG_SERIAL_8250_RSA is not set
633 646
634# 647#
@@ -742,6 +755,7 @@ CONFIG_USB_DEVICEFS=y
742CONFIG_USB_EHCI_HCD=m 755CONFIG_USB_EHCI_HCD=m
743# CONFIG_USB_EHCI_SPLIT_ISO is not set 756# CONFIG_USB_EHCI_SPLIT_ISO is not set
744# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 757# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
758# CONFIG_USB_ISP116X_HCD is not set
745CONFIG_USB_OHCI_HCD=m 759CONFIG_USB_OHCI_HCD=m
746# CONFIG_USB_OHCI_BIG_ENDIAN is not set 760# CONFIG_USB_OHCI_BIG_ENDIAN is not set
747CONFIG_USB_OHCI_LITTLE_ENDIAN=y 761CONFIG_USB_OHCI_LITTLE_ENDIAN=y
@@ -778,9 +792,11 @@ CONFIG_USB_HIDINPUT=y
778# CONFIG_USB_HIDDEV is not set 792# CONFIG_USB_HIDDEV is not set
779# CONFIG_USB_AIPTEK is not set 793# CONFIG_USB_AIPTEK is not set
780# CONFIG_USB_WACOM is not set 794# CONFIG_USB_WACOM is not set
795# CONFIG_USB_ACECAD is not set
781# CONFIG_USB_KBTAB is not set 796# CONFIG_USB_KBTAB is not set
782# CONFIG_USB_POWERMATE is not set 797# CONFIG_USB_POWERMATE is not set
783# CONFIG_USB_MTOUCH is not set 798# CONFIG_USB_MTOUCH is not set
799# CONFIG_USB_ITMTOUCH is not set
784# CONFIG_USB_EGALAX is not set 800# CONFIG_USB_EGALAX is not set
785# CONFIG_USB_XPAD is not set 801# CONFIG_USB_XPAD is not set
786# CONFIG_USB_ATI_REMOTE is not set 802# CONFIG_USB_ATI_REMOTE is not set
@@ -837,7 +853,7 @@ CONFIG_USB_HIDINPUT=y
837# CONFIG_USB_TEST is not set 853# CONFIG_USB_TEST is not set
838 854
839# 855#
840# USB ATM/DSL drivers 856# USB DSL modem support
841# 857#
842 858
843# 859#
@@ -856,12 +872,17 @@ CONFIG_USB_HIDINPUT=y
856# CONFIG_INFINIBAND is not set 872# CONFIG_INFINIBAND is not set
857 873
858# 874#
875# SN Devices
876#
877
878#
859# File systems 879# File systems
860# 880#
861CONFIG_EXT2_FS=y 881CONFIG_EXT2_FS=y
862CONFIG_EXT2_FS_XATTR=y 882CONFIG_EXT2_FS_XATTR=y
863CONFIG_EXT2_FS_POSIX_ACL=y 883CONFIG_EXT2_FS_POSIX_ACL=y
864CONFIG_EXT2_FS_SECURITY=y 884CONFIG_EXT2_FS_SECURITY=y
885# CONFIG_EXT2_FS_XIP is not set
865CONFIG_EXT3_FS=y 886CONFIG_EXT3_FS=y
866CONFIG_EXT3_FS_XATTR=y 887CONFIG_EXT3_FS_XATTR=y
867CONFIG_EXT3_FS_POSIX_ACL=y 888CONFIG_EXT3_FS_POSIX_ACL=y
@@ -921,7 +942,6 @@ CONFIG_NTFS_FS=m
921CONFIG_PROC_FS=y 942CONFIG_PROC_FS=y
922CONFIG_PROC_KCORE=y 943CONFIG_PROC_KCORE=y
923CONFIG_SYSFS=y 944CONFIG_SYSFS=y
924# CONFIG_DEVFS_FS is not set
925# CONFIG_DEVPTS_FS_XATTR is not set 945# CONFIG_DEVPTS_FS_XATTR is not set
926CONFIG_TMPFS=y 946CONFIG_TMPFS=y
927CONFIG_TMPFS_XATTR=y 947CONFIG_TMPFS_XATTR=y
@@ -952,15 +972,18 @@ CONFIG_RAMFS=y
952# 972#
953CONFIG_NFS_FS=m 973CONFIG_NFS_FS=m
954CONFIG_NFS_V3=y 974CONFIG_NFS_V3=y
975# CONFIG_NFS_V3_ACL is not set
955CONFIG_NFS_V4=y 976CONFIG_NFS_V4=y
956CONFIG_NFS_DIRECTIO=y 977CONFIG_NFS_DIRECTIO=y
957CONFIG_NFSD=m 978CONFIG_NFSD=m
958CONFIG_NFSD_V3=y 979CONFIG_NFSD_V3=y
980# CONFIG_NFSD_V3_ACL is not set
959CONFIG_NFSD_V4=y 981CONFIG_NFSD_V4=y
960CONFIG_NFSD_TCP=y 982CONFIG_NFSD_TCP=y
961CONFIG_LOCKD=m 983CONFIG_LOCKD=m
962CONFIG_LOCKD_V4=y 984CONFIG_LOCKD_V4=y
963CONFIG_EXPORTFS=y 985CONFIG_EXPORTFS=y
986CONFIG_NFS_COMMON=y
964CONFIG_SUNRPC=m 987CONFIG_SUNRPC=m
965CONFIG_SUNRPC_GSS=m 988CONFIG_SUNRPC_GSS=m
966CONFIG_RPCSEC_GSS_KRB5=m 989CONFIG_RPCSEC_GSS_KRB5=m
@@ -1068,6 +1091,7 @@ CONFIG_LOG_BUF_SHIFT=20
1068# CONFIG_DEBUG_KOBJECT is not set 1091# CONFIG_DEBUG_KOBJECT is not set
1069# CONFIG_DEBUG_INFO is not set 1092# CONFIG_DEBUG_INFO is not set
1070# CONFIG_DEBUG_FS is not set 1093# CONFIG_DEBUG_FS is not set
1094# CONFIG_KPROBES is not set
1071CONFIG_IA64_GRANULE_16MB=y 1095CONFIG_IA64_GRANULE_16MB=y
1072# CONFIG_IA64_GRANULE_64MB is not set 1096# CONFIG_IA64_GRANULE_64MB is not set
1073# CONFIG_IA64_PRINT_HAZARDS is not set 1097# CONFIG_IA64_PRINT_HAZARDS is not set
@@ -1089,7 +1113,7 @@ CONFIG_CRYPTO=y
1089# CONFIG_CRYPTO_HMAC is not set 1113# CONFIG_CRYPTO_HMAC is not set
1090# CONFIG_CRYPTO_NULL is not set 1114# CONFIG_CRYPTO_NULL is not set
1091# CONFIG_CRYPTO_MD4 is not set 1115# CONFIG_CRYPTO_MD4 is not set
1092CONFIG_CRYPTO_MD5=m 1116CONFIG_CRYPTO_MD5=y
1093# CONFIG_CRYPTO_SHA1 is not set 1117# CONFIG_CRYPTO_SHA1 is not set
1094# CONFIG_CRYPTO_SHA256 is not set 1118# CONFIG_CRYPTO_SHA256 is not set
1095# CONFIG_CRYPTO_SHA512 is not set 1119# CONFIG_CRYPTO_SHA512 is not set
diff --git a/arch/ia64/configs/zx1_defconfig b/arch/ia64/configs/zx1_defconfig
index 21d6f9bab5e9..b7755e4436d2 100644
--- a/arch/ia64/configs/zx1_defconfig
+++ b/arch/ia64/configs/zx1_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.10 3# Linux kernel version: 2.6.13-rc1-20050629
4# Wed Dec 29 09:05:48 2004 4# Wed Jun 29 15:31:11 2005
5# 5#
6 6
7# 7#
@@ -12,6 +12,7 @@ CONFIG_EXPERIMENTAL=y
12CONFIG_BROKEN=y 12CONFIG_BROKEN=y
13CONFIG_BROKEN_ON_SMP=y 13CONFIG_BROKEN_ON_SMP=y
14CONFIG_LOCK_KERNEL=y 14CONFIG_LOCK_KERNEL=y
15CONFIG_INIT_ENV_ARG_LIMIT=32
15 16
16# 17#
17# General setup 18# General setup
@@ -24,23 +25,26 @@ CONFIG_BSD_PROCESS_ACCT=y
24# CONFIG_BSD_PROCESS_ACCT_V3 is not set 25# CONFIG_BSD_PROCESS_ACCT_V3 is not set
25CONFIG_SYSCTL=y 26CONFIG_SYSCTL=y
26# CONFIG_AUDIT is not set 27# CONFIG_AUDIT is not set
27CONFIG_LOG_BUF_SHIFT=17
28CONFIG_HOTPLUG=y 28CONFIG_HOTPLUG=y
29CONFIG_KOBJECT_UEVENT=y 29CONFIG_KOBJECT_UEVENT=y
30# CONFIG_IKCONFIG is not set 30# CONFIG_IKCONFIG is not set
31# CONFIG_CPUSETS is not set
31# CONFIG_EMBEDDED is not set 32# CONFIG_EMBEDDED is not set
32CONFIG_KALLSYMS=y 33CONFIG_KALLSYMS=y
33# CONFIG_KALLSYMS_ALL is not set 34# CONFIG_KALLSYMS_ALL is not set
34# CONFIG_KALLSYMS_EXTRA_PASS is not set 35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_PRINTK=y
37CONFIG_BUG=y
38CONFIG_BASE_FULL=y
35CONFIG_FUTEX=y 39CONFIG_FUTEX=y
36CONFIG_EPOLL=y 40CONFIG_EPOLL=y
37# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
38CONFIG_SHMEM=y 41CONFIG_SHMEM=y
39CONFIG_CC_ALIGN_FUNCTIONS=0 42CONFIG_CC_ALIGN_FUNCTIONS=0
40CONFIG_CC_ALIGN_LABELS=0 43CONFIG_CC_ALIGN_LABELS=0
41CONFIG_CC_ALIGN_LOOPS=0 44CONFIG_CC_ALIGN_LOOPS=0
42CONFIG_CC_ALIGN_JUMPS=0 45CONFIG_CC_ALIGN_JUMPS=0
43# CONFIG_TINY_SHMEM is not set 46# CONFIG_TINY_SHMEM is not set
47CONFIG_BASE_SMALL=0
44 48
45# 49#
46# Loadable module support 50# Loadable module support
@@ -59,12 +63,15 @@ CONFIG_IA64=y
59CONFIG_64BIT=y 63CONFIG_64BIT=y
60CONFIG_MMU=y 64CONFIG_MMU=y
61CONFIG_RWSEM_XCHGADD_ALGORITHM=y 65CONFIG_RWSEM_XCHGADD_ALGORITHM=y
66CONFIG_GENERIC_CALIBRATE_DELAY=y
62CONFIG_TIME_INTERPOLATION=y 67CONFIG_TIME_INTERPOLATION=y
63CONFIG_EFI=y 68CONFIG_EFI=y
64CONFIG_GENERIC_IOMAP=y 69CONFIG_GENERIC_IOMAP=y
70CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
65# CONFIG_IA64_GENERIC is not set 71# CONFIG_IA64_GENERIC is not set
66# CONFIG_IA64_DIG is not set 72# CONFIG_IA64_DIG is not set
67CONFIG_IA64_HP_ZX1=y 73CONFIG_IA64_HP_ZX1=y
74# CONFIG_IA64_HP_ZX1_SWIOTLB is not set
68# CONFIG_IA64_SGI_SN2 is not set 75# CONFIG_IA64_SGI_SN2 is not set
69# CONFIG_IA64_HP_SIM is not set 76# CONFIG_IA64_HP_SIM is not set
70# CONFIG_ITANIUM is not set 77# CONFIG_ITANIUM is not set
@@ -73,22 +80,36 @@ CONFIG_MCKINLEY=y
73# CONFIG_IA64_PAGE_SIZE_8KB is not set 80# CONFIG_IA64_PAGE_SIZE_8KB is not set
74CONFIG_IA64_PAGE_SIZE_16KB=y 81CONFIG_IA64_PAGE_SIZE_16KB=y
75# CONFIG_IA64_PAGE_SIZE_64KB is not set 82# CONFIG_IA64_PAGE_SIZE_64KB is not set
83# CONFIG_HZ_100 is not set
84CONFIG_HZ_250=y
85# CONFIG_HZ_1000 is not set
86CONFIG_HZ=250
76CONFIG_IA64_L1_CACHE_SHIFT=7 87CONFIG_IA64_L1_CACHE_SHIFT=7
77# CONFIG_NUMA is not set 88# CONFIG_NUMA is not set
78CONFIG_VIRTUAL_MEM_MAP=y 89CONFIG_VIRTUAL_MEM_MAP=y
90CONFIG_HOLES_IN_ZONE=y
79# CONFIG_IA64_CYCLONE is not set 91# CONFIG_IA64_CYCLONE is not set
80CONFIG_IOSAPIC=y 92CONFIG_IOSAPIC=y
93# CONFIG_IA64_SGI_SN_XP is not set
81CONFIG_FORCE_MAX_ZONEORDER=18 94CONFIG_FORCE_MAX_ZONEORDER=18
82CONFIG_SMP=y 95CONFIG_SMP=y
83CONFIG_NR_CPUS=16 96CONFIG_NR_CPUS=16
84# CONFIG_HOTPLUG_CPU is not set 97# CONFIG_HOTPLUG_CPU is not set
98# CONFIG_SCHED_SMT is not set
85# CONFIG_PREEMPT is not set 99# CONFIG_PREEMPT is not set
100CONFIG_SELECT_MEMORY_MODEL=y
101CONFIG_FLATMEM_MANUAL=y
102# CONFIG_DISCONTIGMEM_MANUAL is not set
103# CONFIG_SPARSEMEM_MANUAL is not set
104CONFIG_FLATMEM=y
105CONFIG_FLAT_NODE_MEM_MAP=y
86CONFIG_HAVE_DEC_LOCK=y 106CONFIG_HAVE_DEC_LOCK=y
87CONFIG_IA32_SUPPORT=y 107CONFIG_IA32_SUPPORT=y
88CONFIG_COMPAT=y 108CONFIG_COMPAT=y
89CONFIG_IA64_MCA_RECOVERY=y 109CONFIG_IA64_MCA_RECOVERY=y
90CONFIG_PERFMON=y 110CONFIG_PERFMON=y
91CONFIG_IA64_PALINFO=y 111CONFIG_IA64_PALINFO=y
112CONFIG_ACPI_DEALLOCATE_IRQ=y
92 113
93# 114#
94# Firmware Drivers 115# Firmware Drivers
@@ -120,6 +141,7 @@ CONFIG_ACPI_BUS=y
120CONFIG_ACPI_POWER=y 141CONFIG_ACPI_POWER=y
121CONFIG_ACPI_PCI=y 142CONFIG_ACPI_PCI=y
122CONFIG_ACPI_SYSTEM=y 143CONFIG_ACPI_SYSTEM=y
144# CONFIG_ACPI_CONTAINER is not set
123 145
124# 146#
125# Bus options (PCI, PCMCIA) 147# Bus options (PCI, PCMCIA)
@@ -129,6 +151,7 @@ CONFIG_PCI_DOMAINS=y
129# CONFIG_PCI_MSI is not set 151# CONFIG_PCI_MSI is not set
130CONFIG_PCI_LEGACY_PROC=y 152CONFIG_PCI_LEGACY_PROC=y
131CONFIG_PCI_NAMES=y 153CONFIG_PCI_NAMES=y
154# CONFIG_PCI_DEBUG is not set
132 155
133# 156#
134# PCI Hotplug Support 157# PCI Hotplug Support
@@ -138,7 +161,6 @@ CONFIG_HOTPLUG_PCI=y
138CONFIG_HOTPLUG_PCI_ACPI=y 161CONFIG_HOTPLUG_PCI_ACPI=y
139# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set 162# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
140# CONFIG_HOTPLUG_PCI_CPCI is not set 163# CONFIG_HOTPLUG_PCI_CPCI is not set
141# CONFIG_HOTPLUG_PCI_PCIE is not set
142# CONFIG_HOTPLUG_PCI_SHPC is not set 164# CONFIG_HOTPLUG_PCI_SHPC is not set
143 165
144# 166#
@@ -147,10 +169,6 @@ CONFIG_HOTPLUG_PCI_ACPI=y
147# CONFIG_PCCARD is not set 169# CONFIG_PCCARD is not set
148 170
149# 171#
150# PC-card bridges
151#
152
153#
154# Device Drivers 172# Device Drivers
155# 173#
156 174
@@ -184,6 +202,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
184# CONFIG_BLK_CPQ_CISS_DA is not set 202# CONFIG_BLK_CPQ_CISS_DA is not set
185# CONFIG_BLK_DEV_DAC960 is not set 203# CONFIG_BLK_DEV_DAC960 is not set
186# CONFIG_BLK_DEV_UMEM is not set 204# CONFIG_BLK_DEV_UMEM is not set
205# CONFIG_BLK_DEV_COW_COMMON is not set
187CONFIG_BLK_DEV_LOOP=y 206CONFIG_BLK_DEV_LOOP=y
188# CONFIG_BLK_DEV_CRYPTOLOOP is not set 207# CONFIG_BLK_DEV_CRYPTOLOOP is not set
189# CONFIG_BLK_DEV_NBD is not set 208# CONFIG_BLK_DEV_NBD is not set
@@ -203,6 +222,7 @@ CONFIG_IOSCHED_NOOP=y
203CONFIG_IOSCHED_AS=y 222CONFIG_IOSCHED_AS=y
204CONFIG_IOSCHED_DEADLINE=y 223CONFIG_IOSCHED_DEADLINE=y
205CONFIG_IOSCHED_CFQ=y 224CONFIG_IOSCHED_CFQ=y
225# CONFIG_ATA_OVER_ETH is not set
206 226
207# 227#
208# ATA/ATAPI/MFM/RLL support 228# ATA/ATAPI/MFM/RLL support
@@ -246,6 +266,7 @@ CONFIG_BLK_DEV_CMD64X=y
246# CONFIG_BLK_DEV_HPT366 is not set 266# CONFIG_BLK_DEV_HPT366 is not set
247# CONFIG_BLK_DEV_SC1200 is not set 267# CONFIG_BLK_DEV_SC1200 is not set
248# CONFIG_BLK_DEV_PIIX is not set 268# CONFIG_BLK_DEV_PIIX is not set
269# CONFIG_BLK_DEV_IT821X is not set
249# CONFIG_BLK_DEV_NS87415 is not set 270# CONFIG_BLK_DEV_NS87415 is not set
250# CONFIG_BLK_DEV_PDC202XX_OLD is not set 271# CONFIG_BLK_DEV_PDC202XX_OLD is not set
251# CONFIG_BLK_DEV_PDC202XX_NEW is not set 272# CONFIG_BLK_DEV_PDC202XX_NEW is not set
@@ -275,6 +296,7 @@ CONFIG_CHR_DEV_OSST=y
275CONFIG_BLK_DEV_SR=y 296CONFIG_BLK_DEV_SR=y
276CONFIG_BLK_DEV_SR_VENDOR=y 297CONFIG_BLK_DEV_SR_VENDOR=y
277CONFIG_CHR_DEV_SG=y 298CONFIG_CHR_DEV_SG=y
299# CONFIG_CHR_DEV_SCH is not set
278 300
279# 301#
280# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 302# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -288,6 +310,7 @@ CONFIG_SCSI_LOGGING=y
288# 310#
289CONFIG_SCSI_SPI_ATTRS=y 311CONFIG_SCSI_SPI_ATTRS=y
290# CONFIG_SCSI_FC_ATTRS is not set 312# CONFIG_SCSI_FC_ATTRS is not set
313# CONFIG_SCSI_ISCSI_ATTRS is not set
291 314
292# 315#
293# SCSI low-level drivers 316# SCSI low-level drivers
@@ -303,13 +326,10 @@ CONFIG_SCSI_SPI_ATTRS=y
303# CONFIG_MEGARAID_NEWGEN is not set 326# CONFIG_MEGARAID_NEWGEN is not set
304# CONFIG_MEGARAID_LEGACY is not set 327# CONFIG_MEGARAID_LEGACY is not set
305# CONFIG_SCSI_SATA is not set 328# CONFIG_SCSI_SATA is not set
306# CONFIG_SCSI_BUSLOGIC is not set
307# CONFIG_SCSI_CPQFCTS is not set 329# CONFIG_SCSI_CPQFCTS is not set
308# CONFIG_SCSI_DMX3191D is not set 330# CONFIG_SCSI_DMX3191D is not set
309# CONFIG_SCSI_EATA is not set
310# CONFIG_SCSI_EATA_PIO is not set 331# CONFIG_SCSI_EATA_PIO is not set
311# CONFIG_SCSI_FUTURE_DOMAIN is not set 332# CONFIG_SCSI_FUTURE_DOMAIN is not set
312# CONFIG_SCSI_GDTH is not set
313# CONFIG_SCSI_IPS is not set 333# CONFIG_SCSI_IPS is not set
314# CONFIG_SCSI_INITIO is not set 334# CONFIG_SCSI_INITIO is not set
315# CONFIG_SCSI_INIA100 is not set 335# CONFIG_SCSI_INIA100 is not set
@@ -319,8 +339,6 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
319CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 339CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
320# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 340# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
321# CONFIG_SCSI_IPR is not set 341# CONFIG_SCSI_IPR is not set
322# CONFIG_SCSI_PCI2000 is not set
323# CONFIG_SCSI_PCI2220I is not set
324# CONFIG_SCSI_QLOGIC_ISP is not set 342# CONFIG_SCSI_QLOGIC_ISP is not set
325# CONFIG_SCSI_QLOGIC_FC is not set 343# CONFIG_SCSI_QLOGIC_FC is not set
326CONFIG_SCSI_QLOGIC_1280=y 344CONFIG_SCSI_QLOGIC_1280=y
@@ -331,7 +349,7 @@ CONFIG_SCSI_QLA2XXX=y
331# CONFIG_SCSI_QLA2300 is not set 349# CONFIG_SCSI_QLA2300 is not set
332# CONFIG_SCSI_QLA2322 is not set 350# CONFIG_SCSI_QLA2322 is not set
333# CONFIG_SCSI_QLA6312 is not set 351# CONFIG_SCSI_QLA6312 is not set
334# CONFIG_SCSI_QLA6322 is not set 352# CONFIG_SCSI_LPFC is not set
335# CONFIG_SCSI_DC395x is not set 353# CONFIG_SCSI_DC395x is not set
336# CONFIG_SCSI_DC390T is not set 354# CONFIG_SCSI_DC390T is not set
337# CONFIG_SCSI_DEBUG is not set 355# CONFIG_SCSI_DEBUG is not set
@@ -344,9 +362,9 @@ CONFIG_SCSI_QLA2XXX=y
344# 362#
345# Fusion MPT device support 363# Fusion MPT device support
346# 364#
347CONFIG_FUSION=y 365# CONFIG_FUSION is not set
348CONFIG_FUSION_MAX_SGE=40 366# CONFIG_FUSION_SPI is not set
349# CONFIG_FUSION_CTL is not set 367# CONFIG_FUSION_FC is not set
350 368
351# 369#
352# IEEE 1394 (FireWire) support 370# IEEE 1394 (FireWire) support
@@ -368,12 +386,12 @@ CONFIG_NET=y
368# 386#
369CONFIG_PACKET=y 387CONFIG_PACKET=y
370# CONFIG_PACKET_MMAP is not set 388# CONFIG_PACKET_MMAP is not set
371# CONFIG_NETLINK_DEV is not set
372CONFIG_UNIX=y 389CONFIG_UNIX=y
373# CONFIG_NET_KEY is not set 390# CONFIG_NET_KEY is not set
374CONFIG_INET=y 391CONFIG_INET=y
375CONFIG_IP_MULTICAST=y 392CONFIG_IP_MULTICAST=y
376# CONFIG_IP_ADVANCED_ROUTER is not set 393# CONFIG_IP_ADVANCED_ROUTER is not set
394CONFIG_IP_FIB_HASH=y
377# CONFIG_IP_PNP is not set 395# CONFIG_IP_PNP is not set
378# CONFIG_NET_IPIP is not set 396# CONFIG_NET_IPIP is not set
379# CONFIG_NET_IPGRE is not set 397# CONFIG_NET_IPGRE is not set
@@ -386,6 +404,8 @@ CONFIG_IP_MULTICAST=y
386# CONFIG_INET_TUNNEL is not set 404# CONFIG_INET_TUNNEL is not set
387# CONFIG_IP_TCPDIAG is not set 405# CONFIG_IP_TCPDIAG is not set
388# CONFIG_IP_TCPDIAG_IPV6 is not set 406# CONFIG_IP_TCPDIAG_IPV6 is not set
407# CONFIG_TCP_CONG_ADVANCED is not set
408CONFIG_TCP_CONG_BIC=y
389 409
390# 410#
391# IP: Virtual Server Configuration 411# IP: Virtual Server Configuration
@@ -405,8 +425,6 @@ CONFIG_NETFILTER=y
405CONFIG_IP_NF_ARPTABLES=y 425CONFIG_IP_NF_ARPTABLES=y
406# CONFIG_IP_NF_ARPFILTER is not set 426# CONFIG_IP_NF_ARPFILTER is not set
407# CONFIG_IP_NF_ARP_MANGLE is not set 427# CONFIG_IP_NF_ARP_MANGLE is not set
408# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
409# CONFIG_IP_NF_COMPAT_IPFWADM is not set
410 428
411# 429#
412# SCTP Configuration (EXPERIMENTAL) 430# SCTP Configuration (EXPERIMENTAL)
@@ -483,7 +501,6 @@ CONFIG_NET_PCI=y
483# CONFIG_DGRS is not set 501# CONFIG_DGRS is not set
484# CONFIG_EEPRO100 is not set 502# CONFIG_EEPRO100 is not set
485CONFIG_E100=y 503CONFIG_E100=y
486# CONFIG_E100_NAPI is not set
487# CONFIG_FEALNX is not set 504# CONFIG_FEALNX is not set
488# CONFIG_NATSEMI is not set 505# CONFIG_NATSEMI is not set
489# CONFIG_NE2K_PCI is not set 506# CONFIG_NE2K_PCI is not set
@@ -505,9 +522,11 @@ CONFIG_E1000=y
505# CONFIG_HAMACHI is not set 522# CONFIG_HAMACHI is not set
506# CONFIG_YELLOWFIN is not set 523# CONFIG_YELLOWFIN is not set
507# CONFIG_R8169 is not set 524# CONFIG_R8169 is not set
525# CONFIG_SKGE is not set
508# CONFIG_SK98LIN is not set 526# CONFIG_SK98LIN is not set
509# CONFIG_VIA_VELOCITY is not set 527# CONFIG_VIA_VELOCITY is not set
510CONFIG_TIGON3=y 528CONFIG_TIGON3=y
529# CONFIG_BNX2 is not set
511 530
512# 531#
513# Ethernet (10000 Mbit) 532# Ethernet (10000 Mbit)
@@ -565,18 +584,6 @@ CONFIG_INPUT_EVDEV=y
565# CONFIG_INPUT_EVBUG is not set 584# CONFIG_INPUT_EVBUG is not set
566 585
567# 586#
568# Input I/O drivers
569#
570# CONFIG_GAMEPORT is not set
571CONFIG_SOUND_GAMEPORT=y
572CONFIG_SERIO=y
573# CONFIG_SERIO_I8042 is not set
574# CONFIG_SERIO_SERPORT is not set
575# CONFIG_SERIO_CT82C710 is not set
576# CONFIG_SERIO_PCIPS2 is not set
577# CONFIG_SERIO_RAW is not set
578
579#
580# Input Device Drivers 587# Input Device Drivers
581# 588#
582# CONFIG_INPUT_KEYBOARD is not set 589# CONFIG_INPUT_KEYBOARD is not set
@@ -586,6 +593,16 @@ CONFIG_SERIO=y
586# CONFIG_INPUT_MISC is not set 593# CONFIG_INPUT_MISC is not set
587 594
588# 595#
596# Hardware I/O ports
597#
598CONFIG_SERIO=y
599# CONFIG_SERIO_I8042 is not set
600# CONFIG_SERIO_SERPORT is not set
601# CONFIG_SERIO_PCIPS2 is not set
602# CONFIG_SERIO_RAW is not set
603# CONFIG_GAMEPORT is not set
604
605#
589# Character devices 606# Character devices
590# 607#
591CONFIG_VT=y 608CONFIG_VT=y
@@ -603,7 +620,6 @@ CONFIG_SERIAL_8250_NR_UARTS=8
603CONFIG_SERIAL_8250_EXTENDED=y 620CONFIG_SERIAL_8250_EXTENDED=y
604CONFIG_SERIAL_8250_SHARE_IRQ=y 621CONFIG_SERIAL_8250_SHARE_IRQ=y
605# CONFIG_SERIAL_8250_DETECT_IRQ is not set 622# CONFIG_SERIAL_8250_DETECT_IRQ is not set
606# CONFIG_SERIAL_8250_MULTIPORT is not set
607# CONFIG_SERIAL_8250_RSA is not set 623# CONFIG_SERIAL_8250_RSA is not set
608 624
609# 625#
@@ -611,6 +627,7 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
611# 627#
612CONFIG_SERIAL_CORE=y 628CONFIG_SERIAL_CORE=y
613CONFIG_SERIAL_CORE_CONSOLE=y 629CONFIG_SERIAL_CORE_CONSOLE=y
630# CONFIG_SERIAL_JSM is not set
614CONFIG_UNIX98_PTYS=y 631CONFIG_UNIX98_PTYS=y
615CONFIG_LEGACY_PTYS=y 632CONFIG_LEGACY_PTYS=y
616CONFIG_LEGACY_PTY_COUNT=256 633CONFIG_LEGACY_PTY_COUNT=256
@@ -644,6 +661,12 @@ CONFIG_DRM_RADEON=y
644# CONFIG_DRM_SIS is not set 661# CONFIG_DRM_SIS is not set
645# CONFIG_RAW_DRIVER is not set 662# CONFIG_RAW_DRIVER is not set
646# CONFIG_HPET is not set 663# CONFIG_HPET is not set
664# CONFIG_HANGCHECK_TIMER is not set
665
666#
667# TPM devices
668#
669# CONFIG_TCG_TPM is not set
647 670
648# 671#
649# I2C support 672# I2C support
@@ -668,6 +691,7 @@ CONFIG_I2C_ALGOPCF=y
668# CONFIG_I2C_AMD8111 is not set 691# CONFIG_I2C_AMD8111 is not set
669# CONFIG_I2C_I801 is not set 692# CONFIG_I2C_I801 is not set
670# CONFIG_I2C_I810 is not set 693# CONFIG_I2C_I810 is not set
694# CONFIG_I2C_PIIX4 is not set
671# CONFIG_I2C_ISA is not set 695# CONFIG_I2C_ISA is not set
672# CONFIG_I2C_NFORCE2 is not set 696# CONFIG_I2C_NFORCE2 is not set
673# CONFIG_I2C_PARPORT_LIGHT is not set 697# CONFIG_I2C_PARPORT_LIGHT is not set
@@ -691,10 +715,14 @@ CONFIG_I2C_ALGOPCF=y
691# CONFIG_SENSORS_ADM1025 is not set 715# CONFIG_SENSORS_ADM1025 is not set
692# CONFIG_SENSORS_ADM1026 is not set 716# CONFIG_SENSORS_ADM1026 is not set
693# CONFIG_SENSORS_ADM1031 is not set 717# CONFIG_SENSORS_ADM1031 is not set
718# CONFIG_SENSORS_ADM9240 is not set
694# CONFIG_SENSORS_ASB100 is not set 719# CONFIG_SENSORS_ASB100 is not set
720# CONFIG_SENSORS_ATXP1 is not set
695# CONFIG_SENSORS_DS1621 is not set 721# CONFIG_SENSORS_DS1621 is not set
696# CONFIG_SENSORS_FSCHER is not set 722# CONFIG_SENSORS_FSCHER is not set
723# CONFIG_SENSORS_FSCPOS is not set
697# CONFIG_SENSORS_GL518SM is not set 724# CONFIG_SENSORS_GL518SM is not set
725# CONFIG_SENSORS_GL520SM is not set
698# CONFIG_SENSORS_IT87 is not set 726# CONFIG_SENSORS_IT87 is not set
699# CONFIG_SENSORS_LM63 is not set 727# CONFIG_SENSORS_LM63 is not set
700# CONFIG_SENSORS_LM75 is not set 728# CONFIG_SENSORS_LM75 is not set
@@ -705,21 +733,29 @@ CONFIG_I2C_ALGOPCF=y
705# CONFIG_SENSORS_LM85 is not set 733# CONFIG_SENSORS_LM85 is not set
706# CONFIG_SENSORS_LM87 is not set 734# CONFIG_SENSORS_LM87 is not set
707# CONFIG_SENSORS_LM90 is not set 735# CONFIG_SENSORS_LM90 is not set
736# CONFIG_SENSORS_LM92 is not set
708# CONFIG_SENSORS_MAX1619 is not set 737# CONFIG_SENSORS_MAX1619 is not set
709# CONFIG_SENSORS_PC87360 is not set 738# CONFIG_SENSORS_PC87360 is not set
739# CONFIG_SENSORS_SMSC47B397 is not set
740# CONFIG_SENSORS_SIS5595 is not set
710# CONFIG_SENSORS_SMSC47M1 is not set 741# CONFIG_SENSORS_SMSC47M1 is not set
711# CONFIG_SENSORS_VIA686A is not set 742# CONFIG_SENSORS_VIA686A is not set
712# CONFIG_SENSORS_W83781D is not set 743# CONFIG_SENSORS_W83781D is not set
713# CONFIG_SENSORS_W83L785TS is not set 744# CONFIG_SENSORS_W83L785TS is not set
714# CONFIG_SENSORS_W83627HF is not set 745# CONFIG_SENSORS_W83627HF is not set
746# CONFIG_SENSORS_W83627EHF is not set
715 747
716# 748#
717# Other I2C Chip support 749# Other I2C Chip support
718# 750#
751# CONFIG_SENSORS_DS1337 is not set
752# CONFIG_SENSORS_DS1374 is not set
719# CONFIG_SENSORS_EEPROM is not set 753# CONFIG_SENSORS_EEPROM is not set
720# CONFIG_SENSORS_PCF8574 is not set 754# CONFIG_SENSORS_PCF8574 is not set
755# CONFIG_SENSORS_PCA9539 is not set
721# CONFIG_SENSORS_PCF8591 is not set 756# CONFIG_SENSORS_PCF8591 is not set
722# CONFIG_SENSORS_RTC8564 is not set 757# CONFIG_SENSORS_RTC8564 is not set
758# CONFIG_SENSORS_MAX6875 is not set
723# CONFIG_I2C_DEBUG_CORE is not set 759# CONFIG_I2C_DEBUG_CORE is not set
724# CONFIG_I2C_DEBUG_ALGO is not set 760# CONFIG_I2C_DEBUG_ALGO is not set
725# CONFIG_I2C_DEBUG_BUS is not set 761# CONFIG_I2C_DEBUG_BUS is not set
@@ -746,6 +782,7 @@ CONFIG_VIDEO_DEV=y
746# 782#
747# Video Adapters 783# Video Adapters
748# 784#
785# CONFIG_TUNER_MULTI_I2C is not set
749# CONFIG_VIDEO_BT848 is not set 786# CONFIG_VIDEO_BT848 is not set
750# CONFIG_VIDEO_CPIA is not set 787# CONFIG_VIDEO_CPIA is not set
751# CONFIG_VIDEO_SAA5246A is not set 788# CONFIG_VIDEO_SAA5246A is not set
@@ -778,6 +815,11 @@ CONFIG_VIDEO_DEV=y
778# Graphics support 815# Graphics support
779# 816#
780CONFIG_FB=y 817CONFIG_FB=y
818CONFIG_FB_CFB_FILLRECT=y
819CONFIG_FB_CFB_COPYAREA=y
820CONFIG_FB_CFB_IMAGEBLIT=y
821CONFIG_FB_SOFT_CURSOR=y
822# CONFIG_FB_MACMODES is not set
781CONFIG_FB_MODE_HELPERS=y 823CONFIG_FB_MODE_HELPERS=y
782# CONFIG_FB_TILEBLITTING is not set 824# CONFIG_FB_TILEBLITTING is not set
783# CONFIG_FB_CIRRUS is not set 825# CONFIG_FB_CIRRUS is not set
@@ -785,6 +827,7 @@ CONFIG_FB_MODE_HELPERS=y
785# CONFIG_FB_CYBER2000 is not set 827# CONFIG_FB_CYBER2000 is not set
786# CONFIG_FB_ASILIANT is not set 828# CONFIG_FB_ASILIANT is not set
787# CONFIG_FB_IMSTT is not set 829# CONFIG_FB_IMSTT is not set
830# CONFIG_FB_NVIDIA is not set
788# CONFIG_FB_RIVA is not set 831# CONFIG_FB_RIVA is not set
789# CONFIG_FB_MATROX is not set 832# CONFIG_FB_MATROX is not set
790# CONFIG_FB_RADEON_OLD is not set 833# CONFIG_FB_RADEON_OLD is not set
@@ -801,6 +844,7 @@ CONFIG_FB_RADEON_DEBUG=y
801# CONFIG_FB_VOODOO1 is not set 844# CONFIG_FB_VOODOO1 is not set
802# CONFIG_FB_TRIDENT is not set 845# CONFIG_FB_TRIDENT is not set
803# CONFIG_FB_PM3 is not set 846# CONFIG_FB_PM3 is not set
847# CONFIG_FB_S1D13XXX is not set
804# CONFIG_FB_VIRTUAL is not set 848# CONFIG_FB_VIRTUAL is not set
805 849
806# 850#
@@ -820,6 +864,7 @@ CONFIG_LOGO=y
820# CONFIG_LOGO_LINUX_MONO is not set 864# CONFIG_LOGO_LINUX_MONO is not set
821# CONFIG_LOGO_LINUX_VGA16 is not set 865# CONFIG_LOGO_LINUX_VGA16 is not set
822CONFIG_LOGO_LINUX_CLUT224=y 866CONFIG_LOGO_LINUX_CLUT224=y
867# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
823 868
824# 869#
825# Sound 870# Sound
@@ -869,6 +914,8 @@ CONFIG_SND_AC97_CODEC=y
869# CONFIG_SND_CS46XX is not set 914# CONFIG_SND_CS46XX is not set
870# CONFIG_SND_CS4281 is not set 915# CONFIG_SND_CS4281 is not set
871# CONFIG_SND_EMU10K1 is not set 916# CONFIG_SND_EMU10K1 is not set
917# CONFIG_SND_EMU10K1X is not set
918# CONFIG_SND_CA0106 is not set
872# CONFIG_SND_KORG1212 is not set 919# CONFIG_SND_KORG1212 is not set
873# CONFIG_SND_MIXART is not set 920# CONFIG_SND_MIXART is not set
874# CONFIG_SND_NM256 is not set 921# CONFIG_SND_NM256 is not set
@@ -876,6 +923,7 @@ CONFIG_SND_AC97_CODEC=y
876# CONFIG_SND_RME96 is not set 923# CONFIG_SND_RME96 is not set
877# CONFIG_SND_RME9652 is not set 924# CONFIG_SND_RME9652 is not set
878# CONFIG_SND_HDSP is not set 925# CONFIG_SND_HDSP is not set
926# CONFIG_SND_HDSPM is not set
879# CONFIG_SND_TRIDENT is not set 927# CONFIG_SND_TRIDENT is not set
880# CONFIG_SND_YMFPCI is not set 928# CONFIG_SND_YMFPCI is not set
881# CONFIG_SND_ALS4000 is not set 929# CONFIG_SND_ALS4000 is not set
@@ -893,13 +941,14 @@ CONFIG_SND_FM801_TEA575X=y
893# CONFIG_SND_INTEL8X0M is not set 941# CONFIG_SND_INTEL8X0M is not set
894# CONFIG_SND_SONICVIBES is not set 942# CONFIG_SND_SONICVIBES is not set
895# CONFIG_SND_VIA82XX is not set 943# CONFIG_SND_VIA82XX is not set
944# CONFIG_SND_VIA82XX_MODEM is not set
896# CONFIG_SND_VX222 is not set 945# CONFIG_SND_VX222 is not set
946# CONFIG_SND_HDA_INTEL is not set
897 947
898# 948#
899# USB devices 949# USB devices
900# 950#
901# CONFIG_SND_USB_AUDIO is not set 951# CONFIG_SND_USB_AUDIO is not set
902# CONFIG_SND_USB_USX2Y is not set
903 952
904# 953#
905# Open Sound System 954# Open Sound System
@@ -909,6 +958,8 @@ CONFIG_SND_FM801_TEA575X=y
909# 958#
910# USB support 959# USB support
911# 960#
961CONFIG_USB_ARCH_HAS_HCD=y
962CONFIG_USB_ARCH_HAS_OHCI=y
912CONFIG_USB=y 963CONFIG_USB=y
913# CONFIG_USB_DEBUG is not set 964# CONFIG_USB_DEBUG is not set
914 965
@@ -920,8 +971,6 @@ CONFIG_USB_BANDWIDTH=y
920# CONFIG_USB_DYNAMIC_MINORS is not set 971# CONFIG_USB_DYNAMIC_MINORS is not set
921# CONFIG_USB_SUSPEND is not set 972# CONFIG_USB_SUSPEND is not set
922# CONFIG_USB_OTG is not set 973# CONFIG_USB_OTG is not set
923CONFIG_USB_ARCH_HAS_HCD=y
924CONFIG_USB_ARCH_HAS_OHCI=y
925 974
926# 975#
927# USB Host Controller Drivers 976# USB Host Controller Drivers
@@ -929,7 +978,10 @@ CONFIG_USB_ARCH_HAS_OHCI=y
929CONFIG_USB_EHCI_HCD=y 978CONFIG_USB_EHCI_HCD=y
930# CONFIG_USB_EHCI_SPLIT_ISO is not set 979# CONFIG_USB_EHCI_SPLIT_ISO is not set
931# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 980# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
981# CONFIG_USB_ISP116X_HCD is not set
932CONFIG_USB_OHCI_HCD=y 982CONFIG_USB_OHCI_HCD=y
983# CONFIG_USB_OHCI_BIG_ENDIAN is not set
984CONFIG_USB_OHCI_LITTLE_ENDIAN=y
933CONFIG_USB_UHCI_HCD=y 985CONFIG_USB_UHCI_HCD=y
934# CONFIG_USB_SL811_HCD is not set 986# CONFIG_USB_SL811_HCD is not set
935 987
@@ -947,12 +999,11 @@ CONFIG_USB_UHCI_HCD=y
947# 999#
948CONFIG_USB_STORAGE=y 1000CONFIG_USB_STORAGE=y
949# CONFIG_USB_STORAGE_DEBUG is not set 1001# CONFIG_USB_STORAGE_DEBUG is not set
950# CONFIG_USB_STORAGE_RW_DETECT is not set
951# CONFIG_USB_STORAGE_DATAFAB is not set 1002# CONFIG_USB_STORAGE_DATAFAB is not set
952# CONFIG_USB_STORAGE_FREECOM is not set 1003# CONFIG_USB_STORAGE_FREECOM is not set
953# CONFIG_USB_STORAGE_ISD200 is not set 1004# CONFIG_USB_STORAGE_ISD200 is not set
954# CONFIG_USB_STORAGE_DPCM is not set 1005# CONFIG_USB_STORAGE_DPCM is not set
955# CONFIG_USB_STORAGE_HP8200e is not set 1006# CONFIG_USB_STORAGE_USBAT is not set
956# CONFIG_USB_STORAGE_SDDR09 is not set 1007# CONFIG_USB_STORAGE_SDDR09 is not set
957# CONFIG_USB_STORAGE_SDDR55 is not set 1008# CONFIG_USB_STORAGE_SDDR55 is not set
958# CONFIG_USB_STORAGE_JUMPSHOT is not set 1009# CONFIG_USB_STORAGE_JUMPSHOT is not set
@@ -966,9 +1017,11 @@ CONFIG_USB_HIDINPUT=y
966CONFIG_USB_HIDDEV=y 1017CONFIG_USB_HIDDEV=y
967# CONFIG_USB_AIPTEK is not set 1018# CONFIG_USB_AIPTEK is not set
968# CONFIG_USB_WACOM is not set 1019# CONFIG_USB_WACOM is not set
1020# CONFIG_USB_ACECAD is not set
969# CONFIG_USB_KBTAB is not set 1021# CONFIG_USB_KBTAB is not set
970# CONFIG_USB_POWERMATE is not set 1022# CONFIG_USB_POWERMATE is not set
971# CONFIG_USB_MTOUCH is not set 1023# CONFIG_USB_MTOUCH is not set
1024# CONFIG_USB_ITMTOUCH is not set
972# CONFIG_USB_EGALAX is not set 1025# CONFIG_USB_EGALAX is not set
973# CONFIG_USB_XPAD is not set 1026# CONFIG_USB_XPAD is not set
974# CONFIG_USB_ATI_REMOTE is not set 1027# CONFIG_USB_ATI_REMOTE is not set
@@ -978,7 +1031,6 @@ CONFIG_USB_HIDDEV=y
978# 1031#
979# CONFIG_USB_MDC800 is not set 1032# CONFIG_USB_MDC800 is not set
980# CONFIG_USB_MICROTEK is not set 1033# CONFIG_USB_MICROTEK is not set
981# CONFIG_USB_HPUSBSCSI is not set
982 1034
983# 1035#
984# USB Multimedia devices 1036# USB Multimedia devices
@@ -992,6 +1044,7 @@ CONFIG_USB_HIDDEV=y
992# CONFIG_USB_SE401 is not set 1044# CONFIG_USB_SE401 is not set
993# CONFIG_USB_SN9C102 is not set 1045# CONFIG_USB_SN9C102 is not set
994# CONFIG_USB_STV680 is not set 1046# CONFIG_USB_STV680 is not set
1047# CONFIG_USB_PWC is not set
995 1048
996# 1049#
997# USB Network Adapters 1050# USB Network Adapters
@@ -1001,6 +1054,7 @@ CONFIG_USB_HIDDEV=y
1001# CONFIG_USB_PEGASUS is not set 1054# CONFIG_USB_PEGASUS is not set
1002# CONFIG_USB_RTL8150 is not set 1055# CONFIG_USB_RTL8150 is not set
1003# CONFIG_USB_USBNET is not set 1056# CONFIG_USB_USBNET is not set
1057CONFIG_USB_MON=y
1004 1058
1005# 1059#
1006# USB port drivers 1060# USB port drivers
@@ -1016,7 +1070,6 @@ CONFIG_USB_HIDDEV=y
1016# 1070#
1017# CONFIG_USB_EMI62 is not set 1071# CONFIG_USB_EMI62 is not set
1018# CONFIG_USB_EMI26 is not set 1072# CONFIG_USB_EMI26 is not set
1019# CONFIG_USB_TIGL is not set
1020# CONFIG_USB_AUERSWALD is not set 1073# CONFIG_USB_AUERSWALD is not set
1021# CONFIG_USB_RIO500 is not set 1074# CONFIG_USB_RIO500 is not set
1022# CONFIG_USB_LEGOTOWER is not set 1075# CONFIG_USB_LEGOTOWER is not set
@@ -1025,9 +1078,11 @@ CONFIG_USB_HIDDEV=y
1025# CONFIG_USB_CYTHERM is not set 1078# CONFIG_USB_CYTHERM is not set
1026# CONFIG_USB_PHIDGETKIT is not set 1079# CONFIG_USB_PHIDGETKIT is not set
1027# CONFIG_USB_PHIDGETSERVO is not set 1080# CONFIG_USB_PHIDGETSERVO is not set
1081# CONFIG_USB_IDMOUSE is not set
1082# CONFIG_USB_SISUSBVGA is not set
1028 1083
1029# 1084#
1030# USB ATM/DSL drivers 1085# USB DSL modem support
1031# 1086#
1032 1087
1033# 1088#
@@ -1041,12 +1096,22 @@ CONFIG_USB_HIDDEV=y
1041# CONFIG_MMC is not set 1096# CONFIG_MMC is not set
1042 1097
1043# 1098#
1099# InfiniBand support
1100#
1101# CONFIG_INFINIBAND is not set
1102
1103#
1104# SN Devices
1105#
1106
1107#
1044# File systems 1108# File systems
1045# 1109#
1046CONFIG_EXT2_FS=y 1110CONFIG_EXT2_FS=y
1047CONFIG_EXT2_FS_XATTR=y 1111CONFIG_EXT2_FS_XATTR=y
1048# CONFIG_EXT2_FS_POSIX_ACL is not set 1112# CONFIG_EXT2_FS_POSIX_ACL is not set
1049# CONFIG_EXT2_FS_SECURITY is not set 1113# CONFIG_EXT2_FS_SECURITY is not set
1114# CONFIG_EXT2_FS_XIP is not set
1050CONFIG_EXT3_FS=y 1115CONFIG_EXT3_FS=y
1051CONFIG_EXT3_FS_XATTR=y 1116CONFIG_EXT3_FS_XATTR=y
1052# CONFIG_EXT3_FS_POSIX_ACL is not set 1117# CONFIG_EXT3_FS_POSIX_ACL is not set
@@ -1056,6 +1121,10 @@ CONFIG_JBD=y
1056CONFIG_FS_MBCACHE=y 1121CONFIG_FS_MBCACHE=y
1057# CONFIG_REISERFS_FS is not set 1122# CONFIG_REISERFS_FS is not set
1058# CONFIG_JFS_FS is not set 1123# CONFIG_JFS_FS is not set
1124
1125#
1126# XFS support
1127#
1059# CONFIG_XFS_FS is not set 1128# CONFIG_XFS_FS is not set
1060# CONFIG_MINIX_FS is not set 1129# CONFIG_MINIX_FS is not set
1061# CONFIG_ROMFS_FS is not set 1130# CONFIG_ROMFS_FS is not set
@@ -1089,7 +1158,6 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1089CONFIG_PROC_FS=y 1158CONFIG_PROC_FS=y
1090CONFIG_PROC_KCORE=y 1159CONFIG_PROC_KCORE=y
1091CONFIG_SYSFS=y 1160CONFIG_SYSFS=y
1092# CONFIG_DEVFS_FS is not set
1093# CONFIG_DEVPTS_FS_XATTR is not set 1161# CONFIG_DEVPTS_FS_XATTR is not set
1094CONFIG_TMPFS=y 1162CONFIG_TMPFS=y
1095CONFIG_TMPFS_XATTR=y 1163CONFIG_TMPFS_XATTR=y
@@ -1120,15 +1188,18 @@ CONFIG_RAMFS=y
1120# 1188#
1121CONFIG_NFS_FS=y 1189CONFIG_NFS_FS=y
1122CONFIG_NFS_V3=y 1190CONFIG_NFS_V3=y
1191# CONFIG_NFS_V3_ACL is not set
1123CONFIG_NFS_V4=y 1192CONFIG_NFS_V4=y
1124# CONFIG_NFS_DIRECTIO is not set 1193# CONFIG_NFS_DIRECTIO is not set
1125CONFIG_NFSD=y 1194CONFIG_NFSD=y
1126CONFIG_NFSD_V3=y 1195CONFIG_NFSD_V3=y
1196# CONFIG_NFSD_V3_ACL is not set
1127# CONFIG_NFSD_V4 is not set 1197# CONFIG_NFSD_V4 is not set
1128# CONFIG_NFSD_TCP is not set 1198# CONFIG_NFSD_TCP is not set
1129CONFIG_LOCKD=y 1199CONFIG_LOCKD=y
1130CONFIG_LOCKD_V4=y 1200CONFIG_LOCKD_V4=y
1131CONFIG_EXPORTFS=y 1201CONFIG_EXPORTFS=y
1202CONFIG_NFS_COMMON=y
1132CONFIG_SUNRPC=y 1203CONFIG_SUNRPC=y
1133CONFIG_SUNRPC_GSS=y 1204CONFIG_SUNRPC_GSS=y
1134CONFIG_RPCSEC_GSS_KRB5=y 1205CONFIG_RPCSEC_GSS_KRB5=y
@@ -1209,6 +1280,8 @@ CONFIG_NLS_UTF8=y
1209# CONFIG_CRC_CCITT is not set 1280# CONFIG_CRC_CCITT is not set
1210CONFIG_CRC32=y 1281CONFIG_CRC32=y
1211# CONFIG_LIBCRC32C is not set 1282# CONFIG_LIBCRC32C is not set
1283CONFIG_GENERIC_HARDIRQS=y
1284CONFIG_GENERIC_IRQ_PROBE=y
1212 1285
1213# 1286#
1214# Profiling support 1287# Profiling support
@@ -1218,14 +1291,18 @@ CONFIG_CRC32=y
1218# 1291#
1219# Kernel hacking 1292# Kernel hacking
1220# 1293#
1294# CONFIG_PRINTK_TIME is not set
1221CONFIG_DEBUG_KERNEL=y 1295CONFIG_DEBUG_KERNEL=y
1222CONFIG_MAGIC_SYSRQ=y 1296CONFIG_MAGIC_SYSRQ=y
1297CONFIG_LOG_BUF_SHIFT=17
1223# CONFIG_SCHEDSTATS is not set 1298# CONFIG_SCHEDSTATS is not set
1224# CONFIG_DEBUG_SLAB is not set 1299# CONFIG_DEBUG_SLAB is not set
1225# CONFIG_DEBUG_SPINLOCK is not set 1300# CONFIG_DEBUG_SPINLOCK is not set
1226# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1301# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1227# CONFIG_DEBUG_KOBJECT is not set 1302# CONFIG_DEBUG_KOBJECT is not set
1228# CONFIG_DEBUG_INFO is not set 1303# CONFIG_DEBUG_INFO is not set
1304# CONFIG_DEBUG_FS is not set
1305CONFIG_KPROBES=y
1229CONFIG_IA64_GRANULE_16MB=y 1306CONFIG_IA64_GRANULE_16MB=y
1230# CONFIG_IA64_GRANULE_64MB is not set 1307# CONFIG_IA64_GRANULE_64MB is not set
1231CONFIG_IA64_PRINT_HAZARDS=y 1308CONFIG_IA64_PRINT_HAZARDS=y
@@ -1252,6 +1329,7 @@ CONFIG_CRYPTO_MD5=y
1252# CONFIG_CRYPTO_SHA256 is not set 1329# CONFIG_CRYPTO_SHA256 is not set
1253# CONFIG_CRYPTO_SHA512 is not set 1330# CONFIG_CRYPTO_SHA512 is not set
1254# CONFIG_CRYPTO_WP512 is not set 1331# CONFIG_CRYPTO_WP512 is not set
1332# CONFIG_CRYPTO_TGR192 is not set
1255CONFIG_CRYPTO_DES=y 1333CONFIG_CRYPTO_DES=y
1256# CONFIG_CRYPTO_BLOWFISH is not set 1334# CONFIG_CRYPTO_BLOWFISH is not set
1257# CONFIG_CRYPTO_TWOFISH is not set 1335# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/ia64/defconfig b/arch/ia64/defconfig
index 7539e83bf054..8444add76380 100644
--- a/arch/ia64/defconfig
+++ b/arch/ia64/defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.10 3# Linux kernel version: 2.6.12
4# Thu Jan 6 11:13:13 2005 4# Tue Jun 21 11:30:42 2005
5# 5#
6 6
7# 7#
@@ -10,6 +10,7 @@
10CONFIG_EXPERIMENTAL=y 10CONFIG_EXPERIMENTAL=y
11CONFIG_CLEAN_COMPILE=y 11CONFIG_CLEAN_COMPILE=y
12CONFIG_LOCK_KERNEL=y 12CONFIG_LOCK_KERNEL=y
13CONFIG_INIT_ENV_ARG_LIMIT=32
13 14
14# 15#
15# General setup 16# General setup
@@ -21,24 +22,27 @@ CONFIG_POSIX_MQUEUE=y
21# CONFIG_BSD_PROCESS_ACCT is not set 22# CONFIG_BSD_PROCESS_ACCT is not set
22CONFIG_SYSCTL=y 23CONFIG_SYSCTL=y
23# CONFIG_AUDIT is not set 24# CONFIG_AUDIT is not set
24CONFIG_LOG_BUF_SHIFT=20
25CONFIG_HOTPLUG=y 25CONFIG_HOTPLUG=y
26CONFIG_KOBJECT_UEVENT=y 26CONFIG_KOBJECT_UEVENT=y
27CONFIG_IKCONFIG=y 27CONFIG_IKCONFIG=y
28CONFIG_IKCONFIG_PROC=y 28CONFIG_IKCONFIG_PROC=y
29# CONFIG_CPUSETS is not set
29# CONFIG_EMBEDDED is not set 30# CONFIG_EMBEDDED is not set
30CONFIG_KALLSYMS=y 31CONFIG_KALLSYMS=y
31CONFIG_KALLSYMS_ALL=y 32CONFIG_KALLSYMS_ALL=y
32# CONFIG_KALLSYMS_EXTRA_PASS is not set 33# CONFIG_KALLSYMS_EXTRA_PASS is not set
34CONFIG_PRINTK=y
35CONFIG_BUG=y
36CONFIG_BASE_FULL=y
33CONFIG_FUTEX=y 37CONFIG_FUTEX=y
34CONFIG_EPOLL=y 38CONFIG_EPOLL=y
35# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
36CONFIG_SHMEM=y 39CONFIG_SHMEM=y
37CONFIG_CC_ALIGN_FUNCTIONS=0 40CONFIG_CC_ALIGN_FUNCTIONS=0
38CONFIG_CC_ALIGN_LABELS=0 41CONFIG_CC_ALIGN_LABELS=0
39CONFIG_CC_ALIGN_LOOPS=0 42CONFIG_CC_ALIGN_LOOPS=0
40CONFIG_CC_ALIGN_JUMPS=0 43CONFIG_CC_ALIGN_JUMPS=0
41# CONFIG_TINY_SHMEM is not set 44# CONFIG_TINY_SHMEM is not set
45CONFIG_BASE_SMALL=0
42 46
43# 47#
44# Loadable module support 48# Loadable module support
@@ -63,9 +67,11 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y
63CONFIG_TIME_INTERPOLATION=y 67CONFIG_TIME_INTERPOLATION=y
64CONFIG_EFI=y 68CONFIG_EFI=y
65CONFIG_GENERIC_IOMAP=y 69CONFIG_GENERIC_IOMAP=y
70CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
66CONFIG_IA64_GENERIC=y 71CONFIG_IA64_GENERIC=y
67# CONFIG_IA64_DIG is not set 72# CONFIG_IA64_DIG is not set
68# CONFIG_IA64_HP_ZX1 is not set 73# CONFIG_IA64_HP_ZX1 is not set
74# CONFIG_IA64_HP_ZX1_SWIOTLB is not set
69# CONFIG_IA64_SGI_SN2 is not set 75# CONFIG_IA64_SGI_SN2 is not set
70# CONFIG_IA64_HP_SIM is not set 76# CONFIG_IA64_HP_SIM is not set
71# CONFIG_ITANIUM is not set 77# CONFIG_ITANIUM is not set
@@ -77,13 +83,15 @@ CONFIG_IA64_PAGE_SIZE_16KB=y
77CONFIG_IA64_L1_CACHE_SHIFT=7 83CONFIG_IA64_L1_CACHE_SHIFT=7
78CONFIG_NUMA=y 84CONFIG_NUMA=y
79CONFIG_VIRTUAL_MEM_MAP=y 85CONFIG_VIRTUAL_MEM_MAP=y
80CONFIG_DISCONTIGMEM=y 86CONFIG_HOLES_IN_ZONE=y
87CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
81CONFIG_IA64_CYCLONE=y 88CONFIG_IA64_CYCLONE=y
82CONFIG_IOSAPIC=y 89CONFIG_IOSAPIC=y
83CONFIG_FORCE_MAX_ZONEORDER=18 90CONFIG_FORCE_MAX_ZONEORDER=18
84CONFIG_SMP=y 91CONFIG_SMP=y
85CONFIG_NR_CPUS=512 92CONFIG_NR_CPUS=512
86CONFIG_HOTPLUG_CPU=y 93CONFIG_HOTPLUG_CPU=y
94# CONFIG_SCHED_SMT is not set
87# CONFIG_PREEMPT is not set 95# CONFIG_PREEMPT is not set
88CONFIG_HAVE_DEC_LOCK=y 96CONFIG_HAVE_DEC_LOCK=y
89CONFIG_IA32_SUPPORT=y 97CONFIG_IA32_SUPPORT=y
@@ -135,6 +143,7 @@ CONFIG_PCI_DOMAINS=y
135# CONFIG_PCI_MSI is not set 143# CONFIG_PCI_MSI is not set
136CONFIG_PCI_LEGACY_PROC=y 144CONFIG_PCI_LEGACY_PROC=y
137CONFIG_PCI_NAMES=y 145CONFIG_PCI_NAMES=y
146# CONFIG_PCI_DEBUG is not set
138 147
139# 148#
140# PCI Hotplug Support 149# PCI Hotplug Support
@@ -144,7 +153,6 @@ CONFIG_HOTPLUG_PCI=m
144CONFIG_HOTPLUG_PCI_ACPI=m 153CONFIG_HOTPLUG_PCI_ACPI=m
145# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set 154# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
146# CONFIG_HOTPLUG_PCI_CPCI is not set 155# CONFIG_HOTPLUG_PCI_CPCI is not set
147# CONFIG_HOTPLUG_PCI_PCIE is not set
148# CONFIG_HOTPLUG_PCI_SHPC is not set 156# CONFIG_HOTPLUG_PCI_SHPC is not set
149 157
150# 158#
@@ -153,10 +161,6 @@ CONFIG_HOTPLUG_PCI_ACPI=m
153# CONFIG_PCCARD is not set 161# CONFIG_PCCARD is not set
154 162
155# 163#
156# PC-card bridges
157#
158
159#
160# Device Drivers 164# Device Drivers
161# 165#
162 166
@@ -190,6 +194,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
190# CONFIG_BLK_CPQ_CISS_DA is not set 194# CONFIG_BLK_CPQ_CISS_DA is not set
191# CONFIG_BLK_DEV_DAC960 is not set 195# CONFIG_BLK_DEV_DAC960 is not set
192# CONFIG_BLK_DEV_UMEM is not set 196# CONFIG_BLK_DEV_UMEM is not set
197# CONFIG_BLK_DEV_COW_COMMON is not set
193CONFIG_BLK_DEV_LOOP=m 198CONFIG_BLK_DEV_LOOP=m
194CONFIG_BLK_DEV_CRYPTOLOOP=m 199CONFIG_BLK_DEV_CRYPTOLOOP=m
195CONFIG_BLK_DEV_NBD=m 200CONFIG_BLK_DEV_NBD=m
@@ -209,6 +214,7 @@ CONFIG_IOSCHED_NOOP=y
209CONFIG_IOSCHED_AS=y 214CONFIG_IOSCHED_AS=y
210CONFIG_IOSCHED_DEADLINE=y 215CONFIG_IOSCHED_DEADLINE=y
211CONFIG_IOSCHED_CFQ=y 216CONFIG_IOSCHED_CFQ=y
217# CONFIG_ATA_OVER_ETH is not set
212 218
213# 219#
214# ATA/ATAPI/MFM/RLL support 220# ATA/ATAPI/MFM/RLL support
@@ -283,6 +289,7 @@ CONFIG_CHR_DEV_ST=m
283CONFIG_BLK_DEV_SR=m 289CONFIG_BLK_DEV_SR=m
284# CONFIG_BLK_DEV_SR_VENDOR is not set 290# CONFIG_BLK_DEV_SR_VENDOR is not set
285CONFIG_CHR_DEV_SG=m 291CONFIG_CHR_DEV_SG=m
292# CONFIG_CHR_DEV_SCH is not set
286 293
287# 294#
288# Some SCSI devices (e.g. CD jukebox) support multiple LUNs 295# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
@@ -310,13 +317,21 @@ CONFIG_SCSI_FC_ATTRS=y
310# CONFIG_SCSI_AIC79XX is not set 317# CONFIG_SCSI_AIC79XX is not set
311# CONFIG_MEGARAID_NEWGEN is not set 318# CONFIG_MEGARAID_NEWGEN is not set
312# CONFIG_MEGARAID_LEGACY is not set 319# CONFIG_MEGARAID_LEGACY is not set
313# CONFIG_SCSI_SATA is not set 320CONFIG_SCSI_SATA=y
314# CONFIG_SCSI_BUSLOGIC is not set 321# CONFIG_SCSI_SATA_AHCI is not set
322# CONFIG_SCSI_SATA_SVW is not set
323# CONFIG_SCSI_ATA_PIIX is not set
324# CONFIG_SCSI_SATA_NV is not set
325# CONFIG_SCSI_SATA_PROMISE is not set
326# CONFIG_SCSI_SATA_QSTOR is not set
327# CONFIG_SCSI_SATA_SX4 is not set
328# CONFIG_SCSI_SATA_SIL is not set
329# CONFIG_SCSI_SATA_SIS is not set
330# CONFIG_SCSI_SATA_ULI is not set
331# CONFIG_SCSI_SATA_VIA is not set
332CONFIG_SCSI_SATA_VITESSE=y
315# CONFIG_SCSI_DMX3191D is not set 333# CONFIG_SCSI_DMX3191D is not set
316# CONFIG_SCSI_EATA is not set
317# CONFIG_SCSI_EATA_PIO is not set
318# CONFIG_SCSI_FUTURE_DOMAIN is not set 334# CONFIG_SCSI_FUTURE_DOMAIN is not set
319# CONFIG_SCSI_GDTH is not set
320# CONFIG_SCSI_IPS is not set 335# CONFIG_SCSI_IPS is not set
321# CONFIG_SCSI_INITIO is not set 336# CONFIG_SCSI_INITIO is not set
322# CONFIG_SCSI_INIA100 is not set 337# CONFIG_SCSI_INIA100 is not set
@@ -326,7 +341,6 @@ CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16
326CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 341CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64
327# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set 342# CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set
328# CONFIG_SCSI_IPR is not set 343# CONFIG_SCSI_IPR is not set
329# CONFIG_SCSI_QLOGIC_ISP is not set
330CONFIG_SCSI_QLOGIC_FC=y 344CONFIG_SCSI_QLOGIC_FC=y
331# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set 345# CONFIG_SCSI_QLOGIC_FC_FIRMWARE is not set
332CONFIG_SCSI_QLOGIC_1280=y 346CONFIG_SCSI_QLOGIC_1280=y
@@ -337,6 +351,7 @@ CONFIG_SCSI_QLA22XX=m
337CONFIG_SCSI_QLA2300=m 351CONFIG_SCSI_QLA2300=m
338CONFIG_SCSI_QLA2322=m 352CONFIG_SCSI_QLA2322=m
339# CONFIG_SCSI_QLA6312 is not set 353# CONFIG_SCSI_QLA6312 is not set
354# CONFIG_SCSI_LPFC is not set
340# CONFIG_SCSI_DC395x is not set 355# CONFIG_SCSI_DC395x is not set
341# CONFIG_SCSI_DC390T is not set 356# CONFIG_SCSI_DC390T is not set
342# CONFIG_SCSI_DEBUG is not set 357# CONFIG_SCSI_DEBUG is not set
@@ -359,12 +374,16 @@ CONFIG_DM_CRYPT=m
359CONFIG_DM_SNAPSHOT=m 374CONFIG_DM_SNAPSHOT=m
360CONFIG_DM_MIRROR=m 375CONFIG_DM_MIRROR=m
361CONFIG_DM_ZERO=m 376CONFIG_DM_ZERO=m
377CONFIG_DM_MULTIPATH=m
378# CONFIG_DM_MULTIPATH_EMC is not set
362 379
363# 380#
364# Fusion MPT device support 381# Fusion MPT device support
365# 382#
366CONFIG_FUSION=y 383CONFIG_FUSION=y
367CONFIG_FUSION_MAX_SGE=40 384CONFIG_FUSION_SPI=y
385CONFIG_FUSION_FC=m
386CONFIG_FUSION_MAX_SGE=128
368# CONFIG_FUSION_CTL is not set 387# CONFIG_FUSION_CTL is not set
369 388
370# 389#
@@ -387,7 +406,6 @@ CONFIG_NET=y
387# 406#
388CONFIG_PACKET=y 407CONFIG_PACKET=y
389# CONFIG_PACKET_MMAP is not set 408# CONFIG_PACKET_MMAP is not set
390CONFIG_NETLINK_DEV=y
391CONFIG_UNIX=y 409CONFIG_UNIX=y
392# CONFIG_NET_KEY is not set 410# CONFIG_NET_KEY is not set
393CONFIG_INET=y 411CONFIG_INET=y
@@ -447,7 +465,6 @@ CONFIG_DUMMY=m
447# CONFIG_BONDING is not set 465# CONFIG_BONDING is not set
448# CONFIG_EQUALIZER is not set 466# CONFIG_EQUALIZER is not set
449# CONFIG_TUN is not set 467# CONFIG_TUN is not set
450# CONFIG_ETHERTAP is not set
451 468
452# 469#
453# ARCnet devices 470# ARCnet devices
@@ -484,9 +501,7 @@ CONFIG_NET_PCI=y
484# CONFIG_FORCEDETH is not set 501# CONFIG_FORCEDETH is not set
485# CONFIG_DGRS is not set 502# CONFIG_DGRS is not set
486CONFIG_EEPRO100=m 503CONFIG_EEPRO100=m
487# CONFIG_EEPRO100_PIO is not set
488CONFIG_E100=m 504CONFIG_E100=m
489# CONFIG_E100_NAPI is not set
490# CONFIG_FEALNX is not set 505# CONFIG_FEALNX is not set
491# CONFIG_NATSEMI is not set 506# CONFIG_NATSEMI is not set
492# CONFIG_NE2K_PCI is not set 507# CONFIG_NE2K_PCI is not set
@@ -508,9 +523,11 @@ CONFIG_E1000=y
508# CONFIG_HAMACHI is not set 523# CONFIG_HAMACHI is not set
509# CONFIG_YELLOWFIN is not set 524# CONFIG_YELLOWFIN is not set
510# CONFIG_R8169 is not set 525# CONFIG_R8169 is not set
526# CONFIG_SKGE is not set
511# CONFIG_SK98LIN is not set 527# CONFIG_SK98LIN is not set
512# CONFIG_VIA_VELOCITY is not set 528# CONFIG_VIA_VELOCITY is not set
513CONFIG_TIGON3=y 529CONFIG_TIGON3=y
530# CONFIG_BNX2 is not set
514 531
515# 532#
516# Ethernet (10000 Mbit) 533# Ethernet (10000 Mbit)
@@ -568,25 +585,6 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
568# CONFIG_INPUT_EVBUG is not set 585# CONFIG_INPUT_EVBUG is not set
569 586
570# 587#
571# Input I/O drivers
572#
573CONFIG_GAMEPORT=m
574CONFIG_SOUND_GAMEPORT=m
575# CONFIG_GAMEPORT_NS558 is not set
576# CONFIG_GAMEPORT_L4 is not set
577# CONFIG_GAMEPORT_EMU10K1 is not set
578# CONFIG_GAMEPORT_VORTEX is not set
579# CONFIG_GAMEPORT_FM801 is not set
580# CONFIG_GAMEPORT_CS461x is not set
581CONFIG_SERIO=y
582CONFIG_SERIO_I8042=y
583# CONFIG_SERIO_SERPORT is not set
584# CONFIG_SERIO_CT82C710 is not set
585# CONFIG_SERIO_PCIPS2 is not set
586CONFIG_SERIO_LIBPS2=y
587# CONFIG_SERIO_RAW is not set
588
589#
590# Input Device Drivers 588# Input Device Drivers
591# 589#
592CONFIG_INPUT_KEYBOARD=y 590CONFIG_INPUT_KEYBOARD=y
@@ -604,6 +602,23 @@ CONFIG_MOUSE_PS2=y
604# CONFIG_INPUT_MISC is not set 602# CONFIG_INPUT_MISC is not set
605 603
606# 604#
605# Hardware I/O ports
606#
607CONFIG_SERIO=y
608CONFIG_SERIO_I8042=y
609# CONFIG_SERIO_SERPORT is not set
610# CONFIG_SERIO_PCIPS2 is not set
611CONFIG_SERIO_LIBPS2=y
612# CONFIG_SERIO_RAW is not set
613CONFIG_GAMEPORT=m
614# CONFIG_GAMEPORT_NS558 is not set
615# CONFIG_GAMEPORT_L4 is not set
616# CONFIG_GAMEPORT_EMU10K1 is not set
617# CONFIG_GAMEPORT_VORTEX is not set
618# CONFIG_GAMEPORT_FM801 is not set
619# CONFIG_GAMEPORT_CS461X is not set
620
621#
607# Character devices 622# Character devices
608# 623#
609CONFIG_VT=y 624CONFIG_VT=y
@@ -613,11 +628,15 @@ CONFIG_SERIAL_NONSTANDARD=y
613# CONFIG_ROCKETPORT is not set 628# CONFIG_ROCKETPORT is not set
614# CONFIG_CYCLADES is not set 629# CONFIG_CYCLADES is not set
615# CONFIG_MOXA_SMARTIO is not set 630# CONFIG_MOXA_SMARTIO is not set
616# CONFIG_SYNCLINK is not set 631# CONFIG_ISI is not set
617# CONFIG_SYNCLINKMP is not set 632# CONFIG_SYNCLINKMP is not set
618# CONFIG_N_HDLC is not set 633# CONFIG_N_HDLC is not set
634# CONFIG_SPECIALIX is not set
635# CONFIG_SX is not set
619# CONFIG_STALDRV is not set 636# CONFIG_STALDRV is not set
620CONFIG_SGI_SNSC=y 637CONFIG_SGI_SNSC=y
638CONFIG_SGI_TIOCX=y
639CONFIG_SGI_MBCS=m
621 640
622# 641#
623# Serial drivers 642# Serial drivers
@@ -638,6 +657,8 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
638CONFIG_SERIAL_CORE=y 657CONFIG_SERIAL_CORE=y
639CONFIG_SERIAL_CORE_CONSOLE=y 658CONFIG_SERIAL_CORE_CONSOLE=y
640CONFIG_SERIAL_SGI_L1_CONSOLE=y 659CONFIG_SERIAL_SGI_L1_CONSOLE=y
660CONFIG_SERIAL_SGI_IOC4=y
661# CONFIG_SERIAL_JSM is not set
641CONFIG_UNIX98_PTYS=y 662CONFIG_UNIX98_PTYS=y
642CONFIG_LEGACY_PTYS=y 663CONFIG_LEGACY_PTYS=y
643CONFIG_LEGACY_PTY_COUNT=256 664CONFIG_LEGACY_PTY_COUNT=256
@@ -663,6 +684,7 @@ CONFIG_EFI_RTC=y
663CONFIG_AGP=m 684CONFIG_AGP=m
664CONFIG_AGP_I460=m 685CONFIG_AGP_I460=m
665CONFIG_AGP_HP_ZX1=m 686CONFIG_AGP_HP_ZX1=m
687CONFIG_AGP_SGI_TIOCA=m
666CONFIG_DRM=m 688CONFIG_DRM=m
667CONFIG_DRM_TDFX=m 689CONFIG_DRM_TDFX=m
668CONFIG_DRM_R128=m 690CONFIG_DRM_R128=m
@@ -674,9 +696,15 @@ CONFIG_HPET=y
674# CONFIG_HPET_RTC_IRQ is not set 696# CONFIG_HPET_RTC_IRQ is not set
675CONFIG_HPET_MMAP=y 697CONFIG_HPET_MMAP=y
676CONFIG_MAX_RAW_DEVS=256 698CONFIG_MAX_RAW_DEVS=256
699# CONFIG_HANGCHECK_TIMER is not set
677CONFIG_MMTIMER=y 700CONFIG_MMTIMER=y
678 701
679# 702#
703# TPM devices
704#
705# CONFIG_TCG_TPM is not set
706
707#
680# I2C support 708# I2C support
681# 709#
682# CONFIG_I2C is not set 710# CONFIG_I2C is not set
@@ -760,6 +788,8 @@ CONFIG_SND_CS46XX=m
760CONFIG_SND_CS46XX_NEW_DSP=y 788CONFIG_SND_CS46XX_NEW_DSP=y
761CONFIG_SND_CS4281=m 789CONFIG_SND_CS4281=m
762CONFIG_SND_EMU10K1=m 790CONFIG_SND_EMU10K1=m
791# CONFIG_SND_EMU10K1X is not set
792# CONFIG_SND_CA0106 is not set
763# CONFIG_SND_KORG1212 is not set 793# CONFIG_SND_KORG1212 is not set
764# CONFIG_SND_MIXART is not set 794# CONFIG_SND_MIXART is not set
765# CONFIG_SND_NM256 is not set 795# CONFIG_SND_NM256 is not set
@@ -784,13 +814,14 @@ CONFIG_SND_FM801=m
784# CONFIG_SND_INTEL8X0M is not set 814# CONFIG_SND_INTEL8X0M is not set
785# CONFIG_SND_SONICVIBES is not set 815# CONFIG_SND_SONICVIBES is not set
786# CONFIG_SND_VIA82XX is not set 816# CONFIG_SND_VIA82XX is not set
817# CONFIG_SND_VIA82XX_MODEM is not set
787# CONFIG_SND_VX222 is not set 818# CONFIG_SND_VX222 is not set
819# CONFIG_SND_HDA_INTEL is not set
788 820
789# 821#
790# USB devices 822# USB devices
791# 823#
792# CONFIG_SND_USB_AUDIO is not set 824# CONFIG_SND_USB_AUDIO is not set
793# CONFIG_SND_USB_USX2Y is not set
794 825
795# 826#
796# Open Sound System 827# Open Sound System
@@ -800,6 +831,8 @@ CONFIG_SND_FM801=m
800# 831#
801# USB support 832# USB support
802# 833#
834CONFIG_USB_ARCH_HAS_HCD=y
835CONFIG_USB_ARCH_HAS_OHCI=y
803CONFIG_USB=m 836CONFIG_USB=m
804# CONFIG_USB_DEBUG is not set 837# CONFIG_USB_DEBUG is not set
805 838
@@ -811,8 +844,6 @@ CONFIG_USB_DEVICEFS=y
811# CONFIG_USB_DYNAMIC_MINORS is not set 844# CONFIG_USB_DYNAMIC_MINORS is not set
812# CONFIG_USB_SUSPEND is not set 845# CONFIG_USB_SUSPEND is not set
813# CONFIG_USB_OTG is not set 846# CONFIG_USB_OTG is not set
814CONFIG_USB_ARCH_HAS_HCD=y
815CONFIG_USB_ARCH_HAS_OHCI=y
816 847
817# 848#
818# USB Host Controller Drivers 849# USB Host Controller Drivers
@@ -821,6 +852,8 @@ CONFIG_USB_EHCI_HCD=m
821# CONFIG_USB_EHCI_SPLIT_ISO is not set 852# CONFIG_USB_EHCI_SPLIT_ISO is not set
822# CONFIG_USB_EHCI_ROOT_HUB_TT is not set 853# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
823CONFIG_USB_OHCI_HCD=m 854CONFIG_USB_OHCI_HCD=m
855# CONFIG_USB_OHCI_BIG_ENDIAN is not set
856CONFIG_USB_OHCI_LITTLE_ENDIAN=y
824CONFIG_USB_UHCI_HCD=m 857CONFIG_USB_UHCI_HCD=m
825# CONFIG_USB_SL811_HCD is not set 858# CONFIG_USB_SL811_HCD is not set
826 859
@@ -838,12 +871,11 @@ CONFIG_USB_UHCI_HCD=m
838# 871#
839CONFIG_USB_STORAGE=m 872CONFIG_USB_STORAGE=m
840# CONFIG_USB_STORAGE_DEBUG is not set 873# CONFIG_USB_STORAGE_DEBUG is not set
841# CONFIG_USB_STORAGE_RW_DETECT is not set
842# CONFIG_USB_STORAGE_DATAFAB is not set 874# CONFIG_USB_STORAGE_DATAFAB is not set
843# CONFIG_USB_STORAGE_FREECOM is not set 875# CONFIG_USB_STORAGE_FREECOM is not set
844# CONFIG_USB_STORAGE_ISD200 is not set 876# CONFIG_USB_STORAGE_ISD200 is not set
845# CONFIG_USB_STORAGE_DPCM is not set 877# CONFIG_USB_STORAGE_DPCM is not set
846# CONFIG_USB_STORAGE_HP8200e is not set 878# CONFIG_USB_STORAGE_USBAT is not set
847# CONFIG_USB_STORAGE_SDDR09 is not set 879# CONFIG_USB_STORAGE_SDDR09 is not set
848# CONFIG_USB_STORAGE_SDDR55 is not set 880# CONFIG_USB_STORAGE_SDDR55 is not set
849# CONFIG_USB_STORAGE_JUMPSHOT is not set 881# CONFIG_USB_STORAGE_JUMPSHOT is not set
@@ -893,6 +925,7 @@ CONFIG_USB_HIDINPUT=y
893# CONFIG_USB_PEGASUS is not set 925# CONFIG_USB_PEGASUS is not set
894# CONFIG_USB_RTL8150 is not set 926# CONFIG_USB_RTL8150 is not set
895# CONFIG_USB_USBNET is not set 927# CONFIG_USB_USBNET is not set
928CONFIG_USB_MON=m
896 929
897# 930#
898# USB port drivers 931# USB port drivers
@@ -908,7 +941,6 @@ CONFIG_USB_HIDINPUT=y
908# 941#
909# CONFIG_USB_EMI62 is not set 942# CONFIG_USB_EMI62 is not set
910# CONFIG_USB_EMI26 is not set 943# CONFIG_USB_EMI26 is not set
911# CONFIG_USB_TIGL is not set
912# CONFIG_USB_AUERSWALD is not set 944# CONFIG_USB_AUERSWALD is not set
913# CONFIG_USB_RIO500 is not set 945# CONFIG_USB_RIO500 is not set
914# CONFIG_USB_LEGOTOWER is not set 946# CONFIG_USB_LEGOTOWER is not set
@@ -917,6 +949,8 @@ CONFIG_USB_HIDINPUT=y
917# CONFIG_USB_CYTHERM is not set 949# CONFIG_USB_CYTHERM is not set
918# CONFIG_USB_PHIDGETKIT is not set 950# CONFIG_USB_PHIDGETKIT is not set
919# CONFIG_USB_PHIDGETSERVO is not set 951# CONFIG_USB_PHIDGETSERVO is not set
952# CONFIG_USB_IDMOUSE is not set
953# CONFIG_USB_SISUSBVGA is not set
920# CONFIG_USB_TEST is not set 954# CONFIG_USB_TEST is not set
921 955
922# 956#
@@ -943,6 +977,11 @@ CONFIG_INFINIBAND_IPOIB=m
943# CONFIG_INFINIBAND_IPOIB_DEBUG is not set 977# CONFIG_INFINIBAND_IPOIB_DEBUG is not set
944 978
945# 979#
980# SN Devices
981#
982CONFIG_SGI_IOC4=y
983
984#
946# File systems 985# File systems
947# 986#
948CONFIG_EXT2_FS=y 987CONFIG_EXT2_FS=y
@@ -964,7 +1003,12 @@ CONFIG_REISERFS_FS_POSIX_ACL=y
964CONFIG_REISERFS_FS_SECURITY=y 1003CONFIG_REISERFS_FS_SECURITY=y
965# CONFIG_JFS_FS is not set 1004# CONFIG_JFS_FS is not set
966CONFIG_FS_POSIX_ACL=y 1005CONFIG_FS_POSIX_ACL=y
1006
1007#
1008# XFS support
1009#
967CONFIG_XFS_FS=y 1010CONFIG_XFS_FS=y
1011CONFIG_XFS_EXPORT=y
968# CONFIG_XFS_RT is not set 1012# CONFIG_XFS_RT is not set
969# CONFIG_XFS_QUOTA is not set 1013# CONFIG_XFS_QUOTA is not set
970# CONFIG_XFS_SECURITY is not set 1014# CONFIG_XFS_SECURITY is not set
@@ -1042,7 +1086,7 @@ CONFIG_NFSD_V4=y
1042CONFIG_NFSD_TCP=y 1086CONFIG_NFSD_TCP=y
1043CONFIG_LOCKD=m 1087CONFIG_LOCKD=m
1044CONFIG_LOCKD_V4=y 1088CONFIG_LOCKD_V4=y
1045CONFIG_EXPORTFS=m 1089CONFIG_EXPORTFS=y
1046CONFIG_SUNRPC=m 1090CONFIG_SUNRPC=m
1047CONFIG_SUNRPC_GSS=m 1091CONFIG_SUNRPC_GSS=m
1048CONFIG_RPCSEC_GSS_KRB5=m 1092CONFIG_RPCSEC_GSS_KRB5=m
@@ -1128,6 +1172,8 @@ CONFIG_NLS_UTF8=m
1128# CONFIG_CRC_CCITT is not set 1172# CONFIG_CRC_CCITT is not set
1129CONFIG_CRC32=y 1173CONFIG_CRC32=y
1130# CONFIG_LIBCRC32C is not set 1174# CONFIG_LIBCRC32C is not set
1175CONFIG_GENERIC_HARDIRQS=y
1176CONFIG_GENERIC_IRQ_PROBE=y
1131 1177
1132# 1178#
1133# HP Simulator drivers 1179# HP Simulator drivers
@@ -1144,14 +1190,17 @@ CONFIG_CRC32=y
1144# 1190#
1145# Kernel hacking 1191# Kernel hacking
1146# 1192#
1193# CONFIG_PRINTK_TIME is not set
1147CONFIG_DEBUG_KERNEL=y 1194CONFIG_DEBUG_KERNEL=y
1148CONFIG_MAGIC_SYSRQ=y 1195CONFIG_MAGIC_SYSRQ=y
1196CONFIG_LOG_BUF_SHIFT=20
1149# CONFIG_SCHEDSTATS is not set 1197# CONFIG_SCHEDSTATS is not set
1150# CONFIG_DEBUG_SLAB is not set 1198# CONFIG_DEBUG_SLAB is not set
1151# CONFIG_DEBUG_SPINLOCK is not set 1199# CONFIG_DEBUG_SPINLOCK is not set
1152# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1200# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1153# CONFIG_DEBUG_KOBJECT is not set 1201# CONFIG_DEBUG_KOBJECT is not set
1154# CONFIG_DEBUG_INFO is not set 1202# CONFIG_DEBUG_INFO is not set
1203# CONFIG_DEBUG_FS is not set
1155CONFIG_IA64_GRANULE_16MB=y 1204CONFIG_IA64_GRANULE_16MB=y
1156# CONFIG_IA64_GRANULE_64MB is not set 1205# CONFIG_IA64_GRANULE_64MB is not set
1157# CONFIG_IA64_PRINT_HAZARDS is not set 1206# CONFIG_IA64_PRINT_HAZARDS is not set
@@ -1178,6 +1227,7 @@ CONFIG_CRYPTO_MD5=m
1178# CONFIG_CRYPTO_SHA256 is not set 1227# CONFIG_CRYPTO_SHA256 is not set
1179# CONFIG_CRYPTO_SHA512 is not set 1228# CONFIG_CRYPTO_SHA512 is not set
1180# CONFIG_CRYPTO_WP512 is not set 1229# CONFIG_CRYPTO_WP512 is not set
1230# CONFIG_CRYPTO_TGR192 is not set
1181CONFIG_CRYPTO_DES=m 1231CONFIG_CRYPTO_DES=m
1182# CONFIG_CRYPTO_BLOWFISH is not set 1232# CONFIG_CRYPTO_BLOWFISH is not set
1183# CONFIG_CRYPTO_TWOFISH is not set 1233# CONFIG_CRYPTO_TWOFISH is not set
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c
index b8db6e3e5e81..11957598a8b9 100644
--- a/arch/ia64/hp/common/sba_iommu.c
+++ b/arch/ia64/hp/common/sba_iommu.c
@@ -156,10 +156,13 @@
156*/ 156*/
157#define DELAYED_RESOURCE_CNT 64 157#define DELAYED_RESOURCE_CNT 64
158 158
159#define PCI_DEVICE_ID_HP_SX2000_IOC 0x12ec
160
159#define ZX1_IOC_ID ((PCI_DEVICE_ID_HP_ZX1_IOC << 16) | PCI_VENDOR_ID_HP) 161#define ZX1_IOC_ID ((PCI_DEVICE_ID_HP_ZX1_IOC << 16) | PCI_VENDOR_ID_HP)
160#define ZX2_IOC_ID ((PCI_DEVICE_ID_HP_ZX2_IOC << 16) | PCI_VENDOR_ID_HP) 162#define ZX2_IOC_ID ((PCI_DEVICE_ID_HP_ZX2_IOC << 16) | PCI_VENDOR_ID_HP)
161#define REO_IOC_ID ((PCI_DEVICE_ID_HP_REO_IOC << 16) | PCI_VENDOR_ID_HP) 163#define REO_IOC_ID ((PCI_DEVICE_ID_HP_REO_IOC << 16) | PCI_VENDOR_ID_HP)
162#define SX1000_IOC_ID ((PCI_DEVICE_ID_HP_SX1000_IOC << 16) | PCI_VENDOR_ID_HP) 164#define SX1000_IOC_ID ((PCI_DEVICE_ID_HP_SX1000_IOC << 16) | PCI_VENDOR_ID_HP)
165#define SX2000_IOC_ID ((PCI_DEVICE_ID_HP_SX2000_IOC << 16) | PCI_VENDOR_ID_HP)
163 166
164#define ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */ 167#define ZX1_IOC_OFFSET 0x1000 /* ACPI reports SBA, we want IOC */
165 168
@@ -1726,6 +1729,7 @@ static struct ioc_iommu ioc_iommu_info[] __initdata = {
1726 { ZX1_IOC_ID, "zx1", ioc_zx1_init }, 1729 { ZX1_IOC_ID, "zx1", ioc_zx1_init },
1727 { ZX2_IOC_ID, "zx2", NULL }, 1730 { ZX2_IOC_ID, "zx2", NULL },
1728 { SX1000_IOC_ID, "sx1000", NULL }, 1731 { SX1000_IOC_ID, "sx1000", NULL },
1732 { SX2000_IOC_ID, "sx2000", NULL },
1729}; 1733};
1730 1734
1731static struct ioc * __init 1735static struct ioc * __init
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c
index ae84a1018a89..0639ec0ed015 100644
--- a/arch/ia64/hp/sim/simeth.c
+++ b/arch/ia64/hp/sim/simeth.c
@@ -191,7 +191,7 @@ simeth_probe1(void)
191 unsigned char mac_addr[ETH_ALEN]; 191 unsigned char mac_addr[ETH_ALEN];
192 struct simeth_local *local; 192 struct simeth_local *local;
193 struct net_device *dev; 193 struct net_device *dev;
194 int fd, i, err; 194 int fd, i, err, rc;
195 195
196 /* 196 /*
197 * XXX Fix me 197 * XXX Fix me
@@ -228,7 +228,9 @@ simeth_probe1(void)
228 return err; 228 return err;
229 } 229 }
230 230
231 dev->irq = assign_irq_vector(AUTO_ASSIGN); 231 if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
232 panic("%s: out of interrupt vectors!\n", __FUNCTION__);
233 dev->irq = rc;
232 234
233 /* 235 /*
234 * attach the interrupt in the simulator, this does enable interrupts 236 * attach the interrupt in the simulator, this does enable interrupts
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index 786e70718ce4..7dcb8582ae0d 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/serial.h> 31#include <linux/serial.h>
32#include <linux/serialP.h> 32#include <linux/serialP.h>
33#include <linux/sysrq.h>
33 34
34#include <asm/irq.h> 35#include <asm/irq.h>
35#include <asm/hw_irq.h> 36#include <asm/hw_irq.h>
@@ -149,12 +150,17 @@ static void receive_chars(struct tty_struct *tty, struct pt_regs *regs)
149 seen_esc = 2; 150 seen_esc = 2;
150 continue; 151 continue;
151 } else if ( seen_esc == 2 ) { 152 } else if ( seen_esc == 2 ) {
152 if ( ch == 'P' ) show_state(); /* F1 key */ 153 if ( ch == 'P' ) /* F1 */
153#ifdef CONFIG_KDB 154 show_state();
154 if ( ch == 'S' ) 155#ifdef CONFIG_MAGIC_SYSRQ
155 kdb(KDB_REASON_KEYBOARD, 0, (kdb_eframe_t) regs); 156 if ( ch == 'S' ) { /* F4 */
157 do
158 ch = ia64_ssc(0, 0, 0, 0,
159 SSC_GETCHAR);
160 while (!ch);
161 handle_sysrq(ch, regs, NULL);
162 }
156#endif 163#endif
157
158 seen_esc = 0; 164 seen_esc = 0;
159 continue; 165 continue;
160 } 166 }
@@ -976,7 +982,7 @@ static struct tty_operations hp_ops = {
976static int __init 982static int __init
977simrs_init (void) 983simrs_init (void)
978{ 984{
979 int i; 985 int i, rc;
980 struct serial_state *state; 986 struct serial_state *state;
981 987
982 if (!ia64_platform_is("hpsim")) 988 if (!ia64_platform_is("hpsim"))
@@ -1011,7 +1017,10 @@ simrs_init (void)
1011 if (state->type == PORT_UNKNOWN) continue; 1017 if (state->type == PORT_UNKNOWN) continue;
1012 1018
1013 if (!state->irq) { 1019 if (!state->irq) {
1014 state->irq = assign_irq_vector(AUTO_ASSIGN); 1020 if ((rc = assign_irq_vector(AUTO_ASSIGN)) < 0)
1021 panic("%s: out of interrupt vectors!\n",
1022 __FUNCTION__);
1023 state->irq = rc;
1015 ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq); 1024 ia64_ssc_connect_irq(KEYBOARD_INTR, state->irq);
1016 } 1025 }
1017 1026
diff --git a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h
index b2de948bdaea..e3e9290e3ff2 100644
--- a/arch/ia64/ia32/ia32priv.h
+++ b/arch/ia64/ia32/ia32priv.h
@@ -241,7 +241,7 @@ typedef struct compat_siginfo {
241 241
242 /* POSIX.1b timers */ 242 /* POSIX.1b timers */
243 struct { 243 struct {
244 timer_t _tid; /* timer id */ 244 compat_timer_t _tid; /* timer id */
245 int _overrun; /* overrun count */ 245 int _overrun; /* overrun count */
246 char _pad[sizeof(unsigned int) - sizeof(int)]; 246 char _pad[sizeof(unsigned int) - sizeof(int)];
247 compat_sigval_t _sigval; /* same as below */ 247 compat_sigval_t _sigval; /* same as below */
diff --git a/arch/ia64/kernel/Makefile b/arch/ia64/kernel/Makefile
index c1a02bbc252c..e1fb68ddec26 100644
--- a/arch/ia64/kernel/Makefile
+++ b/arch/ia64/kernel/Makefile
@@ -17,9 +17,12 @@ obj-$(CONFIG_IA64_PALINFO) += palinfo.o
17obj-$(CONFIG_IOSAPIC) += iosapic.o 17obj-$(CONFIG_IOSAPIC) += iosapic.o
18obj-$(CONFIG_MODULES) += module.o 18obj-$(CONFIG_MODULES) += module.o
19obj-$(CONFIG_SMP) += smp.o smpboot.o domain.o 19obj-$(CONFIG_SMP) += smp.o smpboot.o domain.o
20obj-$(CONFIG_NUMA) += numa.o
20obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o 21obj-$(CONFIG_PERFMON) += perfmon_default_smpl.o
21obj-$(CONFIG_IA64_CYCLONE) += cyclone.o 22obj-$(CONFIG_IA64_CYCLONE) += cyclone.o
22obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o 23obj-$(CONFIG_IA64_MCA_RECOVERY) += mca_recovery.o
24obj-$(CONFIG_KPROBES) += kprobes.o jprobes.o
25obj-$(CONFIG_IA64_UNCACHED_ALLOCATOR) += uncached.o
23mca_recovery-y += mca_drv.o mca_drv_asm.o 26mca_recovery-y += mca_drv.o mca_drv_asm.o
24 27
25# The gate DSO image is built using a special linker script. 28# The gate DSO image is built using a special linker script.
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index 1c118b72df3c..9609f243e5d0 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -242,9 +242,7 @@ acpi_parse_iosapic (acpi_table_entry_header *header, const unsigned long end)
242 if (BAD_MADT_ENTRY(iosapic, end)) 242 if (BAD_MADT_ENTRY(iosapic, end))
243 return -EINVAL; 243 return -EINVAL;
244 244
245 iosapic_init(iosapic->address, iosapic->global_irq_base); 245 return iosapic_init(iosapic->address, iosapic->global_irq_base);
246
247 return 0;
248} 246}
249 247
250 248
@@ -696,9 +694,11 @@ acpi_boot_init (void)
696 if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id()) 694 if (smp_boot_data.cpu_phys_id[cpu] != hard_smp_processor_id())
697 node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu]; 695 node_cpuid[i++].phys_id = smp_boot_data.cpu_phys_id[cpu];
698 } 696 }
699 build_cpu_to_node_map();
700# endif 697# endif
701#endif 698#endif
699#ifdef CONFIG_ACPI_NUMA
700 build_cpu_to_node_map();
701#endif
702 /* Make boot-up look pretty */ 702 /* Make boot-up look pretty */
703 printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus); 703 printk(KERN_INFO "%d CPUs available, %d CPUs total\n", available_cpus, total_cpus);
704 return 0; 704 return 0;
@@ -826,7 +826,7 @@ EXPORT_SYMBOL(acpi_unmap_lsapic);
826 826
827 827
828#ifdef CONFIG_ACPI_NUMA 828#ifdef CONFIG_ACPI_NUMA
829acpi_status __init 829acpi_status __devinit
830acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret) 830acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
831{ 831{
832 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; 832 struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
@@ -879,4 +879,28 @@ acpi_map_iosapic (acpi_handle handle, u32 depth, void *context, void **ret)
879 return AE_OK; 879 return AE_OK;
880} 880}
881#endif /* CONFIG_NUMA */ 881#endif /* CONFIG_NUMA */
882
883int
884acpi_register_ioapic (acpi_handle handle, u64 phys_addr, u32 gsi_base)
885{
886 int err;
887
888 if ((err = iosapic_init(phys_addr, gsi_base)))
889 return err;
890
891#if CONFIG_ACPI_NUMA
892 acpi_map_iosapic(handle, 0, NULL, NULL);
893#endif /* CONFIG_ACPI_NUMA */
894
895 return 0;
896}
897EXPORT_SYMBOL(acpi_register_ioapic);
898
899int
900acpi_unregister_ioapic (acpi_handle handle, u32 gsi_base)
901{
902 return iosapic_remove(gsi_base);
903}
904EXPORT_SYMBOL(acpi_unregister_ioapic);
905
882#endif /* CONFIG_ACPI_BOOT */ 906#endif /* CONFIG_ACPI_BOOT */
diff --git a/arch/ia64/kernel/domain.c b/arch/ia64/kernel/domain.c
index fe532c970438..d65e87b6394f 100644
--- a/arch/ia64/kernel/domain.c
+++ b/arch/ia64/kernel/domain.c
@@ -14,7 +14,7 @@
14#include <linux/topology.h> 14#include <linux/topology.h>
15#include <linux/nodemask.h> 15#include <linux/nodemask.h>
16 16
17#define SD_NODES_PER_DOMAIN 6 17#define SD_NODES_PER_DOMAIN 16
18 18
19#ifdef CONFIG_NUMA 19#ifdef CONFIG_NUMA
20/** 20/**
@@ -27,7 +27,7 @@
27 * 27 *
28 * Should use nodemask_t. 28 * Should use nodemask_t.
29 */ 29 */
30static int __devinit find_next_best_node(int node, unsigned long *used_nodes) 30static int find_next_best_node(int node, unsigned long *used_nodes)
31{ 31{
32 int i, n, val, min_val, best_node = 0; 32 int i, n, val, min_val, best_node = 0;
33 33
@@ -66,7 +66,7 @@ static int __devinit find_next_best_node(int node, unsigned long *used_nodes)
66 * should be one that prevents unnecessary balancing, but also spreads tasks 66 * should be one that prevents unnecessary balancing, but also spreads tasks
67 * out optimally. 67 * out optimally.
68 */ 68 */
69static cpumask_t __devinit sched_domain_node_span(int node) 69static cpumask_t sched_domain_node_span(int node)
70{ 70{
71 int i; 71 int i;
72 cpumask_t span, nodemask; 72 cpumask_t span, nodemask;
@@ -96,7 +96,7 @@ static cpumask_t __devinit sched_domain_node_span(int node)
96#ifdef CONFIG_SCHED_SMT 96#ifdef CONFIG_SCHED_SMT
97static DEFINE_PER_CPU(struct sched_domain, cpu_domains); 97static DEFINE_PER_CPU(struct sched_domain, cpu_domains);
98static struct sched_group sched_group_cpus[NR_CPUS]; 98static struct sched_group sched_group_cpus[NR_CPUS];
99static int __devinit cpu_to_cpu_group(int cpu) 99static int cpu_to_cpu_group(int cpu)
100{ 100{
101 return cpu; 101 return cpu;
102} 102}
@@ -104,7 +104,7 @@ static int __devinit cpu_to_cpu_group(int cpu)
104 104
105static DEFINE_PER_CPU(struct sched_domain, phys_domains); 105static DEFINE_PER_CPU(struct sched_domain, phys_domains);
106static struct sched_group sched_group_phys[NR_CPUS]; 106static struct sched_group sched_group_phys[NR_CPUS];
107static int __devinit cpu_to_phys_group(int cpu) 107static int cpu_to_phys_group(int cpu)
108{ 108{
109#ifdef CONFIG_SCHED_SMT 109#ifdef CONFIG_SCHED_SMT
110 return first_cpu(cpu_sibling_map[cpu]); 110 return first_cpu(cpu_sibling_map[cpu]);
@@ -125,44 +125,36 @@ static struct sched_group *sched_group_nodes[MAX_NUMNODES];
125static DEFINE_PER_CPU(struct sched_domain, allnodes_domains); 125static DEFINE_PER_CPU(struct sched_domain, allnodes_domains);
126static struct sched_group sched_group_allnodes[MAX_NUMNODES]; 126static struct sched_group sched_group_allnodes[MAX_NUMNODES];
127 127
128static int __devinit cpu_to_allnodes_group(int cpu) 128static int cpu_to_allnodes_group(int cpu)
129{ 129{
130 return cpu_to_node(cpu); 130 return cpu_to_node(cpu);
131} 131}
132#endif 132#endif
133 133
134/* 134/*
135 * Set up scheduler domains and groups. Callers must hold the hotplug lock. 135 * Build sched domains for a given set of cpus and attach the sched domains
136 * to the individual cpus
136 */ 137 */
137void __devinit arch_init_sched_domains(void) 138void build_sched_domains(const cpumask_t *cpu_map)
138{ 139{
139 int i; 140 int i;
140 cpumask_t cpu_default_map;
141 141
142 /* 142 /*
143 * Setup mask for cpus without special case scheduling requirements. 143 * Set up domains for cpus specified by the cpu_map.
144 * For now this just excludes isolated cpus, but could be used to
145 * exclude other special cases in the future.
146 */ 144 */
147 cpus_complement(cpu_default_map, cpu_isolated_map); 145 for_each_cpu_mask(i, *cpu_map) {
148 cpus_and(cpu_default_map, cpu_default_map, cpu_online_map);
149
150 /*
151 * Set up domains. Isolated domains just stay on the dummy domain.
152 */
153 for_each_cpu_mask(i, cpu_default_map) {
154 int group; 146 int group;
155 struct sched_domain *sd = NULL, *p; 147 struct sched_domain *sd = NULL, *p;
156 cpumask_t nodemask = node_to_cpumask(cpu_to_node(i)); 148 cpumask_t nodemask = node_to_cpumask(cpu_to_node(i));
157 149
158 cpus_and(nodemask, nodemask, cpu_default_map); 150 cpus_and(nodemask, nodemask, *cpu_map);
159 151
160#ifdef CONFIG_NUMA 152#ifdef CONFIG_NUMA
161 if (num_online_cpus() 153 if (num_online_cpus()
162 > SD_NODES_PER_DOMAIN*cpus_weight(nodemask)) { 154 > SD_NODES_PER_DOMAIN*cpus_weight(nodemask)) {
163 sd = &per_cpu(allnodes_domains, i); 155 sd = &per_cpu(allnodes_domains, i);
164 *sd = SD_ALLNODES_INIT; 156 *sd = SD_ALLNODES_INIT;
165 sd->span = cpu_default_map; 157 sd->span = *cpu_map;
166 group = cpu_to_allnodes_group(i); 158 group = cpu_to_allnodes_group(i);
167 sd->groups = &sched_group_allnodes[group]; 159 sd->groups = &sched_group_allnodes[group];
168 p = sd; 160 p = sd;
@@ -173,7 +165,7 @@ void __devinit arch_init_sched_domains(void)
173 *sd = SD_NODE_INIT; 165 *sd = SD_NODE_INIT;
174 sd->span = sched_domain_node_span(cpu_to_node(i)); 166 sd->span = sched_domain_node_span(cpu_to_node(i));
175 sd->parent = p; 167 sd->parent = p;
176 cpus_and(sd->span, sd->span, cpu_default_map); 168 cpus_and(sd->span, sd->span, *cpu_map);
177#endif 169#endif
178 170
179 p = sd; 171 p = sd;
@@ -190,7 +182,7 @@ void __devinit arch_init_sched_domains(void)
190 group = cpu_to_cpu_group(i); 182 group = cpu_to_cpu_group(i);
191 *sd = SD_SIBLING_INIT; 183 *sd = SD_SIBLING_INIT;
192 sd->span = cpu_sibling_map[i]; 184 sd->span = cpu_sibling_map[i];
193 cpus_and(sd->span, sd->span, cpu_default_map); 185 cpus_and(sd->span, sd->span, *cpu_map);
194 sd->parent = p; 186 sd->parent = p;
195 sd->groups = &sched_group_cpus[group]; 187 sd->groups = &sched_group_cpus[group];
196#endif 188#endif
@@ -198,9 +190,9 @@ void __devinit arch_init_sched_domains(void)
198 190
199#ifdef CONFIG_SCHED_SMT 191#ifdef CONFIG_SCHED_SMT
200 /* Set up CPU (sibling) groups */ 192 /* Set up CPU (sibling) groups */
201 for_each_cpu_mask(i, cpu_default_map) { 193 for_each_cpu_mask(i, *cpu_map) {
202 cpumask_t this_sibling_map = cpu_sibling_map[i]; 194 cpumask_t this_sibling_map = cpu_sibling_map[i];
203 cpus_and(this_sibling_map, this_sibling_map, cpu_default_map); 195 cpus_and(this_sibling_map, this_sibling_map, *cpu_map);
204 if (i != first_cpu(this_sibling_map)) 196 if (i != first_cpu(this_sibling_map))
205 continue; 197 continue;
206 198
@@ -213,7 +205,7 @@ void __devinit arch_init_sched_domains(void)
213 for (i = 0; i < MAX_NUMNODES; i++) { 205 for (i = 0; i < MAX_NUMNODES; i++) {
214 cpumask_t nodemask = node_to_cpumask(i); 206 cpumask_t nodemask = node_to_cpumask(i);
215 207
216 cpus_and(nodemask, nodemask, cpu_default_map); 208 cpus_and(nodemask, nodemask, *cpu_map);
217 if (cpus_empty(nodemask)) 209 if (cpus_empty(nodemask))
218 continue; 210 continue;
219 211
@@ -222,7 +214,7 @@ void __devinit arch_init_sched_domains(void)
222 } 214 }
223 215
224#ifdef CONFIG_NUMA 216#ifdef CONFIG_NUMA
225 init_sched_build_groups(sched_group_allnodes, cpu_default_map, 217 init_sched_build_groups(sched_group_allnodes, *cpu_map,
226 &cpu_to_allnodes_group); 218 &cpu_to_allnodes_group);
227 219
228 for (i = 0; i < MAX_NUMNODES; i++) { 220 for (i = 0; i < MAX_NUMNODES; i++) {
@@ -233,12 +225,12 @@ void __devinit arch_init_sched_domains(void)
233 cpumask_t covered = CPU_MASK_NONE; 225 cpumask_t covered = CPU_MASK_NONE;
234 int j; 226 int j;
235 227
236 cpus_and(nodemask, nodemask, cpu_default_map); 228 cpus_and(nodemask, nodemask, *cpu_map);
237 if (cpus_empty(nodemask)) 229 if (cpus_empty(nodemask))
238 continue; 230 continue;
239 231
240 domainspan = sched_domain_node_span(i); 232 domainspan = sched_domain_node_span(i);
241 cpus_and(domainspan, domainspan, cpu_default_map); 233 cpus_and(domainspan, domainspan, *cpu_map);
242 234
243 sg = kmalloc(sizeof(struct sched_group), GFP_KERNEL); 235 sg = kmalloc(sizeof(struct sched_group), GFP_KERNEL);
244 sched_group_nodes[i] = sg; 236 sched_group_nodes[i] = sg;
@@ -266,7 +258,7 @@ void __devinit arch_init_sched_domains(void)
266 int n = (i + j) % MAX_NUMNODES; 258 int n = (i + j) % MAX_NUMNODES;
267 259
268 cpus_complement(notcovered, covered); 260 cpus_complement(notcovered, covered);
269 cpus_and(tmp, notcovered, cpu_default_map); 261 cpus_and(tmp, notcovered, *cpu_map);
270 cpus_and(tmp, tmp, domainspan); 262 cpus_and(tmp, tmp, domainspan);
271 if (cpus_empty(tmp)) 263 if (cpus_empty(tmp))
272 break; 264 break;
@@ -293,7 +285,7 @@ void __devinit arch_init_sched_domains(void)
293#endif 285#endif
294 286
295 /* Calculate CPU power for physical packages and nodes */ 287 /* Calculate CPU power for physical packages and nodes */
296 for_each_cpu_mask(i, cpu_default_map) { 288 for_each_cpu_mask(i, *cpu_map) {
297 int power; 289 int power;
298 struct sched_domain *sd; 290 struct sched_domain *sd;
299#ifdef CONFIG_SCHED_SMT 291#ifdef CONFIG_SCHED_SMT
@@ -359,13 +351,35 @@ next_sg:
359 cpu_attach_domain(sd, i); 351 cpu_attach_domain(sd, i);
360 } 352 }
361} 353}
354/*
355 * Set up scheduler domains and groups. Callers must hold the hotplug lock.
356 */
357void arch_init_sched_domains(const cpumask_t *cpu_map)
358{
359 cpumask_t cpu_default_map;
360
361 /*
362 * Setup mask for cpus without special case scheduling requirements.
363 * For now this just excludes isolated cpus, but could be used to
364 * exclude other special cases in the future.
365 */
366 cpus_andnot(cpu_default_map, *cpu_map, cpu_isolated_map);
367
368 build_sched_domains(&cpu_default_map);
369}
362 370
363void __devinit arch_destroy_sched_domains(void) 371void arch_destroy_sched_domains(const cpumask_t *cpu_map)
364{ 372{
365#ifdef CONFIG_NUMA 373#ifdef CONFIG_NUMA
366 int i; 374 int i;
367 for (i = 0; i < MAX_NUMNODES; i++) { 375 for (i = 0; i < MAX_NUMNODES; i++) {
376 cpumask_t nodemask = node_to_cpumask(i);
368 struct sched_group *oldsg, *sg = sched_group_nodes[i]; 377 struct sched_group *oldsg, *sg = sched_group_nodes[i];
378
379 cpus_and(nodemask, nodemask, *cpu_map);
380 if (cpus_empty(nodemask))
381 continue;
382
369 if (sg == NULL) 383 if (sg == NULL)
370 continue; 384 continue;
371 sg = sg->next; 385 sg = sg->next;
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 4a3b1aac43e7..179f230816ed 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -410,6 +410,38 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
410} 410}
411 411
412/* 412/*
413 * Walk the EFI memory map to pull out leftover pages in the lower
414 * memory regions which do not end up in the regular memory map and
415 * stick them into the uncached allocator
416 *
417 * The regular walk function is significantly more complex than the
418 * uncached walk which means it really doesn't make sense to try and
419 * marge the two.
420 */
421void __init
422efi_memmap_walk_uc (efi_freemem_callback_t callback)
423{
424 void *efi_map_start, *efi_map_end, *p;
425 efi_memory_desc_t *md;
426 u64 efi_desc_size, start, end;
427
428 efi_map_start = __va(ia64_boot_param->efi_memmap);
429 efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
430 efi_desc_size = ia64_boot_param->efi_memdesc_size;
431
432 for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
433 md = p;
434 if (md->attribute == EFI_MEMORY_UC) {
435 start = PAGE_ALIGN(md->phys_addr);
436 end = PAGE_ALIGN((md->phys_addr+(md->num_pages << EFI_PAGE_SHIFT)) & PAGE_MASK);
437 if ((*callback)(start, end, NULL) < 0)
438 return;
439 }
440 }
441}
442
443
444/*
413 * Look for the PAL_CODE region reported by EFI and maps it using an 445 * Look for the PAL_CODE region reported by EFI and maps it using an
414 * ITR to enable safe PAL calls in virtual mode. See IA-64 Processor 446 * ITR to enable safe PAL calls in virtual mode. See IA-64 Processor
415 * Abstraction Layer chapter 11 in ADAG 447 * Abstraction Layer chapter 11 in ADAG
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index d99316c9be28..bb9a506deb78 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -470,18 +470,6 @@ ENTRY(load_switch_stack)
470 br.cond.sptk.many b7 470 br.cond.sptk.many b7
471END(load_switch_stack) 471END(load_switch_stack)
472 472
473GLOBAL_ENTRY(__ia64_syscall)
474 .regstk 6,0,0,0
475 mov r15=in5 // put syscall number in place
476 break __BREAK_SYSCALL
477 movl r2=errno
478 cmp.eq p6,p7=-1,r10
479 ;;
480(p6) st4 [r2]=r8
481(p6) mov r8=-1
482 br.ret.sptk.many rp
483END(__ia64_syscall)
484
485GLOBAL_ENTRY(execve) 473GLOBAL_ENTRY(execve)
486 mov r15=__NR_execve // put syscall number in place 474 mov r15=__NR_execve // put syscall number in place
487 break __BREAK_SYSCALL 475 break __BREAK_SYSCALL
@@ -637,7 +625,7 @@ END(ia64_ret_from_syscall)
637 * r8-r11: restored (syscall return value(s)) 625 * r8-r11: restored (syscall return value(s))
638 * r12: restored (user-level stack pointer) 626 * r12: restored (user-level stack pointer)
639 * r13: restored (user-level thread pointer) 627 * r13: restored (user-level thread pointer)
640 * r14: cleared 628 * r14: set to __kernel_syscall_via_epc
641 * r15: restored (syscall #) 629 * r15: restored (syscall #)
642 * r16-r17: cleared 630 * r16-r17: cleared
643 * r18: user-level b6 631 * r18: user-level b6
@@ -658,7 +646,7 @@ END(ia64_ret_from_syscall)
658 * pr: restored (user-level pr) 646 * pr: restored (user-level pr)
659 * b0: restored (user-level rp) 647 * b0: restored (user-level rp)
660 * b6: restored 648 * b6: restored
661 * b7: cleared 649 * b7: set to __kernel_syscall_via_epc
662 * ar.unat: restored (user-level ar.unat) 650 * ar.unat: restored (user-level ar.unat)
663 * ar.pfs: restored (user-level ar.pfs) 651 * ar.pfs: restored (user-level ar.pfs)
664 * ar.rsc: restored (user-level ar.rsc) 652 * ar.rsc: restored (user-level ar.rsc)
@@ -704,72 +692,79 @@ ENTRY(ia64_leave_syscall)
704 ;; 692 ;;
705(p6) ld4 r31=[r18] // load current_thread_info()->flags 693(p6) ld4 r31=[r18] // load current_thread_info()->flags
706 ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs" 694 ld8 r19=[r2],PT(B6)-PT(LOADRS) // load ar.rsc value for "loadrs"
707 mov b7=r0 // clear b7 695 nop.i 0
708 ;; 696 ;;
709 ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage) 697 mov r16=ar.bsp // M2 get existing backing store pointer
710 ld8 r18=[r2],PT(R9)-PT(B6) // load b6 698 ld8 r18=[r2],PT(R9)-PT(B6) // load b6
711(p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE? 699(p6) and r15=TIF_WORK_MASK,r31 // any work other than TIF_SYSCALL_TRACE?
712 ;; 700 ;;
713 mov r16=ar.bsp // M2 get existing backing store pointer 701 ld8 r23=[r3],PT(R11)-PT(AR_BSPSTORE) // load ar.bspstore (may be garbage)
714(p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending? 702(p6) cmp4.ne.unc p6,p0=r15, r0 // any special work pending?
715(p6) br.cond.spnt .work_pending_syscall 703(p6) br.cond.spnt .work_pending_syscall
716 ;; 704 ;;
717 // start restoring the state saved on the kernel stack (struct pt_regs): 705 // start restoring the state saved on the kernel stack (struct pt_regs):
718 ld8 r9=[r2],PT(CR_IPSR)-PT(R9) 706 ld8 r9=[r2],PT(CR_IPSR)-PT(R9)
719 ld8 r11=[r3],PT(CR_IIP)-PT(R11) 707 ld8 r11=[r3],PT(CR_IIP)-PT(R11)
720 mov f6=f0 // clear f6 708(pNonSys) break 0 // bug check: we shouldn't be here if pNonSys is TRUE!
721 ;; 709 ;;
722 invala // M0|1 invalidate ALAT 710 invala // M0|1 invalidate ALAT
723 rsm psr.i | psr.ic // M2 initiate turning off of interrupt and interruption collection 711 rsm psr.i | psr.ic // M2 turn off interrupts and interruption collection
724 mov f9=f0 // clear f9 712 cmp.eq p9,p0=r0,r0 // A set p9 to indicate that we should restore cr.ifs
725 713
726 ld8 r29=[r2],16 // load cr.ipsr 714 ld8 r29=[r2],16 // M0|1 load cr.ipsr
727 ld8 r28=[r3],16 // load cr.iip 715 ld8 r28=[r3],16 // M0|1 load cr.iip
728 mov f8=f0 // clear f8 716 mov r22=r0 // A clear r22
729 ;; 717 ;;
730 ld8 r30=[r2],16 // M0|1 load cr.ifs 718 ld8 r30=[r2],16 // M0|1 load cr.ifs
731 ld8 r25=[r3],16 // M0|1 load ar.unat 719 ld8 r25=[r3],16 // M0|1 load ar.unat
732 cmp.eq p9,p0=r0,r0 // set p9 to indicate that we should restore cr.ifs 720(pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13
733 ;; 721 ;;
734 ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs 722 ld8 r26=[r2],PT(B0)-PT(AR_PFS) // M0|1 load ar.pfs
735(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled 723(pKStk) mov r22=psr // M2 read PSR now that interrupts are disabled
736 mov f10=f0 // clear f10 724 nop 0
737 ;; 725 ;;
738 ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // load b0 726 ld8 r21=[r2],PT(AR_RNAT)-PT(B0) // M0|1 load b0
739 ld8 r27=[r3],PT(PR)-PT(AR_RSC) // load ar.rsc 727 ld8 r27=[r3],PT(PR)-PT(AR_RSC) // M0|1 load ar.rsc
740 mov f11=f0 // clear f11 728 mov f6=f0 // F clear f6
741 ;; 729 ;;
742 ld8 r24=[r2],PT(AR_FPSR)-PT(AR_RNAT) // load ar.rnat (may be garbage) 730 ld8 r24=[r2],PT(AR_FPSR)-PT(AR_RNAT) // M0|1 load ar.rnat (may be garbage)
743 ld8 r31=[r3],PT(R1)-PT(PR) // load predicates 731 ld8 r31=[r3],PT(R1)-PT(PR) // M0|1 load predicates
744(pUStk) add r14=IA64_TASK_THREAD_ON_USTACK_OFFSET,r13 732 mov f7=f0 // F clear f7
745 ;; 733 ;;
746 ld8 r20=[r2],PT(R12)-PT(AR_FPSR) // load ar.fpsr 734 ld8 r20=[r2],PT(R12)-PT(AR_FPSR) // M0|1 load ar.fpsr
747 ld8.fill r1=[r3],16 // load r1 735 ld8.fill r1=[r3],16 // M0|1 load r1
748(pUStk) mov r17=1 736(pUStk) mov r17=1 // A
749 ;; 737 ;;
750 srlz.d // M0 ensure interruption collection is off 738(pUStk) st1 [r14]=r17 // M2|3
751 ld8.fill r13=[r3],16 739 ld8.fill r13=[r3],16 // M0|1
752 mov f7=f0 // clear f7 740 mov f8=f0 // F clear f8
753 ;; 741 ;;
754 ld8.fill r12=[r2] // restore r12 (sp) 742 ld8.fill r12=[r2] // M0|1 restore r12 (sp)
755 mov.m ar.ssd=r0 // M2 clear ar.ssd 743 ld8.fill r15=[r3] // M0|1 restore r15
756 mov r22=r0 // clear r22 744 mov b6=r18 // I0 restore b6
745
746 addl r17=THIS_CPU(ia64_phys_stacked_size_p8),r0 // A
747 mov f9=f0 // F clear f9
748(pKStk) br.cond.dpnt.many skip_rbs_switch // B
757 749
758 ld8.fill r15=[r3] // restore r15 750 srlz.d // M0 ensure interruption collection is off (for cover)
759(pUStk) st1 [r14]=r17 751 shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition
760 addl r3=THIS_CPU(ia64_phys_stacked_size_p8),r0 752 cover // B add current frame into dirty partition & set cr.ifs
761 ;; 753 ;;
762(pUStk) ld4 r17=[r3] // r17 = cpu_data->phys_stacked_size_p8 754(pUStk) ld4 r17=[r17] // M0|1 r17 = cpu_data->phys_stacked_size_p8
763 mov.m ar.csd=r0 // M2 clear ar.csd 755 mov r19=ar.bsp // M2 get new backing store pointer
764 mov b6=r18 // I0 restore b6 756 mov f10=f0 // F clear f10
757
758 nop.m 0
759 movl r14=__kernel_syscall_via_epc // X
765 ;; 760 ;;
766 mov r14=r0 // clear r14 761 mov.m ar.csd=r0 // M2 clear ar.csd
767 shr.u r18=r19,16 // I0|1 get byte size of existing "dirty" partition 762 mov.m ar.ccv=r0 // M2 clear ar.ccv
768(pKStk) br.cond.dpnt.many skip_rbs_switch 763 mov b7=r14 // I0 clear b7 (hint with __kernel_syscall_via_epc)
769 764
770 mov.m ar.ccv=r0 // clear ar.ccv 765 mov.m ar.ssd=r0 // M2 clear ar.ssd
771(pNonSys) br.cond.dpnt.many dont_preserve_current_frame 766 mov f11=f0 // F clear f11
772 br.cond.sptk.many rbs_switch 767 br.cond.sptk.many rbs_switch // B
773END(ia64_leave_syscall) 768END(ia64_leave_syscall)
774 769
775#ifdef CONFIG_IA32_SUPPORT 770#ifdef CONFIG_IA32_SUPPORT
@@ -885,7 +880,7 @@ GLOBAL_ENTRY(ia64_leave_kernel)
885 ldf.fill f7=[r2],PT(F11)-PT(F7) 880 ldf.fill f7=[r2],PT(F11)-PT(F7)
886 ldf.fill f8=[r3],32 881 ldf.fill f8=[r3],32
887 ;; 882 ;;
888 srlz.i // ensure interruption collection is off 883 srlz.d // ensure that inter. collection is off (VHPT is don't care, since text is pinned)
889 mov ar.ccv=r15 884 mov ar.ccv=r15
890 ;; 885 ;;
891 ldf.fill f11=[r2] 886 ldf.fill f11=[r2]
@@ -945,11 +940,10 @@ GLOBAL_ENTRY(ia64_leave_kernel)
945 * NOTE: alloc, loadrs, and cover can't be predicated. 940 * NOTE: alloc, loadrs, and cover can't be predicated.
946 */ 941 */
947(pNonSys) br.cond.dpnt dont_preserve_current_frame 942(pNonSys) br.cond.dpnt dont_preserve_current_frame
948
949rbs_switch:
950 cover // add current frame into dirty partition and set cr.ifs 943 cover // add current frame into dirty partition and set cr.ifs
951 ;; 944 ;;
952 mov r19=ar.bsp // get new backing store pointer 945 mov r19=ar.bsp // get new backing store pointer
946rbs_switch:
953 sub r16=r16,r18 // krbs = old bsp - size of dirty partition 947 sub r16=r16,r18 // krbs = old bsp - size of dirty partition
954 cmp.ne p9,p0=r0,r0 // clear p9 to skip restore of cr.ifs 948 cmp.ne p9,p0=r0,r0 // clear p9 to skip restore of cr.ifs
955 ;; 949 ;;
@@ -1024,14 +1018,14 @@ rse_clear_invalid:
1024 mov loc5=0 1018 mov loc5=0
1025 mov loc6=0 1019 mov loc6=0
1026 mov loc7=0 1020 mov loc7=0
1027(pRecurse) br.call.sptk.few b0=rse_clear_invalid 1021(pRecurse) br.call.dptk.few b0=rse_clear_invalid
1028 ;; 1022 ;;
1029 mov loc8=0 1023 mov loc8=0
1030 mov loc9=0 1024 mov loc9=0
1031 cmp.ne pReturn,p0=r0,in1 // if recursion count != 0, we need to do a br.ret 1025 cmp.ne pReturn,p0=r0,in1 // if recursion count != 0, we need to do a br.ret
1032 mov loc10=0 1026 mov loc10=0
1033 mov loc11=0 1027 mov loc11=0
1034(pReturn) br.ret.sptk.many b0 1028(pReturn) br.ret.dptk.many b0
1035#endif /* !CONFIG_ITANIUM */ 1029#endif /* !CONFIG_ITANIUM */
1036# undef pRecurse 1030# undef pRecurse
1037# undef pReturn 1031# undef pReturn
@@ -1255,7 +1249,7 @@ ENTRY(sys_rt_sigreturn)
1255 stf.spill [r17]=f11 1249 stf.spill [r17]=f11
1256 adds out0=16,sp // out0 = &sigscratch 1250 adds out0=16,sp // out0 = &sigscratch
1257 br.call.sptk.many rp=ia64_rt_sigreturn 1251 br.call.sptk.many rp=ia64_rt_sigreturn
1258.ret19: .restore sp 0 1252.ret19: .restore sp,0
1259 adds sp=16,sp 1253 adds sp=16,sp
1260 ;; 1254 ;;
1261 ld8 r9=[sp] // load new ar.unat 1255 ld8 r9=[sp] // load new ar.unat
@@ -1577,9 +1571,9 @@ sys_call_table:
1577 data8 sys_add_key 1571 data8 sys_add_key
1578 data8 sys_request_key 1572 data8 sys_request_key
1579 data8 sys_keyctl 1573 data8 sys_keyctl
1580 data8 sys_ni_syscall 1574 data8 sys_ioprio_set
1581 data8 sys_ni_syscall // 1275 1575 data8 sys_ioprio_get // 1275
1582 data8 sys_ni_syscall 1576 data8 sys_set_zone_reclaim
1583 data8 sys_ni_syscall 1577 data8 sys_ni_syscall
1584 data8 sys_ni_syscall 1578 data8 sys_ni_syscall
1585 data8 sys_ni_syscall 1579 data8 sys_ni_syscall
diff --git a/arch/ia64/kernel/entry.h b/arch/ia64/kernel/entry.h
index 6d4ecec989b5..78eeb0793419 100644
--- a/arch/ia64/kernel/entry.h
+++ b/arch/ia64/kernel/entry.h
@@ -60,7 +60,7 @@
60 .spillsp @priunat,SW(AR_UNAT)+16+(off); \ 60 .spillsp @priunat,SW(AR_UNAT)+16+(off); \
61 .spillsp ar.rnat,SW(AR_RNAT)+16+(off); \ 61 .spillsp ar.rnat,SW(AR_RNAT)+16+(off); \
62 .spillsp ar.bspstore,SW(AR_BSPSTORE)+16+(off); \ 62 .spillsp ar.bspstore,SW(AR_BSPSTORE)+16+(off); \
63 .spillsp pr,SW(PR)+16+(off)) 63 .spillsp pr,SW(PR)+16+(off)
64 64
65#define DO_SAVE_SWITCH_STACK \ 65#define DO_SAVE_SWITCH_STACK \
66 movl r28=1f; \ 66 movl r28=1f; \
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S
index 962b6c4e32b5..7d7684a369d3 100644
--- a/arch/ia64/kernel/fsys.S
+++ b/arch/ia64/kernel/fsys.S
@@ -531,93 +531,114 @@ GLOBAL_ENTRY(fsys_bubble_down)
531 .altrp b6 531 .altrp b6
532 .body 532 .body
533 /* 533 /*
534 * We get here for syscalls that don't have a lightweight handler. For those, we 534 * We get here for syscalls that don't have a lightweight
535 * need to bubble down into the kernel and that requires setting up a minimal 535 * handler. For those, we need to bubble down into the kernel
536 * pt_regs structure, and initializing the CPU state more or less as if an 536 * and that requires setting up a minimal pt_regs structure,
537 * interruption had occurred. To make syscall-restarts work, we setup pt_regs 537 * and initializing the CPU state more or less as if an
538 * such that cr_iip points to the second instruction in syscall_via_break. 538 * interruption had occurred. To make syscall-restarts work,
539 * Decrementing the IP hence will restart the syscall via break and not 539 * we setup pt_regs such that cr_iip points to the second
540 * decrementing IP will return us to the caller, as usual. Note that we preserve 540 * instruction in syscall_via_break. Decrementing the IP
541 * the value of psr.pp rather than initializing it from dcr.pp. This makes it 541 * hence will restart the syscall via break and not
542 * possible to distinguish fsyscall execution from other privileged execution. 542 * decrementing IP will return us to the caller, as usual.
543 * Note that we preserve the value of psr.pp rather than
544 * initializing it from dcr.pp. This makes it possible to
545 * distinguish fsyscall execution from other privileged
546 * execution.
543 * 547 *
544 * On entry: 548 * On entry:
545 * - normal fsyscall handler register usage, except that we also have: 549 * - normal fsyscall handler register usage, except
550 * that we also have:
546 * - r18: address of syscall entry point 551 * - r18: address of syscall entry point
547 * - r21: ar.fpsr 552 * - r21: ar.fpsr
548 * - r26: ar.pfs 553 * - r26: ar.pfs
549 * - r27: ar.rsc 554 * - r27: ar.rsc
550 * - r29: psr 555 * - r29: psr
556 *
557 * We used to clear some PSR bits here but that requires slow
558 * serialization. Fortuntely, that isn't really necessary.
559 * The rationale is as follows: we used to clear bits
560 * ~PSR_PRESERVED_BITS in PSR.L. Since
561 * PSR_PRESERVED_BITS==PSR.{UP,MFL,MFH,PK,DT,PP,SP,RT,IC}, we
562 * ended up clearing PSR.{BE,AC,I,DFL,DFH,DI,DB,SI,TB}.
563 * However,
564 *
565 * PSR.BE : already is turned off in __kernel_syscall_via_epc()
566 * PSR.AC : don't care (kernel normally turns PSR.AC on)
567 * PSR.I : already turned off by the time fsys_bubble_down gets
568 * invoked
569 * PSR.DFL: always 0 (kernel never turns it on)
570 * PSR.DFH: don't care --- kernel never touches f32-f127 on its own
571 * initiative
572 * PSR.DI : always 0 (kernel never turns it on)
573 * PSR.SI : always 0 (kernel never turns it on)
574 * PSR.DB : don't care --- kernel never enables kernel-level
575 * breakpoints
576 * PSR.TB : must be 0 already; if it wasn't zero on entry to
577 * __kernel_syscall_via_epc, the branch to fsys_bubble_down
578 * will trigger a taken branch; the taken-trap-handler then
579 * converts the syscall into a break-based system-call.
551 */ 580 */
552# define PSR_PRESERVED_BITS (IA64_PSR_UP | IA64_PSR_MFL | IA64_PSR_MFH | IA64_PSR_PK \
553 | IA64_PSR_DT | IA64_PSR_PP | IA64_PSR_SP | IA64_PSR_RT \
554 | IA64_PSR_IC)
555 /* 581 /*
556 * Reading psr.l gives us only bits 0-31, psr.it, and psr.mc. The rest we have 582 * Reading psr.l gives us only bits 0-31, psr.it, and psr.mc.
557 * to synthesize. 583 * The rest we have to synthesize.
558 */ 584 */
559# define PSR_ONE_BITS ((3 << IA64_PSR_CPL0_BIT) | (0x1 << IA64_PSR_RI_BIT) \ 585# define PSR_ONE_BITS ((3 << IA64_PSR_CPL0_BIT) \
586 | (0x1 << IA64_PSR_RI_BIT) \
560 | IA64_PSR_BN | IA64_PSR_I) 587 | IA64_PSR_BN | IA64_PSR_I)
561 588
562 invala 589 invala // M0|1
563 movl r8=PSR_ONE_BITS 590 movl r14=ia64_ret_from_syscall // X
564 591
565 mov r25=ar.unat // save ar.unat (5 cyc) 592 nop.m 0
566 movl r9=PSR_PRESERVED_BITS 593 movl r28=__kernel_syscall_via_break // X create cr.iip
594 ;;
567 595
568 mov ar.rsc=0 // set enforced lazy mode, pl 0, little-endian, loadrs=0 596 mov r2=r16 // A get task addr to addl-addressable register
569 movl r28=__kernel_syscall_via_break 597 adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r16 // A
598 mov r31=pr // I0 save pr (2 cyc)
570 ;; 599 ;;
571 mov r23=ar.bspstore // save ar.bspstore (12 cyc) 600 st1 [r16]=r0 // M2|3 clear current->thread.on_ustack flag
572 mov r31=pr // save pr (2 cyc) 601 addl r22=IA64_RBS_OFFSET,r2 // A compute base of RBS
573 mov r20=r1 // save caller's gp in r20 602 add r3=TI_FLAGS+IA64_TASK_SIZE,r2 // A
574 ;; 603 ;;
575 mov r2=r16 // copy current task addr to addl-addressable register 604 ld4 r3=[r3] // M0|1 r3 = current_thread_info()->flags
576 and r9=r9,r29 605 lfetch.fault.excl.nt1 [r22] // M0|1 prefetch register backing-store
577 mov r19=b6 // save b6 (2 cyc) 606 nop.i 0
578 ;; 607 ;;
579 mov psr.l=r9 // slam the door (17 cyc to srlz.i) 608 mov ar.rsc=0 // M2 set enforced lazy mode, pl 0, LE, loadrs=0
580 or r29=r8,r29 // construct cr.ipsr value to save 609 nop.m 0
581 addl r22=IA64_RBS_OFFSET,r2 // compute base of RBS 610 nop.i 0
582 ;; 611 ;;
583 // GAS reports a spurious RAW hazard on the read of ar.rnat because it thinks 612 mov r23=ar.bspstore // M2 (12 cyc) save ar.bspstore
584 // we may be reading ar.itc after writing to psr.l. Avoid that message with 613 mov.m r24=ar.rnat // M2 (5 cyc) read ar.rnat (dual-issues!)
585 // this directive: 614 nop.i 0
586 dv_serialize_data
587 mov.m r24=ar.rnat // read ar.rnat (5 cyc lat)
588 lfetch.fault.excl.nt1 [r22]
589 adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r2
590
591 // ensure previous insn group is issued before we stall for srlz.i:
592 ;; 615 ;;
593 srlz.i // ensure new psr.l has been established 616 mov ar.bspstore=r22 // M2 (6 cyc) switch to kernel RBS
594 ///////////////////////////////////////////////////////////////////////////// 617 movl r8=PSR_ONE_BITS // X
595 ////////// from this point on, execution is not interruptible anymore
596 /////////////////////////////////////////////////////////////////////////////
597 addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 // compute base of memory stack
598 cmp.ne pKStk,pUStk=r0,r0 // set pKStk <- 0, pUStk <- 1
599 ;; 618 ;;
600 st1 [r16]=r0 // clear current->thread.on_ustack flag 619 mov r25=ar.unat // M2 (5 cyc) save ar.unat
601 mov ar.bspstore=r22 // switch to kernel RBS 620 mov r19=b6 // I0 save b6 (2 cyc)
602 mov b6=r18 // copy syscall entry-point to b6 (7 cyc) 621 mov r20=r1 // A save caller's gp in r20
603 add r3=TI_FLAGS+IA64_TASK_SIZE,r2
604 ;; 622 ;;
605 ld4 r3=[r3] // r2 = current_thread_info()->flags 623 or r29=r8,r29 // A construct cr.ipsr value to save
606 mov r18=ar.bsp // save (kernel) ar.bsp (12 cyc) 624 mov b6=r18 // I0 copy syscall entry-point to b6 (7 cyc)
607 mov ar.rsc=0x3 // set eager mode, pl 0, little-endian, loadrs=0 625 addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r2 // A compute base of memory stack
608 br.call.sptk.many b7=ia64_syscall_setup 626
609 ;; 627 mov r18=ar.bsp // M2 save (kernel) ar.bsp (12 cyc)
610 ssm psr.i 628 cmp.ne pKStk,pUStk=r0,r0 // A set pKStk <- 0, pUStk <- 1
611 movl r2=ia64_ret_from_syscall 629 br.call.sptk.many b7=ia64_syscall_setup // B
612 ;; 630 ;;
613 mov rp=r2 // set the real return addr 631 mov ar.rsc=0x3 // M2 set eager mode, pl 0, LE, loadrs=0
614 and r3=_TIF_SYSCALL_TRACEAUDIT,r3 632 mov rp=r14 // I0 set the real return addr
633 and r3=_TIF_SYSCALL_TRACEAUDIT,r3 // A
615 ;; 634 ;;
616 cmp.eq p8,p0=r3,r0 635 ssm psr.i // M2 we're on kernel stacks now, reenable irqs
636 cmp.eq p8,p0=r3,r0 // A
637(p10) br.cond.spnt.many ia64_ret_from_syscall // B return if bad call-frame or r15 is a NaT
617 638
618(p10) br.cond.spnt.many ia64_ret_from_syscall // p10==true means out registers are more than 8 639 nop.m 0
619(p8) br.call.sptk.many b6=b6 // ignore this return addr 640(p8) br.call.sptk.many b6=b6 // B (ignore return address)
620 br.cond.sptk ia64_trace_syscall 641 br.cond.spnt ia64_trace_syscall // B
621END(fsys_bubble_down) 642END(fsys_bubble_down)
622 643
623 .rodata 644 .rodata
diff --git a/arch/ia64/kernel/gate.S b/arch/ia64/kernel/gate.S
index facf75acdc85..86948ce63e43 100644
--- a/arch/ia64/kernel/gate.S
+++ b/arch/ia64/kernel/gate.S
@@ -72,38 +72,40 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
72 * bundle get executed. The remaining code must be safe even if 72 * bundle get executed. The remaining code must be safe even if
73 * they do not get executed. 73 * they do not get executed.
74 */ 74 */
75 adds r17=-1024,r15 75 adds r17=-1024,r15 // A
76 mov r10=0 // default to successful syscall execution 76 mov r10=0 // A default to successful syscall execution
77 epc 77 epc // B causes split-issue
78} 78}
79 ;; 79 ;;
80 rsm psr.be // note: on McKinley "rsm psr.be/srlz.d" is slightly faster than "rum psr.be" 80 rsm psr.be | psr.i // M2 (5 cyc to srlz.d)
81 LOAD_FSYSCALL_TABLE(r14) 81 LOAD_FSYSCALL_TABLE(r14) // X
82
83 mov r16=IA64_KR(CURRENT) // 12 cycle read latency
84 tnat.nz p10,p9=r15
85 mov r19=NR_syscalls-1
86 ;; 82 ;;
87 shladd r18=r17,3,r14 83 mov r16=IA64_KR(CURRENT) // M2 (12 cyc)
88 84 shladd r18=r17,3,r14 // A
89 srlz.d 85 mov r19=NR_syscalls-1 // A
90 cmp.ne p8,p0=r0,r0 // p8 <- FALSE 86 ;;
91 /* Note: if r17 is a NaT, p6 will be set to zero. */ 87 lfetch [r18] // M0|1
92 cmp.geu p6,p7=r19,r17 // (syscall > 0 && syscall < 1024+NR_syscalls)? 88 mov r29=psr // M2 (12 cyc)
93 ;; 89 // If r17 is a NaT, p6 will be zero
94(p6) ld8 r18=[r18] 90 cmp.geu p6,p7=r19,r17 // A (sysnr > 0 && sysnr < 1024+NR_syscalls)?
95 mov r21=ar.fpsr 91 ;;
96 add r14=-8,r14 // r14 <- addr of fsys_bubble_down entry 92 mov r21=ar.fpsr // M2 (12 cyc)
97 ;; 93 tnat.nz p10,p9=r15 // I0
98(p6) mov b7=r18 94 mov.i r26=ar.pfs // I0 (would stall anyhow due to srlz.d...)
99(p6) tbit.z p8,p0=r18,0 95 ;;
100(p8) br.dptk.many b7 96 srlz.d // M0 (forces split-issue) ensure PSR.BE==0
101 97(p6) ld8 r18=[r18] // M0|1
102(p6) rsm psr.i 98 nop.i 0
103 mov r27=ar.rsc 99 ;;
104 mov r26=ar.pfs 100 nop.m 0
101(p6) tbit.z.unc p8,p0=r18,0 // I0 (dual-issues with "mov b7=r18"!)
102 nop.i 0
105 ;; 103 ;;
106 mov r29=psr // read psr (12 cyc load latency) 104(p8) ssm psr.i
105(p6) mov b7=r18 // I0
106(p8) br.dptk.many b7 // B
107
108 mov r27=ar.rsc // M2 (12 cyc)
107/* 109/*
108 * brl.cond doesn't work as intended because the linker would convert this branch 110 * brl.cond doesn't work as intended because the linker would convert this branch
109 * into a branch to a PLT. Perhaps there will be a way to avoid this with some 111 * into a branch to a PLT. Perhaps there will be a way to avoid this with some
@@ -111,6 +113,8 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
111 * instead. 113 * instead.
112 */ 114 */
113#ifdef CONFIG_ITANIUM 115#ifdef CONFIG_ITANIUM
116(p6) add r14=-8,r14 // r14 <- addr of fsys_bubble_down entry
117 ;;
114(p6) ld8 r14=[r14] // r14 <- fsys_bubble_down 118(p6) ld8 r14=[r14] // r14 <- fsys_bubble_down
115 ;; 119 ;;
116(p6) mov b7=r14 120(p6) mov b7=r14
@@ -118,7 +122,7 @@ GLOBAL_ENTRY(__kernel_syscall_via_epc)
118#else 122#else
119 BRL_COND_FSYS_BUBBLE_DOWN(p6) 123 BRL_COND_FSYS_BUBBLE_DOWN(p6)
120#endif 124#endif
121 125 ssm psr.i
122 mov r10=-1 126 mov r10=-1
123(p10) mov r8=EINVAL 127(p10) mov r8=EINVAL
124(p9) mov r8=ENOSYS 128(p9) mov r8=ENOSYS
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
index 7bbf019c9867..01572814abe4 100644
--- a/arch/ia64/kernel/ia64_ksyms.c
+++ b/arch/ia64/kernel/ia64_ksyms.c
@@ -58,9 +58,6 @@ EXPORT_SYMBOL(__strlen_user);
58EXPORT_SYMBOL(__strncpy_from_user); 58EXPORT_SYMBOL(__strncpy_from_user);
59EXPORT_SYMBOL(__strnlen_user); 59EXPORT_SYMBOL(__strnlen_user);
60 60
61#include <asm/unistd.h>
62EXPORT_SYMBOL(__ia64_syscall);
63
64/* from arch/ia64/lib */ 61/* from arch/ia64/lib */
65extern void __divsi3(void); 62extern void __divsi3(void);
66extern void __udivsi3(void); 63extern void __udivsi3(void);
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 88b014381df5..7936b62f7a2e 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -129,14 +129,13 @@ static struct iosapic {
129 char __iomem *addr; /* base address of IOSAPIC */ 129 char __iomem *addr; /* base address of IOSAPIC */
130 unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ 130 unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
131 unsigned short num_rte; /* number of RTE in this IOSAPIC */ 131 unsigned short num_rte; /* number of RTE in this IOSAPIC */
132 int rtes_inuse; /* # of RTEs in use on this IOSAPIC */
132#ifdef CONFIG_NUMA 133#ifdef CONFIG_NUMA
133 unsigned short node; /* numa node association via pxm */ 134 unsigned short node; /* numa node association via pxm */
134#endif 135#endif
135} iosapic_lists[NR_IOSAPICS]; 136} iosapic_lists[NR_IOSAPICS];
136 137
137static int num_iosapic; 138static unsigned char pcat_compat __devinitdata; /* 8259 compatibility flag */
138
139static unsigned char pcat_compat __initdata; /* 8259 compatibility flag */
140 139
141static int iosapic_kmalloc_ok; 140static int iosapic_kmalloc_ok;
142static LIST_HEAD(free_rte_list); 141static LIST_HEAD(free_rte_list);
@@ -149,7 +148,7 @@ find_iosapic (unsigned int gsi)
149{ 148{
150 int i; 149 int i;
151 150
152 for (i = 0; i < num_iosapic; i++) { 151 for (i = 0; i < NR_IOSAPICS; i++) {
153 if ((unsigned) (gsi - iosapic_lists[i].gsi_base) < iosapic_lists[i].num_rte) 152 if ((unsigned) (gsi - iosapic_lists[i].gsi_base) < iosapic_lists[i].num_rte)
154 return i; 153 return i;
155 } 154 }
@@ -490,8 +489,6 @@ static int iosapic_find_sharable_vector (unsigned long trigger, unsigned long po
490 } 489 }
491 } 490 }
492 } 491 }
493 if (vector < 0)
494 panic("%s: out of interrupt vectors!\n", __FUNCTION__);
495 492
496 return vector; 493 return vector;
497} 494}
@@ -507,6 +504,8 @@ iosapic_reassign_vector (int vector)
507 504
508 if (!list_empty(&iosapic_intr_info[vector].rtes)) { 505 if (!list_empty(&iosapic_intr_info[vector].rtes)) {
509 new_vector = assign_irq_vector(AUTO_ASSIGN); 506 new_vector = assign_irq_vector(AUTO_ASSIGN);
507 if (new_vector < 0)
508 panic("%s: out of interrupt vectors!\n", __FUNCTION__);
510 printk(KERN_INFO "Reassigning vector %d to %d\n", vector, new_vector); 509 printk(KERN_INFO "Reassigning vector %d to %d\n", vector, new_vector);
511 memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector], 510 memcpy(&iosapic_intr_info[new_vector], &iosapic_intr_info[vector],
512 sizeof(struct iosapic_intr_info)); 511 sizeof(struct iosapic_intr_info));
@@ -598,6 +597,7 @@ register_intr (unsigned int gsi, int vector, unsigned char delivery,
598 rte->refcnt++; 597 rte->refcnt++;
599 list_add_tail(&rte->rte_list, &iosapic_intr_info[vector].rtes); 598 list_add_tail(&rte->rte_list, &iosapic_intr_info[vector].rtes);
600 iosapic_intr_info[vector].count++; 599 iosapic_intr_info[vector].count++;
600 iosapic_lists[index].rtes_inuse++;
601 } 601 }
602 else if (vector_is_shared(vector)) { 602 else if (vector_is_shared(vector)) {
603 struct iosapic_intr_info *info = &iosapic_intr_info[vector]; 603 struct iosapic_intr_info *info = &iosapic_intr_info[vector];
@@ -734,9 +734,12 @@ again:
734 spin_unlock_irqrestore(&iosapic_lock, flags); 734 spin_unlock_irqrestore(&iosapic_lock, flags);
735 735
736 /* If vector is running out, we try to find a sharable vector */ 736 /* If vector is running out, we try to find a sharable vector */
737 vector = assign_irq_vector_nopanic(AUTO_ASSIGN); 737 vector = assign_irq_vector(AUTO_ASSIGN);
738 if (vector < 0) 738 if (vector < 0) {
739 vector = iosapic_find_sharable_vector(trigger, polarity); 739 vector = iosapic_find_sharable_vector(trigger, polarity);
740 if (vector < 0)
741 panic("%s: out of interrupt vectors!\n", __FUNCTION__);
742 }
740 743
741 spin_lock_irqsave(&irq_descp(vector)->lock, flags); 744 spin_lock_irqsave(&irq_descp(vector)->lock, flags);
742 spin_lock(&iosapic_lock); 745 spin_lock(&iosapic_lock);
@@ -778,7 +781,7 @@ void
778iosapic_unregister_intr (unsigned int gsi) 781iosapic_unregister_intr (unsigned int gsi)
779{ 782{
780 unsigned long flags; 783 unsigned long flags;
781 int irq, vector; 784 int irq, vector, index;
782 irq_desc_t *idesc; 785 irq_desc_t *idesc;
783 u32 low32; 786 u32 low32;
784 unsigned long trigger, polarity; 787 unsigned long trigger, polarity;
@@ -819,6 +822,9 @@ iosapic_unregister_intr (unsigned int gsi)
819 list_del(&rte->rte_list); 822 list_del(&rte->rte_list);
820 iosapic_intr_info[vector].count--; 823 iosapic_intr_info[vector].count--;
821 iosapic_free_rte(rte); 824 iosapic_free_rte(rte);
825 index = find_iosapic(gsi);
826 iosapic_lists[index].rtes_inuse--;
827 WARN_ON(iosapic_lists[index].rtes_inuse < 0);
822 828
823 trigger = iosapic_intr_info[vector].trigger; 829 trigger = iosapic_intr_info[vector].trigger;
824 polarity = iosapic_intr_info[vector].polarity; 830 polarity = iosapic_intr_info[vector].polarity;
@@ -881,6 +887,8 @@ iosapic_register_platform_intr (u32 int_type, unsigned int gsi,
881 break; 887 break;
882 case ACPI_INTERRUPT_INIT: 888 case ACPI_INTERRUPT_INIT:
883 vector = assign_irq_vector(AUTO_ASSIGN); 889 vector = assign_irq_vector(AUTO_ASSIGN);
890 if (vector < 0)
891 panic("%s: out of interrupt vectors!\n", __FUNCTION__);
884 delivery = IOSAPIC_INIT; 892 delivery = IOSAPIC_INIT;
885 break; 893 break;
886 case ACPI_INTERRUPT_CPEI: 894 case ACPI_INTERRUPT_CPEI:
@@ -952,30 +960,86 @@ iosapic_system_init (int system_pcat_compat)
952 } 960 }
953} 961}
954 962
955void __init 963static inline int
964iosapic_alloc (void)
965{
966 int index;
967
968 for (index = 0; index < NR_IOSAPICS; index++)
969 if (!iosapic_lists[index].addr)
970 return index;
971
972 printk(KERN_WARNING "%s: failed to allocate iosapic\n", __FUNCTION__);
973 return -1;
974}
975
976static inline void
977iosapic_free (int index)
978{
979 memset(&iosapic_lists[index], 0, sizeof(iosapic_lists[0]));
980}
981
982static inline int
983iosapic_check_gsi_range (unsigned int gsi_base, unsigned int ver)
984{
985 int index;
986 unsigned int gsi_end, base, end;
987
988 /* check gsi range */
989 gsi_end = gsi_base + ((ver >> 16) & 0xff);
990 for (index = 0; index < NR_IOSAPICS; index++) {
991 if (!iosapic_lists[index].addr)
992 continue;
993
994 base = iosapic_lists[index].gsi_base;
995 end = base + iosapic_lists[index].num_rte - 1;
996
997 if (gsi_base < base && gsi_end < base)
998 continue;/* OK */
999
1000 if (gsi_base > end && gsi_end > end)
1001 continue; /* OK */
1002
1003 return -EBUSY;
1004 }
1005 return 0;
1006}
1007
1008int __devinit
956iosapic_init (unsigned long phys_addr, unsigned int gsi_base) 1009iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
957{ 1010{
958 int num_rte; 1011 int num_rte, err, index;
959 unsigned int isa_irq, ver; 1012 unsigned int isa_irq, ver;
960 char __iomem *addr; 1013 char __iomem *addr;
1014 unsigned long flags;
961 1015
962 addr = ioremap(phys_addr, 0); 1016 spin_lock_irqsave(&iosapic_lock, flags);
963 ver = iosapic_version(addr); 1017 {
1018 addr = ioremap(phys_addr, 0);
1019 ver = iosapic_version(addr);
964 1020
965 /* 1021 if ((err = iosapic_check_gsi_range(gsi_base, ver))) {
966 * The MAX_REDIR register holds the highest input pin 1022 iounmap(addr);
967 * number (starting from 0). 1023 spin_unlock_irqrestore(&iosapic_lock, flags);
968 * We add 1 so that we can use it for number of pins (= RTEs) 1024 return err;
969 */ 1025 }
970 num_rte = ((ver >> 16) & 0xff) + 1; 1026
1027 /*
1028 * The MAX_REDIR register holds the highest input pin
1029 * number (starting from 0).
1030 * We add 1 so that we can use it for number of pins (= RTEs)
1031 */
1032 num_rte = ((ver >> 16) & 0xff) + 1;
971 1033
972 iosapic_lists[num_iosapic].addr = addr; 1034 index = iosapic_alloc();
973 iosapic_lists[num_iosapic].gsi_base = gsi_base; 1035 iosapic_lists[index].addr = addr;
974 iosapic_lists[num_iosapic].num_rte = num_rte; 1036 iosapic_lists[index].gsi_base = gsi_base;
1037 iosapic_lists[index].num_rte = num_rte;
975#ifdef CONFIG_NUMA 1038#ifdef CONFIG_NUMA
976 iosapic_lists[num_iosapic].node = MAX_NUMNODES; 1039 iosapic_lists[index].node = MAX_NUMNODES;
977#endif 1040#endif
978 num_iosapic++; 1041 }
1042 spin_unlock_irqrestore(&iosapic_lock, flags);
979 1043
980 if ((gsi_base == 0) && pcat_compat) { 1044 if ((gsi_base == 0) && pcat_compat) {
981 /* 1045 /*
@@ -986,10 +1050,43 @@ iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
986 for (isa_irq = 0; isa_irq < 16; ++isa_irq) 1050 for (isa_irq = 0; isa_irq < 16; ++isa_irq)
987 iosapic_override_isa_irq(isa_irq, isa_irq, IOSAPIC_POL_HIGH, IOSAPIC_EDGE); 1051 iosapic_override_isa_irq(isa_irq, isa_irq, IOSAPIC_POL_HIGH, IOSAPIC_EDGE);
988 } 1052 }
1053 return 0;
1054}
1055
1056#ifdef CONFIG_HOTPLUG
1057int
1058iosapic_remove (unsigned int gsi_base)
1059{
1060 int index, err = 0;
1061 unsigned long flags;
1062
1063 spin_lock_irqsave(&iosapic_lock, flags);
1064 {
1065 index = find_iosapic(gsi_base);
1066 if (index < 0) {
1067 printk(KERN_WARNING "%s: No IOSAPIC for GSI base %u\n",
1068 __FUNCTION__, gsi_base);
1069 goto out;
1070 }
1071
1072 if (iosapic_lists[index].rtes_inuse) {
1073 err = -EBUSY;
1074 printk(KERN_WARNING "%s: IOSAPIC for GSI base %u is busy\n",
1075 __FUNCTION__, gsi_base);
1076 goto out;
1077 }
1078
1079 iounmap(iosapic_lists[index].addr);
1080 iosapic_free(index);
1081 }
1082 out:
1083 spin_unlock_irqrestore(&iosapic_lock, flags);
1084 return err;
989} 1085}
1086#endif /* CONFIG_HOTPLUG */
990 1087
991#ifdef CONFIG_NUMA 1088#ifdef CONFIG_NUMA
992void __init 1089void __devinit
993map_iosapic_to_node(unsigned int gsi_base, int node) 1090map_iosapic_to_node(unsigned int gsi_base, int node)
994{ 1091{
995 int index; 1092 int index;
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c
index 4fe60c7a2e90..6c4d59fd0364 100644
--- a/arch/ia64/kernel/irq_ia64.c
+++ b/arch/ia64/kernel/irq_ia64.c
@@ -63,30 +63,19 @@ EXPORT_SYMBOL(isa_irq_to_vector_map);
63static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)]; 63static unsigned long ia64_vector_mask[BITS_TO_LONGS(IA64_NUM_DEVICE_VECTORS)];
64 64
65int 65int
66assign_irq_vector_nopanic (int irq) 66assign_irq_vector (int irq)
67{ 67{
68 int pos, vector; 68 int pos, vector;
69 again: 69 again:
70 pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS); 70 pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS);
71 vector = IA64_FIRST_DEVICE_VECTOR + pos; 71 vector = IA64_FIRST_DEVICE_VECTOR + pos;
72 if (vector > IA64_LAST_DEVICE_VECTOR) 72 if (vector > IA64_LAST_DEVICE_VECTOR)
73 return -1; 73 return -ENOSPC;
74 if (test_and_set_bit(pos, ia64_vector_mask)) 74 if (test_and_set_bit(pos, ia64_vector_mask))
75 goto again; 75 goto again;
76 return vector; 76 return vector;
77} 77}
78 78
79int
80assign_irq_vector (int irq)
81{
82 int vector = assign_irq_vector_nopanic(irq);
83
84 if (vector < 0)
85 panic("assign_irq_vector: out of interrupt vectors!");
86
87 return vector;
88}
89
90void 79void
91free_irq_vector (int vector) 80free_irq_vector (int vector)
92{ 81{
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S
index d9c05d53435b..3bb3a13c4047 100644
--- a/arch/ia64/kernel/ivt.S
+++ b/arch/ia64/kernel/ivt.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/ia64/kernel/ivt.S 2 * arch/ia64/kernel/ivt.S
3 * 3 *
4 * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co 4 * Copyright (C) 1998-2001, 2003, 2005 Hewlett-Packard Co
5 * Stephane Eranian <eranian@hpl.hp.com> 5 * Stephane Eranian <eranian@hpl.hp.com>
6 * David Mosberger <davidm@hpl.hp.com> 6 * David Mosberger <davidm@hpl.hp.com>
7 * Copyright (C) 2000, 2002-2003 Intel Co 7 * Copyright (C) 2000, 2002-2003 Intel Co
@@ -405,17 +405,22 @@ ENTRY(nested_dtlb_miss)
405 * r30: continuation address 405 * r30: continuation address
406 * r31: saved pr 406 * r31: saved pr
407 * 407 *
408 * Clobbered: b0, r18, r19, r21, psr.dt (cleared) 408 * Clobbered: b0, r18, r19, r21, r22, psr.dt (cleared)
409 */ 409 */
410 rsm psr.dt // switch to using physical data addressing 410 rsm psr.dt // switch to using physical data addressing
411 mov r19=IA64_KR(PT_BASE) // get the page table base address 411 mov r19=IA64_KR(PT_BASE) // get the page table base address
412 shl r21=r16,3 // shift bit 60 into sign bit 412 shl r21=r16,3 // shift bit 60 into sign bit
413 mov r18=cr.itir
413 ;; 414 ;;
414 shr.u r17=r16,61 // get the region number into r17 415 shr.u r17=r16,61 // get the region number into r17
416 extr.u r18=r18,2,6 // get the faulting page size
415 ;; 417 ;;
416 cmp.eq p6,p7=5,r17 // is faulting address in region 5? 418 cmp.eq p6,p7=5,r17 // is faulting address in region 5?
417 shr.u r18=r16,PGDIR_SHIFT // get bits 33-63 of faulting address 419 add r22=-PAGE_SHIFT,r18 // adjustment for hugetlb address
420 add r18=PGDIR_SHIFT-PAGE_SHIFT,r18
418 ;; 421 ;;
422 shr.u r22=r16,r22
423 shr.u r18=r16,r18
419(p7) dep r17=r17,r19,(PAGE_SHIFT-3),3 // put region number bits in place 424(p7) dep r17=r17,r19,(PAGE_SHIFT-3),3 // put region number bits in place
420 425
421 srlz.d 426 srlz.d
@@ -428,7 +433,7 @@ ENTRY(nested_dtlb_miss)
428(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=PTA + IFA(33,42)*8 433(p6) dep r17=r18,r19,3,(PAGE_SHIFT-3) // r17=PTA + IFA(33,42)*8
429(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8) 434(p7) dep r17=r18,r17,3,(PAGE_SHIFT-6) // r17=PTA + (((IFA(61,63) << 7) | IFA(33,39))*8)
430 cmp.eq p7,p6=0,r21 // unused address bits all zeroes? 435 cmp.eq p7,p6=0,r21 // unused address bits all zeroes?
431 shr.u r18=r16,PMD_SHIFT // shift L2 index into position 436 shr.u r18=r22,PMD_SHIFT // shift L2 index into position
432 ;; 437 ;;
433 ld8 r17=[r17] // fetch the L1 entry (may be 0) 438 ld8 r17=[r17] // fetch the L1 entry (may be 0)
434 ;; 439 ;;
@@ -436,7 +441,7 @@ ENTRY(nested_dtlb_miss)
436 dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry 441 dep r17=r18,r17,3,(PAGE_SHIFT-3) // compute address of L2 page table entry
437 ;; 442 ;;
438(p7) ld8 r17=[r17] // fetch the L2 entry (may be 0) 443(p7) ld8 r17=[r17] // fetch the L2 entry (may be 0)
439 shr.u r19=r16,PAGE_SHIFT // shift L3 index into position 444 shr.u r19=r22,PAGE_SHIFT // shift L3 index into position
440 ;; 445 ;;
441(p7) cmp.eq.or.andcm p6,p7=r17,r0 // was L2 entry NULL? 446(p7) cmp.eq.or.andcm p6,p7=r17,r0 // was L2 entry NULL?
442 dep r17=r19,r17,3,(PAGE_SHIFT-3) // compute address of L3 page table entry 447 dep r17=r19,r17,3,(PAGE_SHIFT-3) // compute address of L3 page table entry
@@ -687,82 +692,118 @@ ENTRY(break_fault)
687 * to prevent leaking bits from kernel to user level. 692 * to prevent leaking bits from kernel to user level.
688 */ 693 */
689 DBG_FAULT(11) 694 DBG_FAULT(11)
690 mov r16=IA64_KR(CURRENT) // r16 = current task; 12 cycle read lat. 695 mov.m r16=IA64_KR(CURRENT) // M2 r16 <- current task (12 cyc)
691 mov r17=cr.iim 696 mov r29=cr.ipsr // M2 (12 cyc)
692 mov r18=__IA64_BREAK_SYSCALL 697 mov r31=pr // I0 (2 cyc)
693 mov r21=ar.fpsr 698
694 mov r29=cr.ipsr 699 mov r17=cr.iim // M2 (2 cyc)
695 mov r19=b6 700 mov.m r27=ar.rsc // M2 (12 cyc)
696 mov r25=ar.unat 701 mov r18=__IA64_BREAK_SYSCALL // A
697 mov r27=ar.rsc 702
698 mov r26=ar.pfs 703 mov.m ar.rsc=0 // M2
699 mov r28=cr.iip 704 mov.m r21=ar.fpsr // M2 (12 cyc)
700 mov r31=pr // prepare to save predicates 705 mov r19=b6 // I0 (2 cyc)
701 mov r20=r1 706 ;;
702 ;; 707 mov.m r23=ar.bspstore // M2 (12 cyc)
708 mov.m r24=ar.rnat // M2 (5 cyc)
709 mov.i r26=ar.pfs // I0 (2 cyc)
710
711 invala // M0|1
712 nop.m 0 // M
713 mov r20=r1 // A save r1
714
715 nop.m 0
716 movl r30=sys_call_table // X
717
718 mov r28=cr.iip // M2 (2 cyc)
719 cmp.eq p0,p7=r18,r17 // I0 is this a system call?
720(p7) br.cond.spnt non_syscall // B no ->
721 //
722 // From this point on, we are definitely on the syscall-path
723 // and we can use (non-banked) scratch registers.
724 //
725///////////////////////////////////////////////////////////////////////
726 mov r1=r16 // A move task-pointer to "addl"-addressable reg
727 mov r2=r16 // A setup r2 for ia64_syscall_setup
728 add r9=TI_FLAGS+IA64_TASK_SIZE,r16 // A r9 = &current_thread_info()->flags
729
703 adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r16 730 adds r16=IA64_TASK_THREAD_ON_USTACK_OFFSET,r16
704 cmp.eq p0,p7=r18,r17 // is this a system call? (p7 <- false, if so) 731 adds r15=-1024,r15 // A subtract 1024 from syscall number
705(p7) br.cond.spnt non_syscall 732 mov r3=NR_syscalls - 1
706 ;; 733 ;;
707 ld1 r17=[r16] // load current->thread.on_ustack flag 734 ld1.bias r17=[r16] // M0|1 r17 = current->thread.on_ustack flag
708 st1 [r16]=r0 // clear current->thread.on_ustack flag 735 ld4 r9=[r9] // M0|1 r9 = current_thread_info()->flags
709 add r1=-IA64_TASK_THREAD_ON_USTACK_OFFSET,r16 // set r1 for MINSTATE_START_SAVE_MIN_VIRT 736 extr.u r8=r29,41,2 // I0 extract ei field from cr.ipsr
737
738 shladd r30=r15,3,r30 // A r30 = sys_call_table + 8*(syscall-1024)
739 addl r22=IA64_RBS_OFFSET,r1 // A compute base of RBS
740 cmp.leu p6,p7=r15,r3 // A syscall number in range?
710 ;; 741 ;;
711 invala
712 742
713 /* adjust return address so we skip over the break instruction: */ 743 lfetch.fault.excl.nt1 [r22] // M0|1 prefetch RBS
744(p6) ld8 r30=[r30] // M0|1 load address of syscall entry point
745 tnat.nz.or p7,p0=r15 // I0 is syscall nr a NaT?
714 746
715 extr.u r8=r29,41,2 // extract ei field from cr.ipsr 747 mov.m ar.bspstore=r22 // M2 switch to kernel RBS
716 ;; 748 cmp.eq p8,p9=2,r8 // A isr.ei==2?
717 cmp.eq p6,p7=2,r8 // isr.ei==2?
718 mov r2=r1 // setup r2 for ia64_syscall_setup
719 ;;
720(p6) mov r8=0 // clear ei to 0
721(p6) adds r28=16,r28 // switch cr.iip to next bundle cr.ipsr.ei wrapped
722(p7) adds r8=1,r8 // increment ei to next slot
723 ;;
724 cmp.eq pKStk,pUStk=r0,r17 // are we in kernel mode already?
725 dep r29=r8,r29,41,2 // insert new ei into cr.ipsr
726 ;; 749 ;;
727 750
728 // switch from user to kernel RBS: 751(p8) mov r8=0 // A clear ei to 0
729 MINSTATE_START_SAVE_MIN_VIRT 752(p7) movl r30=sys_ni_syscall // X
730 br.call.sptk.many b7=ia64_syscall_setup
731 ;;
732 MINSTATE_END_SAVE_MIN_VIRT // switch to bank 1
733 ssm psr.ic | PSR_DEFAULT_BITS
734 ;;
735 srlz.i // guarantee that interruption collection is on
736 mov r3=NR_syscalls - 1
737 ;;
738(p15) ssm psr.i // restore psr.i
739 // p10==true means out registers are more than 8 or r15's Nat is true
740(p10) br.cond.spnt.many ia64_ret_from_syscall
741 ;;
742 movl r16=sys_call_table
743 753
744 adds r15=-1024,r15 // r15 contains the syscall number---subtract 1024 754(p8) adds r28=16,r28 // A switch cr.iip to next bundle
745 movl r2=ia64_ret_from_syscall 755(p9) adds r8=1,r8 // A increment ei to next slot
746 ;; 756 nop.i 0
747 shladd r20=r15,3,r16 // r20 = sys_call_table + 8*(syscall-1024)
748 cmp.leu p6,p7=r15,r3 // (syscall > 0 && syscall < 1024 + NR_syscalls) ?
749 mov rp=r2 // set the real return addr
750 ;; 757 ;;
751(p6) ld8 r20=[r20] // load address of syscall entry point
752(p7) movl r20=sys_ni_syscall
753 758
754 add r2=TI_FLAGS+IA64_TASK_SIZE,r13 759 mov.m r25=ar.unat // M2 (5 cyc)
755 ;; 760 dep r29=r8,r29,41,2 // I0 insert new ei into cr.ipsr
756 ld4 r2=[r2] // r2 = current_thread_info()->flags 761 adds r15=1024,r15 // A restore original syscall number
757 ;; 762 //
758 and r2=_TIF_SYSCALL_TRACEAUDIT,r2 // mask trace or audit 763 // If any of the above loads miss in L1D, we'll stall here until
764 // the data arrives.
765 //
766///////////////////////////////////////////////////////////////////////
767 st1 [r16]=r0 // M2|3 clear current->thread.on_ustack flag
768 mov b6=r30 // I0 setup syscall handler branch reg early
769 cmp.eq pKStk,pUStk=r0,r17 // A were we on kernel stacks already?
770
771 and r9=_TIF_SYSCALL_TRACEAUDIT,r9 // A mask trace or audit
772 mov r18=ar.bsp // M2 (12 cyc)
773(pKStk) br.cond.spnt .break_fixup // B we're already in kernel-mode -- fix up RBS
774 ;;
775.back_from_break_fixup:
776(pUStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r1 // A compute base of memory stack
777 cmp.eq p14,p0=r9,r0 // A are syscalls being traced/audited?
778 br.call.sptk.many b7=ia64_syscall_setup // B
7791:
780 mov ar.rsc=0x3 // M2 set eager mode, pl 0, LE, loadrs=0
781 nop 0
782 bsw.1 // B (6 cyc) regs are saved, switch to bank 1
759 ;; 783 ;;
760 cmp.eq p8,p0=r2,r0 784
761 mov b6=r20 785 ssm psr.ic | PSR_DEFAULT_BITS // M2 now it's safe to re-enable intr.-collection
786 movl r3=ia64_ret_from_syscall // X
762 ;; 787 ;;
763(p8) br.call.sptk.many b6=b6 // ignore this return addr 788
764 br.cond.sptk ia64_trace_syscall 789 srlz.i // M0 ensure interruption collection is on
790 mov rp=r3 // I0 set the real return addr
791(p10) br.cond.spnt.many ia64_ret_from_syscall // B return if bad call-frame or r15 is a NaT
792
793(p15) ssm psr.i // M2 restore psr.i
794(p14) br.call.sptk.many b6=b6 // B invoke syscall-handker (ignore return addr)
795 br.cond.spnt.many ia64_trace_syscall // B do syscall-tracing thingamagic
765 // NOT REACHED 796 // NOT REACHED
797///////////////////////////////////////////////////////////////////////
798 // On entry, we optimistically assumed that we're coming from user-space.
799 // For the rare cases where a system-call is done from within the kernel,
800 // we fix things up at this point:
801.break_fixup:
802 add r1=-IA64_PT_REGS_SIZE,sp // A allocate space for pt_regs structure
803 mov ar.rnat=r24 // M2 restore kernel's AR.RNAT
804 ;;
805 mov ar.bspstore=r23 // M2 restore kernel's AR.BSPSTORE
806 br.cond.sptk .back_from_break_fixup
766END(break_fault) 807END(break_fault)
767 808
768 .org ia64_ivt+0x3000 809 .org ia64_ivt+0x3000
@@ -837,8 +878,6 @@ END(interrupt)
837 * - r31: saved pr 878 * - r31: saved pr
838 * - b0: original contents (to be saved) 879 * - b0: original contents (to be saved)
839 * On exit: 880 * On exit:
840 * - executing on bank 1 registers
841 * - psr.ic enabled, interrupts restored
842 * - p10: TRUE if syscall is invoked with more than 8 out 881 * - p10: TRUE if syscall is invoked with more than 8 out
843 * registers or r15's Nat is true 882 * registers or r15's Nat is true
844 * - r1: kernel's gp 883 * - r1: kernel's gp
@@ -846,8 +885,11 @@ END(interrupt)
846 * - r8: -EINVAL if p10 is true 885 * - r8: -EINVAL if p10 is true
847 * - r12: points to kernel stack 886 * - r12: points to kernel stack
848 * - r13: points to current task 887 * - r13: points to current task
888 * - r14: preserved (same as on entry)
889 * - p13: preserved
849 * - p15: TRUE if interrupts need to be re-enabled 890 * - p15: TRUE if interrupts need to be re-enabled
850 * - ar.fpsr: set to kernel settings 891 * - ar.fpsr: set to kernel settings
892 * - b6: preserved (same as on entry)
851 */ 893 */
852GLOBAL_ENTRY(ia64_syscall_setup) 894GLOBAL_ENTRY(ia64_syscall_setup)
853#if PT(B6) != 0 895#if PT(B6) != 0
@@ -915,10 +957,10 @@ GLOBAL_ENTRY(ia64_syscall_setup)
915(p13) mov in5=-1 957(p13) mov in5=-1
916 ;; 958 ;;
917 st8 [r16]=r21,PT(R8)-PT(AR_FPSR) // save ar.fpsr 959 st8 [r16]=r21,PT(R8)-PT(AR_FPSR) // save ar.fpsr
918 tnat.nz p14,p0=in6 960 tnat.nz p13,p0=in6
919 cmp.lt p10,p9=r11,r8 // frame size can't be more than local+8 961 cmp.lt p10,p9=r11,r8 // frame size can't be more than local+8
920 ;; 962 ;;
921 stf8 [r16]=f1 // ensure pt_regs.r8 != 0 (see handle_syscall_error) 963 mov r8=1
922(p9) tnat.nz p10,p0=r15 964(p9) tnat.nz p10,p0=r15
923 adds r12=-16,r1 // switch to kernel memory stack (with 16 bytes of scratch) 965 adds r12=-16,r1 // switch to kernel memory stack (with 16 bytes of scratch)
924 966
@@ -929,9 +971,9 @@ GLOBAL_ENTRY(ia64_syscall_setup)
929 mov r13=r2 // establish `current' 971 mov r13=r2 // establish `current'
930 movl r1=__gp // establish kernel global pointer 972 movl r1=__gp // establish kernel global pointer
931 ;; 973 ;;
932(p14) mov in6=-1 974 st8 [r16]=r8 // ensure pt_regs.r8 != 0 (see handle_syscall_error)
975(p13) mov in6=-1
933(p8) mov in7=-1 976(p8) mov in7=-1
934 nop.i 0
935 977
936 cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0 978 cmp.eq pSys,pNonSys=r0,r0 // set pSys=1, pNonSys=0
937 movl r17=FPSR_DEFAULT 979 movl r17=FPSR_DEFAULT
@@ -1002,6 +1044,8 @@ END(dispatch_illegal_op_fault)
1002 FAULT(17) 1044 FAULT(17)
1003 1045
1004ENTRY(non_syscall) 1046ENTRY(non_syscall)
1047 mov ar.rsc=r27 // restore ar.rsc before SAVE_MIN_WITH_COVER
1048 ;;
1005 SAVE_MIN_WITH_COVER 1049 SAVE_MIN_WITH_COVER
1006 1050
1007 // There is no particular reason for this code to be here, other than that 1051 // There is no particular reason for this code to be here, other than that
@@ -1199,6 +1243,25 @@ END(disabled_fp_reg)
1199// 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50) 1243// 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50)
1200ENTRY(nat_consumption) 1244ENTRY(nat_consumption)
1201 DBG_FAULT(26) 1245 DBG_FAULT(26)
1246
1247 mov r16=cr.ipsr
1248 mov r17=cr.isr
1249 mov r31=pr // save PR
1250 ;;
1251 and r18=0xf,r17 // r18 = cr.ipsr.code{3:0}
1252 tbit.z p6,p0=r17,IA64_ISR_NA_BIT
1253 ;;
1254 cmp.ne.or p6,p0=IA64_ISR_CODE_LFETCH,r18
1255 dep r16=-1,r16,IA64_PSR_ED_BIT,1
1256(p6) br.cond.spnt 1f // branch if (cr.ispr.na == 0 || cr.ipsr.code{3:0} != LFETCH)
1257 ;;
1258 mov cr.ipsr=r16 // set cr.ipsr.na
1259 mov pr=r31,-1
1260 ;;
1261 rfi
1262
12631: mov pr=r31,-1
1264 ;;
1202 FAULT(26) 1265 FAULT(26)
1203END(nat_consumption) 1266END(nat_consumption)
1204 1267
diff --git a/arch/ia64/kernel/jprobes.S b/arch/ia64/kernel/jprobes.S
new file mode 100644
index 000000000000..b7fa3ccd2b0f
--- /dev/null
+++ b/arch/ia64/kernel/jprobes.S
@@ -0,0 +1,61 @@
1/*
2 * Jprobe specific operations
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright (C) Intel Corporation, 2005
19 *
20 * 2005-May Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
21 * <anil.s.keshavamurthy@intel.com> initial implementation
22 *
23 * Jprobes (a.k.a. "jump probes" which is built on-top of kprobes) allow a
24 * probe to be inserted into the beginning of a function call. The fundamental
25 * difference between a jprobe and a kprobe is the jprobe handler is executed
26 * in the same context as the target function, while the kprobe handlers
27 * are executed in interrupt context.
28 *
29 * For jprobes we initially gain control by placing a break point in the
30 * first instruction of the targeted function. When we catch that specific
31 * break, we:
32 * * set the return address to our jprobe_inst_return() function
33 * * jump to the jprobe handler function
34 *
35 * Since we fixed up the return address, the jprobe handler will return to our
36 * jprobe_inst_return() function, giving us control again. At this point we
37 * are back in the parents frame marker, so we do yet another call to our
38 * jprobe_break() function to fix up the frame marker as it would normally
39 * exist in the target function.
40 *
41 * Our jprobe_return function then transfers control back to kprobes.c by
42 * executing a break instruction using one of our reserved numbers. When we
43 * catch that break in kprobes.c, we continue like we do for a normal kprobe
44 * by single stepping the emulated instruction, and then returning execution
45 * to the correct location.
46 */
47#include <asm/asmmacro.h>
48
49 /*
50 * void jprobe_break(void)
51 */
52ENTRY(jprobe_break)
53 break.m 0x80300
54END(jprobe_break)
55
56 /*
57 * void jprobe_inst_return(void)
58 */
59GLOBAL_ENTRY(jprobe_inst_return)
60 br.call.sptk.many b0=jprobe_break
61END(jprobe_inst_return)
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
new file mode 100644
index 000000000000..884f5cd27d8a
--- /dev/null
+++ b/arch/ia64/kernel/kprobes.c
@@ -0,0 +1,721 @@
1/*
2 * Kernel Probes (KProbes)
3 * arch/ia64/kernel/kprobes.c
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 * Copyright (C) IBM Corporation, 2002, 2004
20 * Copyright (C) Intel Corporation, 2005
21 *
22 * 2005-Apr Rusty Lynch <rusty.lynch@intel.com> and Anil S Keshavamurthy
23 * <anil.s.keshavamurthy@intel.com> adapted from i386
24 */
25
26#include <linux/config.h>
27#include <linux/kprobes.h>
28#include <linux/ptrace.h>
29#include <linux/spinlock.h>
30#include <linux/string.h>
31#include <linux/slab.h>
32#include <linux/preempt.h>
33#include <linux/moduleloader.h>
34
35#include <asm/pgtable.h>
36#include <asm/kdebug.h>
37#include <asm/sections.h>
38
39extern void jprobe_inst_return(void);
40
41/* kprobe_status settings */
42#define KPROBE_HIT_ACTIVE 0x00000001
43#define KPROBE_HIT_SS 0x00000002
44
45static struct kprobe *current_kprobe, *kprobe_prev;
46static unsigned long kprobe_status, kprobe_status_prev;
47static struct pt_regs jprobe_saved_regs;
48
49enum instruction_type {A, I, M, F, B, L, X, u};
50static enum instruction_type bundle_encoding[32][3] = {
51 { M, I, I }, /* 00 */
52 { M, I, I }, /* 01 */
53 { M, I, I }, /* 02 */
54 { M, I, I }, /* 03 */
55 { M, L, X }, /* 04 */
56 { M, L, X }, /* 05 */
57 { u, u, u }, /* 06 */
58 { u, u, u }, /* 07 */
59 { M, M, I }, /* 08 */
60 { M, M, I }, /* 09 */
61 { M, M, I }, /* 0A */
62 { M, M, I }, /* 0B */
63 { M, F, I }, /* 0C */
64 { M, F, I }, /* 0D */
65 { M, M, F }, /* 0E */
66 { M, M, F }, /* 0F */
67 { M, I, B }, /* 10 */
68 { M, I, B }, /* 11 */
69 { M, B, B }, /* 12 */
70 { M, B, B }, /* 13 */
71 { u, u, u }, /* 14 */
72 { u, u, u }, /* 15 */
73 { B, B, B }, /* 16 */
74 { B, B, B }, /* 17 */
75 { M, M, B }, /* 18 */
76 { M, M, B }, /* 19 */
77 { u, u, u }, /* 1A */
78 { u, u, u }, /* 1B */
79 { M, F, B }, /* 1C */
80 { M, F, B }, /* 1D */
81 { u, u, u }, /* 1E */
82 { u, u, u }, /* 1F */
83};
84
85/*
86 * In this function we check to see if the instruction
87 * is IP relative instruction and update the kprobe
88 * inst flag accordingly
89 */
90static void update_kprobe_inst_flag(uint template, uint slot, uint major_opcode,
91 unsigned long kprobe_inst, struct kprobe *p)
92{
93 p->ainsn.inst_flag = 0;
94 p->ainsn.target_br_reg = 0;
95
96 if (bundle_encoding[template][slot] == B) {
97 switch (major_opcode) {
98 case INDIRECT_CALL_OPCODE:
99 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG;
100 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7);
101 break;
102 case IP_RELATIVE_PREDICT_OPCODE:
103 case IP_RELATIVE_BRANCH_OPCODE:
104 p->ainsn.inst_flag |= INST_FLAG_FIX_RELATIVE_IP_ADDR;
105 break;
106 case IP_RELATIVE_CALL_OPCODE:
107 p->ainsn.inst_flag |= INST_FLAG_FIX_RELATIVE_IP_ADDR;
108 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG;
109 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7);
110 break;
111 }
112 } else if (bundle_encoding[template][slot] == X) {
113 switch (major_opcode) {
114 case LONG_CALL_OPCODE:
115 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG;
116 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7);
117 break;
118 }
119 }
120 return;
121}
122
123/*
124 * In this function we check to see if the instruction
125 * on which we are inserting kprobe is supported.
126 * Returns 0 if supported
127 * Returns -EINVAL if unsupported
128 */
129static int unsupported_inst(uint template, uint slot, uint major_opcode,
130 unsigned long kprobe_inst, struct kprobe *p)
131{
132 unsigned long addr = (unsigned long)p->addr;
133
134 if (bundle_encoding[template][slot] == I) {
135 switch (major_opcode) {
136 case 0x0: //I_UNIT_MISC_OPCODE:
137 /*
138 * Check for Integer speculation instruction
139 * - Bit 33-35 to be equal to 0x1
140 */
141 if (((kprobe_inst >> 33) & 0x7) == 1) {
142 printk(KERN_WARNING
143 "Kprobes on speculation inst at <0x%lx> not supported\n",
144 addr);
145 return -EINVAL;
146 }
147
148 /*
149 * IP relative mov instruction
150 * - Bit 27-35 to be equal to 0x30
151 */
152 if (((kprobe_inst >> 27) & 0x1FF) == 0x30) {
153 printk(KERN_WARNING
154 "Kprobes on \"mov r1=ip\" at <0x%lx> not supported\n",
155 addr);
156 return -EINVAL;
157
158 }
159 }
160 }
161 return 0;
162}
163
164
165/*
166 * In this function we check to see if the instruction
167 * (qp) cmpx.crel.ctype p1,p2=r2,r3
168 * on which we are inserting kprobe is cmp instruction
169 * with ctype as unc.
170 */
171static uint is_cmp_ctype_unc_inst(uint template, uint slot, uint major_opcode,
172unsigned long kprobe_inst)
173{
174 cmp_inst_t cmp_inst;
175 uint ctype_unc = 0;
176
177 if (!((bundle_encoding[template][slot] == I) ||
178 (bundle_encoding[template][slot] == M)))
179 goto out;
180
181 if (!((major_opcode == 0xC) || (major_opcode == 0xD) ||
182 (major_opcode == 0xE)))
183 goto out;
184
185 cmp_inst.l = kprobe_inst;
186 if ((cmp_inst.f.x2 == 0) || (cmp_inst.f.x2 == 1)) {
187 /* Integere compare - Register Register (A6 type)*/
188 if ((cmp_inst.f.tb == 0) && (cmp_inst.f.ta == 0)
189 &&(cmp_inst.f.c == 1))
190 ctype_unc = 1;
191 } else if ((cmp_inst.f.x2 == 2)||(cmp_inst.f.x2 == 3)) {
192 /* Integere compare - Immediate Register (A8 type)*/
193 if ((cmp_inst.f.ta == 0) &&(cmp_inst.f.c == 1))
194 ctype_unc = 1;
195 }
196out:
197 return ctype_unc;
198}
199
200/*
201 * In this function we override the bundle with
202 * the break instruction at the given slot.
203 */
204static void prepare_break_inst(uint template, uint slot, uint major_opcode,
205 unsigned long kprobe_inst, struct kprobe *p)
206{
207 unsigned long break_inst = BREAK_INST;
208 bundle_t *bundle = &p->ainsn.insn.bundle;
209
210 /*
211 * Copy the original kprobe_inst qualifying predicate(qp)
212 * to the break instruction iff !is_cmp_ctype_unc_inst
213 * because for cmp instruction with ctype equal to unc,
214 * which is a special instruction always needs to be
215 * executed regradless of qp
216 */
217 if (!is_cmp_ctype_unc_inst(template, slot, major_opcode, kprobe_inst))
218 break_inst |= (0x3f & kprobe_inst);
219
220 switch (slot) {
221 case 0:
222 bundle->quad0.slot0 = break_inst;
223 break;
224 case 1:
225 bundle->quad0.slot1_p0 = break_inst;
226 bundle->quad1.slot1_p1 = break_inst >> (64-46);
227 break;
228 case 2:
229 bundle->quad1.slot2 = break_inst;
230 break;
231 }
232
233 /*
234 * Update the instruction flag, so that we can
235 * emulate the instruction properly after we
236 * single step on original instruction
237 */
238 update_kprobe_inst_flag(template, slot, major_opcode, kprobe_inst, p);
239}
240
241static inline void get_kprobe_inst(bundle_t *bundle, uint slot,
242 unsigned long *kprobe_inst, uint *major_opcode)
243{
244 unsigned long kprobe_inst_p0, kprobe_inst_p1;
245 unsigned int template;
246
247 template = bundle->quad0.template;
248
249 switch (slot) {
250 case 0:
251 *major_opcode = (bundle->quad0.slot0 >> SLOT0_OPCODE_SHIFT);
252 *kprobe_inst = bundle->quad0.slot0;
253 break;
254 case 1:
255 *major_opcode = (bundle->quad1.slot1_p1 >> SLOT1_p1_OPCODE_SHIFT);
256 kprobe_inst_p0 = bundle->quad0.slot1_p0;
257 kprobe_inst_p1 = bundle->quad1.slot1_p1;
258 *kprobe_inst = kprobe_inst_p0 | (kprobe_inst_p1 << (64-46));
259 break;
260 case 2:
261 *major_opcode = (bundle->quad1.slot2 >> SLOT2_OPCODE_SHIFT);
262 *kprobe_inst = bundle->quad1.slot2;
263 break;
264 }
265}
266
267/* Returns non-zero if the addr is in the Interrupt Vector Table */
268static inline int in_ivt_functions(unsigned long addr)
269{
270 return (addr >= (unsigned long)__start_ivt_text
271 && addr < (unsigned long)__end_ivt_text);
272}
273
274static int valid_kprobe_addr(int template, int slot, unsigned long addr)
275{
276 if ((slot > 2) || ((bundle_encoding[template][1] == L) && slot > 1)) {
277 printk(KERN_WARNING "Attempting to insert unaligned kprobe "
278 "at 0x%lx\n", addr);
279 return -EINVAL;
280 }
281
282 if (in_ivt_functions(addr)) {
283 printk(KERN_WARNING "Kprobes can't be inserted inside "
284 "IVT functions at 0x%lx\n", addr);
285 return -EINVAL;
286 }
287
288 if (slot == 1 && bundle_encoding[template][1] != L) {
289 printk(KERN_WARNING "Inserting kprobes on slot #1 "
290 "is not supported\n");
291 return -EINVAL;
292 }
293
294 return 0;
295}
296
297static inline void save_previous_kprobe(void)
298{
299 kprobe_prev = current_kprobe;
300 kprobe_status_prev = kprobe_status;
301}
302
303static inline void restore_previous_kprobe(void)
304{
305 current_kprobe = kprobe_prev;
306 kprobe_status = kprobe_status_prev;
307}
308
309static inline void set_current_kprobe(struct kprobe *p)
310{
311 current_kprobe = p;
312}
313
314static void kretprobe_trampoline(void)
315{
316}
317
318/*
319 * At this point the target function has been tricked into
320 * returning into our trampoline. Lookup the associated instance
321 * and then:
322 * - call the handler function
323 * - cleanup by marking the instance as unused
324 * - long jump back to the original return address
325 */
326int trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
327{
328 struct kretprobe_instance *ri = NULL;
329 struct hlist_head *head;
330 struct hlist_node *node, *tmp;
331 unsigned long orig_ret_address = 0;
332 unsigned long trampoline_address =
333 ((struct fnptr *)kretprobe_trampoline)->ip;
334
335 head = kretprobe_inst_table_head(current);
336
337 /*
338 * It is possible to have multiple instances associated with a given
339 * task either because an multiple functions in the call path
340 * have a return probe installed on them, and/or more then one return
341 * return probe was registered for a target function.
342 *
343 * We can handle this because:
344 * - instances are always inserted at the head of the list
345 * - when multiple return probes are registered for the same
346 * function, the first instance's ret_addr will point to the
347 * real return address, and all the rest will point to
348 * kretprobe_trampoline
349 */
350 hlist_for_each_entry_safe(ri, node, tmp, head, hlist) {
351 if (ri->task != current)
352 /* another task is sharing our hash bucket */
353 continue;
354
355 if (ri->rp && ri->rp->handler)
356 ri->rp->handler(ri, regs);
357
358 orig_ret_address = (unsigned long)ri->ret_addr;
359 recycle_rp_inst(ri);
360
361 if (orig_ret_address != trampoline_address)
362 /*
363 * This is the real return address. Any other
364 * instances associated with this task are for
365 * other calls deeper on the call stack
366 */
367 break;
368 }
369
370 BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
371 regs->cr_iip = orig_ret_address;
372
373 unlock_kprobes();
374 preempt_enable_no_resched();
375
376 /*
377 * By returning a non-zero value, we are telling
378 * kprobe_handler() that we have handled unlocking
379 * and re-enabling preemption.
380 */
381 return 1;
382}
383
384void arch_prepare_kretprobe(struct kretprobe *rp, struct pt_regs *regs)
385{
386 struct kretprobe_instance *ri;
387
388 if ((ri = get_free_rp_inst(rp)) != NULL) {
389 ri->rp = rp;
390 ri->task = current;
391 ri->ret_addr = (kprobe_opcode_t *)regs->b0;
392
393 /* Replace the return addr with trampoline addr */
394 regs->b0 = ((struct fnptr *)kretprobe_trampoline)->ip;
395
396 add_rp_inst(ri);
397 } else {
398 rp->nmissed++;
399 }
400}
401
402int arch_prepare_kprobe(struct kprobe *p)
403{
404 unsigned long addr = (unsigned long) p->addr;
405 unsigned long *kprobe_addr = (unsigned long *)(addr & ~0xFULL);
406 unsigned long kprobe_inst=0;
407 unsigned int slot = addr & 0xf, template, major_opcode = 0;
408 bundle_t *bundle = &p->ainsn.insn.bundle;
409
410 memcpy(&p->opcode.bundle, kprobe_addr, sizeof(bundle_t));
411 memcpy(&p->ainsn.insn.bundle, kprobe_addr, sizeof(bundle_t));
412
413 template = bundle->quad0.template;
414
415 if(valid_kprobe_addr(template, slot, addr))
416 return -EINVAL;
417
418 /* Move to slot 2, if bundle is MLX type and kprobe slot is 1 */
419 if (slot == 1 && bundle_encoding[template][1] == L)
420 slot++;
421
422 /* Get kprobe_inst and major_opcode from the bundle */
423 get_kprobe_inst(bundle, slot, &kprobe_inst, &major_opcode);
424
425 if (unsupported_inst(template, slot, major_opcode, kprobe_inst, p))
426 return -EINVAL;
427
428 prepare_break_inst(template, slot, major_opcode, kprobe_inst, p);
429
430 return 0;
431}
432
433void arch_arm_kprobe(struct kprobe *p)
434{
435 unsigned long addr = (unsigned long)p->addr;
436 unsigned long arm_addr = addr & ~0xFULL;
437
438 memcpy((char *)arm_addr, &p->ainsn.insn.bundle, sizeof(bundle_t));
439 flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
440}
441
442void arch_disarm_kprobe(struct kprobe *p)
443{
444 unsigned long addr = (unsigned long)p->addr;
445 unsigned long arm_addr = addr & ~0xFULL;
446
447 /* p->opcode contains the original unaltered bundle */
448 memcpy((char *) arm_addr, (char *) &p->opcode.bundle, sizeof(bundle_t));
449 flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
450}
451
452void arch_remove_kprobe(struct kprobe *p)
453{
454}
455
456/*
457 * We are resuming execution after a single step fault, so the pt_regs
458 * structure reflects the register state after we executed the instruction
459 * located in the kprobe (p->ainsn.insn.bundle). We still need to adjust
460 * the ip to point back to the original stack address. To set the IP address
461 * to original stack address, handle the case where we need to fixup the
462 * relative IP address and/or fixup branch register.
463 */
464static void resume_execution(struct kprobe *p, struct pt_regs *regs)
465{
466 unsigned long bundle_addr = ((unsigned long) (&p->opcode.bundle)) & ~0xFULL;
467 unsigned long resume_addr = (unsigned long)p->addr & ~0xFULL;
468 unsigned long template;
469 int slot = ((unsigned long)p->addr & 0xf);
470
471 template = p->opcode.bundle.quad0.template;
472
473 if (slot == 1 && bundle_encoding[template][1] == L)
474 slot = 2;
475
476 if (p->ainsn.inst_flag) {
477
478 if (p->ainsn.inst_flag & INST_FLAG_FIX_RELATIVE_IP_ADDR) {
479 /* Fix relative IP address */
480 regs->cr_iip = (regs->cr_iip - bundle_addr) + resume_addr;
481 }
482
483 if (p->ainsn.inst_flag & INST_FLAG_FIX_BRANCH_REG) {
484 /*
485 * Fix target branch register, software convention is
486 * to use either b0 or b6 or b7, so just checking
487 * only those registers
488 */
489 switch (p->ainsn.target_br_reg) {
490 case 0:
491 if ((regs->b0 == bundle_addr) ||
492 (regs->b0 == bundle_addr + 0x10)) {
493 regs->b0 = (regs->b0 - bundle_addr) +
494 resume_addr;
495 }
496 break;
497 case 6:
498 if ((regs->b6 == bundle_addr) ||
499 (regs->b6 == bundle_addr + 0x10)) {
500 regs->b6 = (regs->b6 - bundle_addr) +
501 resume_addr;
502 }
503 break;
504 case 7:
505 if ((regs->b7 == bundle_addr) ||
506 (regs->b7 == bundle_addr + 0x10)) {
507 regs->b7 = (regs->b7 - bundle_addr) +
508 resume_addr;
509 }
510 break;
511 } /* end switch */
512 }
513 goto turn_ss_off;
514 }
515
516 if (slot == 2) {
517 if (regs->cr_iip == bundle_addr + 0x10) {
518 regs->cr_iip = resume_addr + 0x10;
519 }
520 } else {
521 if (regs->cr_iip == bundle_addr) {
522 regs->cr_iip = resume_addr;
523 }
524 }
525
526turn_ss_off:
527 /* Turn off Single Step bit */
528 ia64_psr(regs)->ss = 0;
529}
530
531static void prepare_ss(struct kprobe *p, struct pt_regs *regs)
532{
533 unsigned long bundle_addr = (unsigned long) &p->opcode.bundle;
534 unsigned long slot = (unsigned long)p->addr & 0xf;
535
536 /* Update instruction pointer (IIP) and slot number (IPSR.ri) */
537 regs->cr_iip = bundle_addr & ~0xFULL;
538
539 if (slot > 2)
540 slot = 0;
541
542 ia64_psr(regs)->ri = slot;
543
544 /* turn on single stepping */
545 ia64_psr(regs)->ss = 1;
546}
547
548static int pre_kprobes_handler(struct die_args *args)
549{
550 struct kprobe *p;
551 int ret = 0;
552 struct pt_regs *regs = args->regs;
553 kprobe_opcode_t *addr = (kprobe_opcode_t *)instruction_pointer(regs);
554
555 preempt_disable();
556
557 /* Handle recursion cases */
558 if (kprobe_running()) {
559 p = get_kprobe(addr);
560 if (p) {
561 if (kprobe_status == KPROBE_HIT_SS) {
562 unlock_kprobes();
563 goto no_kprobe;
564 }
565 /* We have reentered the pre_kprobe_handler(), since
566 * another probe was hit while within the handler.
567 * We here save the original kprobes variables and
568 * just single step on the instruction of the new probe
569 * without calling any user handlers.
570 */
571 save_previous_kprobe();
572 set_current_kprobe(p);
573 p->nmissed++;
574 prepare_ss(p, regs);
575 kprobe_status = KPROBE_REENTER;
576 return 1;
577 } else if (args->err == __IA64_BREAK_JPROBE) {
578 /*
579 * jprobe instrumented function just completed
580 */
581 p = current_kprobe;
582 if (p->break_handler && p->break_handler(p, regs)) {
583 goto ss_probe;
584 }
585 } else {
586 /* Not our break */
587 goto no_kprobe;
588 }
589 }
590
591 lock_kprobes();
592 p = get_kprobe(addr);
593 if (!p) {
594 unlock_kprobes();
595 goto no_kprobe;
596 }
597
598 kprobe_status = KPROBE_HIT_ACTIVE;
599 set_current_kprobe(p);
600
601 if (p->pre_handler && p->pre_handler(p, regs))
602 /*
603 * Our pre-handler is specifically requesting that we just
604 * do a return. This is used for both the jprobe pre-handler
605 * and the kretprobe trampoline
606 */
607 return 1;
608
609ss_probe:
610 prepare_ss(p, regs);
611 kprobe_status = KPROBE_HIT_SS;
612 return 1;
613
614no_kprobe:
615 preempt_enable_no_resched();
616 return ret;
617}
618
619static int post_kprobes_handler(struct pt_regs *regs)
620{
621 if (!kprobe_running())
622 return 0;
623
624 if ((kprobe_status != KPROBE_REENTER) && current_kprobe->post_handler) {
625 kprobe_status = KPROBE_HIT_SSDONE;
626 current_kprobe->post_handler(current_kprobe, regs, 0);
627 }
628
629 resume_execution(current_kprobe, regs);
630
631 /*Restore back the original saved kprobes variables and continue. */
632 if (kprobe_status == KPROBE_REENTER) {
633 restore_previous_kprobe();
634 goto out;
635 }
636
637 unlock_kprobes();
638
639out:
640 preempt_enable_no_resched();
641 return 1;
642}
643
644static int kprobes_fault_handler(struct pt_regs *regs, int trapnr)
645{
646 if (!kprobe_running())
647 return 0;
648
649 if (current_kprobe->fault_handler &&
650 current_kprobe->fault_handler(current_kprobe, regs, trapnr))
651 return 1;
652
653 if (kprobe_status & KPROBE_HIT_SS) {
654 resume_execution(current_kprobe, regs);
655 unlock_kprobes();
656 preempt_enable_no_resched();
657 }
658
659 return 0;
660}
661
662int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val,
663 void *data)
664{
665 struct die_args *args = (struct die_args *)data;
666 switch(val) {
667 case DIE_BREAK:
668 if (pre_kprobes_handler(args))
669 return NOTIFY_STOP;
670 break;
671 case DIE_SS:
672 if (post_kprobes_handler(args->regs))
673 return NOTIFY_STOP;
674 break;
675 case DIE_PAGE_FAULT:
676 if (kprobes_fault_handler(args->regs, args->trapnr))
677 return NOTIFY_STOP;
678 default:
679 break;
680 }
681 return NOTIFY_DONE;
682}
683
684int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
685{
686 struct jprobe *jp = container_of(p, struct jprobe, kp);
687 unsigned long addr = ((struct fnptr *)(jp->entry))->ip;
688
689 /* save architectural state */
690 jprobe_saved_regs = *regs;
691
692 /* after rfi, execute the jprobe instrumented function */
693 regs->cr_iip = addr & ~0xFULL;
694 ia64_psr(regs)->ri = addr & 0xf;
695 regs->r1 = ((struct fnptr *)(jp->entry))->gp;
696
697 /*
698 * fix the return address to our jprobe_inst_return() function
699 * in the jprobes.S file
700 */
701 regs->b0 = ((struct fnptr *)(jprobe_inst_return))->ip;
702
703 return 1;
704}
705
706int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
707{
708 *regs = jprobe_saved_regs;
709 return 1;
710}
711
712static struct kprobe trampoline_p = {
713 .pre_handler = trampoline_probe_handler
714};
715
716int __init arch_init_kprobes(void)
717{
718 trampoline_p.addr =
719 (kprobe_opcode_t *)((struct fnptr *)kretprobe_trampoline)->ip;
720 return register_kprobe(&trampoline_p);
721}
diff --git a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c
new file mode 100644
index 000000000000..a68ce6678092
--- /dev/null
+++ b/arch/ia64/kernel/numa.c
@@ -0,0 +1,57 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * ia64 kernel NUMA specific stuff
17 *
18 * Copyright (C) 2002 Erich Focht <efocht@ess.nec.de>
19 * Copyright (C) 2004 Silicon Graphics, Inc.
20 * Jesse Barnes <jbarnes@sgi.com>
21 */
22#include <linux/config.h>
23#include <linux/topology.h>
24#include <linux/module.h>
25#include <asm/processor.h>
26#include <asm/smp.h>
27
28u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
29EXPORT_SYMBOL(cpu_to_node_map);
30
31cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
32
33/**
34 * build_cpu_to_node_map - setup cpu to node and node to cpumask arrays
35 *
36 * Build cpu to node mapping and initialize the per node cpu masks using
37 * info from the node_cpuid array handed to us by ACPI.
38 */
39void __init build_cpu_to_node_map(void)
40{
41 int cpu, i, node;
42
43 for(node=0; node < MAX_NUMNODES; node++)
44 cpus_clear(node_to_cpu_mask[node]);
45
46 for(cpu = 0; cpu < NR_CPUS; ++cpu) {
47 node = -1;
48 for (i = 0; i < NR_CPUS; ++i)
49 if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) {
50 node = node_cpuid[i].nid;
51 break;
52 }
53 cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
54 if (node >= 0)
55 cpu_set(cpu, node_to_cpu_mask[node]);
56 }
57}
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 6407bff6bfd7..b8ebb8e427ef 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -37,7 +37,6 @@
37#include <linux/vfs.h> 37#include <linux/vfs.h>
38#include <linux/pagemap.h> 38#include <linux/pagemap.h>
39#include <linux/mount.h> 39#include <linux/mount.h>
40#include <linux/version.h>
41#include <linux/bitops.h> 40#include <linux/bitops.h>
42 41
43#include <asm/errno.h> 42#include <asm/errno.h>
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index a9bfba46733d..e484910246ad 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -27,6 +27,7 @@
27#include <linux/efi.h> 27#include <linux/efi.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/kprobes.h>
30 31
31#include <asm/cpu.h> 32#include <asm/cpu.h>
32#include <asm/delay.h> 33#include <asm/delay.h>
@@ -708,6 +709,13 @@ kernel_thread_helper (int (*fn)(void *), void *arg)
708void 709void
709flush_thread (void) 710flush_thread (void)
710{ 711{
712 /*
713 * Remove function-return probe instances associated with this task
714 * and put them back on the free list. Do not insert an exit probe for
715 * this function, it will be disabled by kprobe_flush_task if you do.
716 */
717 kprobe_flush_task(current);
718
711 /* drop floating-point and debug-register state if it exists: */ 719 /* drop floating-point and debug-register state if it exists: */
712 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); 720 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
713 ia64_drop_fpu(current); 721 ia64_drop_fpu(current);
@@ -722,6 +730,14 @@ flush_thread (void)
722void 730void
723exit_thread (void) 731exit_thread (void)
724{ 732{
733
734 /*
735 * Remove function-return probe instances associated with this task
736 * and put them back on the free list. Do not insert an exit probe for
737 * this function, it will be disabled by kprobe_flush_task if you do.
738 */
739 kprobe_flush_task(current);
740
725 ia64_drop_fpu(current); 741 ia64_drop_fpu(current);
726#ifdef CONFIG_PERFMON 742#ifdef CONFIG_PERFMON
727 /* if needed, stop monitoring and flush state to perfmon context */ 743 /* if needed, stop monitoring and flush state to perfmon context */
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c
index 575a8f657b31..bbb8bc7c0552 100644
--- a/arch/ia64/kernel/ptrace.c
+++ b/arch/ia64/kernel/ptrace.c
@@ -725,12 +725,32 @@ convert_to_non_syscall (struct task_struct *child, struct pt_regs *pt,
725 break; 725 break;
726 } 726 }
727 727
728 /*
729 * Note: at the time of this call, the target task is blocked
730 * in notify_resume_user() and by clearling PRED_LEAVE_SYSCALL
731 * (aka, "pLvSys") we redirect execution from
732 * .work_pending_syscall_end to .work_processed_kernel.
733 */
728 unw_get_pr(&prev_info, &pr); 734 unw_get_pr(&prev_info, &pr);
729 pr &= ~(1UL << PRED_SYSCALL); 735 pr &= ~((1UL << PRED_SYSCALL) | (1UL << PRED_LEAVE_SYSCALL));
730 pr |= (1UL << PRED_NON_SYSCALL); 736 pr |= (1UL << PRED_NON_SYSCALL);
731 unw_set_pr(&prev_info, pr); 737 unw_set_pr(&prev_info, pr);
732 738
733 pt->cr_ifs = (1UL << 63) | cfm; 739 pt->cr_ifs = (1UL << 63) | cfm;
740 /*
741 * Clear the memory that is NOT written on syscall-entry to
742 * ensure we do not leak kernel-state to user when execution
743 * resumes.
744 */
745 pt->r2 = 0;
746 pt->r3 = 0;
747 pt->r14 = 0;
748 memset(&pt->r16, 0, 16*8); /* clear r16-r31 */
749 memset(&pt->f6, 0, 6*16); /* clear f6-f11 */
750 pt->b7 = 0;
751 pt->ar_ccv = 0;
752 pt->ar_csd = 0;
753 pt->ar_ssd = 0;
734} 754}
735 755
736static int 756static int
@@ -945,6 +965,13 @@ access_uarea (struct task_struct *child, unsigned long addr,
945 *data = (pt->cr_ipsr & IPSR_MASK); 965 *data = (pt->cr_ipsr & IPSR_MASK);
946 return 0; 966 return 0;
947 967
968 case PT_AR_RSC:
969 if (write_access)
970 pt->ar_rsc = *data | (3 << 2); /* force PL3 */
971 else
972 *data = pt->ar_rsc;
973 return 0;
974
948 case PT_AR_RNAT: 975 case PT_AR_RNAT:
949 urbs_end = ia64_get_user_rbs_end(child, pt, NULL); 976 urbs_end = ia64_get_user_rbs_end(child, pt, NULL);
950 rnat_addr = (long) ia64_rse_rnat_addr((long *) 977 rnat_addr = (long) ia64_rse_rnat_addr((long *)
@@ -996,9 +1023,6 @@ access_uarea (struct task_struct *child, unsigned long addr,
996 case PT_AR_BSPSTORE: 1023 case PT_AR_BSPSTORE:
997 ptr = pt_reg_addr(pt, ar_bspstore); 1024 ptr = pt_reg_addr(pt, ar_bspstore);
998 break; 1025 break;
999 case PT_AR_RSC:
1000 ptr = pt_reg_addr(pt, ar_rsc);
1001 break;
1002 case PT_AR_UNAT: 1026 case PT_AR_UNAT:
1003 ptr = pt_reg_addr(pt, ar_unat); 1027 ptr = pt_reg_addr(pt, ar_unat);
1004 break; 1028 break;
@@ -1234,7 +1258,7 @@ ptrace_getregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
1234static long 1258static long
1235ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr) 1259ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
1236{ 1260{
1237 unsigned long psr, ec, lc, rnat, bsp, cfm, nat_bits, val = 0; 1261 unsigned long psr, rsc, ec, lc, rnat, bsp, cfm, nat_bits, val = 0;
1238 struct unw_frame_info info; 1262 struct unw_frame_info info;
1239 struct switch_stack *sw; 1263 struct switch_stack *sw;
1240 struct ia64_fpreg fpval; 1264 struct ia64_fpreg fpval;
@@ -1267,7 +1291,7 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
1267 /* app regs */ 1291 /* app regs */
1268 1292
1269 retval |= __get_user(pt->ar_pfs, &ppr->ar[PT_AUR_PFS]); 1293 retval |= __get_user(pt->ar_pfs, &ppr->ar[PT_AUR_PFS]);
1270 retval |= __get_user(pt->ar_rsc, &ppr->ar[PT_AUR_RSC]); 1294 retval |= __get_user(rsc, &ppr->ar[PT_AUR_RSC]);
1271 retval |= __get_user(pt->ar_bspstore, &ppr->ar[PT_AUR_BSPSTORE]); 1295 retval |= __get_user(pt->ar_bspstore, &ppr->ar[PT_AUR_BSPSTORE]);
1272 retval |= __get_user(pt->ar_unat, &ppr->ar[PT_AUR_UNAT]); 1296 retval |= __get_user(pt->ar_unat, &ppr->ar[PT_AUR_UNAT]);
1273 retval |= __get_user(pt->ar_ccv, &ppr->ar[PT_AUR_CCV]); 1297 retval |= __get_user(pt->ar_ccv, &ppr->ar[PT_AUR_CCV]);
@@ -1365,6 +1389,7 @@ ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr)
1365 retval |= __get_user(nat_bits, &ppr->nat); 1389 retval |= __get_user(nat_bits, &ppr->nat);
1366 1390
1367 retval |= access_uarea(child, PT_CR_IPSR, &psr, 1); 1391 retval |= access_uarea(child, PT_CR_IPSR, &psr, 1);
1392 retval |= access_uarea(child, PT_AR_RSC, &rsc, 1);
1368 retval |= access_uarea(child, PT_AR_EC, &ec, 1); 1393 retval |= access_uarea(child, PT_AR_EC, &ec, 1);
1369 retval |= access_uarea(child, PT_AR_LC, &lc, 1); 1394 retval |= access_uarea(child, PT_AR_LC, &lc, 1);
1370 retval |= access_uarea(child, PT_AR_RNAT, &rnat, 1); 1395 retval |= access_uarea(child, PT_AR_RNAT, &rnat, 1);
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index bb9033187d42..5c7c95737bbf 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -74,6 +74,8 @@ DEFINE_PER_CPU(unsigned long, ia64_phys_stacked_size_p8);
74unsigned long ia64_cycles_per_usec; 74unsigned long ia64_cycles_per_usec;
75struct ia64_boot_param *ia64_boot_param; 75struct ia64_boot_param *ia64_boot_param;
76struct screen_info screen_info; 76struct screen_info screen_info;
77unsigned long vga_console_iobase;
78unsigned long vga_console_membase;
77 79
78unsigned long ia64_max_cacheline_size; 80unsigned long ia64_max_cacheline_size;
79unsigned long ia64_iobase; /* virtual address for I/O accesses */ 81unsigned long ia64_iobase; /* virtual address for I/O accesses */
@@ -275,23 +277,25 @@ io_port_init (void)
275static inline int __init 277static inline int __init
276early_console_setup (char *cmdline) 278early_console_setup (char *cmdline)
277{ 279{
280 int earlycons = 0;
281
278#ifdef CONFIG_SERIAL_SGI_L1_CONSOLE 282#ifdef CONFIG_SERIAL_SGI_L1_CONSOLE
279 { 283 {
280 extern int sn_serial_console_early_setup(void); 284 extern int sn_serial_console_early_setup(void);
281 if (!sn_serial_console_early_setup()) 285 if (!sn_serial_console_early_setup())
282 return 0; 286 earlycons++;
283 } 287 }
284#endif 288#endif
285#ifdef CONFIG_EFI_PCDP 289#ifdef CONFIG_EFI_PCDP
286 if (!efi_setup_pcdp_console(cmdline)) 290 if (!efi_setup_pcdp_console(cmdline))
287 return 0; 291 earlycons++;
288#endif 292#endif
289#ifdef CONFIG_SERIAL_8250_CONSOLE 293#ifdef CONFIG_SERIAL_8250_CONSOLE
290 if (!early_serial_console_init(cmdline)) 294 if (!early_serial_console_init(cmdline))
291 return 0; 295 earlycons++;
292#endif 296#endif
293 297
294 return -1; 298 return (earlycons) ? 0 : -1;
295} 299}
296 300
297static inline void 301static inline void
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
index 499b7e5317cf..b8a0a7d257a9 100644
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -94,7 +94,7 @@ sys_sigaltstack (const stack_t __user *uss, stack_t __user *uoss, long arg2,
94static long 94static long
95restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr) 95restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
96{ 96{
97 unsigned long ip, flags, nat, um, cfm; 97 unsigned long ip, flags, nat, um, cfm, rsc;
98 long err; 98 long err;
99 99
100 /* Always make any pending restarted system calls return -EINTR */ 100 /* Always make any pending restarted system calls return -EINTR */
@@ -106,7 +106,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
106 err |= __get_user(ip, &sc->sc_ip); /* instruction pointer */ 106 err |= __get_user(ip, &sc->sc_ip); /* instruction pointer */
107 err |= __get_user(cfm, &sc->sc_cfm); 107 err |= __get_user(cfm, &sc->sc_cfm);
108 err |= __get_user(um, &sc->sc_um); /* user mask */ 108 err |= __get_user(um, &sc->sc_um); /* user mask */
109 err |= __get_user(scr->pt.ar_rsc, &sc->sc_ar_rsc); 109 err |= __get_user(rsc, &sc->sc_ar_rsc);
110 err |= __get_user(scr->pt.ar_unat, &sc->sc_ar_unat); 110 err |= __get_user(scr->pt.ar_unat, &sc->sc_ar_unat);
111 err |= __get_user(scr->pt.ar_fpsr, &sc->sc_ar_fpsr); 111 err |= __get_user(scr->pt.ar_fpsr, &sc->sc_ar_fpsr);
112 err |= __get_user(scr->pt.ar_pfs, &sc->sc_ar_pfs); 112 err |= __get_user(scr->pt.ar_pfs, &sc->sc_ar_pfs);
@@ -119,6 +119,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
119 err |= __copy_from_user(&scr->pt.r15, &sc->sc_gr[15], 8); /* r15 */ 119 err |= __copy_from_user(&scr->pt.r15, &sc->sc_gr[15], 8); /* r15 */
120 120
121 scr->pt.cr_ifs = cfm | (1UL << 63); 121 scr->pt.cr_ifs = cfm | (1UL << 63);
122 scr->pt.ar_rsc = rsc | (3 << 2); /* force PL3 */
122 123
123 /* establish new instruction pointer: */ 124 /* establish new instruction pointer: */
124 scr->pt.cr_iip = ip & ~0x3UL; 125 scr->pt.cr_iip = ip & ~0x3UL;
@@ -142,6 +143,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
142 143
143 __copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16); 144 __copy_from_user(current->thread.fph, &sc->sc_fr[32], 96*16);
144 psr->mfh = 0; /* drop signal handler's fph contents... */ 145 psr->mfh = 0; /* drop signal handler's fph contents... */
146 preempt_disable();
145 if (psr->dfh) 147 if (psr->dfh)
146 ia64_drop_fpu(current); 148 ia64_drop_fpu(current);
147 else { 149 else {
@@ -149,6 +151,7 @@ restore_sigcontext (struct sigcontext __user *sc, struct sigscratch *scr)
149 __ia64_load_fpu(current->thread.fph); 151 __ia64_load_fpu(current->thread.fph);
150 ia64_set_local_fpu_owner(current); 152 ia64_set_local_fpu_owner(current);
151 } 153 }
154 preempt_enable();
152 } 155 }
153 return err; 156 return err;
154} 157}
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index 953095e2ce15..0166a9847095 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -231,13 +231,16 @@ smp_flush_tlb_all (void)
231void 231void
232smp_flush_tlb_mm (struct mm_struct *mm) 232smp_flush_tlb_mm (struct mm_struct *mm)
233{ 233{
234 preempt_disable();
234 /* this happens for the common case of a single-threaded fork(): */ 235 /* this happens for the common case of a single-threaded fork(): */
235 if (likely(mm == current->active_mm && atomic_read(&mm->mm_users) == 1)) 236 if (likely(mm == current->active_mm && atomic_read(&mm->mm_users) == 1))
236 { 237 {
237 local_finish_flush_tlb_mm(mm); 238 local_finish_flush_tlb_mm(mm);
239 preempt_enable();
238 return; 240 return;
239 } 241 }
240 242
243 preempt_enable();
241 /* 244 /*
242 * We could optimize this further by using mm->cpu_vm_mask to track which CPUs 245 * We could optimize this further by using mm->cpu_vm_mask to track which CPUs
243 * have been running in the address space. It's not clear that this is worth the 246 * have been running in the address space. It's not clear that this is worth the
@@ -269,7 +272,7 @@ smp_call_function_single (int cpuid, void (*func) (void *info), void *info, int
269 int me = get_cpu(); /* prevent preemption and reschedule on another processor */ 272 int me = get_cpu(); /* prevent preemption and reschedule on another processor */
270 273
271 if (cpuid == me) { 274 if (cpuid == me) {
272 printk("%s: trying to call self\n", __FUNCTION__); 275 printk(KERN_INFO "%s: trying to call self\n", __FUNCTION__);
273 put_cpu(); 276 put_cpu();
274 return -EBUSY; 277 return -EBUSY;
275 } 278 }
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 3865f088ffa2..7d72c0d872b3 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -346,6 +346,7 @@ smp_callin (void)
346 lock_ipi_calllock(); 346 lock_ipi_calllock();
347 cpu_set(cpuid, cpu_online_map); 347 cpu_set(cpuid, cpu_online_map);
348 unlock_ipi_calllock(); 348 unlock_ipi_calllock();
349 per_cpu(cpu_state, cpuid) = CPU_ONLINE;
349 350
350 smp_setup_percpu_timer(); 351 smp_setup_percpu_timer();
351 352
@@ -524,47 +525,6 @@ smp_build_cpu_map (void)
524 } 525 }
525} 526}
526 527
527#ifdef CONFIG_NUMA
528
529/* on which node is each logical CPU (one cacheline even for 64 CPUs) */
530u8 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
531EXPORT_SYMBOL(cpu_to_node_map);
532/* which logical CPUs are on which nodes */
533cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
534
535/*
536 * Build cpu to node mapping and initialize the per node cpu masks.
537 */
538void __init
539build_cpu_to_node_map (void)
540{
541 int cpu, i, node;
542
543 for(node=0; node<MAX_NUMNODES; node++)
544 cpus_clear(node_to_cpu_mask[node]);
545 for(cpu = 0; cpu < NR_CPUS; ++cpu) {
546 /*
547 * All Itanium NUMA platforms I know use ACPI, so maybe we
548 * can drop this ifdef completely. [EF]
549 */
550#ifdef CONFIG_ACPI_NUMA
551 node = -1;
552 for (i = 0; i < NR_CPUS; ++i)
553 if (cpu_physical_id(cpu) == node_cpuid[i].phys_id) {
554 node = node_cpuid[i].nid;
555 break;
556 }
557#else
558# error Fixme: Dunno how to build CPU-to-node map.
559#endif
560 cpu_to_node_map[cpu] = (node >= 0) ? node : 0;
561 if (node >= 0)
562 cpu_set(cpu, node_to_cpu_mask[node]);
563 }
564}
565
566#endif /* CONFIG_NUMA */
567
568/* 528/*
569 * Cycle through the APs sending Wakeup IPIs to boot each. 529 * Cycle through the APs sending Wakeup IPIs to boot each.
570 */ 530 */
@@ -611,6 +571,7 @@ void __devinit smp_prepare_boot_cpu(void)
611{ 571{
612 cpu_set(smp_processor_id(), cpu_online_map); 572 cpu_set(smp_processor_id(), cpu_online_map);
613 cpu_set(smp_processor_id(), cpu_callin_map); 573 cpu_set(smp_processor_id(), cpu_callin_map);
574 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
614} 575}
615 576
616/* 577/*
@@ -688,6 +649,7 @@ int __cpu_disable(void)
688 return -EBUSY; 649 return -EBUSY;
689 650
690 remove_siblinginfo(cpu); 651 remove_siblinginfo(cpu);
652 cpu_clear(cpu, cpu_online_map);
691 fixup_irqs(); 653 fixup_irqs();
692 local_flush_tlb_all(); 654 local_flush_tlb_all();
693 cpu_clear(cpu, cpu_callin_map); 655 cpu_clear(cpu, cpu_callin_map);
@@ -774,6 +736,7 @@ __cpu_up (unsigned int cpu)
774 if (cpu_isset(cpu, cpu_callin_map)) 736 if (cpu_isset(cpu, cpu_callin_map))
775 return -EINVAL; 737 return -EINVAL;
776 738
739 per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;
777 /* Processor goes to start_secondary(), sets online flag */ 740 /* Processor goes to start_secondary(), sets online flag */
778 ret = do_boot_cpu(sapicid, cpu); 741 ret = do_boot_cpu(sapicid, cpu);
779 if (ret < 0) 742 if (ret < 0)
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index 1861173bd4f6..4440c8343fa4 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -21,12 +21,26 @@
21#include <asm/intrinsics.h> 21#include <asm/intrinsics.h>
22#include <asm/processor.h> 22#include <asm/processor.h>
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/kdebug.h>
24 25
25extern spinlock_t timerlist_lock; 26extern spinlock_t timerlist_lock;
26 27
27fpswa_interface_t *fpswa_interface; 28fpswa_interface_t *fpswa_interface;
28EXPORT_SYMBOL(fpswa_interface); 29EXPORT_SYMBOL(fpswa_interface);
29 30
31struct notifier_block *ia64die_chain;
32static DEFINE_SPINLOCK(die_notifier_lock);
33
34int register_die_notifier(struct notifier_block *nb)
35{
36 int err = 0;
37 unsigned long flags;
38 spin_lock_irqsave(&die_notifier_lock, flags);
39 err = notifier_chain_register(&ia64die_chain, nb);
40 spin_unlock_irqrestore(&die_notifier_lock, flags);
41 return err;
42}
43
30void __init 44void __init
31trap_init (void) 45trap_init (void)
32{ 46{
@@ -76,14 +90,16 @@ die (const char *str, struct pt_regs *regs, long err)
76 .lock_owner_depth = 0 90 .lock_owner_depth = 0
77 }; 91 };
78 static int die_counter; 92 static int die_counter;
93 int cpu = get_cpu();
79 94
80 if (die.lock_owner != smp_processor_id()) { 95 if (die.lock_owner != cpu) {
81 console_verbose(); 96 console_verbose();
82 spin_lock_irq(&die.lock); 97 spin_lock_irq(&die.lock);
83 die.lock_owner = smp_processor_id(); 98 die.lock_owner = cpu;
84 die.lock_owner_depth = 0; 99 die.lock_owner_depth = 0;
85 bust_spinlocks(1); 100 bust_spinlocks(1);
86 } 101 }
102 put_cpu();
87 103
88 if (++die.lock_owner_depth < 3) { 104 if (++die.lock_owner_depth < 3) {
89 printk("%s[%d]: %s %ld [%d]\n", 105 printk("%s[%d]: %s %ld [%d]\n",
@@ -137,6 +153,10 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
137 153
138 switch (break_num) { 154 switch (break_num) {
139 case 0: /* unknown error (used by GCC for __builtin_abort()) */ 155 case 0: /* unknown error (used by GCC for __builtin_abort()) */
156 if (notify_die(DIE_BREAK, "break 0", regs, break_num, TRAP_BRKPT, SIGTRAP)
157 == NOTIFY_STOP) {
158 return;
159 }
140 die_if_kernel("bugcheck!", regs, break_num); 160 die_if_kernel("bugcheck!", regs, break_num);
141 sig = SIGILL; code = ILL_ILLOPC; 161 sig = SIGILL; code = ILL_ILLOPC;
142 break; 162 break;
@@ -189,6 +209,15 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
189 sig = SIGILL; code = __ILL_BNDMOD; 209 sig = SIGILL; code = __ILL_BNDMOD;
190 break; 210 break;
191 211
212 case 0x80200:
213 case 0x80300:
214 if (notify_die(DIE_BREAK, "kprobe", regs, break_num, TRAP_BRKPT, SIGTRAP)
215 == NOTIFY_STOP) {
216 return;
217 }
218 sig = SIGTRAP; code = TRAP_BRKPT;
219 break;
220
192 default: 221 default:
193 if (break_num < 0x40000 || break_num > 0x100000) 222 if (break_num < 0x40000 || break_num > 0x100000)
194 die_if_kernel("Bad break", regs, break_num); 223 die_if_kernel("Bad break", regs, break_num);
@@ -548,7 +577,11 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
548#endif 577#endif
549 break; 578 break;
550 case 35: siginfo.si_code = TRAP_BRANCH; ifa = 0; break; 579 case 35: siginfo.si_code = TRAP_BRANCH; ifa = 0; break;
551 case 36: siginfo.si_code = TRAP_TRACE; ifa = 0; break; 580 case 36:
581 if (notify_die(DIE_SS, "ss", &regs, vector,
582 vector, SIGTRAP) == NOTIFY_STOP)
583 return;
584 siginfo.si_code = TRAP_TRACE; ifa = 0; break;
552 } 585 }
553 siginfo.si_signo = SIGTRAP; 586 siginfo.si_signo = SIGTRAP;
554 siginfo.si_errno = 0; 587 siginfo.si_errno = 0;
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
new file mode 100644
index 000000000000..490dfc9ab47f
--- /dev/null
+++ b/arch/ia64/kernel/uncached.c
@@ -0,0 +1,246 @@
1/*
2 * Copyright (C) 2001-2005 Silicon Graphics, Inc. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License
6 * as published by the Free Software Foundation.
7 *
8 * A simple uncached page allocator using the generic allocator. This
9 * allocator first utilizes the spare (spill) pages found in the EFI
10 * memmap and will then start converting cached pages to uncached ones
11 * at a granule at a time. Node awareness is implemented by having a
12 * pool of pages per node.
13 */
14
15#include <linux/types.h>
16#include <linux/kernel.h>
17#include <linux/module.h>
18#include <linux/init.h>
19#include <linux/errno.h>
20#include <linux/string.h>
21#include <linux/slab.h>
22#include <linux/efi.h>
23#include <linux/genalloc.h>
24#include <asm/page.h>
25#include <asm/pal.h>
26#include <asm/system.h>
27#include <asm/pgtable.h>
28#include <asm/atomic.h>
29#include <asm/tlbflush.h>
30#include <asm/sn/arch.h>
31
32#define DEBUG 0
33
34#if DEBUG
35#define dprintk printk
36#else
37#define dprintk(x...) do { } while (0)
38#endif
39
40void __init efi_memmap_walk_uc (efi_freemem_callback_t callback);
41
42#define MAX_UNCACHED_GRANULES 5
43static int allocated_granules;
44
45struct gen_pool *uncached_pool[MAX_NUMNODES];
46
47
48static void uncached_ipi_visibility(void *data)
49{
50 int status;
51
52 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
53 if ((status != PAL_VISIBILITY_OK) &&
54 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED))
55 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "
56 "CPU %i\n", status, get_cpu());
57}
58
59
60static void uncached_ipi_mc_drain(void *data)
61{
62 int status;
63 status = ia64_pal_mc_drain();
64 if (status)
65 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "
66 "CPU %i\n", status, get_cpu());
67}
68
69
70static unsigned long
71uncached_get_new_chunk(struct gen_pool *poolp)
72{
73 struct page *page;
74 void *tmp;
75 int status, i;
76 unsigned long addr, node;
77
78 if (allocated_granules >= MAX_UNCACHED_GRANULES)
79 return 0;
80
81 node = poolp->private;
82 page = alloc_pages_node(node, GFP_KERNEL | __GFP_ZERO,
83 IA64_GRANULE_SHIFT-PAGE_SHIFT);
84
85 dprintk(KERN_INFO "get_new_chunk page %p, addr %lx\n",
86 page, (unsigned long)(page-vmem_map) << PAGE_SHIFT);
87
88 /*
89 * Do magic if no mem on local node! XXX
90 */
91 if (!page)
92 return 0;
93 tmp = page_address(page);
94
95 /*
96 * There's a small race here where it's possible for someone to
97 * access the page through /dev/mem halfway through the conversion
98 * to uncached - not sure it's really worth bothering about
99 */
100 for (i = 0; i < (IA64_GRANULE_SIZE / PAGE_SIZE); i++)
101 SetPageUncached(&page[i]);
102
103 flush_tlb_kernel_range(tmp, tmp + IA64_GRANULE_SIZE);
104
105 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
106
107 dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n",
108 status, get_cpu());
109
110 if (!status) {
111 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
112 if (status)
113 printk(KERN_WARNING "smp_call_function failed for "
114 "uncached_ipi_visibility! (%i)\n", status);
115 }
116
117 if (ia64_platform_is("sn2"))
118 sn_flush_all_caches((unsigned long)tmp, IA64_GRANULE_SIZE);
119 else
120 flush_icache_range((unsigned long)tmp,
121 (unsigned long)tmp+IA64_GRANULE_SIZE);
122
123 ia64_pal_mc_drain();
124 status = smp_call_function(uncached_ipi_mc_drain, NULL, 0, 1);
125 if (status)
126 printk(KERN_WARNING "smp_call_function failed for "
127 "uncached_ipi_mc_drain! (%i)\n", status);
128
129 addr = (unsigned long)tmp - PAGE_OFFSET + __IA64_UNCACHED_OFFSET;
130
131 allocated_granules++;
132 return addr;
133}
134
135
136/*
137 * uncached_alloc_page
138 *
139 * Allocate 1 uncached page. Allocates on the requested node. If no
140 * uncached pages are available on the requested node, roundrobin starting
141 * with higher nodes.
142 */
143unsigned long
144uncached_alloc_page(int nid)
145{
146 unsigned long maddr;
147
148 maddr = gen_pool_alloc(uncached_pool[nid], PAGE_SIZE);
149
150 dprintk(KERN_DEBUG "uncached_alloc_page returns %lx on node %i\n",
151 maddr, nid);
152
153 /*
154 * If no memory is availble on our local node, try the
155 * remaining nodes in the system.
156 */
157 if (!maddr) {
158 int i;
159
160 for (i = MAX_NUMNODES - 1; i >= 0; i--) {
161 if (i == nid || !node_online(i))
162 continue;
163 maddr = gen_pool_alloc(uncached_pool[i], PAGE_SIZE);
164 dprintk(KERN_DEBUG "uncached_alloc_page alternate search "
165 "returns %lx on node %i\n", maddr, i);
166 if (maddr) {
167 break;
168 }
169 }
170 }
171
172 return maddr;
173}
174EXPORT_SYMBOL(uncached_alloc_page);
175
176
177/*
178 * uncached_free_page
179 *
180 * Free a single uncached page.
181 */
182void
183uncached_free_page(unsigned long maddr)
184{
185 int node;
186
187 node = nasid_to_cnodeid(NASID_GET(maddr));
188
189 dprintk(KERN_DEBUG "uncached_free_page(%lx) on node %i\n", maddr, node);
190
191 if ((maddr & (0XFUL << 60)) != __IA64_UNCACHED_OFFSET)
192 panic("uncached_free_page invalid address %lx\n", maddr);
193
194 gen_pool_free(uncached_pool[node], maddr, PAGE_SIZE);
195}
196EXPORT_SYMBOL(uncached_free_page);
197
198
199/*
200 * uncached_build_memmap,
201 *
202 * Called at boot time to build a map of pages that can be used for
203 * memory special operations.
204 */
205static int __init
206uncached_build_memmap(unsigned long start, unsigned long end, void *arg)
207{
208 long length;
209 unsigned long vstart, vend;
210 int node;
211
212 length = end - start;
213 vstart = start + __IA64_UNCACHED_OFFSET;
214 vend = end + __IA64_UNCACHED_OFFSET;
215
216 dprintk(KERN_ERR "uncached_build_memmap(%lx %lx)\n", start, end);
217
218 memset((char *)vstart, 0, length);
219
220 node = nasid_to_cnodeid(NASID_GET(start));
221
222 for (; vstart < vend ; vstart += PAGE_SIZE) {
223 dprintk(KERN_INFO "sticking %lx into the pool!\n", vstart);
224 gen_pool_free(uncached_pool[node], vstart, PAGE_SIZE);
225 }
226
227 return 0;
228}
229
230
231static int __init uncached_init(void) {
232 int i;
233
234 for (i = 0; i < MAX_NUMNODES; i++) {
235 if (!node_online(i))
236 continue;
237 uncached_pool[i] = gen_pool_create(0, IA64_GRANULE_SHIFT,
238 &uncached_get_new_chunk, i);
239 }
240
241 efi_memmap_walk_uc(uncached_build_memmap);
242
243 return 0;
244}
245
246__initcall(uncached_init);
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index b9f0db4c1b04..a676e79e0681 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -8,6 +8,11 @@
8#define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE) 8#define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE)
9#include <asm-generic/vmlinux.lds.h> 9#include <asm-generic/vmlinux.lds.h>
10 10
11#define IVT_TEXT \
12 VMLINUX_SYMBOL(__start_ivt_text) = .; \
13 *(.text.ivt) \
14 VMLINUX_SYMBOL(__end_ivt_text) = .;
15
11OUTPUT_FORMAT("elf64-ia64-little") 16OUTPUT_FORMAT("elf64-ia64-little")
12OUTPUT_ARCH(ia64) 17OUTPUT_ARCH(ia64)
13ENTRY(phys_start) 18ENTRY(phys_start)
@@ -39,7 +44,7 @@ SECTIONS
39 44
40 .text : AT(ADDR(.text) - LOAD_OFFSET) 45 .text : AT(ADDR(.text) - LOAD_OFFSET)
41 { 46 {
42 *(.text.ivt) 47 IVT_TEXT
43 *(.text) 48 *(.text)
44 SCHED_TEXT 49 SCHED_TEXT
45 LOCK_TEXT 50 LOCK_TEXT
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c
index c00710929390..b5c90e548195 100644
--- a/arch/ia64/mm/discontig.c
+++ b/arch/ia64/mm/discontig.c
@@ -44,150 +44,7 @@ struct early_node_data {
44}; 44};
45 45
46static struct early_node_data mem_data[MAX_NUMNODES] __initdata; 46static struct early_node_data mem_data[MAX_NUMNODES] __initdata;
47 47static nodemask_t memory_less_mask __initdata;
48/**
49 * reassign_cpu_only_nodes - called from find_memory to move CPU-only nodes to a memory node
50 *
51 * This function will move nodes with only CPUs (no memory)
52 * to a node with memory which is at the minimum numa_slit distance.
53 * Any reassigments will result in the compression of the nodes
54 * and renumbering the nid values where appropriate.
55 * The static declarations below are to avoid large stack size which
56 * makes the code not re-entrant.
57 */
58static void __init reassign_cpu_only_nodes(void)
59{
60 struct node_memblk_s *p;
61 int i, j, k, nnode, nid, cpu, cpunid, pxm;
62 u8 cslit, slit;
63 static DECLARE_BITMAP(nodes_with_mem, MAX_NUMNODES) __initdata;
64 static u8 numa_slit_fix[MAX_NUMNODES * MAX_NUMNODES] __initdata;
65 static int node_flip[MAX_NUMNODES] __initdata;
66 static int old_nid_map[NR_CPUS] __initdata;
67
68 for (nnode = 0, p = &node_memblk[0]; p < &node_memblk[num_node_memblks]; p++)
69 if (!test_bit(p->nid, (void *) nodes_with_mem)) {
70 set_bit(p->nid, (void *) nodes_with_mem);
71 nnode++;
72 }
73
74 /*
75 * All nids with memory.
76 */
77 if (nnode == num_online_nodes())
78 return;
79
80 /*
81 * Change nids and attempt to migrate CPU-only nodes
82 * to the best numa_slit (closest neighbor) possible.
83 * For reassigned CPU nodes a nid can't be arrived at
84 * until after this loop because the target nid's new
85 * identity might not have been established yet. So
86 * new nid values are fabricated above num_online_nodes() and
87 * mapped back later to their true value.
88 */
89 /* MCD - This code is a bit complicated, but may be unnecessary now.
90 * We can now handle much more interesting node-numbering.
91 * The old requirement that 0 <= nid <= numnodes <= MAX_NUMNODES
92 * and that there be no holes in the numbering 0..numnodes
93 * has become simply 0 <= nid <= MAX_NUMNODES.
94 */
95 nid = 0;
96 for_each_online_node(i) {
97 if (test_bit(i, (void *) nodes_with_mem)) {
98 /*
99 * Save original nid value for numa_slit
100 * fixup and node_cpuid reassignments.
101 */
102 node_flip[nid] = i;
103
104 if (i == nid) {
105 nid++;
106 continue;
107 }
108
109 for (p = &node_memblk[0]; p < &node_memblk[num_node_memblks]; p++)
110 if (p->nid == i)
111 p->nid = nid;
112
113 cpunid = nid;
114 nid++;
115 } else
116 cpunid = MAX_NUMNODES;
117
118 for (cpu = 0; cpu < NR_CPUS; cpu++)
119 if (node_cpuid[cpu].nid == i) {
120 /*
121 * For nodes not being reassigned just
122 * fix the cpu's nid and reverse pxm map
123 */
124 if (cpunid < MAX_NUMNODES) {
125 pxm = nid_to_pxm_map[i];
126 pxm_to_nid_map[pxm] =
127 node_cpuid[cpu].nid = cpunid;
128 continue;
129 }
130
131 /*
132 * For nodes being reassigned, find best node by
133 * numa_slit information and then make a temporary
134 * nid value based on current nid and num_online_nodes().
135 */
136 slit = 0xff;
137 k = 2*num_online_nodes();
138 for_each_online_node(j) {
139 if (i == j)
140 continue;
141 else if (test_bit(j, (void *) nodes_with_mem)) {
142 cslit = numa_slit[i * num_online_nodes() + j];
143 if (cslit < slit) {
144 k = num_online_nodes() + j;
145 slit = cslit;
146 }
147 }
148 }
149
150 /* save old nid map so we can update the pxm */
151 old_nid_map[cpu] = node_cpuid[cpu].nid;
152 node_cpuid[cpu].nid = k;
153 }
154 }
155
156 /*
157 * Fixup temporary nid values for CPU-only nodes.
158 */
159 for (cpu = 0; cpu < NR_CPUS; cpu++)
160 if (node_cpuid[cpu].nid == (2*num_online_nodes())) {
161 pxm = nid_to_pxm_map[old_nid_map[cpu]];
162 pxm_to_nid_map[pxm] = node_cpuid[cpu].nid = nnode - 1;
163 } else {
164 for (i = 0; i < nnode; i++) {
165 if (node_flip[i] != (node_cpuid[cpu].nid - num_online_nodes()))
166 continue;
167
168 pxm = nid_to_pxm_map[old_nid_map[cpu]];
169 pxm_to_nid_map[pxm] = node_cpuid[cpu].nid = i;
170 break;
171 }
172 }
173
174 /*
175 * Fix numa_slit by compressing from larger
176 * nid array to reduced nid array.
177 */
178 for (i = 0; i < nnode; i++)
179 for (j = 0; j < nnode; j++)
180 numa_slit_fix[i * nnode + j] =
181 numa_slit[node_flip[i] * num_online_nodes() + node_flip[j]];
182
183 memcpy(numa_slit, numa_slit_fix, sizeof (numa_slit));
184
185 nodes_clear(node_online_map);
186 for (i = 0; i < nnode; i++)
187 node_set_online(i);
188
189 return;
190}
191 48
192/* 49/*
193 * To prevent cache aliasing effects, align per-node structures so that they 50 * To prevent cache aliasing effects, align per-node structures so that they
@@ -233,44 +90,101 @@ static int __init build_node_maps(unsigned long start, unsigned long len,
233} 90}
234 91
235/** 92/**
236 * early_nr_phys_cpus_node - return number of physical cpus on a given node 93 * early_nr_cpus_node - return number of cpus on a given node
237 * @node: node to check 94 * @node: node to check
238 * 95 *
239 * Count the number of physical cpus on @node. These are cpus that actually 96 * Count the number of cpus on @node. We can't use nr_cpus_node() yet because
240 * exist. We can't use nr_cpus_node() yet because
241 * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been 97 * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been
242 * called yet. 98 * called yet. Note that node 0 will also count all non-existent cpus.
243 */ 99 */
244static int early_nr_phys_cpus_node(int node) 100static int __init early_nr_cpus_node(int node)
245{ 101{
246 int cpu, n = 0; 102 int cpu, n = 0;
247 103
248 for (cpu = 0; cpu < NR_CPUS; cpu++) 104 for (cpu = 0; cpu < NR_CPUS; cpu++)
249 if (node == node_cpuid[cpu].nid) 105 if (node == node_cpuid[cpu].nid)
250 if ((cpu == 0) || node_cpuid[cpu].phys_id) 106 n++;
251 n++;
252 107
253 return n; 108 return n;
254} 109}
255 110
111/**
112 * compute_pernodesize - compute size of pernode data
113 * @node: the node id.
114 */
115static unsigned long __init compute_pernodesize(int node)
116{
117 unsigned long pernodesize = 0, cpus;
118
119 cpus = early_nr_cpus_node(node);
120 pernodesize += PERCPU_PAGE_SIZE * cpus;
121 pernodesize += node * L1_CACHE_BYTES;
122 pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t));
123 pernodesize += L1_CACHE_ALIGN(sizeof(struct ia64_node_data));
124 pernodesize = PAGE_ALIGN(pernodesize);
125 return pernodesize;
126}
256 127
257/** 128/**
258 * early_nr_cpus_node - return number of cpus on a given node 129 * per_cpu_node_setup - setup per-cpu areas on each node
259 * @node: node to check 130 * @cpu_data: per-cpu area on this node
131 * @node: node to setup
260 * 132 *
261 * Count the number of cpus on @node. We can't use nr_cpus_node() yet because 133 * Copy the static per-cpu data into the region we just set aside and then
262 * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been 134 * setup __per_cpu_offset for each CPU on this node. Return a pointer to
263 * called yet. Note that node 0 will also count all non-existent cpus. 135 * the end of the area.
264 */ 136 */
265static int early_nr_cpus_node(int node) 137static void *per_cpu_node_setup(void *cpu_data, int node)
266{ 138{
267 int cpu, n = 0; 139#ifdef CONFIG_SMP
140 int cpu;
268 141
269 for (cpu = 0; cpu < NR_CPUS; cpu++) 142 for (cpu = 0; cpu < NR_CPUS; cpu++) {
270 if (node == node_cpuid[cpu].nid) 143 if (node == node_cpuid[cpu].nid) {
271 n++; 144 memcpy(__va(cpu_data), __phys_per_cpu_start,
145 __per_cpu_end - __per_cpu_start);
146 __per_cpu_offset[cpu] = (char*)__va(cpu_data) -
147 __per_cpu_start;
148 cpu_data += PERCPU_PAGE_SIZE;
149 }
150 }
151#endif
152 return cpu_data;
153}
272 154
273 return n; 155/**
156 * fill_pernode - initialize pernode data.
157 * @node: the node id.
158 * @pernode: physical address of pernode data
159 * @pernodesize: size of the pernode data
160 */
161static void __init fill_pernode(int node, unsigned long pernode,
162 unsigned long pernodesize)
163{
164 void *cpu_data;
165 int cpus = early_nr_cpus_node(node);
166 struct bootmem_data *bdp = &mem_data[node].bootmem_data;
167
168 mem_data[node].pernode_addr = pernode;
169 mem_data[node].pernode_size = pernodesize;
170 memset(__va(pernode), 0, pernodesize);
171
172 cpu_data = (void *)pernode;
173 pernode += PERCPU_PAGE_SIZE * cpus;
174 pernode += node * L1_CACHE_BYTES;
175
176 mem_data[node].pgdat = __va(pernode);
177 pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
178
179 mem_data[node].node_data = __va(pernode);
180 pernode += L1_CACHE_ALIGN(sizeof(struct ia64_node_data));
181
182 mem_data[node].pgdat->bdata = bdp;
183 pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
184
185 cpu_data = per_cpu_node_setup(cpu_data, node);
186
187 return;
274} 188}
275 189
276/** 190/**
@@ -304,9 +218,8 @@ static int early_nr_cpus_node(int node)
304static int __init find_pernode_space(unsigned long start, unsigned long len, 218static int __init find_pernode_space(unsigned long start, unsigned long len,
305 int node) 219 int node)
306{ 220{
307 unsigned long epfn, cpu, cpus, phys_cpus; 221 unsigned long epfn;
308 unsigned long pernodesize = 0, pernode, pages, mapsize; 222 unsigned long pernodesize = 0, pernode, pages, mapsize;
309 void *cpu_data;
310 struct bootmem_data *bdp = &mem_data[node].bootmem_data; 223 struct bootmem_data *bdp = &mem_data[node].bootmem_data;
311 224
312 epfn = (start + len) >> PAGE_SHIFT; 225 epfn = (start + len) >> PAGE_SHIFT;
@@ -329,49 +242,12 @@ static int __init find_pernode_space(unsigned long start, unsigned long len,
329 * Calculate total size needed, incl. what's necessary 242 * Calculate total size needed, incl. what's necessary
330 * for good alignment and alias prevention. 243 * for good alignment and alias prevention.
331 */ 244 */
332 cpus = early_nr_cpus_node(node); 245 pernodesize = compute_pernodesize(node);
333 phys_cpus = early_nr_phys_cpus_node(node);
334 pernodesize += PERCPU_PAGE_SIZE * cpus;
335 pernodesize += node * L1_CACHE_BYTES;
336 pernodesize += L1_CACHE_ALIGN(sizeof(pg_data_t));
337 pernodesize += L1_CACHE_ALIGN(sizeof(struct ia64_node_data));
338 pernodesize = PAGE_ALIGN(pernodesize);
339 pernode = NODEDATA_ALIGN(start, node); 246 pernode = NODEDATA_ALIGN(start, node);
340 247
341 /* Is this range big enough for what we want to store here? */ 248 /* Is this range big enough for what we want to store here? */
342 if (start + len > (pernode + pernodesize + mapsize)) { 249 if (start + len > (pernode + pernodesize + mapsize))
343 mem_data[node].pernode_addr = pernode; 250 fill_pernode(node, pernode, pernodesize);
344 mem_data[node].pernode_size = pernodesize;
345 memset(__va(pernode), 0, pernodesize);
346
347 cpu_data = (void *)pernode;
348 pernode += PERCPU_PAGE_SIZE * cpus;
349 pernode += node * L1_CACHE_BYTES;
350
351 mem_data[node].pgdat = __va(pernode);
352 pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
353
354 mem_data[node].node_data = __va(pernode);
355 pernode += L1_CACHE_ALIGN(sizeof(struct ia64_node_data));
356
357 mem_data[node].pgdat->bdata = bdp;
358 pernode += L1_CACHE_ALIGN(sizeof(pg_data_t));
359
360 /*
361 * Copy the static per-cpu data into the region we
362 * just set aside and then setup __per_cpu_offset
363 * for each CPU on this node.
364 */
365 for (cpu = 0; cpu < NR_CPUS; cpu++) {
366 if (node == node_cpuid[cpu].nid) {
367 memcpy(__va(cpu_data), __phys_per_cpu_start,
368 __per_cpu_end - __per_cpu_start);
369 __per_cpu_offset[cpu] = (char*)__va(cpu_data) -
370 __per_cpu_start;
371 cpu_data += PERCPU_PAGE_SIZE;
372 }
373 }
374 }
375 251
376 return 0; 252 return 0;
377} 253}
@@ -411,6 +287,9 @@ static void __init reserve_pernode_space(void)
411 for_each_online_node(node) { 287 for_each_online_node(node) {
412 pg_data_t *pdp = mem_data[node].pgdat; 288 pg_data_t *pdp = mem_data[node].pgdat;
413 289
290 if (node_isset(node, memory_less_mask))
291 continue;
292
414 bdp = pdp->bdata; 293 bdp = pdp->bdata;
415 294
416 /* First the bootmem_map itself */ 295 /* First the bootmem_map itself */
@@ -436,8 +315,8 @@ static void __init reserve_pernode_space(void)
436 */ 315 */
437static void __init initialize_pernode_data(void) 316static void __init initialize_pernode_data(void)
438{ 317{
439 int cpu, node;
440 pg_data_t *pgdat_list[MAX_NUMNODES]; 318 pg_data_t *pgdat_list[MAX_NUMNODES];
319 int cpu, node;
441 320
442 for_each_online_node(node) 321 for_each_online_node(node)
443 pgdat_list[node] = mem_data[node].pgdat; 322 pgdat_list[node] = mem_data[node].pgdat;
@@ -447,12 +326,99 @@ static void __init initialize_pernode_data(void)
447 memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list, 326 memcpy(mem_data[node].node_data->pg_data_ptrs, pgdat_list,
448 sizeof(pgdat_list)); 327 sizeof(pgdat_list));
449 } 328 }
450 329#ifdef CONFIG_SMP
451 /* Set the node_data pointer for each per-cpu struct */ 330 /* Set the node_data pointer for each per-cpu struct */
452 for (cpu = 0; cpu < NR_CPUS; cpu++) { 331 for (cpu = 0; cpu < NR_CPUS; cpu++) {
453 node = node_cpuid[cpu].nid; 332 node = node_cpuid[cpu].nid;
454 per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data; 333 per_cpu(cpu_info, cpu).node_data = mem_data[node].node_data;
455 } 334 }
335#else
336 {
337 struct cpuinfo_ia64 *cpu0_cpu_info;
338 cpu = 0;
339 node = node_cpuid[cpu].nid;
340 cpu0_cpu_info = (struct cpuinfo_ia64 *)(__phys_per_cpu_start +
341 ((char *)&per_cpu__cpu_info - __per_cpu_start));
342 cpu0_cpu_info->node_data = mem_data[node].node_data;
343 }
344#endif /* CONFIG_SMP */
345}
346
347/**
348 * memory_less_node_alloc - * attempt to allocate memory on the best NUMA slit
349 * node but fall back to any other node when __alloc_bootmem_node fails
350 * for best.
351 * @nid: node id
352 * @pernodesize: size of this node's pernode data
353 * @align: alignment to use for this node's pernode data
354 */
355static void __init *memory_less_node_alloc(int nid, unsigned long pernodesize,
356 unsigned long align)
357{
358 void *ptr = NULL;
359 u8 best = 0xff;
360 int bestnode = -1, node;
361
362 for_each_online_node(node) {
363 if (node_isset(node, memory_less_mask))
364 continue;
365 else if (node_distance(nid, node) < best) {
366 best = node_distance(nid, node);
367 bestnode = node;
368 }
369 }
370
371 ptr = __alloc_bootmem_node(mem_data[bestnode].pgdat,
372 pernodesize, align, __pa(MAX_DMA_ADDRESS));
373
374 if (!ptr)
375 panic("NO memory for memory less node\n");
376 return ptr;
377}
378
379/**
380 * pgdat_insert - insert the pgdat into global pgdat_list
381 * @pgdat: the pgdat for a node.
382 */
383static void __init pgdat_insert(pg_data_t *pgdat)
384{
385 pg_data_t *prev = NULL, *next;
386
387 for_each_pgdat(next)
388 if (pgdat->node_id < next->node_id)
389 break;
390 else
391 prev = next;
392
393 if (prev) {
394 prev->pgdat_next = pgdat;
395 pgdat->pgdat_next = next;
396 } else {
397 pgdat->pgdat_next = pgdat_list;
398 pgdat_list = pgdat;
399 }
400
401 return;
402}
403
404/**
405 * memory_less_nodes - allocate and initialize CPU only nodes pernode
406 * information.
407 */
408static void __init memory_less_nodes(void)
409{
410 unsigned long pernodesize;
411 void *pernode;
412 int node;
413
414 for_each_node_mask(node, memory_less_mask) {
415 pernodesize = compute_pernodesize(node);
416 pernode = memory_less_node_alloc(node, pernodesize,
417 (node) ? (node * PERCPU_PAGE_SIZE) : (1024*1024));
418 fill_pernode(node, __pa(pernode), pernodesize);
419 }
420
421 return;
456} 422}
457 423
458/** 424/**
@@ -472,16 +438,19 @@ void __init find_memory(void)
472 node_set_online(0); 438 node_set_online(0);
473 } 439 }
474 440
441 nodes_or(memory_less_mask, memory_less_mask, node_online_map);
475 min_low_pfn = -1; 442 min_low_pfn = -1;
476 max_low_pfn = 0; 443 max_low_pfn = 0;
477 444
478 if (num_online_nodes() > 1)
479 reassign_cpu_only_nodes();
480
481 /* These actually end up getting called by call_pernode_memory() */ 445 /* These actually end up getting called by call_pernode_memory() */
482 efi_memmap_walk(filter_rsvd_memory, build_node_maps); 446 efi_memmap_walk(filter_rsvd_memory, build_node_maps);
483 efi_memmap_walk(filter_rsvd_memory, find_pernode_space); 447 efi_memmap_walk(filter_rsvd_memory, find_pernode_space);
484 448
449 for_each_online_node(node)
450 if (mem_data[node].bootmem_data.node_low_pfn) {
451 node_clear(node, memory_less_mask);
452 mem_data[node].min_pfn = ~0UL;
453 }
485 /* 454 /*
486 * Initialize the boot memory maps in reverse order since that's 455 * Initialize the boot memory maps in reverse order since that's
487 * what the bootmem allocator expects 456 * what the bootmem allocator expects
@@ -492,17 +461,14 @@ void __init find_memory(void)
492 461
493 if (!node_online(node)) 462 if (!node_online(node))
494 continue; 463 continue;
464 else if (node_isset(node, memory_less_mask))
465 continue;
495 466
496 bdp = &mem_data[node].bootmem_data; 467 bdp = &mem_data[node].bootmem_data;
497 pernode = mem_data[node].pernode_addr; 468 pernode = mem_data[node].pernode_addr;
498 pernodesize = mem_data[node].pernode_size; 469 pernodesize = mem_data[node].pernode_size;
499 map = pernode + pernodesize; 470 map = pernode + pernodesize;
500 471
501 /* Sanity check... */
502 if (!pernode)
503 panic("pernode space for node %d "
504 "could not be allocated!", node);
505
506 init_bootmem_node(mem_data[node].pgdat, 472 init_bootmem_node(mem_data[node].pgdat,
507 map>>PAGE_SHIFT, 473 map>>PAGE_SHIFT,
508 bdp->node_boot_start>>PAGE_SHIFT, 474 bdp->node_boot_start>>PAGE_SHIFT,
@@ -512,6 +478,7 @@ void __init find_memory(void)
512 efi_memmap_walk(filter_rsvd_memory, free_node_bootmem); 478 efi_memmap_walk(filter_rsvd_memory, free_node_bootmem);
513 479
514 reserve_pernode_space(); 480 reserve_pernode_space();
481 memory_less_nodes();
515 initialize_pernode_data(); 482 initialize_pernode_data();
516 483
517 max_pfn = max_low_pfn; 484 max_pfn = max_low_pfn;
@@ -519,6 +486,7 @@ void __init find_memory(void)
519 find_initrd(); 486 find_initrd();
520} 487}
521 488
489#ifdef CONFIG_SMP
522/** 490/**
523 * per_cpu_init - setup per-cpu variables 491 * per_cpu_init - setup per-cpu variables
524 * 492 *
@@ -529,15 +497,15 @@ void *per_cpu_init(void)
529{ 497{
530 int cpu; 498 int cpu;
531 499
532 if (smp_processor_id() == 0) { 500 if (smp_processor_id() != 0)
533 for (cpu = 0; cpu < NR_CPUS; cpu++) { 501 return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
534 per_cpu(local_per_cpu_offset, cpu) = 502
535 __per_cpu_offset[cpu]; 503 for (cpu = 0; cpu < NR_CPUS; cpu++)
536 } 504 per_cpu(local_per_cpu_offset, cpu) = __per_cpu_offset[cpu];
537 }
538 505
539 return __per_cpu_start + __per_cpu_offset[smp_processor_id()]; 506 return __per_cpu_start + __per_cpu_offset[smp_processor_id()];
540} 507}
508#endif /* CONFIG_SMP */
541 509
542/** 510/**
543 * show_mem - give short summary of memory stats 511 * show_mem - give short summary of memory stats
@@ -560,14 +528,15 @@ void show_mem(void)
560 int shared = 0, cached = 0, reserved = 0; 528 int shared = 0, cached = 0, reserved = 0;
561 printk("Node ID: %d\n", pgdat->node_id); 529 printk("Node ID: %d\n", pgdat->node_id);
562 for(i = 0; i < pgdat->node_spanned_pages; i++) { 530 for(i = 0; i < pgdat->node_spanned_pages; i++) {
531 struct page *page = pgdat_page_nr(pgdat, i);
563 if (!ia64_pfn_valid(pgdat->node_start_pfn+i)) 532 if (!ia64_pfn_valid(pgdat->node_start_pfn+i))
564 continue; 533 continue;
565 if (PageReserved(pgdat->node_mem_map+i)) 534 if (PageReserved(page))
566 reserved++; 535 reserved++;
567 else if (PageSwapCache(pgdat->node_mem_map+i)) 536 else if (PageSwapCache(page))
568 cached++; 537 cached++;
569 else if (page_count(pgdat->node_mem_map+i)) 538 else if (page_count(page))
570 shared += page_count(pgdat->node_mem_map+i)-1; 539 shared += page_count(page)-1;
571 } 540 }
572 total_present += present; 541 total_present += present;
573 total_reserved += reserved; 542 total_reserved += reserved;
@@ -679,12 +648,13 @@ void __init paging_init(void)
679 648
680 max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT; 649 max_dma = virt_to_phys((void *) MAX_DMA_ADDRESS) >> PAGE_SHIFT;
681 650
682 /* so min() will work in count_node_pages */
683 for_each_online_node(node)
684 mem_data[node].min_pfn = ~0UL;
685
686 efi_memmap_walk(filter_rsvd_memory, count_node_pages); 651 efi_memmap_walk(filter_rsvd_memory, count_node_pages);
687 652
653 vmalloc_end -= PAGE_ALIGN(max_low_pfn * sizeof(struct page));
654 vmem_map = (struct page *) vmalloc_end;
655 efi_memmap_walk(create_mem_map_page_table, NULL);
656 printk("Virtual mem_map starts at 0x%p\n", vmem_map);
657
688 for_each_online_node(node) { 658 for_each_online_node(node) {
689 memset(zones_size, 0, sizeof(zones_size)); 659 memset(zones_size, 0, sizeof(zones_size));
690 memset(zholes_size, 0, sizeof(zholes_size)); 660 memset(zholes_size, 0, sizeof(zholes_size));
@@ -718,15 +688,6 @@ void __init paging_init(void)
718 mem_data[node].num_dma_physpages); 688 mem_data[node].num_dma_physpages);
719 } 689 }
720 690
721 if (node == 0) {
722 vmalloc_end -=
723 PAGE_ALIGN(max_low_pfn * sizeof(struct page));
724 vmem_map = (struct page *) vmalloc_end;
725
726 efi_memmap_walk(create_mem_map_page_table, NULL);
727 printk("Virtual mem_map starts at 0x%p\n", vmem_map);
728 }
729
730 pfn_offset = mem_data[node].min_pfn; 691 pfn_offset = mem_data[node].min_pfn;
731 692
732 NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset; 693 NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset;
@@ -734,5 +695,11 @@ void __init paging_init(void)
734 pfn_offset, zholes_size); 695 pfn_offset, zholes_size);
735 } 696 }
736 697
698 /*
699 * Make memory less nodes become a member of the known nodes.
700 */
701 for_each_node_mask(node, memory_less_mask)
702 pgdat_insert(mem_data[node].pgdat);
703
737 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page)); 704 zero_page_memmap_ptr = virt_to_page(ia64_imva(empty_zero_page));
738} 705}
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c
index 4174ec999dde..ff62551eb3a1 100644
--- a/arch/ia64/mm/fault.c
+++ b/arch/ia64/mm/fault.c
@@ -14,6 +14,7 @@
14#include <asm/processor.h> 14#include <asm/processor.h>
15#include <asm/system.h> 15#include <asm/system.h>
16#include <asm/uaccess.h> 16#include <asm/uaccess.h>
17#include <asm/kdebug.h>
17 18
18extern void die (char *, struct pt_regs *, long); 19extern void die (char *, struct pt_regs *, long);
19 20
@@ -102,6 +103,13 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re
102 goto bad_area_no_up; 103 goto bad_area_no_up;
103#endif 104#endif
104 105
106 /*
107 * This is to handle the kprobes on user space access instructions
108 */
109 if (notify_die(DIE_PAGE_FAULT, "page fault", regs, code, TRAP_BRKPT,
110 SIGSEGV) == NOTIFY_STOP)
111 return;
112
105 down_read(&mm->mmap_sem); 113 down_read(&mm->mmap_sem);
106 114
107 vma = find_vma_prev(mm, address, &prev_vma); 115 vma = find_vma_prev(mm, address, &prev_vma);
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
index df08ae7634b6..e0a776a3044c 100644
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -24,7 +24,7 @@
24 24
25unsigned int hpage_shift=HPAGE_SHIFT_DEFAULT; 25unsigned int hpage_shift=HPAGE_SHIFT_DEFAULT;
26 26
27static pte_t * 27pte_t *
28huge_pte_alloc (struct mm_struct *mm, unsigned long addr) 28huge_pte_alloc (struct mm_struct *mm, unsigned long addr)
29{ 29{
30 unsigned long taddr = htlbpage_to_page(addr); 30 unsigned long taddr = htlbpage_to_page(addr);
@@ -43,7 +43,7 @@ huge_pte_alloc (struct mm_struct *mm, unsigned long addr)
43 return pte; 43 return pte;
44} 44}
45 45
46static pte_t * 46pte_t *
47huge_pte_offset (struct mm_struct *mm, unsigned long addr) 47huge_pte_offset (struct mm_struct *mm, unsigned long addr)
48{ 48{
49 unsigned long taddr = htlbpage_to_page(addr); 49 unsigned long taddr = htlbpage_to_page(addr);
@@ -67,23 +67,6 @@ huge_pte_offset (struct mm_struct *mm, unsigned long addr)
67 67
68#define mk_pte_huge(entry) { pte_val(entry) |= _PAGE_P; } 68#define mk_pte_huge(entry) { pte_val(entry) |= _PAGE_P; }
69 69
70static void
71set_huge_pte (struct mm_struct *mm, struct vm_area_struct *vma,
72 struct page *page, pte_t * page_table, int write_access)
73{
74 pte_t entry;
75
76 add_mm_counter(mm, rss, HPAGE_SIZE / PAGE_SIZE);
77 if (write_access) {
78 entry =
79 pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
80 } else
81 entry = pte_wrprotect(mk_pte(page, vma->vm_page_prot));
82 entry = pte_mkyoung(entry);
83 mk_pte_huge(entry);
84 set_pte(page_table, entry);
85 return;
86}
87/* 70/*
88 * This function checks for proper alignment of input addr and len parameters. 71 * This function checks for proper alignment of input addr and len parameters.
89 */ 72 */
@@ -99,68 +82,6 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
99 return 0; 82 return 0;
100} 83}
101 84
102int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src,
103 struct vm_area_struct *vma)
104{
105 pte_t *src_pte, *dst_pte, entry;
106 struct page *ptepage;
107 unsigned long addr = vma->vm_start;
108 unsigned long end = vma->vm_end;
109
110 while (addr < end) {
111 dst_pte = huge_pte_alloc(dst, addr);
112 if (!dst_pte)
113 goto nomem;
114 src_pte = huge_pte_offset(src, addr);
115 entry = *src_pte;
116 ptepage = pte_page(entry);
117 get_page(ptepage);
118 set_pte(dst_pte, entry);
119 add_mm_counter(dst, rss, HPAGE_SIZE / PAGE_SIZE);
120 addr += HPAGE_SIZE;
121 }
122 return 0;
123nomem:
124 return -ENOMEM;
125}
126
127int
128follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
129 struct page **pages, struct vm_area_struct **vmas,
130 unsigned long *st, int *length, int i)
131{
132 pte_t *ptep, pte;
133 unsigned long start = *st;
134 unsigned long pstart;
135 int len = *length;
136 struct page *page;
137
138 do {
139 pstart = start & HPAGE_MASK;
140 ptep = huge_pte_offset(mm, start);
141 pte = *ptep;
142
143back1:
144 page = pte_page(pte);
145 if (pages) {
146 page += ((start & ~HPAGE_MASK) >> PAGE_SHIFT);
147 get_page(page);
148 pages[i] = page;
149 }
150 if (vmas)
151 vmas[i] = vma;
152 i++;
153 len--;
154 start += PAGE_SIZE;
155 if (((start & HPAGE_MASK) == pstart) && len &&
156 (start < vma->vm_end))
157 goto back1;
158 } while (len && start < vma->vm_end);
159 *length = len;
160 *st = start;
161 return i;
162}
163
164struct page *follow_huge_addr(struct mm_struct *mm, unsigned long addr, int write) 85struct page *follow_huge_addr(struct mm_struct *mm, unsigned long addr, int write)
165{ 86{
166 struct page *page; 87 struct page *page;
@@ -212,81 +133,6 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb,
212 free_pgd_range(tlb, addr, end, floor, ceiling); 133 free_pgd_range(tlb, addr, end, floor, ceiling);
213} 134}
214 135
215void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start, unsigned long end)
216{
217 struct mm_struct *mm = vma->vm_mm;
218 unsigned long address;
219 pte_t *pte;
220 struct page *page;
221
222 BUG_ON(start & (HPAGE_SIZE - 1));
223 BUG_ON(end & (HPAGE_SIZE - 1));
224
225 for (address = start; address < end; address += HPAGE_SIZE) {
226 pte = huge_pte_offset(mm, address);
227 if (pte_none(*pte))
228 continue;
229 page = pte_page(*pte);
230 put_page(page);
231 pte_clear(mm, address, pte);
232 }
233 add_mm_counter(mm, rss, - ((end - start) >> PAGE_SHIFT));
234 flush_tlb_range(vma, start, end);
235}
236
237int hugetlb_prefault(struct address_space *mapping, struct vm_area_struct *vma)
238{
239 struct mm_struct *mm = current->mm;
240 unsigned long addr;
241 int ret = 0;
242
243 BUG_ON(vma->vm_start & ~HPAGE_MASK);
244 BUG_ON(vma->vm_end & ~HPAGE_MASK);
245
246 spin_lock(&mm->page_table_lock);
247 for (addr = vma->vm_start; addr < vma->vm_end; addr += HPAGE_SIZE) {
248 unsigned long idx;
249 pte_t *pte = huge_pte_alloc(mm, addr);
250 struct page *page;
251
252 if (!pte) {
253 ret = -ENOMEM;
254 goto out;
255 }
256 if (!pte_none(*pte))
257 continue;
258
259 idx = ((addr - vma->vm_start) >> HPAGE_SHIFT)
260 + (vma->vm_pgoff >> (HPAGE_SHIFT - PAGE_SHIFT));
261 page = find_get_page(mapping, idx);
262 if (!page) {
263 /* charge the fs quota first */
264 if (hugetlb_get_quota(mapping)) {
265 ret = -ENOMEM;
266 goto out;
267 }
268 page = alloc_huge_page();
269 if (!page) {
270 hugetlb_put_quota(mapping);
271 ret = -ENOMEM;
272 goto out;
273 }
274 ret = add_to_page_cache(page, mapping, idx, GFP_ATOMIC);
275 if (! ret) {
276 unlock_page(page);
277 } else {
278 hugetlb_put_quota(mapping);
279 page_cache_release(page);
280 goto out;
281 }
282 }
283 set_huge_pte(mm, vma, page, pte, vma->vm_flags & VM_WRITE);
284 }
285out:
286 spin_unlock(&mm->page_table_lock);
287 return ret;
288}
289
290unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, 136unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
291 unsigned long pgoff, unsigned long flags) 137 unsigned long pgoff, unsigned long flags)
292{ 138{
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 4eb2f52b87a1..65f9958db9f0 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -597,7 +597,8 @@ mem_init (void)
597 kclist_add(&kcore_kernel, _stext, _end - _stext); 597 kclist_add(&kcore_kernel, _stext, _end - _stext);
598 598
599 for_each_pgdat(pgdat) 599 for_each_pgdat(pgdat)
600 totalram_pages += free_all_bootmem_node(pgdat); 600 if (pgdat->bdata->node_bootmem_map)
601 totalram_pages += free_all_bootmem_node(pgdat);
601 602
602 reserved_pages = 0; 603 reserved_pages = 0;
603 efi_memmap_walk(count_reserved_pages, &reserved_pages); 604 efi_memmap_walk(count_reserved_pages, &reserved_pages);
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
index 88641e5095b5..720a861f88be 100644
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -33,8 +33,6 @@
33#include <asm/hw_irq.h> 33#include <asm/hw_irq.h>
34 34
35 35
36static int pci_routeirq;
37
38/* 36/*
39 * Low-level SAL-based PCI configuration access functions. Note that SAL 37 * Low-level SAL-based PCI configuration access functions. Note that SAL
40 * calls are already serialized (via sal_lock), so we don't need another 38 * calls are already serialized (via sal_lock), so we don't need another
@@ -139,24 +137,8 @@ static void acpi_map_iosapics(void)
139static int __init 137static int __init
140pci_acpi_init (void) 138pci_acpi_init (void)
141{ 139{
142 struct pci_dev *dev = NULL;
143
144 printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
145
146 acpi_map_iosapics(); 140 acpi_map_iosapics();
147 141
148 if (pci_routeirq) {
149 /*
150 * PCI IRQ routing is set up by pci_enable_device(), but we
151 * also do it here in case there are still broken drivers that
152 * don't use pci_enable_device().
153 */
154 printk(KERN_INFO "PCI: Routing interrupts for all devices because \"pci=routeirq\" specified\n");
155 for_each_pci_dev(dev)
156 acpi_pci_irq_enable(dev);
157 } else
158 printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\". If it helps, post a report\n");
159
160 return 0; 142 return 0;
161} 143}
162 144
@@ -330,7 +312,7 @@ pci_acpi_scan_root(struct acpi_device *device, int domain, int bus)
330 acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window, 312 acpi_walk_resources(device->handle, METHOD_NAME__CRS, add_window,
331 &info); 313 &info);
332 314
333 pbus = pci_scan_bus(bus, &pci_root_ops, controller); 315 pbus = pci_scan_bus_parented(NULL, bus, &pci_root_ops, controller);
334 if (pbus) 316 if (pbus)
335 pcibios_setup_root_windows(pbus, controller); 317 pcibios_setup_root_windows(pbus, controller);
336 318
@@ -391,6 +373,25 @@ void pcibios_bus_to_resource(struct pci_dev *dev,
391 res->end = region->end + offset; 373 res->end = region->end + offset;
392} 374}
393 375
376static int __devinit is_valid_resource(struct pci_dev *dev, int idx)
377{
378 unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM;
379 struct resource *devr = &dev->resource[idx];
380
381 if (!dev->bus)
382 return 0;
383 for (i=0; i<PCI_BUS_NUM_RESOURCES; i++) {
384 struct resource *busr = dev->bus->resource[i];
385
386 if (!busr || ((busr->flags ^ devr->flags) & type_mask))
387 continue;
388 if ((devr->start) && (devr->start >= busr->start) &&
389 (devr->end <= busr->end))
390 return 1;
391 }
392 return 0;
393}
394
394static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev) 395static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
395{ 396{
396 struct pci_bus_region region; 397 struct pci_bus_region region;
@@ -404,7 +405,8 @@ static void __devinit pcibios_fixup_device_resources(struct pci_dev *dev)
404 region.start = dev->resource[i].start; 405 region.start = dev->resource[i].start;
405 region.end = dev->resource[i].end; 406 region.end = dev->resource[i].end;
406 pcibios_bus_to_resource(dev, &dev->resource[i], &region); 407 pcibios_bus_to_resource(dev, &dev->resource[i], &region);
407 pci_claim_resource(dev, i); 408 if ((is_valid_resource(dev, i)))
409 pci_claim_resource(dev, i);
408 } 410 }
409} 411}
410 412
@@ -416,6 +418,10 @@ pcibios_fixup_bus (struct pci_bus *b)
416{ 418{
417 struct pci_dev *dev; 419 struct pci_dev *dev;
418 420
421 if (b->self) {
422 pci_read_bridge_bases(b);
423 pcibios_fixup_device_resources(b->self);
424 }
419 list_for_each_entry(dev, &b->devices, bus_list) 425 list_for_each_entry(dev, &b->devices, bus_list)
420 pcibios_fixup_device_resources(dev); 426 pcibios_fixup_device_resources(dev);
421 427
@@ -436,18 +442,24 @@ pcibios_enable_resources (struct pci_dev *dev, int mask)
436 u16 cmd, old_cmd; 442 u16 cmd, old_cmd;
437 int idx; 443 int idx;
438 struct resource *r; 444 struct resource *r;
445 unsigned long type_mask = IORESOURCE_IO | IORESOURCE_MEM;
439 446
440 if (!dev) 447 if (!dev)
441 return -EINVAL; 448 return -EINVAL;
442 449
443 pci_read_config_word(dev, PCI_COMMAND, &cmd); 450 pci_read_config_word(dev, PCI_COMMAND, &cmd);
444 old_cmd = cmd; 451 old_cmd = cmd;
445 for (idx=0; idx<6; idx++) { 452 for (idx=0; idx<PCI_NUM_RESOURCES; idx++) {
446 /* Only set up the desired resources. */ 453 /* Only set up the desired resources. */
447 if (!(mask & (1 << idx))) 454 if (!(mask & (1 << idx)))
448 continue; 455 continue;
449 456
450 r = &dev->resource[idx]; 457 r = &dev->resource[idx];
458 if (!(r->flags & type_mask))
459 continue;
460 if ((idx == PCI_ROM_RESOURCE) &&
461 (!(r->flags & IORESOURCE_ROM_ENABLE)))
462 continue;
451 if (!r->start && r->end) { 463 if (!r->start && r->end) {
452 printk(KERN_ERR 464 printk(KERN_ERR
453 "PCI: Device %s not available because of resource collisions\n", 465 "PCI: Device %s not available because of resource collisions\n",
@@ -459,8 +471,6 @@ pcibios_enable_resources (struct pci_dev *dev, int mask)
459 if (r->flags & IORESOURCE_MEM) 471 if (r->flags & IORESOURCE_MEM)
460 cmd |= PCI_COMMAND_MEMORY; 472 cmd |= PCI_COMMAND_MEMORY;
461 } 473 }
462 if (dev->resource[PCI_ROM_RESOURCE].start)
463 cmd |= PCI_COMMAND_MEMORY;
464 if (cmd != old_cmd) { 474 if (cmd != old_cmd) {
465 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd); 475 printk("PCI: Enabling device %s (%04x -> %04x)\n", pci_name(dev), old_cmd, cmd);
466 pci_write_config_word(dev, PCI_COMMAND, cmd); 476 pci_write_config_word(dev, PCI_COMMAND, cmd);
@@ -500,8 +510,6 @@ pcibios_align_resource (void *data, struct resource *res,
500char * __init 510char * __init
501pcibios_setup (char *str) 511pcibios_setup (char *str)
502{ 512{
503 if (!strcmp(str, "routeirq"))
504 pci_routeirq = 1;
505 return NULL; 513 return NULL;
506} 514}
507 515
diff --git a/arch/ia64/sn/include/pci/pcibr_provider.h b/arch/ia64/sn/include/pci/pcibr_provider.h
deleted file mode 100644
index 1cd291d8badd..000000000000
--- a/arch/ia64/sn/include/pci/pcibr_provider.h
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1992-1997,2000-2004 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
9#define _ASM_IA64_SN_PCI_PCIBR_PROVIDER_H
10
11/* Workarounds */
12#define PV907516 (1 << 1) /* TIOCP: Don't write the write buffer flush reg */
13
14#define BUSTYPE_MASK 0x1
15
16/* Macros given a pcibus structure */
17#define IS_PCIX(ps) ((ps)->pbi_bridge_mode & BUSTYPE_MASK)
18#define IS_PCI_BRIDGE_ASIC(asic) (asic == PCIIO_ASIC_TYPE_PIC || \
19 asic == PCIIO_ASIC_TYPE_TIOCP)
20#define IS_PIC_SOFT(ps) (ps->pbi_bridge_type == PCIBR_BRIDGETYPE_PIC)
21
22
23/*
24 * The different PCI Bridge types supported on the SGI Altix platforms
25 */
26#define PCIBR_BRIDGETYPE_UNKNOWN -1
27#define PCIBR_BRIDGETYPE_PIC 2
28#define PCIBR_BRIDGETYPE_TIOCP 3
29
30/*
31 * Bridge 64bit Direct Map Attributes
32 */
33#define PCI64_ATTR_PREF (1ull << 59)
34#define PCI64_ATTR_PREC (1ull << 58)
35#define PCI64_ATTR_VIRTUAL (1ull << 57)
36#define PCI64_ATTR_BAR (1ull << 56)
37#define PCI64_ATTR_SWAP (1ull << 55)
38#define PCI64_ATTR_VIRTUAL1 (1ull << 54)
39
40#define PCI32_LOCAL_BASE 0
41#define PCI32_MAPPED_BASE 0x40000000
42#define PCI32_DIRECT_BASE 0x80000000
43
44#define IS_PCI32_MAPPED(x) ((uint64_t)(x) < PCI32_DIRECT_BASE && \
45 (uint64_t)(x) >= PCI32_MAPPED_BASE)
46#define IS_PCI32_DIRECT(x) ((uint64_t)(x) >= PCI32_MAPPED_BASE)
47
48
49/*
50 * Bridge PMU Address Transaltion Entry Attibutes
51 */
52#define PCI32_ATE_V (0x1 << 0)
53#define PCI32_ATE_CO (0x1 << 1)
54#define PCI32_ATE_PREC (0x1 << 2)
55#define PCI32_ATE_PREF (0x1 << 3)
56#define PCI32_ATE_BAR (0x1 << 4)
57#define PCI32_ATE_ADDR_SHFT 12
58
59#define MINIMAL_ATES_REQUIRED(addr, size) \
60 (IOPG(IOPGOFF(addr) + (size) - 1) == IOPG((size) - 1))
61
62#define MINIMAL_ATE_FLAG(addr, size) \
63 (MINIMAL_ATES_REQUIRED((uint64_t)addr, size) ? 1 : 0)
64
65/* bit 29 of the pci address is the SWAP bit */
66#define ATE_SWAPSHIFT 29
67#define ATE_SWAP_ON(x) ((x) |= (1 << ATE_SWAPSHIFT))
68#define ATE_SWAP_OFF(x) ((x) &= ~(1 << ATE_SWAPSHIFT))
69
70/*
71 * I/O page size
72 */
73#if PAGE_SIZE < 16384
74#define IOPFNSHIFT 12 /* 4K per mapped page */
75#else
76#define IOPFNSHIFT 14 /* 16K per mapped page */
77#endif
78
79#define IOPGSIZE (1 << IOPFNSHIFT)
80#define IOPG(x) ((x) >> IOPFNSHIFT)
81#define IOPGOFF(x) ((x) & (IOPGSIZE-1))
82
83#define PCIBR_DEV_SWAP_DIR (1ull << 19)
84#define PCIBR_CTRL_PAGE_SIZE (0x1 << 21)
85
86/*
87 * PMU resources.
88 */
89struct ate_resource{
90 uint64_t *ate;
91 uint64_t num_ate;
92 uint64_t lowest_free_index;
93};
94
95struct pcibus_info {
96 struct pcibus_bussoft pbi_buscommon; /* common header */
97 uint32_t pbi_moduleid;
98 short pbi_bridge_type;
99 short pbi_bridge_mode;
100
101 struct ate_resource pbi_int_ate_resource;
102 uint64_t pbi_int_ate_size;
103
104 uint64_t pbi_dir_xbase;
105 char pbi_hub_xid;
106
107 uint64_t pbi_devreg[8];
108 spinlock_t pbi_lock;
109
110 uint32_t pbi_valid_devices;
111 uint32_t pbi_enabled_devices;
112};
113
114/*
115 * pcibus_info structure locking macros
116 */
117inline static unsigned long
118pcibr_lock(struct pcibus_info *pcibus_info)
119{
120 unsigned long flag;
121 spin_lock_irqsave(&pcibus_info->pbi_lock, flag);
122 return(flag);
123}
124#define pcibr_unlock(pcibus_info, flag) spin_unlock_irqrestore(&pcibus_info->pbi_lock, flag)
125
126extern int pcibr_init_provider(void);
127extern void *pcibr_bus_fixup(struct pcibus_bussoft *);
128extern dma_addr_t pcibr_dma_map(struct pci_dev *, unsigned long, size_t);
129extern dma_addr_t pcibr_dma_map_consistent(struct pci_dev *, unsigned long, size_t);
130extern void pcibr_dma_unmap(struct pci_dev *, dma_addr_t, int);
131
132/*
133 * prototypes for the bridge asic register access routines in pcibr_reg.c
134 */
135extern void pcireg_control_bit_clr(struct pcibus_info *, uint64_t);
136extern void pcireg_control_bit_set(struct pcibus_info *, uint64_t);
137extern uint64_t pcireg_tflush_get(struct pcibus_info *);
138extern uint64_t pcireg_intr_status_get(struct pcibus_info *);
139extern void pcireg_intr_enable_bit_clr(struct pcibus_info *, uint64_t);
140extern void pcireg_intr_enable_bit_set(struct pcibus_info *, uint64_t);
141extern void pcireg_intr_addr_addr_set(struct pcibus_info *, int, uint64_t);
142extern void pcireg_force_intr_set(struct pcibus_info *, int);
143extern uint64_t pcireg_wrb_flush_get(struct pcibus_info *, int);
144extern void pcireg_int_ate_set(struct pcibus_info *, int, uint64_t);
145extern uint64_t * pcireg_int_ate_addr(struct pcibus_info *, int);
146extern void pcibr_force_interrupt(struct sn_irq_info *sn_irq_info);
147extern void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info);
148extern int pcibr_ate_alloc(struct pcibus_info *, int);
149extern void pcibr_ate_free(struct pcibus_info *, int);
150extern void ate_write(struct pcibus_info *, int, int, uint64_t);
151#endif
diff --git a/arch/ia64/sn/include/pci/pic.h b/arch/ia64/sn/include/pci/pic.h
deleted file mode 100644
index fd18acecb1e6..000000000000
--- a/arch/ia64/sn/include/pci/pic.h
+++ /dev/null
@@ -1,261 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_PCI_PIC_H
9#define _ASM_IA64_SN_PCI_PIC_H
10
11/*
12 * PIC AS DEVICE ZERO
13 * ------------------
14 *
15 * PIC handles PCI/X busses. PCI/X requires that the 'bridge' (i.e. PIC)
16 * be designated as 'device 0'. That is a departure from earlier SGI
17 * PCI bridges. Because of that we use config space 1 to access the
18 * config space of the first actual PCI device on the bus.
19 * Here's what the PIC manual says:
20 *
21 * The current PCI-X bus specification now defines that the parent
22 * hosts bus bridge (PIC for example) must be device 0 on bus 0. PIC
23 * reduced the total number of devices from 8 to 4 and removed the
24 * device registers and windows, now only supporting devices 0,1,2, and
25 * 3. PIC did leave all 8 configuration space windows. The reason was
26 * there was nothing to gain by removing them. Here in lies the problem.
27 * The device numbering we do using 0 through 3 is unrelated to the device
28 * numbering which PCI-X requires in configuration space. In the past we
29 * correlated Configs pace and our device space 0 <-> 0, 1 <-> 1, etc.
30 * PCI-X requires we start a 1, not 0 and currently the PX brick
31 * does associate our:
32 *
33 * device 0 with configuration space window 1,
34 * device 1 with configuration space window 2,
35 * device 2 with configuration space window 3,
36 * device 3 with configuration space window 4.
37 *
38 * The net effect is that all config space access are off-by-one with
39 * relation to other per-slot accesses on the PIC.
40 * Here is a table that shows some of that:
41 *
42 * Internal Slot#
43 * |
44 * | 0 1 2 3
45 * ----------|---------------------------------------
46 * config | 0x21000 0x22000 0x23000 0x24000
47 * |
48 * even rrb | 0[0] n/a 1[0] n/a [] == implied even/odd
49 * |
50 * odd rrb | n/a 0[1] n/a 1[1]
51 * |
52 * int dev | 00 01 10 11
53 * |
54 * ext slot# | 1 2 3 4
55 * ----------|---------------------------------------
56 */
57
58#define PIC_ATE_TARGETID_SHFT 8
59#define PIC_HOST_INTR_ADDR 0x0000FFFFFFFFFFFFUL
60#define PIC_PCI64_ATTR_TARG_SHFT 60
61
62
63/*****************************************************************************
64 *********************** PIC MMR structure mapping ***************************
65 *****************************************************************************/
66
67/* NOTE: PIC WAR. PV#854697. PIC does not allow writes just to [31:0]
68 * of a 64-bit register. When writing PIC registers, always write the
69 * entire 64 bits.
70 */
71
72struct pic {
73
74 /* 0x000000-0x00FFFF -- Local Registers */
75
76 /* 0x000000-0x000057 -- Standard Widget Configuration */
77 uint64_t p_wid_id; /* 0x000000 */
78 uint64_t p_wid_stat; /* 0x000008 */
79 uint64_t p_wid_err_upper; /* 0x000010 */
80 uint64_t p_wid_err_lower; /* 0x000018 */
81 #define p_wid_err p_wid_err_lower
82 uint64_t p_wid_control; /* 0x000020 */
83 uint64_t p_wid_req_timeout; /* 0x000028 */
84 uint64_t p_wid_int_upper; /* 0x000030 */
85 uint64_t p_wid_int_lower; /* 0x000038 */
86 #define p_wid_int p_wid_int_lower
87 uint64_t p_wid_err_cmdword; /* 0x000040 */
88 uint64_t p_wid_llp; /* 0x000048 */
89 uint64_t p_wid_tflush; /* 0x000050 */
90
91 /* 0x000058-0x00007F -- Bridge-specific Widget Configuration */
92 uint64_t p_wid_aux_err; /* 0x000058 */
93 uint64_t p_wid_resp_upper; /* 0x000060 */
94 uint64_t p_wid_resp_lower; /* 0x000068 */
95 #define p_wid_resp p_wid_resp_lower
96 uint64_t p_wid_tst_pin_ctrl; /* 0x000070 */
97 uint64_t p_wid_addr_lkerr; /* 0x000078 */
98
99 /* 0x000080-0x00008F -- PMU & MAP */
100 uint64_t p_dir_map; /* 0x000080 */
101 uint64_t _pad_000088; /* 0x000088 */
102
103 /* 0x000090-0x00009F -- SSRAM */
104 uint64_t p_map_fault; /* 0x000090 */
105 uint64_t _pad_000098; /* 0x000098 */
106
107 /* 0x0000A0-0x0000AF -- Arbitration */
108 uint64_t p_arb; /* 0x0000A0 */
109 uint64_t _pad_0000A8; /* 0x0000A8 */
110
111 /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
112 uint64_t p_ate_parity_err; /* 0x0000B0 */
113 uint64_t _pad_0000B8; /* 0x0000B8 */
114
115 /* 0x0000C0-0x0000FF -- PCI/GIO */
116 uint64_t p_bus_timeout; /* 0x0000C0 */
117 uint64_t p_pci_cfg; /* 0x0000C8 */
118 uint64_t p_pci_err_upper; /* 0x0000D0 */
119 uint64_t p_pci_err_lower; /* 0x0000D8 */
120 #define p_pci_err p_pci_err_lower
121 uint64_t _pad_0000E0[4]; /* 0x0000{E0..F8} */
122
123 /* 0x000100-0x0001FF -- Interrupt */
124 uint64_t p_int_status; /* 0x000100 */
125 uint64_t p_int_enable; /* 0x000108 */
126 uint64_t p_int_rst_stat; /* 0x000110 */
127 uint64_t p_int_mode; /* 0x000118 */
128 uint64_t p_int_device; /* 0x000120 */
129 uint64_t p_int_host_err; /* 0x000128 */
130 uint64_t p_int_addr[8]; /* 0x0001{30,,,68} */
131 uint64_t p_err_int_view; /* 0x000170 */
132 uint64_t p_mult_int; /* 0x000178 */
133 uint64_t p_force_always[8]; /* 0x0001{80,,,B8} */
134 uint64_t p_force_pin[8]; /* 0x0001{C0,,,F8} */
135
136 /* 0x000200-0x000298 -- Device */
137 uint64_t p_device[4]; /* 0x0002{00,,,18} */
138 uint64_t _pad_000220[4]; /* 0x0002{20,,,38} */
139 uint64_t p_wr_req_buf[4]; /* 0x0002{40,,,58} */
140 uint64_t _pad_000260[4]; /* 0x0002{60,,,78} */
141 uint64_t p_rrb_map[2]; /* 0x0002{80,,,88} */
142 #define p_even_resp p_rrb_map[0] /* 0x000280 */
143 #define p_odd_resp p_rrb_map[1] /* 0x000288 */
144 uint64_t p_resp_status; /* 0x000290 */
145 uint64_t p_resp_clear; /* 0x000298 */
146
147 uint64_t _pad_0002A0[12]; /* 0x0002{A0..F8} */
148
149 /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
150 struct {
151 uint64_t upper; /* 0x0003{00,,,F0} */
152 uint64_t lower; /* 0x0003{08,,,F8} */
153 } p_buf_addr_match[16];
154
155 /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
156 struct {
157 uint64_t flush_w_touch; /* 0x000{400,,,5C0} */
158 uint64_t flush_wo_touch; /* 0x000{408,,,5C8} */
159 uint64_t inflight; /* 0x000{410,,,5D0} */
160 uint64_t prefetch; /* 0x000{418,,,5D8} */
161 uint64_t total_pci_retry; /* 0x000{420,,,5E0} */
162 uint64_t max_pci_retry; /* 0x000{428,,,5E8} */
163 uint64_t max_latency; /* 0x000{430,,,5F0} */
164 uint64_t clear_all; /* 0x000{438,,,5F8} */
165 } p_buf_count[8];
166
167
168 /* 0x000600-0x0009FF -- PCI/X registers */
169 uint64_t p_pcix_bus_err_addr; /* 0x000600 */
170 uint64_t p_pcix_bus_err_attr; /* 0x000608 */
171 uint64_t p_pcix_bus_err_data; /* 0x000610 */
172 uint64_t p_pcix_pio_split_addr; /* 0x000618 */
173 uint64_t p_pcix_pio_split_attr; /* 0x000620 */
174 uint64_t p_pcix_dma_req_err_attr; /* 0x000628 */
175 uint64_t p_pcix_dma_req_err_addr; /* 0x000630 */
176 uint64_t p_pcix_timeout; /* 0x000638 */
177
178 uint64_t _pad_000640[120]; /* 0x000{640,,,9F8} */
179
180 /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
181 struct {
182 uint64_t p_buf_addr; /* 0x000{A00,,,AF0} */
183 uint64_t p_buf_attr; /* 0X000{A08,,,AF8} */
184 } p_pcix_read_buf_64[16];
185
186 struct {
187 uint64_t p_buf_addr; /* 0x000{B00,,,BE0} */
188 uint64_t p_buf_attr; /* 0x000{B08,,,BE8} */
189 uint64_t p_buf_valid; /* 0x000{B10,,,BF0} */
190 uint64_t __pad1; /* 0x000{B18,,,BF8} */
191 } p_pcix_write_buf_64[8];
192
193 /* End of Local Registers -- Start of Address Map space */
194
195 char _pad_000c00[0x010000 - 0x000c00];
196
197 /* 0x010000-0x011fff -- Internal ATE RAM (Auto Parity Generation) */
198 uint64_t p_int_ate_ram[1024]; /* 0x010000-0x011fff */
199
200 /* 0x012000-0x013fff -- Internal ATE RAM (Manual Parity Generation) */
201 uint64_t p_int_ate_ram_mp[1024]; /* 0x012000-0x013fff */
202
203 char _pad_014000[0x18000 - 0x014000];
204
205 /* 0x18000-0x197F8 -- PIC Write Request Ram */
206 uint64_t p_wr_req_lower[256]; /* 0x18000 - 0x187F8 */
207 uint64_t p_wr_req_upper[256]; /* 0x18800 - 0x18FF8 */
208 uint64_t p_wr_req_parity[256]; /* 0x19000 - 0x197F8 */
209
210 char _pad_019800[0x20000 - 0x019800];
211
212 /* 0x020000-0x027FFF -- PCI Device Configuration Spaces */
213 union {
214 uint8_t c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */
215 uint16_t s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */
216 uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */
217 uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */
218 union {
219 uint8_t c[0x100 / 1];
220 uint16_t s[0x100 / 2];
221 uint32_t l[0x100 / 4];
222 uint64_t d[0x100 / 8];
223 } f[8];
224 } p_type0_cfg_dev[8]; /* 0x02{0000,,,7FFF} */
225
226 /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
227 union {
228 uint8_t c[0x1000 / 1]; /* 0x028000-0x029000 */
229 uint16_t s[0x1000 / 2]; /* 0x028000-0x029000 */
230 uint32_t l[0x1000 / 4]; /* 0x028000-0x029000 */
231 uint64_t d[0x1000 / 8]; /* 0x028000-0x029000 */
232 union {
233 uint8_t c[0x100 / 1];
234 uint16_t s[0x100 / 2];
235 uint32_t l[0x100 / 4];
236 uint64_t d[0x100 / 8];
237 } f[8];
238 } p_type1_cfg; /* 0x028000-0x029000 */
239
240 char _pad_029000[0x030000-0x029000];
241
242 /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
243 union {
244 uint8_t c[8 / 1];
245 uint16_t s[8 / 2];
246 uint32_t l[8 / 4];
247 uint64_t d[8 / 8];
248 } p_pci_iack; /* 0x030000-0x030007 */
249
250 char _pad_030007[0x040000-0x030008];
251
252 /* 0x040000-0x030007 -- PCIX Special Cycle */
253 union {
254 uint8_t c[8 / 1];
255 uint16_t s[8 / 2];
256 uint32_t l[8 / 4];
257 uint64_t d[8 / 8];
258 } p_pcix_cycle; /* 0x040000-0x040007 */
259};
260
261#endif /* _ASM_IA64_SN_PCI_PIC_H */
diff --git a/arch/ia64/sn/include/pci/tiocp.h b/arch/ia64/sn/include/pci/tiocp.h
deleted file mode 100644
index f07c83b2bf6e..000000000000
--- a/arch/ia64/sn/include/pci/tiocp.h
+++ /dev/null
@@ -1,256 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2003-2004 Silicon Graphics, Inc. All rights reserved.
7 */
8#ifndef _ASM_IA64_SN_PCI_TIOCP_H
9#define _ASM_IA64_SN_PCI_TIOCP_H
10
11#define TIOCP_HOST_INTR_ADDR 0x003FFFFFFFFFFFFFUL
12#define TIOCP_PCI64_CMDTYPE_MEM (0x1ull << 60)
13
14
15/*****************************************************************************
16 *********************** TIOCP MMR structure mapping ***************************
17 *****************************************************************************/
18
19struct tiocp{
20
21 /* 0x000000-0x00FFFF -- Local Registers */
22
23 /* 0x000000-0x000057 -- (Legacy Widget Space) Configuration */
24 uint64_t cp_id; /* 0x000000 */
25 uint64_t cp_stat; /* 0x000008 */
26 uint64_t cp_err_upper; /* 0x000010 */
27 uint64_t cp_err_lower; /* 0x000018 */
28 #define cp_err cp_err_lower
29 uint64_t cp_control; /* 0x000020 */
30 uint64_t cp_req_timeout; /* 0x000028 */
31 uint64_t cp_intr_upper; /* 0x000030 */
32 uint64_t cp_intr_lower; /* 0x000038 */
33 #define cp_intr cp_intr_lower
34 uint64_t cp_err_cmdword; /* 0x000040 */
35 uint64_t _pad_000048; /* 0x000048 */
36 uint64_t cp_tflush; /* 0x000050 */
37
38 /* 0x000058-0x00007F -- Bridge-specific Configuration */
39 uint64_t cp_aux_err; /* 0x000058 */
40 uint64_t cp_resp_upper; /* 0x000060 */
41 uint64_t cp_resp_lower; /* 0x000068 */
42 #define cp_resp cp_resp_lower
43 uint64_t cp_tst_pin_ctrl; /* 0x000070 */
44 uint64_t cp_addr_lkerr; /* 0x000078 */
45
46 /* 0x000080-0x00008F -- PMU & MAP */
47 uint64_t cp_dir_map; /* 0x000080 */
48 uint64_t _pad_000088; /* 0x000088 */
49
50 /* 0x000090-0x00009F -- SSRAM */
51 uint64_t cp_map_fault; /* 0x000090 */
52 uint64_t _pad_000098; /* 0x000098 */
53
54 /* 0x0000A0-0x0000AF -- Arbitration */
55 uint64_t cp_arb; /* 0x0000A0 */
56 uint64_t _pad_0000A8; /* 0x0000A8 */
57
58 /* 0x0000B0-0x0000BF -- Number In A Can or ATE Parity Error */
59 uint64_t cp_ate_parity_err; /* 0x0000B0 */
60 uint64_t _pad_0000B8; /* 0x0000B8 */
61
62 /* 0x0000C0-0x0000FF -- PCI/GIO */
63 uint64_t cp_bus_timeout; /* 0x0000C0 */
64 uint64_t cp_pci_cfg; /* 0x0000C8 */
65 uint64_t cp_pci_err_upper; /* 0x0000D0 */
66 uint64_t cp_pci_err_lower; /* 0x0000D8 */
67 #define cp_pci_err cp_pci_err_lower
68 uint64_t _pad_0000E0[4]; /* 0x0000{E0..F8} */
69
70 /* 0x000100-0x0001FF -- Interrupt */
71 uint64_t cp_int_status; /* 0x000100 */
72 uint64_t cp_int_enable; /* 0x000108 */
73 uint64_t cp_int_rst_stat; /* 0x000110 */
74 uint64_t cp_int_mode; /* 0x000118 */
75 uint64_t cp_int_device; /* 0x000120 */
76 uint64_t cp_int_host_err; /* 0x000128 */
77 uint64_t cp_int_addr[8]; /* 0x0001{30,,,68} */
78 uint64_t cp_err_int_view; /* 0x000170 */
79 uint64_t cp_mult_int; /* 0x000178 */
80 uint64_t cp_force_always[8]; /* 0x0001{80,,,B8} */
81 uint64_t cp_force_pin[8]; /* 0x0001{C0,,,F8} */
82
83 /* 0x000200-0x000298 -- Device */
84 uint64_t cp_device[4]; /* 0x0002{00,,,18} */
85 uint64_t _pad_000220[4]; /* 0x0002{20,,,38} */
86 uint64_t cp_wr_req_buf[4]; /* 0x0002{40,,,58} */
87 uint64_t _pad_000260[4]; /* 0x0002{60,,,78} */
88 uint64_t cp_rrb_map[2]; /* 0x0002{80,,,88} */
89 #define cp_even_resp cp_rrb_map[0] /* 0x000280 */
90 #define cp_odd_resp cp_rrb_map[1] /* 0x000288 */
91 uint64_t cp_resp_status; /* 0x000290 */
92 uint64_t cp_resp_clear; /* 0x000298 */
93
94 uint64_t _pad_0002A0[12]; /* 0x0002{A0..F8} */
95
96 /* 0x000300-0x0003F8 -- Buffer Address Match Registers */
97 struct {
98 uint64_t upper; /* 0x0003{00,,,F0} */
99 uint64_t lower; /* 0x0003{08,,,F8} */
100 } cp_buf_addr_match[16];
101
102 /* 0x000400-0x0005FF -- Performance Monitor Registers (even only) */
103 struct {
104 uint64_t flush_w_touch; /* 0x000{400,,,5C0} */
105 uint64_t flush_wo_touch; /* 0x000{408,,,5C8} */
106 uint64_t inflight; /* 0x000{410,,,5D0} */
107 uint64_t prefetch; /* 0x000{418,,,5D8} */
108 uint64_t total_pci_retry; /* 0x000{420,,,5E0} */
109 uint64_t max_pci_retry; /* 0x000{428,,,5E8} */
110 uint64_t max_latency; /* 0x000{430,,,5F0} */
111 uint64_t clear_all; /* 0x000{438,,,5F8} */
112 } cp_buf_count[8];
113
114
115 /* 0x000600-0x0009FF -- PCI/X registers */
116 uint64_t cp_pcix_bus_err_addr; /* 0x000600 */
117 uint64_t cp_pcix_bus_err_attr; /* 0x000608 */
118 uint64_t cp_pcix_bus_err_data; /* 0x000610 */
119 uint64_t cp_pcix_pio_split_addr; /* 0x000618 */
120 uint64_t cp_pcix_pio_split_attr; /* 0x000620 */
121 uint64_t cp_pcix_dma_req_err_attr; /* 0x000628 */
122 uint64_t cp_pcix_dma_req_err_addr; /* 0x000630 */
123 uint64_t cp_pcix_timeout; /* 0x000638 */
124
125 uint64_t _pad_000640[24]; /* 0x000{640,,,6F8} */
126
127 /* 0x000700-0x000737 -- Debug Registers */
128 uint64_t cp_ct_debug_ctl; /* 0x000700 */
129 uint64_t cp_br_debug_ctl; /* 0x000708 */
130 uint64_t cp_mux3_debug_ctl; /* 0x000710 */
131 uint64_t cp_mux4_debug_ctl; /* 0x000718 */
132 uint64_t cp_mux5_debug_ctl; /* 0x000720 */
133 uint64_t cp_mux6_debug_ctl; /* 0x000728 */
134 uint64_t cp_mux7_debug_ctl; /* 0x000730 */
135
136 uint64_t _pad_000738[89]; /* 0x000{738,,,9F8} */
137
138 /* 0x000A00-0x000BFF -- PCI/X Read&Write Buffer */
139 struct {
140 uint64_t cp_buf_addr; /* 0x000{A00,,,AF0} */
141 uint64_t cp_buf_attr; /* 0X000{A08,,,AF8} */
142 } cp_pcix_read_buf_64[16];
143
144 struct {
145 uint64_t cp_buf_addr; /* 0x000{B00,,,BE0} */
146 uint64_t cp_buf_attr; /* 0x000{B08,,,BE8} */
147 uint64_t cp_buf_valid; /* 0x000{B10,,,BF0} */
148 uint64_t __pad1; /* 0x000{B18,,,BF8} */
149 } cp_pcix_write_buf_64[8];
150
151 /* End of Local Registers -- Start of Address Map space */
152
153 char _pad_000c00[0x010000 - 0x000c00];
154
155 /* 0x010000-0x011FF8 -- Internal ATE RAM (Auto Parity Generation) */
156 uint64_t cp_int_ate_ram[1024]; /* 0x010000-0x011FF8 */
157
158 char _pad_012000[0x14000 - 0x012000];
159
160 /* 0x014000-0x015FF8 -- Internal ATE RAM (Manual Parity Generation) */
161 uint64_t cp_int_ate_ram_mp[1024]; /* 0x014000-0x015FF8 */
162
163 char _pad_016000[0x18000 - 0x016000];
164
165 /* 0x18000-0x197F8 -- TIOCP Write Request Ram */
166 uint64_t cp_wr_req_lower[256]; /* 0x18000 - 0x187F8 */
167 uint64_t cp_wr_req_upper[256]; /* 0x18800 - 0x18FF8 */
168 uint64_t cp_wr_req_parity[256]; /* 0x19000 - 0x197F8 */
169
170 char _pad_019800[0x1C000 - 0x019800];
171
172 /* 0x1C000-0x1EFF8 -- TIOCP Read Response Ram */
173 uint64_t cp_rd_resp_lower[512]; /* 0x1C000 - 0x1CFF8 */
174 uint64_t cp_rd_resp_upper[512]; /* 0x1D000 - 0x1DFF8 */
175 uint64_t cp_rd_resp_parity[512]; /* 0x1E000 - 0x1EFF8 */
176
177 char _pad_01F000[0x20000 - 0x01F000];
178
179 /* 0x020000-0x021FFF -- Host Device (CP) Configuration Space (not used) */
180 char _pad_020000[0x021000 - 0x20000];
181
182 /* 0x021000-0x027FFF -- PCI Device Configuration Spaces */
183 union {
184 uint8_t c[0x1000 / 1]; /* 0x02{0000,,,7FFF} */
185 uint16_t s[0x1000 / 2]; /* 0x02{0000,,,7FFF} */
186 uint32_t l[0x1000 / 4]; /* 0x02{0000,,,7FFF} */
187 uint64_t d[0x1000 / 8]; /* 0x02{0000,,,7FFF} */
188 union {
189 uint8_t c[0x100 / 1];
190 uint16_t s[0x100 / 2];
191 uint32_t l[0x100 / 4];
192 uint64_t d[0x100 / 8];
193 } f[8];
194 } cp_type0_cfg_dev[7]; /* 0x02{1000,,,7FFF} */
195
196 /* 0x028000-0x028FFF -- PCI Type 1 Configuration Space */
197 union {
198 uint8_t c[0x1000 / 1]; /* 0x028000-0x029000 */
199 uint16_t s[0x1000 / 2]; /* 0x028000-0x029000 */
200 uint32_t l[0x1000 / 4]; /* 0x028000-0x029000 */
201 uint64_t d[0x1000 / 8]; /* 0x028000-0x029000 */
202 union {
203 uint8_t c[0x100 / 1];
204 uint16_t s[0x100 / 2];
205 uint32_t l[0x100 / 4];
206 uint64_t d[0x100 / 8];
207 } f[8];
208 } cp_type1_cfg; /* 0x028000-0x029000 */
209
210 char _pad_029000[0x030000-0x029000];
211
212 /* 0x030000-0x030007 -- PCI Interrupt Acknowledge Cycle */
213 union {
214 uint8_t c[8 / 1];
215 uint16_t s[8 / 2];
216 uint32_t l[8 / 4];
217 uint64_t d[8 / 8];
218 } cp_pci_iack; /* 0x030000-0x030007 */
219
220 char _pad_030007[0x040000-0x030008];
221
222 /* 0x040000-0x040007 -- PCIX Special Cycle */
223 union {
224 uint8_t c[8 / 1];
225 uint16_t s[8 / 2];
226 uint32_t l[8 / 4];
227 uint64_t d[8 / 8];
228 } cp_pcix_cycle; /* 0x040000-0x040007 */
229
230 char _pad_040007[0x200000-0x040008];
231
232 /* 0x200000-0x7FFFFF -- PCI/GIO Device Spaces */
233 union {
234 uint8_t c[0x100000 / 1];
235 uint16_t s[0x100000 / 2];
236 uint32_t l[0x100000 / 4];
237 uint64_t d[0x100000 / 8];
238 } cp_devio_raw[6]; /* 0x200000-0x7FFFFF */
239
240 #define cp_devio(n) cp_devio_raw[((n)<2)?(n*2):(n+2)]
241
242 char _pad_800000[0xA00000-0x800000];
243
244 /* 0xA00000-0xBFFFFF -- PCI/GIO Device Spaces w/flush */
245 union {
246 uint8_t c[0x100000 / 1];
247 uint16_t s[0x100000 / 2];
248 uint32_t l[0x100000 / 4];
249 uint64_t d[0x100000 / 8];
250 } cp_devio_raw_flush[6]; /* 0xA00000-0xBFFFFF */
251
252 #define cp_devio_flush(n) cp_devio_raw_flush[((n)<2)?(n*2):(n+2)]
253
254};
255
256#endif /* _ASM_IA64_SN_PCI_TIOCP_H */
diff --git a/arch/ia64/sn/include/xtalk/hubdev.h b/arch/ia64/sn/include/xtalk/hubdev.h
index 868e7ecae84b..580a1c0403a7 100644
--- a/arch/ia64/sn/include/xtalk/hubdev.h
+++ b/arch/ia64/sn/include/xtalk/hubdev.h
@@ -8,6 +8,8 @@
8#ifndef _ASM_IA64_SN_XTALK_HUBDEV_H 8#ifndef _ASM_IA64_SN_XTALK_HUBDEV_H
9#define _ASM_IA64_SN_XTALK_HUBDEV_H 9#define _ASM_IA64_SN_XTALK_HUBDEV_H
10 10
11#include "xtalk/xwidgetdev.h"
12
11#define HUB_WIDGET_ID_MAX 0xf 13#define HUB_WIDGET_ID_MAX 0xf
12#define DEV_PER_WIDGET (2*2*8) 14#define DEV_PER_WIDGET (2*2*8)
13#define IIO_ITTE_WIDGET_BITS 4 /* size of widget field */ 15#define IIO_ITTE_WIDGET_BITS 4 /* size of widget field */
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index 9e07f5463f21..a67f39e448cb 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -9,21 +9,28 @@
9#include <linux/bootmem.h> 9#include <linux/bootmem.h>
10#include <linux/nodemask.h> 10#include <linux/nodemask.h>
11#include <asm/sn/types.h> 11#include <asm/sn/types.h>
12#include <asm/sn/sn_sal.h>
13#include <asm/sn/addrs.h> 12#include <asm/sn/addrs.h>
14#include <asm/sn/pcibus_provider_defs.h>
15#include <asm/sn/pcidev.h>
16#include "pci/pcibr_provider.h"
17#include "xtalk/xwidgetdev.h"
18#include <asm/sn/geo.h> 13#include <asm/sn/geo.h>
19#include "xtalk/hubdev.h"
20#include <asm/sn/io.h> 14#include <asm/sn/io.h>
15#include <asm/sn/pcibr_provider.h>
16#include <asm/sn/pcibus_provider_defs.h>
17#include <asm/sn/pcidev.h>
21#include <asm/sn/simulator.h> 18#include <asm/sn/simulator.h>
19#include <asm/sn/sn_sal.h>
22#include <asm/sn/tioca_provider.h> 20#include <asm/sn/tioca_provider.h>
21#include "xtalk/hubdev.h"
22#include "xtalk/xwidgetdev.h"
23 23
24char master_baseio_wid;
25nasid_t master_nasid = INVALID_NASID; /* Partition Master */ 24nasid_t master_nasid = INVALID_NASID; /* Partition Master */
26 25
26static struct list_head sn_sysdata_list;
27
28/* sysdata list struct */
29struct sysdata_el {
30 struct list_head entry;
31 void *sysdata;
32};
33
27struct slab_info { 34struct slab_info {
28 struct hubdev_info hubdev; 35 struct hubdev_info hubdev;
29}; 36};
@@ -138,23 +145,6 @@ sal_get_pcidev_info(u64 segment, u64 bus_number, u64 devfn, u64 pci_dev,
138} 145}
139 146
140/* 147/*
141 * sn_alloc_pci_sysdata() - This routine allocates a pci controller
142 * which is expected as the pci_dev and pci_bus sysdata by the Linux
143 * PCI infrastructure.
144 */
145static inline struct pci_controller *sn_alloc_pci_sysdata(void)
146{
147 struct pci_controller *pci_sysdata;
148
149 pci_sysdata = kmalloc(sizeof(*pci_sysdata), GFP_KERNEL);
150 if (!pci_sysdata)
151 BUG();
152
153 memset(pci_sysdata, 0, sizeof(*pci_sysdata));
154 return pci_sysdata;
155}
156
157/*
158 * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for 148 * sn_fixup_ionodes() - This routine initializes the HUB data strcuture for
159 * each node in the system. 149 * each node in the system.
160 */ 150 */
@@ -221,22 +211,34 @@ static void sn_fixup_ionodes(void)
221 211
222} 212}
223 213
214void sn_pci_unfixup_slot(struct pci_dev *dev)
215{
216 struct pci_dev *host_pci_dev = SN_PCIDEV_INFO(dev)->host_pci_dev;
217
218 sn_irq_unfixup(dev);
219 pci_dev_put(host_pci_dev);
220 pci_dev_put(dev);
221}
222
224/* 223/*
225 * sn_pci_fixup_slot() - This routine sets up a slot's resources 224 * sn_pci_fixup_slot() - This routine sets up a slot's resources
226 * consistent with the Linux PCI abstraction layer. Resources acquired 225 * consistent with the Linux PCI abstraction layer. Resources acquired
227 * from our PCI provider include PIO maps to BAR space and interrupt 226 * from our PCI provider include PIO maps to BAR space and interrupt
228 * objects. 227 * objects.
229 */ 228 */
230static void sn_pci_fixup_slot(struct pci_dev *dev) 229void sn_pci_fixup_slot(struct pci_dev *dev)
231{ 230{
232 int idx; 231 int idx;
233 int segment = 0; 232 int segment = 0;
234 uint64_t size;
235 struct sn_irq_info *sn_irq_info;
236 struct pci_dev *host_pci_dev;
237 int status = 0; 233 int status = 0;
238 struct pcibus_bussoft *bs; 234 struct pcibus_bussoft *bs;
235 struct pci_bus *host_pci_bus;
236 struct pci_dev *host_pci_dev;
237 struct sn_irq_info *sn_irq_info;
238 unsigned long size;
239 unsigned int bus_no, devfn;
239 240
241 pci_dev_get(dev); /* for the sysdata pointer */
240 dev->sysdata = kmalloc(sizeof(struct pcidev_info), GFP_KERNEL); 242 dev->sysdata = kmalloc(sizeof(struct pcidev_info), GFP_KERNEL);
241 if (SN_PCIDEV_INFO(dev) <= 0) 243 if (SN_PCIDEV_INFO(dev) <= 0)
242 BUG(); /* Cannot afford to run out of memory */ 244 BUG(); /* Cannot afford to run out of memory */
@@ -253,7 +255,7 @@ static void sn_pci_fixup_slot(struct pci_dev *dev)
253 (u64) __pa(SN_PCIDEV_INFO(dev)), 255 (u64) __pa(SN_PCIDEV_INFO(dev)),
254 (u64) __pa(sn_irq_info)); 256 (u64) __pa(sn_irq_info));
255 if (status) 257 if (status)
256 BUG(); /* Cannot get platform pci device information information */ 258 BUG(); /* Cannot get platform pci device information */
257 259
258 /* Copy over PIO Mapped Addresses */ 260 /* Copy over PIO Mapped Addresses */
259 for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) { 261 for (idx = 0; idx <= PCI_ROM_RESOURCE; idx++) {
@@ -275,15 +277,21 @@ static void sn_pci_fixup_slot(struct pci_dev *dev)
275 dev->resource[idx].parent = &iomem_resource; 277 dev->resource[idx].parent = &iomem_resource;
276 } 278 }
277 279
278 /* set up host bus linkages */ 280 /*
279 bs = SN_PCIBUS_BUSSOFT(dev->bus); 281 * Using the PROMs values for the PCI host bus, get the Linux
280 host_pci_dev = 282 * PCI host_pci_dev struct and set up host bus linkages
281 pci_find_slot(SN_PCIDEV_INFO(dev)->pdi_slot_host_handle >> 32, 283 */
282 SN_PCIDEV_INFO(dev)-> 284
283 pdi_slot_host_handle & 0xffffffff); 285 bus_no = SN_PCIDEV_INFO(dev)->pdi_slot_host_handle >> 32;
286 devfn = SN_PCIDEV_INFO(dev)->pdi_slot_host_handle & 0xffffffff;
287 host_pci_bus = pci_find_bus(pci_domain_nr(dev->bus), bus_no);
288 host_pci_dev = pci_get_slot(host_pci_bus, devfn);
289
290 SN_PCIDEV_INFO(dev)->host_pci_dev = host_pci_dev;
284 SN_PCIDEV_INFO(dev)->pdi_host_pcidev_info = 291 SN_PCIDEV_INFO(dev)->pdi_host_pcidev_info =
285 SN_PCIDEV_INFO(host_pci_dev); 292 SN_PCIDEV_INFO(host_pci_dev);
286 SN_PCIDEV_INFO(dev)->pdi_linux_pcidev = dev; 293 SN_PCIDEV_INFO(dev)->pdi_linux_pcidev = dev;
294 bs = SN_PCIBUS_BUSSOFT(dev->bus);
287 SN_PCIDEV_INFO(dev)->pdi_pcibus_info = bs; 295 SN_PCIDEV_INFO(dev)->pdi_pcibus_info = bs;
288 296
289 if (bs && bs->bs_asic_type < PCIIO_ASIC_MAX_TYPES) { 297 if (bs && bs->bs_asic_type < PCIIO_ASIC_MAX_TYPES) {
@@ -297,6 +305,9 @@ static void sn_pci_fixup_slot(struct pci_dev *dev)
297 SN_PCIDEV_INFO(dev)->pdi_sn_irq_info = sn_irq_info; 305 SN_PCIDEV_INFO(dev)->pdi_sn_irq_info = sn_irq_info;
298 dev->irq = SN_PCIDEV_INFO(dev)->pdi_sn_irq_info->irq_irq; 306 dev->irq = SN_PCIDEV_INFO(dev)->pdi_sn_irq_info->irq_irq;
299 sn_irq_fixup(dev, sn_irq_info); 307 sn_irq_fixup(dev, sn_irq_info);
308 } else {
309 SN_PCIDEV_INFO(dev)->pdi_sn_irq_info = NULL;
310 kfree(sn_irq_info);
300 } 311 }
301} 312}
302 313
@@ -304,55 +315,57 @@ static void sn_pci_fixup_slot(struct pci_dev *dev)
304 * sn_pci_controller_fixup() - This routine sets up a bus's resources 315 * sn_pci_controller_fixup() - This routine sets up a bus's resources
305 * consistent with the Linux PCI abstraction layer. 316 * consistent with the Linux PCI abstraction layer.
306 */ 317 */
307static void sn_pci_controller_fixup(int segment, int busnum) 318void sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
308{ 319{
309 int status = 0; 320 int status = 0;
310 int nasid, cnode; 321 int nasid, cnode;
311 struct pci_bus *bus;
312 struct pci_controller *controller; 322 struct pci_controller *controller;
313 struct pcibus_bussoft *prom_bussoft_ptr; 323 struct pcibus_bussoft *prom_bussoft_ptr;
314 struct hubdev_info *hubdev_info; 324 struct hubdev_info *hubdev_info;
315 void *provider_soft; 325 void *provider_soft;
316 struct sn_pcibus_provider *provider; 326 struct sn_pcibus_provider *provider;
317 327
318 status = 328 status = sal_get_pcibus_info((u64) segment, (u64) busnum,
319 sal_get_pcibus_info((u64) segment, (u64) busnum, 329 (u64) ia64_tpa(&prom_bussoft_ptr));
320 (u64) ia64_tpa(&prom_bussoft_ptr)); 330 if (status > 0)
321 if (status > 0) { 331 return; /*bus # does not exist */
322 return; /* bus # does not exist */
323 }
324
325 prom_bussoft_ptr = __va(prom_bussoft_ptr); 332 prom_bussoft_ptr = __va(prom_bussoft_ptr);
326 controller = sn_alloc_pci_sysdata();
327 /* controller non-zero is BUG'd in sn_alloc_pci_sysdata */
328 333
329 bus = pci_scan_bus(busnum, &pci_root_ops, controller); 334 controller = kcalloc(1,sizeof(struct pci_controller), GFP_KERNEL);
335 if (!controller)
336 BUG();
337
330 if (bus == NULL) { 338 if (bus == NULL) {
331 return; /* error, or bus already scanned */ 339 bus = pci_scan_bus(busnum, &pci_root_ops, controller);
340 if (bus == NULL)
341 return; /* error, or bus already scanned */
342 bus->sysdata = NULL;
332 } 343 }
333 344
345 if (bus->sysdata)
346 goto error_return; /* sysdata already alloc'd */
347
334 /* 348 /*
335 * Per-provider fixup. Copies the contents from prom to local 349 * Per-provider fixup. Copies the contents from prom to local
336 * area and links SN_PCIBUS_BUSSOFT(). 350 * area and links SN_PCIBUS_BUSSOFT().
337 */ 351 */
338 352
339 if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES) { 353 if (prom_bussoft_ptr->bs_asic_type >= PCIIO_ASIC_MAX_TYPES)
340 return; /* unsupported asic type */ 354 return; /* unsupported asic type */
341 } 355
356 if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB)
357 goto error_return; /* no further fixup necessary */
342 358
343 provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type]; 359 provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type];
344 if (provider == NULL) { 360 if (provider == NULL)
345 return; /* no provider registerd for this asic */ 361 return; /* no provider registerd for this asic */
346 }
347 362
348 provider_soft = NULL; 363 provider_soft = NULL;
349 if (provider->bus_fixup) { 364 if (provider->bus_fixup)
350 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr); 365 provider_soft = (*provider->bus_fixup) (prom_bussoft_ptr);
351 }
352 366
353 if (provider_soft == NULL) { 367 if (provider_soft == NULL)
354 return; /* fixup failed or not applicable */ 368 return; /* fixup failed or not applicable */
355 }
356 369
357 /* 370 /*
358 * Generic bus fixup goes here. Don't reference prom_bussoft_ptr 371 * Generic bus fixup goes here. Don't reference prom_bussoft_ptr
@@ -361,12 +374,47 @@ static void sn_pci_controller_fixup(int segment, int busnum)
361 374
362 bus->sysdata = controller; 375 bus->sysdata = controller;
363 PCI_CONTROLLER(bus)->platform_data = provider_soft; 376 PCI_CONTROLLER(bus)->platform_data = provider_soft;
364
365 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base); 377 nasid = NASID_GET(SN_PCIBUS_BUSSOFT(bus)->bs_base);
366 cnode = nasid_to_cnodeid(nasid); 378 cnode = nasid_to_cnodeid(nasid);
367 hubdev_info = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo); 379 hubdev_info = (struct hubdev_info *)(NODEPDA(cnode)->pdinfo);
368 SN_PCIBUS_BUSSOFT(bus)->bs_xwidget_info = 380 SN_PCIBUS_BUSSOFT(bus)->bs_xwidget_info =
369 &(hubdev_info->hdi_xwidget_info[SN_PCIBUS_BUSSOFT(bus)->bs_xid]); 381 &(hubdev_info->hdi_xwidget_info[SN_PCIBUS_BUSSOFT(bus)->bs_xid]);
382
383 return;
384
385error_return:
386
387 kfree(controller);
388 return;
389}
390
391void sn_bus_store_sysdata(struct pci_dev *dev)
392{
393 struct sysdata_el *element;
394
395 element = kcalloc(1, sizeof(struct sysdata_el), GFP_KERNEL);
396 if (!element) {
397 dev_dbg(dev, "%s: out of memory!\n", __FUNCTION__);
398 return;
399 }
400 element->sysdata = dev->sysdata;
401 list_add(&element->entry, &sn_sysdata_list);
402}
403
404void sn_bus_free_sysdata(void)
405{
406 struct sysdata_el *element;
407 struct list_head *list;
408
409sn_sysdata_free_start:
410 list_for_each(list, &sn_sysdata_list) {
411 element = list_entry(list, struct sysdata_el, entry);
412 list_del(&element->entry);
413 kfree(element->sysdata);
414 kfree(element);
415 goto sn_sysdata_free_start;
416 }
417 return;
370} 418}
371 419
372/* 420/*
@@ -384,7 +432,7 @@ static int __init sn_pci_init(void)
384 extern void register_sn_procfs(void); 432 extern void register_sn_procfs(void);
385#endif 433#endif
386 434
387 if (!ia64_platform_is("sn2") || IS_RUNNING_ON_SIMULATOR()) 435 if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
388 return 0; 436 return 0;
389 437
390 /* 438 /*
@@ -403,20 +451,17 @@ static int __init sn_pci_init(void)
403 */ 451 */
404 ia64_max_iommu_merge_mask = ~PAGE_MASK; 452 ia64_max_iommu_merge_mask = ~PAGE_MASK;
405 sn_fixup_ionodes(); 453 sn_fixup_ionodes();
406 sn_irq = kmalloc(sizeof(struct sn_irq_info *) * NR_IRQS, GFP_KERNEL); 454 sn_irq_lh_init();
407 if (sn_irq <= 0) 455 INIT_LIST_HEAD(&sn_sysdata_list);
408 BUG(); /* Canno afford to run out of memory. */
409 memset(sn_irq, 0, sizeof(struct sn_irq_info *) * NR_IRQS);
410
411 sn_init_cpei_timer(); 456 sn_init_cpei_timer();
412 457
413#ifdef CONFIG_PROC_FS 458#ifdef CONFIG_PROC_FS
414 register_sn_procfs(); 459 register_sn_procfs();
415#endif 460#endif
416 461
417 for (i = 0; i < PCI_BUSES_TO_SCAN; i++) { 462 /* busses are not known yet ... */
418 sn_pci_controller_fixup(0, i); 463 for (i = 0; i < PCI_BUSES_TO_SCAN; i++)
419 } 464 sn_pci_controller_fixup(0, i, NULL);
420 465
421 /* 466 /*
422 * Generic Linux PCI Layer has created the pci_bus and pci_dev 467 * Generic Linux PCI Layer has created the pci_bus and pci_dev
@@ -425,9 +470,8 @@ static int __init sn_pci_init(void)
425 */ 470 */
426 471
427 while ((pci_dev = 472 while ((pci_dev =
428 pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pci_dev)) != NULL) { 473 pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pci_dev)) != NULL)
429 sn_pci_fixup_slot(pci_dev); 474 sn_pci_fixup_slot(pci_dev);
430 }
431 475
432 sn_ioif_inited = 1; /* sn I/O infrastructure now initialized */ 476 sn_ioif_inited = 1; /* sn I/O infrastructure now initialized */
433 477
@@ -469,3 +513,8 @@ cnodeid_get_geoid(cnodeid_t cnode)
469} 513}
470 514
471subsys_initcall(sn_pci_init); 515subsys_initcall(sn_pci_init);
516EXPORT_SYMBOL(sn_pci_fixup_slot);
517EXPORT_SYMBOL(sn_pci_unfixup_slot);
518EXPORT_SYMBOL(sn_pci_controller_fixup);
519EXPORT_SYMBOL(sn_bus_store_sysdata);
520EXPORT_SYMBOL(sn_bus_free_sysdata);
diff --git a/arch/ia64/sn/kernel/iomv.c b/arch/ia64/sn/kernel/iomv.c
index fec6d8b8237b..7ce3cdad627b 100644
--- a/arch/ia64/sn/kernel/iomv.c
+++ b/arch/ia64/sn/kernel/iomv.c
@@ -9,12 +9,16 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <asm/io.h> 10#include <asm/io.h>
11#include <asm/delay.h> 11#include <asm/delay.h>
12#include <asm/vga.h>
12#include <asm/sn/nodepda.h> 13#include <asm/sn/nodepda.h>
13#include <asm/sn/simulator.h> 14#include <asm/sn/simulator.h>
14#include <asm/sn/pda.h> 15#include <asm/sn/pda.h>
15#include <asm/sn/sn_cpuid.h> 16#include <asm/sn/sn_cpuid.h>
16#include <asm/sn/shub_mmr.h> 17#include <asm/sn/shub_mmr.h>
17 18
19#define IS_LEGACY_VGA_IOPORT(p) \
20 (((p) >= 0x3b0 && (p) <= 0x3bb) || ((p) >= 0x3c0 && (p) <= 0x3df))
21
18/** 22/**
19 * sn_io_addr - convert an in/out port to an i/o address 23 * sn_io_addr - convert an in/out port to an i/o address
20 * @port: port to convert 24 * @port: port to convert
@@ -26,6 +30,8 @@
26void *sn_io_addr(unsigned long port) 30void *sn_io_addr(unsigned long port)
27{ 31{
28 if (!IS_RUNNING_ON_SIMULATOR()) { 32 if (!IS_RUNNING_ON_SIMULATOR()) {
33 if (IS_LEGACY_VGA_IOPORT(port))
34 port += vga_console_iobase;
29 /* On sn2, legacy I/O ports don't point at anything */ 35 /* On sn2, legacy I/O ports don't point at anything */
30 if (port < (64 * 1024)) 36 if (port < (64 * 1024))
31 return NULL; 37 return NULL;
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 0f4e8138658f..84d276a14ecb 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -9,13 +9,13 @@
9 */ 9 */
10 10
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <asm/sn/intr.h> 12#include <linux/spinlock.h>
13#include <asm/sn/addrs.h> 13#include <asm/sn/addrs.h>
14#include <asm/sn/arch.h> 14#include <asm/sn/arch.h>
15#include "xtalk/xwidgetdev.h" 15#include <asm/sn/intr.h>
16#include <asm/sn/pcibr_provider.h>
16#include <asm/sn/pcibus_provider_defs.h> 17#include <asm/sn/pcibus_provider_defs.h>
17#include <asm/sn/pcidev.h> 18#include <asm/sn/pcidev.h>
18#include "pci/pcibr_provider.h"
19#include <asm/sn/shub_mmr.h> 19#include <asm/sn/shub_mmr.h>
20#include <asm/sn/sn_sal.h> 20#include <asm/sn/sn_sal.h>
21 21
@@ -25,7 +25,8 @@ static void unregister_intr_pda(struct sn_irq_info *sn_irq_info);
25 25
26extern int sn_force_interrupt_flag; 26extern int sn_force_interrupt_flag;
27extern int sn_ioif_inited; 27extern int sn_ioif_inited;
28struct sn_irq_info **sn_irq; 28static struct list_head **sn_irq_lh;
29static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */
29 30
30static inline uint64_t sn_intr_alloc(nasid_t local_nasid, int local_widget, 31static inline uint64_t sn_intr_alloc(nasid_t local_nasid, int local_widget,
31 u64 sn_irq_info, 32 u64 sn_irq_info,
@@ -101,7 +102,7 @@ static void sn_end_irq(unsigned int irq)
101 nasid = get_nasid(); 102 nasid = get_nasid();
102 event_occurred = HUB_L((uint64_t *) GLOBAL_MMR_ADDR 103 event_occurred = HUB_L((uint64_t *) GLOBAL_MMR_ADDR
103 (nasid, SH_EVENT_OCCURRED)); 104 (nasid, SH_EVENT_OCCURRED));
104 /* If the UART bit is set here, we may have received an 105 /* If the UART bit is set here, we may have received an
105 * interrupt from the UART that the driver missed. To 106 * interrupt from the UART that the driver missed. To
106 * make sure, we IPI ourselves to force us to look again. 107 * make sure, we IPI ourselves to force us to look again.
107 */ 108 */
@@ -115,82 +116,84 @@ static void sn_end_irq(unsigned int irq)
115 force_interrupt(irq); 116 force_interrupt(irq);
116} 117}
117 118
119static void sn_irq_info_free(struct rcu_head *head);
120
118static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) 121static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask)
119{ 122{
120 struct sn_irq_info *sn_irq_info = sn_irq[irq]; 123 struct sn_irq_info *sn_irq_info, *sn_irq_info_safe;
121 struct sn_irq_info *tmp_sn_irq_info;
122 int cpuid, cpuphys; 124 int cpuid, cpuphys;
123 nasid_t t_nasid; /* nasid to target */
124 int t_slice; /* slice to target */
125
126 /* allocate a temp sn_irq_info struct to get new target info */
127 tmp_sn_irq_info = kmalloc(sizeof(*tmp_sn_irq_info), GFP_KERNEL);
128 if (!tmp_sn_irq_info)
129 return;
130 125
131 cpuid = first_cpu(mask); 126 cpuid = first_cpu(mask);
132 cpuphys = cpu_physical_id(cpuid); 127 cpuphys = cpu_physical_id(cpuid);
133 t_nasid = cpuid_to_nasid(cpuid);
134 t_slice = cpuid_to_slice(cpuid);
135 128
136 while (sn_irq_info) { 129 list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe,
137 int status; 130 sn_irq_lh[irq], list) {
138 int local_widget; 131 uint64_t bridge;
139 uint64_t bridge = (uint64_t) sn_irq_info->irq_bridge; 132 int local_widget, status;
140 nasid_t local_nasid = NASID_GET(bridge); 133 nasid_t local_nasid;
134 struct sn_irq_info *new_irq_info;
135
136 new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC);
137 if (new_irq_info == NULL)
138 break;
139 memcpy(new_irq_info, sn_irq_info, sizeof(struct sn_irq_info));
140
141 bridge = (uint64_t) new_irq_info->irq_bridge;
142 if (!bridge) {
143 kfree(new_irq_info);
144 break; /* irq is not a device interrupt */
145 }
141 146
142 if (!bridge) 147 local_nasid = NASID_GET(bridge);
143 break; /* irq is not a device interrupt */
144 148
145 if (local_nasid & 1) 149 if (local_nasid & 1)
146 local_widget = TIO_SWIN_WIDGETNUM(bridge); 150 local_widget = TIO_SWIN_WIDGETNUM(bridge);
147 else 151 else
148 local_widget = SWIN_WIDGETNUM(bridge); 152 local_widget = SWIN_WIDGETNUM(bridge);
149 153
150 /* Free the old PROM sn_irq_info structure */ 154 /* Free the old PROM new_irq_info structure */
151 sn_intr_free(local_nasid, local_widget, sn_irq_info); 155 sn_intr_free(local_nasid, local_widget, new_irq_info);
156 /* Update kernels new_irq_info with new target info */
157 unregister_intr_pda(new_irq_info);
152 158
153 /* allocate a new PROM sn_irq_info struct */ 159 /* allocate a new PROM new_irq_info struct */
154 status = sn_intr_alloc(local_nasid, local_widget, 160 status = sn_intr_alloc(local_nasid, local_widget,
155 __pa(tmp_sn_irq_info), irq, t_nasid, 161 __pa(new_irq_info), irq,
156 t_slice); 162 cpuid_to_nasid(cpuid),
157 163 cpuid_to_slice(cpuid));
158 if (status == 0) { 164
159 /* Update kernels sn_irq_info with new target info */ 165 /* SAL call failed */
160 unregister_intr_pda(sn_irq_info); 166 if (status) {
161 sn_irq_info->irq_cpuid = cpuid; 167 kfree(new_irq_info);
162 sn_irq_info->irq_nasid = t_nasid; 168 break;
163 sn_irq_info->irq_slice = t_slice; 169 }
164 sn_irq_info->irq_xtalkaddr = 170
165 tmp_sn_irq_info->irq_xtalkaddr; 171 new_irq_info->irq_cpuid = cpuid;
166 sn_irq_info->irq_cookie = tmp_sn_irq_info->irq_cookie; 172 register_intr_pda(new_irq_info);
167 register_intr_pda(sn_irq_info); 173
168 174 if (IS_PCI_BRIDGE_ASIC(new_irq_info->irq_bridge_type))
169 if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type)) { 175 pcibr_change_devices_irq(new_irq_info);
170 pcibr_change_devices_irq(sn_irq_info);
171 }
172 176
173 sn_irq_info = sn_irq_info->irq_next; 177 spin_lock(&sn_irq_info_lock);
178 list_replace_rcu(&sn_irq_info->list, &new_irq_info->list);
179 spin_unlock(&sn_irq_info_lock);
180 call_rcu(&sn_irq_info->rcu, sn_irq_info_free);
174 181
175#ifdef CONFIG_SMP 182#ifdef CONFIG_SMP
176 set_irq_affinity_info((irq & 0xff), cpuphys, 0); 183 set_irq_affinity_info((irq & 0xff), cpuphys, 0);
177#endif 184#endif
178 } else {
179 break; /* snp_affinity failed the intr_alloc */
180 }
181 } 185 }
182 kfree(tmp_sn_irq_info);
183} 186}
184 187
185struct hw_interrupt_type irq_type_sn = { 188struct hw_interrupt_type irq_type_sn = {
186 "SN hub", 189 .typename = "SN hub",
187 sn_startup_irq, 190 .startup = sn_startup_irq,
188 sn_shutdown_irq, 191 .shutdown = sn_shutdown_irq,
189 sn_enable_irq, 192 .enable = sn_enable_irq,
190 sn_disable_irq, 193 .disable = sn_disable_irq,
191 sn_ack_irq, 194 .ack = sn_ack_irq,
192 sn_end_irq, 195 .end = sn_end_irq,
193 sn_set_affinity_irq 196 .set_affinity = sn_set_affinity_irq
194}; 197};
195 198
196unsigned int sn_local_vector_to_irq(u8 vector) 199unsigned int sn_local_vector_to_irq(u8 vector)
@@ -231,19 +234,18 @@ static void unregister_intr_pda(struct sn_irq_info *sn_irq_info)
231 struct sn_irq_info *tmp_irq_info; 234 struct sn_irq_info *tmp_irq_info;
232 int i, foundmatch; 235 int i, foundmatch;
233 236
237 rcu_read_lock();
234 if (pdacpu(cpu)->sn_last_irq == irq) { 238 if (pdacpu(cpu)->sn_last_irq == irq) {
235 foundmatch = 0; 239 foundmatch = 0;
236 for (i = pdacpu(cpu)->sn_last_irq - 1; i; i--) { 240 for (i = pdacpu(cpu)->sn_last_irq - 1;
237 tmp_irq_info = sn_irq[i]; 241 i && !foundmatch; i--) {
238 while (tmp_irq_info) { 242 list_for_each_entry_rcu(tmp_irq_info,
243 sn_irq_lh[i],
244 list) {
239 if (tmp_irq_info->irq_cpuid == cpu) { 245 if (tmp_irq_info->irq_cpuid == cpu) {
240 foundmatch++; 246 foundmatch = 1;
241 break; 247 break;
242 } 248 }
243 tmp_irq_info = tmp_irq_info->irq_next;
244 }
245 if (foundmatch) {
246 break;
247 } 249 }
248 } 250 }
249 pdacpu(cpu)->sn_last_irq = i; 251 pdacpu(cpu)->sn_last_irq = i;
@@ -251,60 +253,27 @@ static void unregister_intr_pda(struct sn_irq_info *sn_irq_info)
251 253
252 if (pdacpu(cpu)->sn_first_irq == irq) { 254 if (pdacpu(cpu)->sn_first_irq == irq) {
253 foundmatch = 0; 255 foundmatch = 0;
254 for (i = pdacpu(cpu)->sn_first_irq + 1; i < NR_IRQS; i++) { 256 for (i = pdacpu(cpu)->sn_first_irq + 1;
255 tmp_irq_info = sn_irq[i]; 257 i < NR_IRQS && !foundmatch; i++) {
256 while (tmp_irq_info) { 258 list_for_each_entry_rcu(tmp_irq_info,
259 sn_irq_lh[i],
260 list) {
257 if (tmp_irq_info->irq_cpuid == cpu) { 261 if (tmp_irq_info->irq_cpuid == cpu) {
258 foundmatch++; 262 foundmatch = 1;
259 break; 263 break;
260 } 264 }
261 tmp_irq_info = tmp_irq_info->irq_next;
262 }
263 if (foundmatch) {
264 break;
265 } 265 }
266 } 266 }
267 pdacpu(cpu)->sn_first_irq = ((i == NR_IRQS) ? 0 : i); 267 pdacpu(cpu)->sn_first_irq = ((i == NR_IRQS) ? 0 : i);
268 } 268 }
269 rcu_read_unlock();
269} 270}
270 271
271struct sn_irq_info *sn_irq_alloc(nasid_t local_nasid, int local_widget, int irq, 272static void sn_irq_info_free(struct rcu_head *head)
272 nasid_t nasid, int slice)
273{ 273{
274 struct sn_irq_info *sn_irq_info; 274 struct sn_irq_info *sn_irq_info;
275 int status;
276
277 sn_irq_info = kmalloc(sizeof(*sn_irq_info), GFP_KERNEL);
278 if (sn_irq_info == NULL)
279 return NULL;
280
281 memset(sn_irq_info, 0x0, sizeof(*sn_irq_info));
282
283 status =
284 sn_intr_alloc(local_nasid, local_widget, __pa(sn_irq_info), irq,
285 nasid, slice);
286
287 if (status) {
288 kfree(sn_irq_info);
289 return NULL;
290 } else {
291 return sn_irq_info;
292 }
293}
294
295void sn_irq_free(struct sn_irq_info *sn_irq_info)
296{
297 uint64_t bridge = (uint64_t) sn_irq_info->irq_bridge;
298 nasid_t local_nasid = NASID_GET(bridge);
299 int local_widget;
300
301 if (local_nasid & 1) /* tio check */
302 local_widget = TIO_SWIN_WIDGETNUM(bridge);
303 else
304 local_widget = SWIN_WIDGETNUM(bridge);
305
306 sn_intr_free(local_nasid, local_widget, sn_irq_info);
307 275
276 sn_irq_info = container_of(head, struct sn_irq_info, rcu);
308 kfree(sn_irq_info); 277 kfree(sn_irq_info);
309} 278}
310 279
@@ -314,30 +283,54 @@ void sn_irq_fixup(struct pci_dev *pci_dev, struct sn_irq_info *sn_irq_info)
314 int slice = sn_irq_info->irq_slice; 283 int slice = sn_irq_info->irq_slice;
315 int cpu = nasid_slice_to_cpuid(nasid, slice); 284 int cpu = nasid_slice_to_cpuid(nasid, slice);
316 285
286 pci_dev_get(pci_dev);
317 sn_irq_info->irq_cpuid = cpu; 287 sn_irq_info->irq_cpuid = cpu;
318 sn_irq_info->irq_pciioinfo = SN_PCIDEV_INFO(pci_dev); 288 sn_irq_info->irq_pciioinfo = SN_PCIDEV_INFO(pci_dev);
319 289
320 /* link it into the sn_irq[irq] list */ 290 /* link it into the sn_irq[irq] list */
321 sn_irq_info->irq_next = sn_irq[sn_irq_info->irq_irq]; 291 spin_lock(&sn_irq_info_lock);
322 sn_irq[sn_irq_info->irq_irq] = sn_irq_info; 292 list_add_rcu(&sn_irq_info->list, sn_irq_lh[sn_irq_info->irq_irq]);
293 spin_unlock(&sn_irq_info_lock);
323 294
324 (void)register_intr_pda(sn_irq_info); 295 (void)register_intr_pda(sn_irq_info);
325} 296}
326 297
298void sn_irq_unfixup(struct pci_dev *pci_dev)
299{
300 struct sn_irq_info *sn_irq_info;
301
302 /* Only cleanup IRQ stuff if this device has a host bus context */
303 if (!SN_PCIDEV_BUSSOFT(pci_dev))
304 return;
305
306 sn_irq_info = SN_PCIDEV_INFO(pci_dev)->pdi_sn_irq_info;
307 if (!sn_irq_info || !sn_irq_info->irq_irq) {
308 kfree(sn_irq_info);
309 return;
310 }
311
312 unregister_intr_pda(sn_irq_info);
313 spin_lock(&sn_irq_info_lock);
314 list_del_rcu(&sn_irq_info->list);
315 spin_unlock(&sn_irq_info_lock);
316 call_rcu(&sn_irq_info->rcu, sn_irq_info_free);
317 pci_dev_put(pci_dev);
318}
319
327static void force_interrupt(int irq) 320static void force_interrupt(int irq)
328{ 321{
329 struct sn_irq_info *sn_irq_info; 322 struct sn_irq_info *sn_irq_info;
330 323
331 if (!sn_ioif_inited) 324 if (!sn_ioif_inited)
332 return; 325 return;
333 sn_irq_info = sn_irq[irq]; 326
334 while (sn_irq_info) { 327 rcu_read_lock();
328 list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[irq], list) {
335 if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type) && 329 if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type) &&
336 (sn_irq_info->irq_bridge != NULL)) { 330 (sn_irq_info->irq_bridge != NULL))
337 pcibr_force_interrupt(sn_irq_info); 331 pcibr_force_interrupt(sn_irq_info);
338 }
339 sn_irq_info = sn_irq_info->irq_next;
340 } 332 }
333 rcu_read_unlock();
341} 334}
342 335
343/* 336/*
@@ -402,19 +395,41 @@ static void sn_check_intr(int irq, struct sn_irq_info *sn_irq_info)
402 395
403void sn_lb_int_war_check(void) 396void sn_lb_int_war_check(void)
404{ 397{
398 struct sn_irq_info *sn_irq_info;
405 int i; 399 int i;
406 400
407 if (!sn_ioif_inited || pda->sn_first_irq == 0) 401 if (!sn_ioif_inited || pda->sn_first_irq == 0)
408 return; 402 return;
403
404 rcu_read_lock();
409 for (i = pda->sn_first_irq; i <= pda->sn_last_irq; i++) { 405 for (i = pda->sn_first_irq; i <= pda->sn_last_irq; i++) {
410 struct sn_irq_info *sn_irq_info = sn_irq[i]; 406 list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[i], list) {
411 while (sn_irq_info) { 407 /*
412 /* Only call for PCI bridges that are fully initialized. */ 408 * Only call for PCI bridges that are fully
409 * initialized.
410 */
413 if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type) && 411 if (IS_PCI_BRIDGE_ASIC(sn_irq_info->irq_bridge_type) &&
414 (sn_irq_info->irq_bridge != NULL)) { 412 (sn_irq_info->irq_bridge != NULL))
415 sn_check_intr(i, sn_irq_info); 413 sn_check_intr(i, sn_irq_info);
416 }
417 sn_irq_info = sn_irq_info->irq_next;
418 } 414 }
419 } 415 }
416 rcu_read_unlock();
417}
418
419void sn_irq_lh_init(void)
420{
421 int i;
422
423 sn_irq_lh = kmalloc(sizeof(struct list_head *) * NR_IRQS, GFP_KERNEL);
424 if (!sn_irq_lh)
425 panic("SN PCI INIT: Failed to allocate memory for PCI init\n");
426
427 for (i = 0; i < NR_IRQS; i++) {
428 sn_irq_lh[i] = kmalloc(sizeof(struct list_head), GFP_KERNEL);
429 if (!sn_irq_lh[i])
430 panic("SN PCI INIT: Failed IRQ memory allocation\n");
431
432 INIT_LIST_HEAD(sn_irq_lh[i]);
433 }
434
420} 435}
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 44bfc7f318cb..7c7fe441d623 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -36,6 +36,7 @@
36#include <asm/machvec.h> 36#include <asm/machvec.h>
37#include <asm/system.h> 37#include <asm/system.h>
38#include <asm/processor.h> 38#include <asm/processor.h>
39#include <asm/vga.h>
39#include <asm/sn/arch.h> 40#include <asm/sn/arch.h>
40#include <asm/sn/addrs.h> 41#include <asm/sn/addrs.h>
41#include <asm/sn/pda.h> 42#include <asm/sn/pda.h>
@@ -95,6 +96,7 @@ u8 sn_coherency_id;
95EXPORT_SYMBOL(sn_coherency_id); 96EXPORT_SYMBOL(sn_coherency_id);
96u8 sn_region_size; 97u8 sn_region_size;
97EXPORT_SYMBOL(sn_region_size); 98EXPORT_SYMBOL(sn_region_size);
99int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */
98 100
99short physical_node_map[MAX_PHYSNODE_ID]; 101short physical_node_map[MAX_PHYSNODE_ID];
100 102
@@ -268,19 +270,22 @@ void __init sn_setup(char **cmdline_p)
268{ 270{
269 long status, ticks_per_sec, drift; 271 long status, ticks_per_sec, drift;
270 int pxm; 272 int pxm;
271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); 273 u32 version = sn_sal_rev();
272 extern void sn_cpu_init(void); 274 extern void sn_cpu_init(void);
273 275
274 ia64_sn_plat_set_error_handling_features(); 276 ia64_sn_plat_set_error_handling_features();
275 277
278#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
276 /* 279 /*
277 * If the generic code has enabled vga console support - lets 280 * If there was a primary vga adapter identified through the
278 * get rid of it again. This is a kludge for the fact that ACPI 281 * EFI PCDP table, make it the preferred console. Otherwise
279 * currtently has no way of informing us if legacy VGA is available 282 * zero out conswitchp.
280 * or not.
281 */ 283 */
282#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) 284
283 if (conswitchp == &vga_con) { 285 if (vga_console_membase) {
286 /* usable vga ... make tty0 the preferred default console */
287 add_preferred_console("tty", 0, NULL);
288 } else {
284 printk(KERN_DEBUG "SGI: Disabling VGA console\n"); 289 printk(KERN_DEBUG "SGI: Disabling VGA console\n");
285#ifdef CONFIG_DUMMY_CONSOLE 290#ifdef CONFIG_DUMMY_CONSOLE
286 conswitchp = &dummy_con; 291 conswitchp = &dummy_con;
@@ -303,22 +308,21 @@ void __init sn_setup(char **cmdline_p)
303 * support here so we don't have to listen to failed keyboard probe 308 * support here so we don't have to listen to failed keyboard probe
304 * messages. 309 * messages.
305 */ 310 */
306 if ((major < 2 || (major == 2 && minor <= 9)) && 311 if (version <= 0x0209 && acpi_kbd_controller_present) {
307 acpi_kbd_controller_present) {
308 printk(KERN_INFO "Disabling legacy keyboard support as prom " 312 printk(KERN_INFO "Disabling legacy keyboard support as prom "
309 "is too old and doesn't provide FADT\n"); 313 "is too old and doesn't provide FADT\n");
310 acpi_kbd_controller_present = 0; 314 acpi_kbd_controller_present = 0;
311 } 315 }
312 316
313 printk("SGI SAL version %x.%02x\n", major, minor); 317 printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF);
314 318
315 /* 319 /*
316 * Confirm the SAL we're running on is recent enough... 320 * Confirm the SAL we're running on is recent enough...
317 */ 321 */
318 if ((major < SN_SAL_MIN_MAJOR) || (major == SN_SAL_MIN_MAJOR && 322 if (version < SN_SAL_MIN_VERSION) {
319 minor < SN_SAL_MIN_MINOR)) {
320 printk(KERN_ERR "This kernel needs SGI SAL version >= " 323 printk(KERN_ERR "This kernel needs SGI SAL version >= "
321 "%x.%02x\n", SN_SAL_MIN_MAJOR, SN_SAL_MIN_MINOR); 324 "%x.%02x\n", SN_SAL_MIN_VERSION >> 8,
325 SN_SAL_MIN_VERSION & 0x00FF);
322 panic("PROM version too old\n"); 326 panic("PROM version too old\n");
323 } 327 }
324 328
@@ -350,7 +354,7 @@ void __init sn_setup(char **cmdline_p)
350 354
351 ia64_mark_idle = &snidle; 355 ia64_mark_idle = &snidle;
352 356
353 /* 357 /*
354 * For the bootcpu, we do this here. All other cpus will make the 358 * For the bootcpu, we do this here. All other cpus will make the
355 * call as part of cpu_init in slave cpu initialization. 359 * call as part of cpu_init in slave cpu initialization.
356 */ 360 */
@@ -397,7 +401,7 @@ static void __init sn_init_pdas(char **cmdline_p)
397 nodepdaindr[cnode] = 401 nodepdaindr[cnode] =
398 alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t)); 402 alloc_bootmem_node(NODE_DATA(cnode), sizeof(nodepda_t));
399 memset(nodepdaindr[cnode], 0, sizeof(nodepda_t)); 403 memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
400 memset(nodepdaindr[cnode]->phys_cpuid, -1, 404 memset(nodepdaindr[cnode]->phys_cpuid, -1,
401 sizeof(nodepdaindr[cnode]->phys_cpuid)); 405 sizeof(nodepdaindr[cnode]->phys_cpuid));
402 } 406 }
403 407
@@ -427,7 +431,7 @@ static void __init sn_init_pdas(char **cmdline_p)
427 } 431 }
428 432
429 /* 433 /*
430 * Initialize the per node hubdev. This includes IO Nodes and 434 * Initialize the per node hubdev. This includes IO Nodes and
431 * headless/memless nodes. 435 * headless/memless nodes.
432 */ 436 */
433 for (cnode = 0; cnode < numionodes; cnode++) { 437 for (cnode = 0; cnode < numionodes; cnode++) {
@@ -455,6 +459,14 @@ void __init sn_cpu_init(void)
455 int i; 459 int i;
456 static int wars_have_been_checked; 460 static int wars_have_been_checked;
457 461
462 if (smp_processor_id() == 0 && IS_MEDUSA()) {
463 if (ia64_sn_is_fake_prom())
464 sn_prom_type = 2;
465 else
466 sn_prom_type = 1;
467 printk("Running on medusa with %s PROM\n", (sn_prom_type == 1) ? "real" : "fake");
468 }
469
458 memset(pda, 0, sizeof(pda)); 470 memset(pda, 0, sizeof(pda));
459 if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift, 471 if (ia64_sn_get_sn_info(0, &sn_hub_info->shub2, &sn_hub_info->nasid_bitmask, &sn_hub_info->nasid_shift,
460 &sn_system_size, &sn_sharing_domain_size, &sn_partition_id, 472 &sn_system_size, &sn_sharing_domain_size, &sn_partition_id,
@@ -520,7 +532,7 @@ void __init sn_cpu_init(void)
520 */ 532 */
521 { 533 {
522 u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0}; 534 u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, SH1_PIO_WRITE_STATUS_1, 0};
523 u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1, 535 u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1,
524 SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3}; 536 SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3};
525 u64 *pio; 537 u64 *pio;
526 pio = is_shub1() ? pio1 : pio2; 538 pio = is_shub1() ? pio1 : pio2;
@@ -552,6 +564,10 @@ static void __init scan_for_ionodes(void)
552 int nasid = 0; 564 int nasid = 0;
553 lboard_t *brd; 565 lboard_t *brd;
554 566
567 /* fakeprom does not support klgraph */
568 if (IS_RUNNING_ON_FAKE_PROM())
569 return;
570
555 /* Setup ionodes with memory */ 571 /* Setup ionodes with memory */
556 for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) { 572 for (nasid = 0; nasid < MAX_PHYSNODE_ID; nasid += 2) {
557 char *klgraph_header; 573 char *klgraph_header;
@@ -563,8 +579,6 @@ static void __init scan_for_ionodes(void)
563 cnodeid = -1; 579 cnodeid = -1;
564 klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid)); 580 klgraph_header = __va(ia64_sn_get_klconfig_addr(nasid));
565 if (!klgraph_header) { 581 if (!klgraph_header) {
566 if (IS_RUNNING_ON_SIMULATOR())
567 continue;
568 BUG(); /* All nodes must have klconfig tables! */ 582 BUG(); /* All nodes must have klconfig tables! */
569 } 583 }
570 cnodeid = nasid_to_cnodeid(nasid); 584 cnodeid = nasid_to_cnodeid(nasid);
@@ -630,8 +644,8 @@ int
630nasid_slice_to_cpuid(int nasid, int slice) 644nasid_slice_to_cpuid(int nasid, int slice)
631{ 645{
632 long cpu; 646 long cpu;
633 647
634 for (cpu=0; cpu < NR_CPUS; cpu++) 648 for (cpu=0; cpu < NR_CPUS; cpu++)
635 if (cpuid_to_nasid(cpu) == nasid && 649 if (cpuid_to_nasid(cpu) == nasid &&
636 cpuid_to_slice(cpu) == slice) 650 cpuid_to_slice(cpu) == slice)
637 return cpu; 651 return cpu;
diff --git a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
index 7947312801ec..96cb71d15682 100644
--- a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
+++ b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
@@ -6,6 +6,7 @@
6 * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <asm/types.h>
9#include <asm/sn/shub_mmr.h> 10#include <asm/sn/shub_mmr.h>
10 11
11#define DEADLOCKBIT SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT 12#define DEADLOCKBIT SH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index ab9b5f35c2a7..254fe15c064b 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -8,12 +8,12 @@
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/version.h>
12#include <linux/slab.h> 11#include <linux/slab.h>
13#include <linux/spinlock.h> 12#include <linux/spinlock.h>
14#include <linux/proc_fs.h> 13#include <linux/proc_fs.h>
15#include <linux/device.h> 14#include <linux/device.h>
16#include <linux/delay.h> 15#include <linux/delay.h>
16#include <asm/system.h>
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/sn/sn_sal.h> 18#include <asm/sn/sn_sal.h>
19#include <asm/sn/addrs.h> 19#include <asm/sn/addrs.h>
@@ -204,8 +204,8 @@ cx_device_register(nasid_t nasid, int part_num, int mfg_num,
204 cx_dev->dev.parent = NULL; 204 cx_dev->dev.parent = NULL;
205 cx_dev->dev.bus = &tiocx_bus_type; 205 cx_dev->dev.bus = &tiocx_bus_type;
206 cx_dev->dev.release = tiocx_bus_release; 206 cx_dev->dev.release = tiocx_bus_release;
207 snprintf(cx_dev->dev.bus_id, BUS_ID_SIZE, "%d.0x%x", 207 snprintf(cx_dev->dev.bus_id, BUS_ID_SIZE, "%d",
208 cx_dev->cx_id.nasid, cx_dev->cx_id.part_num); 208 cx_dev->cx_id.nasid);
209 device_register(&cx_dev->dev); 209 device_register(&cx_dev->dev);
210 get_device(&cx_dev->dev); 210 get_device(&cx_dev->dev);
211 211
@@ -236,7 +236,6 @@ int cx_device_unregister(struct cx_dev *cx_dev)
236 */ 236 */
237static int cx_device_reload(struct cx_dev *cx_dev) 237static int cx_device_reload(struct cx_dev *cx_dev)
238{ 238{
239 device_remove_file(&cx_dev->dev, &dev_attr_cxdev_control);
240 cx_device_unregister(cx_dev); 239 cx_device_unregister(cx_dev);
241 return cx_device_register(cx_dev->cx_id.nasid, cx_dev->cx_id.part_num, 240 return cx_device_register(cx_dev->cx_id.nasid, cx_dev->cx_id.part_num,
242 cx_dev->cx_id.mfg_num, cx_dev->hubdev); 241 cx_dev->cx_id.mfg_num, cx_dev->hubdev);
@@ -383,6 +382,7 @@ static int is_fpga_brick(int nasid)
383 switch (tiocx_btchar_get(nasid)) { 382 switch (tiocx_btchar_get(nasid)) {
384 case L1_BRICKTYPE_SA: 383 case L1_BRICKTYPE_SA:
385 case L1_BRICKTYPE_ATHENA: 384 case L1_BRICKTYPE_ATHENA:
385 case L1_BRICKTYPE_DAYTONA:
386 return 1; 386 return 1;
387 } 387 }
388 return 0; 388 return 0;
@@ -409,7 +409,7 @@ static int tiocx_reload(struct cx_dev *cx_dev)
409 uint64_t cx_id; 409 uint64_t cx_id;
410 410
411 cx_id = 411 cx_id =
412 *(volatile int32_t *)(TIO_SWIN_BASE(nasid, TIOCX_CORELET) + 412 *(volatile uint64_t *)(TIO_SWIN_BASE(nasid, TIOCX_CORELET) +
413 WIDGET_ID); 413 WIDGET_ID);
414 part_num = XWIDGET_PART_NUM(cx_id); 414 part_num = XWIDGET_PART_NUM(cx_id);
415 mfg_num = XWIDGET_MFG_NUM(cx_id); 415 mfg_num = XWIDGET_MFG_NUM(cx_id);
@@ -432,7 +432,7 @@ static int tiocx_reload(struct cx_dev *cx_dev)
432 return cx_device_reload(cx_dev); 432 return cx_device_reload(cx_dev);
433} 433}
434 434
435static ssize_t show_cxdev_control(struct device *dev, char *buf) 435static ssize_t show_cxdev_control(struct device *dev, struct device_attribute *attr, char *buf)
436{ 436{
437 struct cx_dev *cx_dev = to_cx_dev(dev); 437 struct cx_dev *cx_dev = to_cx_dev(dev);
438 438
@@ -442,7 +442,7 @@ static ssize_t show_cxdev_control(struct device *dev, char *buf)
442 tiocx_btchar_get(cx_dev->cx_id.nasid)); 442 tiocx_btchar_get(cx_dev->cx_id.nasid));
443} 443}
444 444
445static ssize_t store_cxdev_control(struct device *dev, const char *buf, 445static ssize_t store_cxdev_control(struct device *dev, struct device_attribute *attr, const char *buf,
446 size_t count) 446 size_t count)
447{ 447{
448 int n; 448 int n;
@@ -458,6 +458,10 @@ static ssize_t store_cxdev_control(struct device *dev, const char *buf,
458 458
459 switch (n) { 459 switch (n) {
460 case 1: 460 case 1:
461 tio_corelet_reset(cx_dev->cx_id.nasid, TIOCX_CORELET);
462 tiocx_reload(cx_dev);
463 break;
464 case 2:
461 tiocx_reload(cx_dev); 465 tiocx_reload(cx_dev);
462 break; 466 break;
463 case 3: 467 case 3:
@@ -477,6 +481,9 @@ static int __init tiocx_init(void)
477 cnodeid_t cnodeid; 481 cnodeid_t cnodeid;
478 int found_tiocx_device = 0; 482 int found_tiocx_device = 0;
479 483
484 if (!ia64_platform_is("sn2"))
485 return -ENODEV;
486
480 bus_register(&tiocx_bus_type); 487 bus_register(&tiocx_bus_type);
481 488
482 for (cnodeid = 0; cnodeid < MAX_COMPACT_NODES; cnodeid++) { 489 for (cnodeid = 0; cnodeid < MAX_COMPACT_NODES; cnodeid++) {
@@ -518,29 +525,26 @@ static int __init tiocx_init(void)
518 return 0; 525 return 0;
519} 526}
520 527
521static void __exit tiocx_exit(void) 528static int cx_remove_device(struct device * dev, void * data)
522{ 529{
523 struct device *dev; 530 struct cx_dev *cx_dev = to_cx_dev(dev);
524 struct device *tdev; 531 device_remove_file(dev, &dev_attr_cxdev_control);
532 cx_device_unregister(cx_dev);
533 return 0;
534}
525 535
536static void __exit tiocx_exit(void)
537{
526 DBG("tiocx_exit\n"); 538 DBG("tiocx_exit\n");
527 539
528 /* 540 /*
529 * Unregister devices. 541 * Unregister devices.
530 */ 542 */
531 list_for_each_entry_safe(dev, tdev, &tiocx_bus_type.devices.list, 543 bus_for_each_dev(&tiocx_bus_type, NULL, NULL, cx_remove_device);
532 bus_list) {
533 if (dev) {
534 struct cx_dev *cx_dev = to_cx_dev(dev);
535 device_remove_file(dev, &dev_attr_cxdev_control);
536 cx_device_unregister(cx_dev);
537 }
538 }
539
540 bus_unregister(&tiocx_bus_type); 544 bus_unregister(&tiocx_bus_type);
541} 545}
542 546
543module_init(tiocx_init); 547subsys_initcall(tiocx_init);
544module_exit(tiocx_exit); 548module_exit(tiocx_exit);
545 549
546/************************************************************************ 550/************************************************************************
diff --git a/arch/ia64/sn/kernel/xpc.h b/arch/ia64/sn/kernel/xpc.h
index 1a0aed8490d1..d0ee635daf2e 100644
--- a/arch/ia64/sn/kernel/xpc.h
+++ b/arch/ia64/sn/kernel/xpc.h
@@ -87,7 +87,7 @@ struct xpc_rsvd_page {
87 u8 partid; /* partition ID from SAL */ 87 u8 partid; /* partition ID from SAL */
88 u8 version; 88 u8 version;
89 u8 pad[6]; /* pad to u64 align */ 89 u8 pad[6]; /* pad to u64 align */
90 u64 vars_pa; 90 volatile u64 vars_pa;
91 u64 part_nasids[XP_NASID_MASK_WORDS] ____cacheline_aligned; 91 u64 part_nasids[XP_NASID_MASK_WORDS] ____cacheline_aligned;
92 u64 mach_nasids[XP_NASID_MASK_WORDS] ____cacheline_aligned; 92 u64 mach_nasids[XP_NASID_MASK_WORDS] ____cacheline_aligned;
93}; 93};
@@ -138,7 +138,7 @@ struct xpc_vars {
138 * occupies half a cacheline. 138 * occupies half a cacheline.
139 */ 139 */
140struct xpc_vars_part { 140struct xpc_vars_part {
141 u64 magic; 141 volatile u64 magic;
142 142
143 u64 openclose_args_pa; /* physical address of open and close args */ 143 u64 openclose_args_pa; /* physical address of open and close args */
144 u64 GPs_pa; /* physical address of Get/Put values */ 144 u64 GPs_pa; /* physical address of Get/Put values */
@@ -185,8 +185,8 @@ struct xpc_vars_part {
185 * Define a Get/Put value pair (pointers) used with a message queue. 185 * Define a Get/Put value pair (pointers) used with a message queue.
186 */ 186 */
187struct xpc_gp { 187struct xpc_gp {
188 s64 get; /* Get value */ 188 volatile s64 get; /* Get value */
189 s64 put; /* Put value */ 189 volatile s64 put; /* Put value */
190}; 190};
191 191
192#define XPC_GP_SIZE \ 192#define XPC_GP_SIZE \
@@ -231,7 +231,7 @@ struct xpc_openclose_args {
231 */ 231 */
232struct xpc_notify { 232struct xpc_notify {
233 struct semaphore sema; /* notify semaphore */ 233 struct semaphore sema; /* notify semaphore */
234 u8 type; /* type of notification */ 234 volatile u8 type; /* type of notification */
235 235
236 /* the following two fields are only used if type == XPC_N_CALL */ 236 /* the following two fields are only used if type == XPC_N_CALL */
237 xpc_notify_func func; /* user's notify function */ 237 xpc_notify_func func; /* user's notify function */
@@ -439,7 +439,7 @@ struct xpc_partition {
439 439
440 /* XPC infrastructure referencing and teardown control */ 440 /* XPC infrastructure referencing and teardown control */
441 441
442 u8 setup_state; /* infrastructure setup state */ 442 volatile u8 setup_state; /* infrastructure setup state */
443 wait_queue_head_t teardown_wq; /* kthread waiting to teardown infra */ 443 wait_queue_head_t teardown_wq; /* kthread waiting to teardown infra */
444 atomic_t references; /* #of references to infrastructure */ 444 atomic_t references; /* #of references to infrastructure */
445 445
diff --git a/arch/ia64/sn/kernel/xpc_channel.c b/arch/ia64/sn/kernel/xpc_channel.c
index 0bf6fbcc46d2..6d02dac8056f 100644
--- a/arch/ia64/sn/kernel/xpc_channel.c
+++ b/arch/ia64/sn/kernel/xpc_channel.c
@@ -209,7 +209,7 @@ xpc_setup_infrastructure(struct xpc_partition *part)
209 * With the setting of the partition setup_state to XPC_P_SETUP, we're 209 * With the setting of the partition setup_state to XPC_P_SETUP, we're
210 * declaring that this partition is ready to go. 210 * declaring that this partition is ready to go.
211 */ 211 */
212 (volatile u8) part->setup_state = XPC_P_SETUP; 212 part->setup_state = XPC_P_SETUP;
213 213
214 214
215 /* 215 /*
@@ -227,7 +227,7 @@ xpc_setup_infrastructure(struct xpc_partition *part)
227 xpc_vars_part[partid].IPI_phys_cpuid = 227 xpc_vars_part[partid].IPI_phys_cpuid =
228 cpu_physical_id(smp_processor_id()); 228 cpu_physical_id(smp_processor_id());
229 xpc_vars_part[partid].nchannels = part->nchannels; 229 xpc_vars_part[partid].nchannels = part->nchannels;
230 (volatile u64) xpc_vars_part[partid].magic = XPC_VP_MAGIC1; 230 xpc_vars_part[partid].magic = XPC_VP_MAGIC1;
231 231
232 return xpcSuccess; 232 return xpcSuccess;
233} 233}
@@ -355,7 +355,7 @@ xpc_pull_remote_vars_part(struct xpc_partition *part)
355 355
356 /* let the other side know that we've pulled their variables */ 356 /* let the other side know that we've pulled their variables */
357 357
358 (volatile u64) xpc_vars_part[partid].magic = XPC_VP_MAGIC2; 358 xpc_vars_part[partid].magic = XPC_VP_MAGIC2;
359 } 359 }
360 360
361 if (pulled_entry->magic == XPC_VP_MAGIC1) { 361 if (pulled_entry->magic == XPC_VP_MAGIC1) {
@@ -1183,7 +1183,7 @@ xpc_process_msg_IPI(struct xpc_partition *part, int ch_number)
1183 */ 1183 */
1184 xpc_clear_local_msgqueue_flags(ch); 1184 xpc_clear_local_msgqueue_flags(ch);
1185 1185
1186 (volatile s64) ch->w_remote_GP.get = ch->remote_GP.get; 1186 ch->w_remote_GP.get = ch->remote_GP.get;
1187 1187
1188 dev_dbg(xpc_chan, "w_remote_GP.get changed to %ld, partid=%d, " 1188 dev_dbg(xpc_chan, "w_remote_GP.get changed to %ld, partid=%d, "
1189 "channel=%d\n", ch->w_remote_GP.get, ch->partid, 1189 "channel=%d\n", ch->w_remote_GP.get, ch->partid,
@@ -1211,7 +1211,7 @@ xpc_process_msg_IPI(struct xpc_partition *part, int ch_number)
1211 */ 1211 */
1212 xpc_clear_remote_msgqueue_flags(ch); 1212 xpc_clear_remote_msgqueue_flags(ch);
1213 1213
1214 (volatile s64) ch->w_remote_GP.put = ch->remote_GP.put; 1214 ch->w_remote_GP.put = ch->remote_GP.put;
1215 1215
1216 dev_dbg(xpc_chan, "w_remote_GP.put changed to %ld, partid=%d, " 1216 dev_dbg(xpc_chan, "w_remote_GP.put changed to %ld, partid=%d, "
1217 "channel=%d\n", ch->w_remote_GP.put, ch->partid, 1217 "channel=%d\n", ch->w_remote_GP.put, ch->partid,
@@ -1875,7 +1875,7 @@ xpc_send_msg(struct xpc_channel *ch, struct xpc_msg *msg, u8 notify_type,
1875 notify = &ch->notify_queue[msg_number % ch->local_nentries]; 1875 notify = &ch->notify_queue[msg_number % ch->local_nentries];
1876 notify->func = func; 1876 notify->func = func;
1877 notify->key = key; 1877 notify->key = key;
1878 (volatile u8) notify->type = notify_type; 1878 notify->type = notify_type;
1879 1879
1880 // >>> is a mb() needed here? 1880 // >>> is a mb() needed here?
1881 1881
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index 177ddb748ebe..d580adcad927 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -53,6 +53,7 @@
53#include <linux/cache.h> 53#include <linux/cache.h>
54#include <linux/interrupt.h> 54#include <linux/interrupt.h>
55#include <linux/slab.h> 55#include <linux/slab.h>
56#include <linux/delay.h>
56#include <asm/sn/intr.h> 57#include <asm/sn/intr.h>
57#include <asm/sn/sn_sal.h> 58#include <asm/sn/sn_sal.h>
58#include <asm/uaccess.h> 59#include <asm/uaccess.h>
@@ -308,8 +309,7 @@ xpc_make_first_contact(struct xpc_partition *part)
308 "partition %d\n", XPC_PARTID(part)); 309 "partition %d\n", XPC_PARTID(part));
309 310
310 /* wait a 1/4 of a second or so */ 311 /* wait a 1/4 of a second or so */
311 set_current_state(TASK_INTERRUPTIBLE); 312 msleep_interruptible(250);
312 (void) schedule_timeout(0.25 * HZ);
313 313
314 if (part->act_state == XPC_P_DEACTIVATING) { 314 if (part->act_state == XPC_P_DEACTIVATING) {
315 return part->reason; 315 return part->reason;
@@ -841,9 +841,7 @@ xpc_do_exit(void)
841 down(&xpc_discovery_exited); 841 down(&xpc_discovery_exited);
842 842
843 843
844 set_current_state(TASK_INTERRUPTIBLE); 844 msleep_interruptible(300);
845 schedule_timeout(0.3 * HZ);
846 set_current_state(TASK_RUNNING);
847 845
848 846
849 /* wait for all partitions to become inactive */ 847 /* wait for all partitions to become inactive */
@@ -860,12 +858,8 @@ xpc_do_exit(void)
860 } 858 }
861 } 859 }
862 860
863 if (active_part_count) { 861 if (active_part_count)
864 set_current_state(TASK_INTERRUPTIBLE); 862 msleep_interruptible(300);
865 schedule_timeout(0.3 * HZ);
866 set_current_state(TASK_RUNNING);
867 }
868
869 } while (active_part_count > 0); 863 } while (active_part_count > 0);
870 864
871 865
diff --git a/arch/ia64/sn/kernel/xpc_partition.c b/arch/ia64/sn/kernel/xpc_partition.c
index 2c3c4a8af553..578265ea9e67 100644
--- a/arch/ia64/sn/kernel/xpc_partition.c
+++ b/arch/ia64/sn/kernel/xpc_partition.c
@@ -22,6 +22,7 @@
22#include <linux/cache.h> 22#include <linux/cache.h>
23#include <linux/mmzone.h> 23#include <linux/mmzone.h>
24#include <linux/nodemask.h> 24#include <linux/nodemask.h>
25#include <asm/uncached.h>
25#include <asm/sn/bte.h> 26#include <asm/sn/bte.h>
26#include <asm/sn/intr.h> 27#include <asm/sn/intr.h>
27#include <asm/sn/sn_sal.h> 28#include <asm/sn/sn_sal.h>
@@ -183,7 +184,7 @@ xpc_rsvd_page_init(void)
183 * memory protections are never restricted. 184 * memory protections are never restricted.
184 */ 185 */
185 if ((amos_page = xpc_vars->amos_page) == NULL) { 186 if ((amos_page = xpc_vars->amos_page) == NULL) {
186 amos_page = (AMO_t *) mspec_kalloc_page(0); 187 amos_page = (AMO_t *) TO_AMO(uncached_alloc_page(0));
187 if (amos_page == NULL) { 188 if (amos_page == NULL) {
188 dev_err(xpc_part, "can't allocate page of AMOs\n"); 189 dev_err(xpc_part, "can't allocate page of AMOs\n");
189 return NULL; 190 return NULL;
@@ -200,7 +201,8 @@ xpc_rsvd_page_init(void)
200 if (ret != 0) { 201 if (ret != 0) {
201 dev_err(xpc_part, "can't change memory " 202 dev_err(xpc_part, "can't change memory "
202 "protections\n"); 203 "protections\n");
203 mspec_kfree_page((unsigned long) amos_page); 204 uncached_free_page(__IA64_UNCACHED_OFFSET |
205 TO_PHYS((u64) amos_page));
204 return NULL; 206 return NULL;
205 } 207 }
206 } 208 }
@@ -251,7 +253,7 @@ xpc_rsvd_page_init(void)
251 * This signifies to the remote partition that our reserved 253 * This signifies to the remote partition that our reserved
252 * page is initialized. 254 * page is initialized.
253 */ 255 */
254 (volatile u64) rp->vars_pa = __pa(xpc_vars); 256 rp->vars_pa = __pa(xpc_vars);
255 257
256 return rp; 258 return rp;
257} 259}
diff --git a/arch/ia64/sn/pci/pci_dma.c b/arch/ia64/sn/pci/pci_dma.c
index 5da9bdbde7cb..a2f7a88aefbb 100644
--- a/arch/ia64/sn/pci/pci_dma.c
+++ b/arch/ia64/sn/pci/pci_dma.c
@@ -11,9 +11,10 @@
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <asm/dma.h> 13#include <asm/dma.h>
14#include <asm/sn/sn_sal.h> 14#include <asm/sn/pcibr_provider.h>
15#include <asm/sn/pcibus_provider_defs.h> 15#include <asm/sn/pcibus_provider_defs.h>
16#include <asm/sn/pcidev.h> 16#include <asm/sn/pcidev.h>
17#include <asm/sn/sn_sal.h>
17 18
18#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset) 19#define SG_ENT_VIRT_ADDRESS(sg) (page_address((sg)->page) + (sg)->offset)
19#define SG_ENT_PHYS_ADDRESS(SG) virt_to_phys(SG_ENT_VIRT_ADDRESS(SG)) 20#define SG_ENT_PHYS_ADDRESS(SG) virt_to_phys(SG_ENT_VIRT_ADDRESS(SG))
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_ate.c b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
index 0e47bce85f2d..d1647b863e61 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_ate.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
@@ -8,9 +8,9 @@
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <asm/sn/sn_sal.h> 10#include <asm/sn/sn_sal.h>
11#include <asm/sn/pcibr_provider.h>
11#include <asm/sn/pcibus_provider_defs.h> 12#include <asm/sn/pcibus_provider_defs.h>
12#include <asm/sn/pcidev.h> 13#include <asm/sn/pcidev.h>
13#include "pci/pcibr_provider.h"
14 14
15int pcibr_invalidate_ate = 0; /* by default don't invalidate ATE on free */ 15int pcibr_invalidate_ate = 0; /* by default don't invalidate ATE on free */
16 16
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
index 64af2b2c1787..b058dc2a0b9d 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
@@ -8,18 +8,17 @@
8 8
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/pci.h> 10#include <linux/pci.h>
11#include <asm/sn/sn_sal.h> 11#include <asm/sn/addrs.h>
12#include <asm/sn/geo.h> 12#include <asm/sn/geo.h>
13#include "xtalk/xwidgetdev.h" 13#include <asm/sn/pcibr_provider.h>
14#include "xtalk/hubdev.h"
15#include <asm/sn/pcibus_provider_defs.h> 14#include <asm/sn/pcibus_provider_defs.h>
16#include <asm/sn/pcidev.h> 15#include <asm/sn/pcidev.h>
17#include "pci/tiocp.h" 16#include <asm/sn/pic.h>
18#include "pci/pic.h" 17#include <asm/sn/sn_sal.h>
19#include "pci/pcibr_provider.h" 18#include <asm/sn/tiocp.h>
20#include "pci/tiocp.h"
21#include "tio.h" 19#include "tio.h"
22#include <asm/sn/addrs.h> 20#include "xtalk/xwidgetdev.h"
21#include "xtalk/hubdev.h"
23 22
24extern int sn_ioif_inited; 23extern int sn_ioif_inited;
25 24
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
index 3893999d23d8..9813da56d311 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -6,18 +6,51 @@
6 * Copyright (C) 2001-2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2001-2004 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/types.h>
10#include <linux/interrupt.h> 9#include <linux/interrupt.h>
10#include <linux/types.h>
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <asm/sn/sn_sal.h> 12#include <asm/sn/addrs.h>
13#include "xtalk/xwidgetdev.h"
14#include <asm/sn/geo.h> 13#include <asm/sn/geo.h>
15#include "xtalk/hubdev.h" 14#include <asm/sn/pcibr_provider.h>
16#include <asm/sn/pcibus_provider_defs.h> 15#include <asm/sn/pcibus_provider_defs.h>
17#include <asm/sn/pcidev.h> 16#include <asm/sn/pcidev.h>
18#include "pci/pcibr_provider.h" 17#include <asm/sn/sn_sal.h>
19#include <asm/sn/addrs.h> 18#include "xtalk/xwidgetdev.h"
19#include "xtalk/hubdev.h"
20
21int
22sal_pcibr_slot_enable(struct pcibus_info *soft, int device, void *resp)
23{
24 struct ia64_sal_retval ret_stuff;
25 uint64_t busnum;
26
27 ret_stuff.status = 0;
28 ret_stuff.v0 = 0;
20 29
30 busnum = soft->pbi_buscommon.bs_persist_busnum;
31 SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_SLOT_ENABLE, (u64) busnum,
32 (u64) device, (u64) resp, 0, 0, 0, 0);
33
34 return (int)ret_stuff.v0;
35}
36
37int
38sal_pcibr_slot_disable(struct pcibus_info *soft, int device, int action,
39 void *resp)
40{
41 struct ia64_sal_retval ret_stuff;
42 uint64_t busnum;
43
44 ret_stuff.status = 0;
45 ret_stuff.v0 = 0;
46
47 busnum = soft->pbi_buscommon.bs_persist_busnum;
48 SAL_CALL_NOLOCK(ret_stuff, (u64) SN_SAL_IOIF_SLOT_DISABLE,
49 (u64) busnum, (u64) device, (u64) action,
50 (u64) resp, 0, 0, 0);
51
52 return (int)ret_stuff.v0;
53}
21 54
22static int sal_pcibr_error_interrupt(struct pcibus_info *soft) 55static int sal_pcibr_error_interrupt(struct pcibus_info *soft)
23{ 56{
@@ -188,3 +221,6 @@ pcibr_init_provider(void)
188 221
189 return 0; 222 return 0;
190} 223}
224
225EXPORT_SYMBOL_GPL(sal_pcibr_slot_enable);
226EXPORT_SYMBOL_GPL(sal_pcibr_slot_disable);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_reg.c b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
index 865c11c3b50a..21426d02fbe6 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_reg.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
@@ -6,13 +6,13 @@
6 * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved. 6 * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved.
7 */ 7 */
8 8
9#include <linux/types.h>
10#include <linux/interrupt.h> 9#include <linux/interrupt.h>
10#include <linux/types.h>
11#include <asm/sn/pcibr_provider.h>
11#include <asm/sn/pcibus_provider_defs.h> 12#include <asm/sn/pcibus_provider_defs.h>
12#include <asm/sn/pcidev.h> 13#include <asm/sn/pcidev.h>
13#include "pci/tiocp.h" 14#include <asm/sn/pic.h>
14#include "pci/pic.h" 15#include <asm/sn/tiocp.h>
15#include "pci/pcibr_provider.h"
16 16
17union br_ptr { 17union br_ptr {
18 struct tiocp tio; 18 struct tiocp tio;
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 8dae9eb45456..51cc4e63092c 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -336,7 +336,7 @@ tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr)
336 if (!ct_addr) 336 if (!ct_addr)
337 return 0; 337 return 0;
338 338
339 bus_addr = (dma_addr_t) (ct_addr & 0xffffffffffff); 339 bus_addr = (dma_addr_t) (ct_addr & 0xffffffffffffUL);
340 node_upper = ct_addr >> 48; 340 node_upper = ct_addr >> 48;
341 341
342 if (node_upper > 64) { 342 if (node_upper > 64) {
@@ -464,7 +464,7 @@ map_return:
464 * For mappings created using the direct modes (64 or 48) there are no 464 * For mappings created using the direct modes (64 or 48) there are no
465 * resources to release. 465 * resources to release.
466 */ 466 */
467void 467static void
468tioca_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir) 468tioca_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir)
469{ 469{
470 int i, entry; 470 int i, entry;
@@ -514,7 +514,7 @@ tioca_dma_unmap(struct pci_dev *pdev, dma_addr_t bus_addr, int dir)
514 * The mapping mode used is based on the devices dma_mask. As a last resort 514 * The mapping mode used is based on the devices dma_mask. As a last resort
515 * use the GART mapped mode. 515 * use the GART mapped mode.
516 */ 516 */
517uint64_t 517static uint64_t
518tioca_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count) 518tioca_dma_map(struct pci_dev *pdev, uint64_t paddr, size_t byte_count)
519{ 519{
520 uint64_t mapaddr; 520 uint64_t mapaddr;
@@ -580,7 +580,7 @@ tioca_error_intr_handler(int irq, void *arg, struct pt_regs *pt)
580 * On successful setup, returns the kernel version of tioca_common back to 580 * On successful setup, returns the kernel version of tioca_common back to
581 * the caller. 581 * the caller.
582 */ 582 */
583void * 583static void *
584tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft) 584tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft)
585{ 585{
586 struct tioca_common *tioca_common; 586 struct tioca_common *tioca_common;
@@ -589,8 +589,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft)
589 589
590 /* sanity check prom rev */ 590 /* sanity check prom rev */
591 591
592 if (sn_sal_rev_major() < 4 || 592 if (sn_sal_rev() < 0x0406) {
593 (sn_sal_rev_major() == 4 && sn_sal_rev_minor() < 6)) {
594 printk 593 printk
595 (KERN_ERR "%s: SGI prom rev 4.06 or greater required " 594 (KERN_ERR "%s: SGI prom rev 4.06 or greater required "
596 "for tioca support\n", __FUNCTION__); 595 "for tioca support\n", __FUNCTION__);