diff options
Diffstat (limited to 'arch/sparc')
47 files changed, 366 insertions, 182 deletions
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 6db513674050..9908d477ccd9 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
| @@ -37,6 +37,9 @@ config SPARC64 | |||
| 37 | def_bool 64BIT | 37 | def_bool 64BIT |
| 38 | select ARCH_SUPPORTS_MSI | 38 | select ARCH_SUPPORTS_MSI |
| 39 | select HAVE_FUNCTION_TRACER | 39 | select HAVE_FUNCTION_TRACER |
| 40 | select HAVE_FUNCTION_GRAPH_TRACER | ||
| 41 | select HAVE_FUNCTION_GRAPH_FP_TEST | ||
| 42 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST | ||
| 40 | select HAVE_KRETPROBES | 43 | select HAVE_KRETPROBES |
| 41 | select HAVE_KPROBES | 44 | select HAVE_KPROBES |
| 42 | select HAVE_LMB | 45 | select HAVE_LMB |
diff --git a/arch/sparc/Kconfig.debug b/arch/sparc/Kconfig.debug index 9d3c889718ac..1b4a831565f9 100644 --- a/arch/sparc/Kconfig.debug +++ b/arch/sparc/Kconfig.debug | |||
| @@ -19,13 +19,10 @@ config DEBUG_DCFLUSH | |||
| 19 | bool "D-cache flush debugging" | 19 | bool "D-cache flush debugging" |
| 20 | depends on SPARC64 && DEBUG_KERNEL | 20 | depends on SPARC64 && DEBUG_KERNEL |
| 21 | 21 | ||
| 22 | config STACK_DEBUG | ||
| 23 | bool "Stack Overflow Detection Support" | ||
| 24 | |||
| 25 | config MCOUNT | 22 | config MCOUNT |
| 26 | bool | 23 | bool |
| 27 | depends on SPARC64 | 24 | depends on SPARC64 |
| 28 | depends on STACK_DEBUG || FUNCTION_TRACER | 25 | depends on FUNCTION_TRACER |
| 29 | default y | 26 | default y |
| 30 | 27 | ||
| 31 | config FRAME_POINTER | 28 | config FRAME_POINTER |
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig index 56e3163673e3..259e3fd50993 100644 --- a/arch/sparc/configs/sparc64_defconfig +++ b/arch/sparc/configs/sparc64_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.33 | 3 | # Linux kernel version: 2.6.34-rc3 |
| 4 | # Wed Mar 3 02:54:29 2010 | 4 | # Sat Apr 3 15:49:56 2010 |
| 5 | # | 5 | # |
| 6 | CONFIG_64BIT=y | 6 | CONFIG_64BIT=y |
| 7 | CONFIG_SPARC=y | 7 | CONFIG_SPARC=y |
| @@ -23,6 +23,7 @@ CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y | |||
| 23 | CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y | 23 | CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y |
| 24 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | 24 | CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y |
| 25 | CONFIG_MMU=y | 25 | CONFIG_MMU=y |
| 26 | CONFIG_NEED_DMA_MAP_STATE=y | ||
| 26 | CONFIG_ARCH_NO_VIRT_TO_BUS=y | 27 | CONFIG_ARCH_NO_VIRT_TO_BUS=y |
| 27 | CONFIG_OF=y | 28 | CONFIG_OF=y |
| 28 | CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y | 29 | CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y |
| @@ -439,6 +440,7 @@ CONFIG_MISC_DEVICES=y | |||
| 439 | # CONFIG_ENCLOSURE_SERVICES is not set | 440 | # CONFIG_ENCLOSURE_SERVICES is not set |
| 440 | # CONFIG_HP_ILO is not set | 441 | # CONFIG_HP_ILO is not set |
| 441 | # CONFIG_ISL29003 is not set | 442 | # CONFIG_ISL29003 is not set |
| 443 | # CONFIG_SENSORS_TSL2550 is not set | ||
| 442 | # CONFIG_DS1682 is not set | 444 | # CONFIG_DS1682 is not set |
| 443 | # CONFIG_C2PORT is not set | 445 | # CONFIG_C2PORT is not set |
| 444 | 446 | ||
| @@ -511,6 +513,7 @@ CONFIG_BLK_DEV_IDEDMA=y | |||
| 511 | # | 513 | # |
| 512 | # SCSI device support | 514 | # SCSI device support |
| 513 | # | 515 | # |
| 516 | CONFIG_SCSI_MOD=y | ||
| 514 | CONFIG_RAID_ATTRS=m | 517 | CONFIG_RAID_ATTRS=m |
| 515 | CONFIG_SCSI=y | 518 | CONFIG_SCSI=y |
| 516 | CONFIG_SCSI_DMA=y | 519 | CONFIG_SCSI_DMA=y |
| @@ -888,6 +891,7 @@ CONFIG_SERIAL_SUNHV=y | |||
| 888 | CONFIG_SERIAL_CORE=y | 891 | CONFIG_SERIAL_CORE=y |
| 889 | CONFIG_SERIAL_CORE_CONSOLE=y | 892 | CONFIG_SERIAL_CORE_CONSOLE=y |
| 890 | # CONFIG_SERIAL_JSM is not set | 893 | # CONFIG_SERIAL_JSM is not set |
| 894 | # CONFIG_SERIAL_TIMBERDALE is not set | ||
| 891 | # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set | 895 | # CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set |
| 892 | CONFIG_UNIX98_PTYS=y | 896 | CONFIG_UNIX98_PTYS=y |
| 893 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | 897 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set |
| @@ -935,6 +939,7 @@ CONFIG_I2C_ALGOBIT=y | |||
| 935 | # | 939 | # |
| 936 | # CONFIG_I2C_OCORES is not set | 940 | # CONFIG_I2C_OCORES is not set |
| 937 | # CONFIG_I2C_SIMTEC is not set | 941 | # CONFIG_I2C_SIMTEC is not set |
| 942 | # CONFIG_I2C_XILINX is not set | ||
| 938 | 943 | ||
| 939 | # | 944 | # |
| 940 | # External I2C/SMBus adapter drivers | 945 | # External I2C/SMBus adapter drivers |
| @@ -948,15 +953,9 @@ CONFIG_I2C_ALGOBIT=y | |||
| 948 | # | 953 | # |
| 949 | # CONFIG_I2C_PCA_PLATFORM is not set | 954 | # CONFIG_I2C_PCA_PLATFORM is not set |
| 950 | # CONFIG_I2C_STUB is not set | 955 | # CONFIG_I2C_STUB is not set |
| 951 | |||
| 952 | # | ||
| 953 | # Miscellaneous I2C Chip support | ||
| 954 | # | ||
| 955 | # CONFIG_SENSORS_TSL2550 is not set | ||
| 956 | # CONFIG_I2C_DEBUG_CORE is not set | 956 | # CONFIG_I2C_DEBUG_CORE is not set |
| 957 | # CONFIG_I2C_DEBUG_ALGO is not set | 957 | # CONFIG_I2C_DEBUG_ALGO is not set |
| 958 | # CONFIG_I2C_DEBUG_BUS is not set | 958 | # CONFIG_I2C_DEBUG_BUS is not set |
| 959 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
| 960 | # CONFIG_SPI is not set | 959 | # CONFIG_SPI is not set |
| 961 | 960 | ||
| 962 | # | 961 | # |
| @@ -982,10 +981,11 @@ CONFIG_HWMON=y | |||
| 982 | # CONFIG_SENSORS_ADM1029 is not set | 981 | # CONFIG_SENSORS_ADM1029 is not set |
| 983 | # CONFIG_SENSORS_ADM1031 is not set | 982 | # CONFIG_SENSORS_ADM1031 is not set |
| 984 | # CONFIG_SENSORS_ADM9240 is not set | 983 | # CONFIG_SENSORS_ADM9240 is not set |
| 984 | # CONFIG_SENSORS_ADT7411 is not set | ||
| 985 | # CONFIG_SENSORS_ADT7462 is not set | 985 | # CONFIG_SENSORS_ADT7462 is not set |
| 986 | # CONFIG_SENSORS_ADT7470 is not set | 986 | # CONFIG_SENSORS_ADT7470 is not set |
| 987 | # CONFIG_SENSORS_ADT7473 is not set | ||
| 988 | # CONFIG_SENSORS_ADT7475 is not set | 987 | # CONFIG_SENSORS_ADT7475 is not set |
| 988 | # CONFIG_SENSORS_ASC7621 is not set | ||
| 989 | # CONFIG_SENSORS_ATXP1 is not set | 989 | # CONFIG_SENSORS_ATXP1 is not set |
| 990 | # CONFIG_SENSORS_DS1621 is not set | 990 | # CONFIG_SENSORS_DS1621 is not set |
| 991 | # CONFIG_SENSORS_I5K_AMB is not set | 991 | # CONFIG_SENSORS_I5K_AMB is not set |
| @@ -1052,18 +1052,21 @@ CONFIG_SSB_POSSIBLE=y | |||
| 1052 | # Multifunction device drivers | 1052 | # Multifunction device drivers |
| 1053 | # | 1053 | # |
| 1054 | # CONFIG_MFD_CORE is not set | 1054 | # CONFIG_MFD_CORE is not set |
| 1055 | # CONFIG_MFD_88PM860X is not set | ||
| 1055 | # CONFIG_MFD_SM501 is not set | 1056 | # CONFIG_MFD_SM501 is not set |
| 1056 | # CONFIG_HTC_PASIC3 is not set | 1057 | # CONFIG_HTC_PASIC3 is not set |
| 1057 | # CONFIG_TWL4030_CORE is not set | 1058 | # CONFIG_TWL4030_CORE is not set |
| 1058 | # CONFIG_MFD_TMIO is not set | 1059 | # CONFIG_MFD_TMIO is not set |
| 1059 | # CONFIG_PMIC_DA903X is not set | 1060 | # CONFIG_PMIC_DA903X is not set |
| 1060 | # CONFIG_PMIC_ADP5520 is not set | 1061 | # CONFIG_PMIC_ADP5520 is not set |
| 1062 | # CONFIG_MFD_MAX8925 is not set | ||
| 1061 | # CONFIG_MFD_WM8400 is not set | 1063 | # CONFIG_MFD_WM8400 is not set |
| 1062 | # CONFIG_MFD_WM831X is not set | 1064 | # CONFIG_MFD_WM831X is not set |
| 1063 | # CONFIG_MFD_WM8350_I2C is not set | 1065 | # CONFIG_MFD_WM8350_I2C is not set |
| 1066 | # CONFIG_MFD_WM8994 is not set | ||
| 1064 | # CONFIG_MFD_PCF50633 is not set | 1067 | # CONFIG_MFD_PCF50633 is not set |
| 1065 | # CONFIG_AB3100_CORE is not set | 1068 | # CONFIG_AB3100_CORE is not set |
| 1066 | # CONFIG_MFD_88PM8607 is not set | 1069 | # CONFIG_LPC_SCH is not set |
| 1067 | # CONFIG_REGULATOR is not set | 1070 | # CONFIG_REGULATOR is not set |
| 1068 | # CONFIG_MEDIA_SUPPORT is not set | 1071 | # CONFIG_MEDIA_SUPPORT is not set |
| 1069 | 1072 | ||
| @@ -1113,6 +1116,7 @@ CONFIG_FB_FFB=y | |||
| 1113 | # CONFIG_FB_LEO is not set | 1116 | # CONFIG_FB_LEO is not set |
| 1114 | CONFIG_FB_XVR500=y | 1117 | CONFIG_FB_XVR500=y |
| 1115 | CONFIG_FB_XVR2500=y | 1118 | CONFIG_FB_XVR2500=y |
| 1119 | CONFIG_FB_XVR1000=y | ||
| 1116 | # CONFIG_FB_S1D13XXX is not set | 1120 | # CONFIG_FB_S1D13XXX is not set |
| 1117 | # CONFIG_FB_NVIDIA is not set | 1121 | # CONFIG_FB_NVIDIA is not set |
| 1118 | # CONFIG_FB_RIVA is not set | 1122 | # CONFIG_FB_RIVA is not set |
| @@ -1430,7 +1434,6 @@ CONFIG_USB_STORAGE=m | |||
| 1430 | # CONFIG_USB_RIO500 is not set | 1434 | # CONFIG_USB_RIO500 is not set |
| 1431 | # CONFIG_USB_LEGOTOWER is not set | 1435 | # CONFIG_USB_LEGOTOWER is not set |
| 1432 | # CONFIG_USB_LCD is not set | 1436 | # CONFIG_USB_LCD is not set |
| 1433 | # CONFIG_USB_BERRY_CHARGE is not set | ||
| 1434 | # CONFIG_USB_LED is not set | 1437 | # CONFIG_USB_LED is not set |
| 1435 | # CONFIG_USB_CYPRESS_CY7C63 is not set | 1438 | # CONFIG_USB_CYPRESS_CY7C63 is not set |
| 1436 | # CONFIG_USB_CYTHERM is not set | 1439 | # CONFIG_USB_CYTHERM is not set |
| @@ -1443,7 +1446,6 @@ CONFIG_USB_STORAGE=m | |||
| 1443 | # CONFIG_USB_IOWARRIOR is not set | 1446 | # CONFIG_USB_IOWARRIOR is not set |
| 1444 | # CONFIG_USB_TEST is not set | 1447 | # CONFIG_USB_TEST is not set |
| 1445 | # CONFIG_USB_ISIGHTFW is not set | 1448 | # CONFIG_USB_ISIGHTFW is not set |
| 1446 | # CONFIG_USB_VST is not set | ||
| 1447 | # CONFIG_USB_GADGET is not set | 1449 | # CONFIG_USB_GADGET is not set |
| 1448 | 1450 | ||
| 1449 | # | 1451 | # |
| @@ -1610,6 +1612,7 @@ CONFIG_MISC_FILESYSTEMS=y | |||
| 1610 | # CONFIG_BEFS_FS is not set | 1612 | # CONFIG_BEFS_FS is not set |
| 1611 | # CONFIG_BFS_FS is not set | 1613 | # CONFIG_BFS_FS is not set |
| 1612 | # CONFIG_EFS_FS is not set | 1614 | # CONFIG_EFS_FS is not set |
| 1615 | # CONFIG_LOGFS is not set | ||
| 1613 | # CONFIG_CRAMFS is not set | 1616 | # CONFIG_CRAMFS is not set |
| 1614 | # CONFIG_SQUASHFS is not set | 1617 | # CONFIG_SQUASHFS is not set |
| 1615 | # CONFIG_VXFS_FS is not set | 1618 | # CONFIG_VXFS_FS is not set |
| @@ -1624,6 +1627,7 @@ CONFIG_NETWORK_FILESYSTEMS=y | |||
| 1624 | # CONFIG_NFS_FS is not set | 1627 | # CONFIG_NFS_FS is not set |
| 1625 | # CONFIG_NFSD is not set | 1628 | # CONFIG_NFSD is not set |
| 1626 | # CONFIG_SMB_FS is not set | 1629 | # CONFIG_SMB_FS is not set |
| 1630 | # CONFIG_CEPH_FS is not set | ||
| 1627 | # CONFIG_CIFS is not set | 1631 | # CONFIG_CIFS is not set |
| 1628 | # CONFIG_NCP_FS is not set | 1632 | # CONFIG_NCP_FS is not set |
| 1629 | # CONFIG_CODA_FS is not set | 1633 | # CONFIG_CODA_FS is not set |
diff --git a/arch/sparc/include/asm/cpudata_64.h b/arch/sparc/include/asm/cpudata_64.h index 926397d345ff..050ef35b9dcf 100644 --- a/arch/sparc/include/asm/cpudata_64.h +++ b/arch/sparc/include/asm/cpudata_64.h | |||
| @@ -17,7 +17,7 @@ typedef struct { | |||
| 17 | unsigned int __nmi_count; | 17 | unsigned int __nmi_count; |
| 18 | unsigned long clock_tick; /* %tick's per second */ | 18 | unsigned long clock_tick; /* %tick's per second */ |
| 19 | unsigned long __pad; | 19 | unsigned long __pad; |
| 20 | unsigned int __pad1; | 20 | unsigned int irq0_irqs; |
| 21 | unsigned int __pad2; | 21 | unsigned int __pad2; |
| 22 | 22 | ||
| 23 | /* Dcache line 2, rarely used */ | 23 | /* Dcache line 2, rarely used */ |
diff --git a/arch/sparc/include/asm/irqflags_64.h b/arch/sparc/include/asm/irqflags_64.h index 8b49bf920df3..bfa1ea45b4cd 100644 --- a/arch/sparc/include/asm/irqflags_64.h +++ b/arch/sparc/include/asm/irqflags_64.h | |||
| @@ -76,9 +76,26 @@ static inline int raw_irqs_disabled(void) | |||
| 76 | */ | 76 | */ |
| 77 | static inline unsigned long __raw_local_irq_save(void) | 77 | static inline unsigned long __raw_local_irq_save(void) |
| 78 | { | 78 | { |
| 79 | unsigned long flags = __raw_local_save_flags(); | 79 | unsigned long flags, tmp; |
| 80 | 80 | ||
| 81 | raw_local_irq_disable(); | 81 | /* Disable interrupts to PIL_NORMAL_MAX unless we already |
| 82 | * are using PIL_NMI, in which case PIL_NMI is retained. | ||
| 83 | * | ||
| 84 | * The only values we ever program into the %pil are 0, | ||
| 85 | * PIL_NORMAL_MAX and PIL_NMI. | ||
| 86 | * | ||
| 87 | * Since PIL_NMI is the largest %pil value and all bits are | ||
| 88 | * set in it (0xf), it doesn't matter what PIL_NORMAL_MAX | ||
| 89 | * actually is. | ||
| 90 | */ | ||
| 91 | __asm__ __volatile__( | ||
| 92 | "rdpr %%pil, %0\n\t" | ||
| 93 | "or %0, %2, %1\n\t" | ||
| 94 | "wrpr %1, 0x0, %%pil" | ||
| 95 | : "=r" (flags), "=r" (tmp) | ||
| 96 | : "i" (PIL_NORMAL_MAX) | ||
| 97 | : "memory" | ||
| 98 | ); | ||
| 82 | 99 | ||
| 83 | return flags; | 100 | return flags; |
| 84 | } | 101 | } |
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h index 9e2d9447f2ad..4827a3aeac7f 100644 --- a/arch/sparc/include/asm/thread_info_64.h +++ b/arch/sparc/include/asm/thread_info_64.h | |||
| @@ -111,7 +111,7 @@ struct thread_info { | |||
| 111 | #define THREAD_SHIFT PAGE_SHIFT | 111 | #define THREAD_SHIFT PAGE_SHIFT |
| 112 | #endif /* PAGE_SHIFT == 13 */ | 112 | #endif /* PAGE_SHIFT == 13 */ |
| 113 | 113 | ||
| 114 | #define PREEMPT_ACTIVE 0x4000000 | 114 | #define PREEMPT_ACTIVE 0x10000000 |
| 115 | 115 | ||
| 116 | /* | 116 | /* |
| 117 | * macros/functions for gaining access to the thread information structure | 117 | * macros/functions for gaining access to the thread information structure |
diff --git a/arch/sparc/kernel/Makefile b/arch/sparc/kernel/Makefile index c6316142db4e..0c2dc1f24a9a 100644 --- a/arch/sparc/kernel/Makefile +++ b/arch/sparc/kernel/Makefile | |||
| @@ -13,6 +13,14 @@ extra-y += init_task.o | |||
| 13 | CPPFLAGS_vmlinux.lds := -Usparc -m$(BITS) | 13 | CPPFLAGS_vmlinux.lds := -Usparc -m$(BITS) |
| 14 | extra-y += vmlinux.lds | 14 | extra-y += vmlinux.lds |
| 15 | 15 | ||
| 16 | ifdef CONFIG_FUNCTION_TRACER | ||
| 17 | # Do not profile debug and lowlevel utilities | ||
| 18 | CFLAGS_REMOVE_ftrace.o := -pg | ||
| 19 | CFLAGS_REMOVE_time_$(BITS).o := -pg | ||
| 20 | CFLAGS_REMOVE_perf_event.o := -pg | ||
| 21 | CFLAGS_REMOVE_pcr.o := -pg | ||
| 22 | endif | ||
| 23 | |||
| 16 | obj-$(CONFIG_SPARC32) += entry.o wof.o wuf.o | 24 | obj-$(CONFIG_SPARC32) += entry.o wof.o wuf.o |
| 17 | obj-$(CONFIG_SPARC32) += etrap_32.o | 25 | obj-$(CONFIG_SPARC32) += etrap_32.o |
| 18 | obj-$(CONFIG_SPARC32) += rtrap_32.o | 26 | obj-$(CONFIG_SPARC32) += rtrap_32.o |
| @@ -85,7 +93,7 @@ obj-$(CONFIG_KGDB) += kgdb_$(BITS).o | |||
| 85 | 93 | ||
| 86 | 94 | ||
| 87 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o | 95 | obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o |
| 88 | CFLAGS_REMOVE_ftrace.o := -pg | 96 | obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o |
| 89 | 97 | ||
| 90 | obj-$(CONFIG_EARLYFB) += btext.o | 98 | obj-$(CONFIG_EARLYFB) += btext.o |
| 91 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 99 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c index 4589ca33220f..415c86d5a8da 100644 --- a/arch/sparc/kernel/central.c +++ b/arch/sparc/kernel/central.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
| 7 | #include <linux/types.h> | 7 | #include <linux/types.h> |
| 8 | #include <linux/slab.h> | ||
| 8 | #include <linux/string.h> | 9 | #include <linux/string.h> |
| 9 | #include <linux/init.h> | 10 | #include <linux/init.h> |
| 10 | #include <linux/of_device.h> | 11 | #include <linux/of_device.h> |
diff --git a/arch/sparc/kernel/cpumap.c b/arch/sparc/kernel/cpumap.c index 7430ed080b23..8de64c8126bc 100644 --- a/arch/sparc/kernel/cpumap.c +++ b/arch/sparc/kernel/cpumap.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| 7 | #include <linux/slab.h> | ||
| 7 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
| 8 | #include <linux/init.h> | 9 | #include <linux/init.h> |
| 9 | #include <linux/cpumask.h> | 10 | #include <linux/cpumask.h> |
diff --git a/arch/sparc/kernel/ftrace.c b/arch/sparc/kernel/ftrace.c index 9103a56b39e8..03ab022e51c5 100644 --- a/arch/sparc/kernel/ftrace.c +++ b/arch/sparc/kernel/ftrace.c | |||
| @@ -13,7 +13,7 @@ static const u32 ftrace_nop = 0x01000000; | |||
| 13 | 13 | ||
| 14 | static u32 ftrace_call_replace(unsigned long ip, unsigned long addr) | 14 | static u32 ftrace_call_replace(unsigned long ip, unsigned long addr) |
| 15 | { | 15 | { |
| 16 | static u32 call; | 16 | u32 call; |
| 17 | s32 off; | 17 | s32 off; |
| 18 | 18 | ||
| 19 | off = ((s32)addr - (s32)ip); | 19 | off = ((s32)addr - (s32)ip); |
| @@ -91,3 +91,61 @@ int __init ftrace_dyn_arch_init(void *data) | |||
| 91 | return 0; | 91 | return 0; |
| 92 | } | 92 | } |
| 93 | #endif | 93 | #endif |
| 94 | |||
| 95 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 96 | |||
| 97 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
| 98 | extern void ftrace_graph_call(void); | ||
| 99 | |||
| 100 | int ftrace_enable_ftrace_graph_caller(void) | ||
| 101 | { | ||
| 102 | unsigned long ip = (unsigned long)(&ftrace_graph_call); | ||
| 103 | u32 old, new; | ||
| 104 | |||
| 105 | old = *(u32 *) &ftrace_graph_call; | ||
| 106 | new = ftrace_call_replace(ip, (unsigned long) &ftrace_graph_caller); | ||
| 107 | return ftrace_modify_code(ip, old, new); | ||
| 108 | } | ||
| 109 | |||
| 110 | int ftrace_disable_ftrace_graph_caller(void) | ||
| 111 | { | ||
| 112 | unsigned long ip = (unsigned long)(&ftrace_graph_call); | ||
| 113 | u32 old, new; | ||
| 114 | |||
| 115 | old = *(u32 *) &ftrace_graph_call; | ||
| 116 | new = ftrace_call_replace(ip, (unsigned long) &ftrace_stub); | ||
| 117 | |||
| 118 | return ftrace_modify_code(ip, old, new); | ||
| 119 | } | ||
| 120 | |||
| 121 | #endif /* !CONFIG_DYNAMIC_FTRACE */ | ||
| 122 | |||
| 123 | /* | ||
| 124 | * Hook the return address and push it in the stack of return addrs | ||
| 125 | * in current thread info. | ||
| 126 | */ | ||
| 127 | unsigned long prepare_ftrace_return(unsigned long parent, | ||
| 128 | unsigned long self_addr, | ||
| 129 | unsigned long frame_pointer) | ||
| 130 | { | ||
| 131 | unsigned long return_hooker = (unsigned long) &return_to_handler; | ||
| 132 | struct ftrace_graph_ent trace; | ||
| 133 | |||
| 134 | if (unlikely(atomic_read(¤t->tracing_graph_pause))) | ||
| 135 | return parent + 8UL; | ||
| 136 | |||
| 137 | if (ftrace_push_return_trace(parent, self_addr, &trace.depth, | ||
| 138 | frame_pointer) == -EBUSY) | ||
| 139 | return parent + 8UL; | ||
| 140 | |||
| 141 | trace.func = self_addr; | ||
| 142 | |||
| 143 | /* Only trace if the calling function expects to */ | ||
| 144 | if (!ftrace_graph_entry(&trace)) { | ||
| 145 | current->curr_ret_stack--; | ||
| 146 | return parent + 8UL; | ||
| 147 | } | ||
| 148 | |||
| 149 | return return_hooker; | ||
| 150 | } | ||
| 151 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | ||
diff --git a/arch/sparc/kernel/helpers.S b/arch/sparc/kernel/helpers.S index 314dd0c9fc5b..92090cc9e829 100644 --- a/arch/sparc/kernel/helpers.S +++ b/arch/sparc/kernel/helpers.S | |||
| @@ -46,6 +46,81 @@ stack_trace_flush: | |||
| 46 | nop | 46 | nop |
| 47 | .size stack_trace_flush,.-stack_trace_flush | 47 | .size stack_trace_flush,.-stack_trace_flush |
| 48 | 48 | ||
| 49 | #ifdef CONFIG_PERF_EVENTS | ||
| 50 | .globl perf_arch_fetch_caller_regs | ||
| 51 | .type perf_arch_fetch_caller_regs,#function | ||
| 52 | perf_arch_fetch_caller_regs: | ||
| 53 | /* We always read the %pstate into %o5 since we will use | ||
| 54 | * that to construct a fake %tstate to store into the regs. | ||
| 55 | */ | ||
| 56 | rdpr %pstate, %o5 | ||
| 57 | brz,pn %o2, 50f | ||
| 58 | mov %o2, %g7 | ||
| 59 | |||
| 60 | /* Turn off interrupts while we walk around the register | ||
| 61 | * window by hand. | ||
| 62 | */ | ||
| 63 | wrpr %o5, PSTATE_IE, %pstate | ||
| 64 | |||
| 65 | /* The %canrestore tells us how many register windows are | ||
| 66 | * still live in the chip above us, past that we have to | ||
| 67 | * walk the frame as saved on the stack. We stash away | ||
| 68 | * the %cwp in %g1 so we can return back to the original | ||
| 69 | * register window. | ||
| 70 | */ | ||
| 71 | rdpr %cwp, %g1 | ||
| 72 | rdpr %canrestore, %g2 | ||
| 73 | sub %g1, 1, %g3 | ||
| 74 | |||
| 75 | /* We have the skip count in %g7, if it hits zero then | ||
| 76 | * %fp/%i7 are the registers we need. Otherwise if our | ||
| 77 | * %canrestore count maintained in %g2 hits zero we have | ||
| 78 | * to start traversing the stack. | ||
| 79 | */ | ||
| 80 | 10: brz,pn %g2, 4f | ||
| 81 | sub %g2, 1, %g2 | ||
| 82 | wrpr %g3, %cwp | ||
| 83 | subcc %g7, 1, %g7 | ||
| 84 | bne,pt %xcc, 10b | ||
| 85 | sub %g3, 1, %g3 | ||
| 86 | |||
| 87 | /* We found the values we need in the cpu's register | ||
| 88 | * windows. | ||
| 89 | */ | ||
| 90 | mov %fp, %g3 | ||
| 91 | ba,pt %xcc, 3f | ||
| 92 | mov %i7, %g2 | ||
| 93 | |||
| 94 | 50: mov %fp, %g3 | ||
| 95 | ba,pt %xcc, 2f | ||
| 96 | mov %i7, %g2 | ||
| 97 | |||
| 98 | /* We hit the end of the valid register windows in the | ||
| 99 | * cpu, start traversing the stack frame. | ||
| 100 | */ | ||
| 101 | 4: mov %fp, %g3 | ||
| 102 | |||
| 103 | 20: ldx [%g3 + STACK_BIAS + RW_V9_I7], %g2 | ||
| 104 | subcc %g7, 1, %g7 | ||
| 105 | bne,pn %xcc, 20b | ||
| 106 | ldx [%g3 + STACK_BIAS + RW_V9_I6], %g3 | ||
| 107 | |||
| 108 | /* Restore the current register window position and | ||
| 109 | * re-enable interrupts. | ||
| 110 | */ | ||
| 111 | 3: wrpr %g1, %cwp | ||
| 112 | wrpr %o5, %pstate | ||
| 113 | |||
| 114 | 2: stx %g3, [%o0 + PT_V9_FP] | ||
| 115 | sllx %o5, 8, %o5 | ||
| 116 | stx %o5, [%o0 + PT_V9_TSTATE] | ||
| 117 | stx %g2, [%o0 + PT_V9_TPC] | ||
| 118 | add %g2, 4, %g2 | ||
| 119 | retl | ||
| 120 | stx %g2, [%o0 + PT_V9_TNPC] | ||
| 121 | .size perf_arch_fetch_caller_regs,.-perf_arch_fetch_caller_regs | ||
| 122 | #endif /* CONFIG_PERF_EVENTS */ | ||
| 123 | |||
| 49 | #ifdef CONFIG_SMP | 124 | #ifdef CONFIG_SMP |
| 50 | .globl hard_smp_processor_id | 125 | .globl hard_smp_processor_id |
| 51 | .type hard_smp_processor_id,#function | 126 | .type hard_smp_processor_id,#function |
diff --git a/arch/sparc/kernel/hvapi.c b/arch/sparc/kernel/hvapi.c index 1d272c3b5740..7c60afb835b0 100644 --- a/arch/sparc/kernel/hvapi.c +++ b/arch/sparc/kernel/hvapi.c | |||
| @@ -5,7 +5,6 @@ | |||
| 5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
| 6 | #include <linux/module.h> | 6 | #include <linux/module.h> |
| 7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
| 8 | #include <linux/slab.h> | ||
| 9 | 8 | ||
| 10 | #include <asm/hypervisor.h> | 9 | #include <asm/hypervisor.h> |
| 11 | #include <asm/oplib.h> | 10 | #include <asm/oplib.h> |
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index 8414549c1834..47977a77f6c6 100644 --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/slab.h> | ||
| 9 | #include <linux/delay.h> | 10 | #include <linux/delay.h> |
| 10 | #include <linux/device.h> | 11 | #include <linux/device.h> |
| 11 | #include <linux/dma-mapping.h> | 12 | #include <linux/dma-mapping.h> |
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index e1cbdb94d97b..830d70a3e20b 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c | |||
| @@ -20,7 +20,9 @@ | |||
| 20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
| 21 | #include <linux/proc_fs.h> | 21 | #include <linux/proc_fs.h> |
| 22 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
| 23 | #include <linux/ftrace.h> | ||
| 23 | #include <linux/irq.h> | 24 | #include <linux/irq.h> |
| 25 | #include <linux/kmemleak.h> | ||
| 24 | 26 | ||
| 25 | #include <asm/ptrace.h> | 27 | #include <asm/ptrace.h> |
| 26 | #include <asm/processor.h> | 28 | #include <asm/processor.h> |
| @@ -45,6 +47,7 @@ | |||
| 45 | 47 | ||
| 46 | #include "entry.h" | 48 | #include "entry.h" |
| 47 | #include "cpumap.h" | 49 | #include "cpumap.h" |
| 50 | #include "kstack.h" | ||
| 48 | 51 | ||
| 49 | #define NUM_IVECS (IMAP_INR + 1) | 52 | #define NUM_IVECS (IMAP_INR + 1) |
| 50 | 53 | ||
| @@ -647,6 +650,14 @@ unsigned int sun4v_build_virq(u32 devhandle, unsigned int devino) | |||
| 647 | bucket = kzalloc(sizeof(struct ino_bucket), GFP_ATOMIC); | 650 | bucket = kzalloc(sizeof(struct ino_bucket), GFP_ATOMIC); |
| 648 | if (unlikely(!bucket)) | 651 | if (unlikely(!bucket)) |
| 649 | return 0; | 652 | return 0; |
| 653 | |||
| 654 | /* The only reference we store to the IRQ bucket is | ||
| 655 | * by physical address which kmemleak can't see, tell | ||
| 656 | * it that this object explicitly is not a leak and | ||
| 657 | * should be scanned. | ||
| 658 | */ | ||
| 659 | kmemleak_not_leak(bucket); | ||
| 660 | |||
| 650 | __flush_dcache_range((unsigned long) bucket, | 661 | __flush_dcache_range((unsigned long) bucket, |
| 651 | ((unsigned long) bucket + | 662 | ((unsigned long) bucket + |
| 652 | sizeof(struct ino_bucket))); | 663 | sizeof(struct ino_bucket))); |
| @@ -703,25 +714,7 @@ void ack_bad_irq(unsigned int virt_irq) | |||
| 703 | void *hardirq_stack[NR_CPUS]; | 714 | void *hardirq_stack[NR_CPUS]; |
| 704 | void *softirq_stack[NR_CPUS]; | 715 | void *softirq_stack[NR_CPUS]; |
| 705 | 716 | ||
| 706 | static __attribute__((always_inline)) void *set_hardirq_stack(void) | 717 | void __irq_entry handler_irq(int irq, struct pt_regs *regs) |
| 707 | { | ||
| 708 | void *orig_sp, *sp = hardirq_stack[smp_processor_id()]; | ||
| 709 | |||
| 710 | __asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp)); | ||
| 711 | if (orig_sp < sp || | ||
| 712 | orig_sp > (sp + THREAD_SIZE)) { | ||
| 713 | sp += THREAD_SIZE - 192 - STACK_BIAS; | ||
| 714 | __asm__ __volatile__("mov %0, %%sp" : : "r" (sp)); | ||
| 715 | } | ||
| 716 | |||
| 717 | return orig_sp; | ||
| 718 | } | ||
| 719 | static __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp) | ||
| 720 | { | ||
| 721 | __asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp)); | ||
| 722 | } | ||
| 723 | |||
| 724 | void handler_irq(int irq, struct pt_regs *regs) | ||
| 725 | { | 718 | { |
| 726 | unsigned long pstate, bucket_pa; | 719 | unsigned long pstate, bucket_pa; |
| 727 | struct pt_regs *old_regs; | 720 | struct pt_regs *old_regs; |
diff --git a/arch/sparc/kernel/kgdb_64.c b/arch/sparc/kernel/kgdb_64.c index f5a0fd490b59..0a2bd0f99fc1 100644 --- a/arch/sparc/kernel/kgdb_64.c +++ b/arch/sparc/kernel/kgdb_64.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/kgdb.h> | 6 | #include <linux/kgdb.h> |
| 7 | #include <linux/kdebug.h> | 7 | #include <linux/kdebug.h> |
| 8 | #include <linux/ftrace.h> | ||
| 8 | 9 | ||
| 9 | #include <asm/kdebug.h> | 10 | #include <asm/kdebug.h> |
| 10 | #include <asm/ptrace.h> | 11 | #include <asm/ptrace.h> |
| @@ -108,7 +109,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) | |||
| 108 | } | 109 | } |
| 109 | 110 | ||
| 110 | #ifdef CONFIG_SMP | 111 | #ifdef CONFIG_SMP |
| 111 | void smp_kgdb_capture_client(int irq, struct pt_regs *regs) | 112 | void __irq_entry smp_kgdb_capture_client(int irq, struct pt_regs *regs) |
| 112 | { | 113 | { |
| 113 | unsigned long flags; | 114 | unsigned long flags; |
| 114 | 115 | ||
diff --git a/arch/sparc/kernel/kprobes.c b/arch/sparc/kernel/kprobes.c index 6716584e48ab..a39d1ba5a119 100644 --- a/arch/sparc/kernel/kprobes.c +++ b/arch/sparc/kernel/kprobes.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/kprobes.h> | 7 | #include <linux/kprobes.h> |
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/kdebug.h> | 9 | #include <linux/kdebug.h> |
| 10 | #include <linux/slab.h> | ||
| 10 | #include <asm/signal.h> | 11 | #include <asm/signal.h> |
| 11 | #include <asm/cacheflush.h> | 12 | #include <asm/cacheflush.h> |
| 12 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
diff --git a/arch/sparc/kernel/kstack.h b/arch/sparc/kernel/kstack.h index 5247283d1c03..53dfb92e09fb 100644 --- a/arch/sparc/kernel/kstack.h +++ b/arch/sparc/kernel/kstack.h | |||
| @@ -61,4 +61,23 @@ check_magic: | |||
| 61 | 61 | ||
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | static inline __attribute__((always_inline)) void *set_hardirq_stack(void) | ||
| 65 | { | ||
| 66 | void *orig_sp, *sp = hardirq_stack[smp_processor_id()]; | ||
| 67 | |||
| 68 | __asm__ __volatile__("mov %%sp, %0" : "=r" (orig_sp)); | ||
| 69 | if (orig_sp < sp || | ||
| 70 | orig_sp > (sp + THREAD_SIZE)) { | ||
| 71 | sp += THREAD_SIZE - 192 - STACK_BIAS; | ||
| 72 | __asm__ __volatile__("mov %0, %%sp" : : "r" (sp)); | ||
| 73 | } | ||
| 74 | |||
| 75 | return orig_sp; | ||
| 76 | } | ||
| 77 | |||
| 78 | static inline __attribute__((always_inline)) void restore_hardirq_stack(void *orig_sp) | ||
| 79 | { | ||
| 80 | __asm__ __volatile__("mov %0, %%sp" : : "r" (orig_sp)); | ||
| 81 | } | ||
| 82 | |||
| 64 | #endif /* _KSTACK_H */ | 83 | #endif /* _KSTACK_H */ |
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c index 00d034ea2164..3ae36f36e758 100644 --- a/arch/sparc/kernel/led.c +++ b/arch/sparc/kernel/led.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #include <linux/init.h> | 3 | #include <linux/init.h> |
| 4 | #include <linux/proc_fs.h> | 4 | #include <linux/proc_fs.h> |
| 5 | #include <linux/seq_file.h> | 5 | #include <linux/seq_file.h> |
| 6 | #include <linux/slab.h> | ||
| 6 | #include <linux/string.h> | 7 | #include <linux/string.h> |
| 7 | #include <linux/jiffies.h> | 8 | #include <linux/jiffies.h> |
| 8 | #include <linux/timer.h> | 9 | #include <linux/timer.h> |
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index 0409d62d8ca2..6a7b4dbc8e09 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
| @@ -7,7 +7,6 @@ | |||
| 7 | #include <linux/module.h> | 7 | #include <linux/module.h> |
| 8 | #include <linux/errno.h> | 8 | #include <linux/errno.h> |
| 9 | #include <linux/mutex.h> | 9 | #include <linux/mutex.h> |
| 10 | #include <linux/slab.h> | ||
| 11 | #include <linux/of.h> | 10 | #include <linux/of.h> |
| 12 | #include <linux/of_platform.h> | 11 | #include <linux/of_platform.h> |
| 13 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index 85787577f683..e1656fc41ccb 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/profile.h> | 22 | #include <linux/profile.h> |
| 23 | #include <linux/pm.h> | 23 | #include <linux/pm.h> |
| 24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
| 25 | #include <linux/gfp.h> | ||
| 25 | 26 | ||
| 26 | #include <asm/cacheflush.h> | 27 | #include <asm/cacheflush.h> |
| 27 | #include <asm/tlbflush.h> | 28 | #include <asm/tlbflush.h> |
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index 0ee642f63234..f848aadf54dc 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c | |||
| @@ -9,9 +9,9 @@ | |||
| 9 | #include <linux/elf.h> | 9 | #include <linux/elf.h> |
| 10 | #include <linux/vmalloc.h> | 10 | #include <linux/vmalloc.h> |
| 11 | #include <linux/fs.h> | 11 | #include <linux/fs.h> |
| 12 | #include <linux/gfp.h> | ||
| 12 | #include <linux/string.h> | 13 | #include <linux/string.h> |
| 13 | #include <linux/ctype.h> | 14 | #include <linux/ctype.h> |
| 14 | #include <linux/slab.h> | ||
| 15 | #include <linux/mm.h> | 15 | #include <linux/mm.h> |
| 16 | 16 | ||
| 17 | #include <asm/processor.h> | 17 | #include <asm/processor.h> |
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c index b287b62c7ea3..a4bd7ba74c89 100644 --- a/arch/sparc/kernel/nmi.c +++ b/arch/sparc/kernel/nmi.c | |||
| @@ -23,6 +23,8 @@ | |||
| 23 | #include <asm/ptrace.h> | 23 | #include <asm/ptrace.h> |
| 24 | #include <asm/pcr.h> | 24 | #include <asm/pcr.h> |
| 25 | 25 | ||
| 26 | #include "kstack.h" | ||
| 27 | |||
| 26 | /* We don't have a real NMI on sparc64, but we can fake one | 28 | /* We don't have a real NMI on sparc64, but we can fake one |
| 27 | * up using profiling counter overflow interrupts and interrupt | 29 | * up using profiling counter overflow interrupts and interrupt |
| 28 | * levels. | 30 | * levels. |
| @@ -92,7 +94,7 @@ static void die_nmi(const char *str, struct pt_regs *regs, int do_panic) | |||
| 92 | notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) | 94 | notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) |
| 93 | { | 95 | { |
| 94 | unsigned int sum, touched = 0; | 96 | unsigned int sum, touched = 0; |
| 95 | int cpu = smp_processor_id(); | 97 | void *orig_sp; |
| 96 | 98 | ||
| 97 | clear_softint(1 << irq); | 99 | clear_softint(1 << irq); |
| 98 | 100 | ||
| @@ -100,13 +102,15 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) | |||
| 100 | 102 | ||
| 101 | nmi_enter(); | 103 | nmi_enter(); |
| 102 | 104 | ||
| 105 | orig_sp = set_hardirq_stack(); | ||
| 106 | |||
| 103 | if (notify_die(DIE_NMI, "nmi", regs, 0, | 107 | if (notify_die(DIE_NMI, "nmi", regs, 0, |
| 104 | pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP) | 108 | pt_regs_trap_type(regs), SIGINT) == NOTIFY_STOP) |
| 105 | touched = 1; | 109 | touched = 1; |
| 106 | else | 110 | else |
| 107 | pcr_ops->write(PCR_PIC_PRIV); | 111 | pcr_ops->write(PCR_PIC_PRIV); |
| 108 | 112 | ||
| 109 | sum = kstat_irqs_cpu(0, cpu); | 113 | sum = local_cpu_data().irq0_irqs; |
| 110 | if (__get_cpu_var(nmi_touch)) { | 114 | if (__get_cpu_var(nmi_touch)) { |
| 111 | __get_cpu_var(nmi_touch) = 0; | 115 | __get_cpu_var(nmi_touch) = 0; |
| 112 | touched = 1; | 116 | touched = 1; |
| @@ -125,6 +129,8 @@ notrace __kprobes void perfctr_irq(int irq, struct pt_regs *regs) | |||
| 125 | pcr_ops->write(pcr_enable); | 129 | pcr_ops->write(pcr_enable); |
| 126 | } | 130 | } |
| 127 | 131 | ||
| 132 | restore_hardirq_stack(orig_sp); | ||
| 133 | |||
| 128 | nmi_exit(); | 134 | nmi_exit(); |
| 129 | } | 135 | } |
| 130 | 136 | ||
diff --git a/arch/sparc/kernel/of_device_common.c b/arch/sparc/kernel/of_device_common.c index cb8eb799bb6c..0247e68210b3 100644 --- a/arch/sparc/kernel/of_device_common.c +++ b/arch/sparc/kernel/of_device_common.c | |||
| @@ -4,7 +4,6 @@ | |||
| 4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
| 5 | #include <linux/module.h> | 5 | #include <linux/module.h> |
| 6 | #include <linux/mod_devicetable.h> | 6 | #include <linux/mod_devicetable.h> |
| 7 | #include <linux/slab.h> | ||
| 8 | #include <linux/errno.h> | 7 | #include <linux/errno.h> |
| 9 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
| 10 | #include <linux/of_device.h> | 9 | #include <linux/of_device.h> |
diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c index b775658a927d..8a000583b5cf 100644 --- a/arch/sparc/kernel/pci_common.c +++ b/arch/sparc/kernel/pci_common.c | |||
| @@ -371,14 +371,19 @@ static void pci_register_iommu_region(struct pci_pbm_info *pbm) | |||
| 371 | struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); | 371 | struct resource *rp = kzalloc(sizeof(*rp), GFP_KERNEL); |
| 372 | 372 | ||
| 373 | if (!rp) { | 373 | if (!rp) { |
| 374 | prom_printf("Cannot allocate IOMMU resource.\n"); | 374 | pr_info("%s: Cannot allocate IOMMU resource.\n", |
| 375 | prom_halt(); | 375 | pbm->name); |
| 376 | return; | ||
| 376 | } | 377 | } |
| 377 | rp->name = "IOMMU"; | 378 | rp->name = "IOMMU"; |
| 378 | rp->start = pbm->mem_space.start + (unsigned long) vdma[0]; | 379 | rp->start = pbm->mem_space.start + (unsigned long) vdma[0]; |
| 379 | rp->end = rp->start + (unsigned long) vdma[1] - 1UL; | 380 | rp->end = rp->start + (unsigned long) vdma[1] - 1UL; |
| 380 | rp->flags = IORESOURCE_BUSY; | 381 | rp->flags = IORESOURCE_BUSY; |
| 381 | request_resource(&pbm->mem_space, rp); | 382 | if (request_resource(&pbm->mem_space, rp)) { |
| 383 | pr_info("%s: Unable to request IOMMU resource.\n", | ||
| 384 | pbm->name); | ||
| 385 | kfree(rp); | ||
| 386 | } | ||
| 382 | } | 387 | } |
| 383 | } | 388 | } |
| 384 | 389 | ||
diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c index e1b0541feb19..e0ef847219c3 100644 --- a/arch/sparc/kernel/pci_msi.c +++ b/arch/sparc/kernel/pci_msi.c | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | */ | 4 | */ |
| 5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
| 6 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
| 7 | #include <linux/slab.h> | ||
| 7 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
| 8 | 9 | ||
| 9 | #include "pci_impl.h" | 10 | #include "pci_impl.h" |
diff --git a/arch/sparc/kernel/pcr.c b/arch/sparc/kernel/pcr.c index 2d94e7a03af5..c4a6a50b4849 100644 --- a/arch/sparc/kernel/pcr.c +++ b/arch/sparc/kernel/pcr.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/irq.h> | 8 | #include <linux/irq.h> |
| 9 | 9 | ||
| 10 | #include <linux/perf_event.h> | 10 | #include <linux/perf_event.h> |
| 11 | #include <linux/ftrace.h> | ||
| 11 | 12 | ||
| 12 | #include <asm/pil.h> | 13 | #include <asm/pil.h> |
| 13 | #include <asm/pcr.h> | 14 | #include <asm/pcr.h> |
| @@ -34,7 +35,7 @@ unsigned int picl_shift; | |||
| 34 | * Therefore in such situations we defer the work by signalling | 35 | * Therefore in such situations we defer the work by signalling |
| 35 | * a lower level cpu IRQ. | 36 | * a lower level cpu IRQ. |
| 36 | */ | 37 | */ |
| 37 | void deferred_pcr_work_irq(int irq, struct pt_regs *regs) | 38 | void __irq_entry deferred_pcr_work_irq(int irq, struct pt_regs *regs) |
| 38 | { | 39 | { |
| 39 | struct pt_regs *old_regs; | 40 | struct pt_regs *old_regs; |
| 40 | 41 | ||
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index c49865b30719..40e29fc8a4d6 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
| @@ -17,13 +17,13 @@ | |||
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/stddef.h> | 18 | #include <linux/stddef.h> |
| 19 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
| 20 | #include <linux/slab.h> | ||
| 21 | #include <linux/user.h> | 20 | #include <linux/user.h> |
| 22 | #include <linux/smp.h> | 21 | #include <linux/smp.h> |
| 23 | #include <linux/reboot.h> | 22 | #include <linux/reboot.h> |
| 24 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
| 25 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
| 26 | #include <linux/init.h> | 25 | #include <linux/init.h> |
| 26 | #include <linux/slab.h> | ||
| 27 | 27 | ||
| 28 | #include <asm/auxio.h> | 28 | #include <asm/auxio.h> |
| 29 | #include <asm/oplib.h> | 29 | #include <asm/oplib.h> |
diff --git a/arch/sparc/kernel/ptrace_32.c b/arch/sparc/kernel/ptrace_32.c index 7e3dfd9bb97e..e608f397e11f 100644 --- a/arch/sparc/kernel/ptrace_32.c +++ b/arch/sparc/kernel/ptrace_32.c | |||
| @@ -65,6 +65,7 @@ static int genregs32_get(struct task_struct *target, | |||
| 65 | *k++ = regs->u_regs[pos++]; | 65 | *k++ = regs->u_regs[pos++]; |
| 66 | 66 | ||
| 67 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; | 67 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; |
| 68 | reg_window -= 16; | ||
| 68 | for (; count > 0 && pos < 32; count--) { | 69 | for (; count > 0 && pos < 32; count--) { |
| 69 | if (get_user(*k++, ®_window[pos++])) | 70 | if (get_user(*k++, ®_window[pos++])) |
| 70 | return -EFAULT; | 71 | return -EFAULT; |
| @@ -76,6 +77,7 @@ static int genregs32_get(struct task_struct *target, | |||
| 76 | } | 77 | } |
| 77 | 78 | ||
| 78 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; | 79 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; |
| 80 | reg_window -= 16; | ||
| 79 | for (; count > 0 && pos < 32; count--) { | 81 | for (; count > 0 && pos < 32; count--) { |
| 80 | if (get_user(reg, ®_window[pos++]) || | 82 | if (get_user(reg, ®_window[pos++]) || |
| 81 | put_user(reg, u++)) | 83 | put_user(reg, u++)) |
| @@ -141,6 +143,7 @@ static int genregs32_set(struct task_struct *target, | |||
| 141 | regs->u_regs[pos++] = *k++; | 143 | regs->u_regs[pos++] = *k++; |
| 142 | 144 | ||
| 143 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; | 145 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; |
| 146 | reg_window -= 16; | ||
| 144 | for (; count > 0 && pos < 32; count--) { | 147 | for (; count > 0 && pos < 32; count--) { |
| 145 | if (put_user(*k++, ®_window[pos++])) | 148 | if (put_user(*k++, ®_window[pos++])) |
| 146 | return -EFAULT; | 149 | return -EFAULT; |
| @@ -153,6 +156,7 @@ static int genregs32_set(struct task_struct *target, | |||
| 153 | } | 156 | } |
| 154 | 157 | ||
| 155 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; | 158 | reg_window = (unsigned long __user *) regs->u_regs[UREG_I6]; |
| 159 | reg_window -= 16; | ||
| 156 | for (; count > 0 && pos < 32; count--) { | 160 | for (; count > 0 && pos < 32; count--) { |
| 157 | if (get_user(reg, u++) || | 161 | if (get_user(reg, u++) || |
| 158 | put_user(reg, ®_window[pos++])) | 162 | put_user(reg, ®_window[pos++])) |
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index 2f6524d1a817..aa90da08bf61 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c | |||
| @@ -492,6 +492,7 @@ static int genregs32_get(struct task_struct *target, | |||
| 492 | *k++ = regs->u_regs[pos++]; | 492 | *k++ = regs->u_regs[pos++]; |
| 493 | 493 | ||
| 494 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 494 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
| 495 | reg_window -= 16; | ||
| 495 | if (target == current) { | 496 | if (target == current) { |
| 496 | for (; count > 0 && pos < 32; count--) { | 497 | for (; count > 0 && pos < 32; count--) { |
| 497 | if (get_user(*k++, ®_window[pos++])) | 498 | if (get_user(*k++, ®_window[pos++])) |
| @@ -516,6 +517,7 @@ static int genregs32_get(struct task_struct *target, | |||
| 516 | } | 517 | } |
| 517 | 518 | ||
| 518 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 519 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
| 520 | reg_window -= 16; | ||
| 519 | if (target == current) { | 521 | if (target == current) { |
| 520 | for (; count > 0 && pos < 32; count--) { | 522 | for (; count > 0 && pos < 32; count--) { |
| 521 | if (get_user(reg, ®_window[pos++]) || | 523 | if (get_user(reg, ®_window[pos++]) || |
| @@ -599,6 +601,7 @@ static int genregs32_set(struct task_struct *target, | |||
| 599 | regs->u_regs[pos++] = *k++; | 601 | regs->u_regs[pos++] = *k++; |
| 600 | 602 | ||
| 601 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 603 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
| 604 | reg_window -= 16; | ||
| 602 | if (target == current) { | 605 | if (target == current) { |
| 603 | for (; count > 0 && pos < 32; count--) { | 606 | for (; count > 0 && pos < 32; count--) { |
| 604 | if (put_user(*k++, ®_window[pos++])) | 607 | if (put_user(*k++, ®_window[pos++])) |
| @@ -625,6 +628,7 @@ static int genregs32_set(struct task_struct *target, | |||
| 625 | } | 628 | } |
| 626 | 629 | ||
| 627 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; | 630 | reg_window = (compat_ulong_t __user *) regs->u_regs[UREG_I6]; |
| 631 | reg_window -= 16; | ||
| 628 | if (target == current) { | 632 | if (target == current) { |
| 629 | for (; count > 0 && pos < 32; count--) { | 633 | for (; count > 0 && pos < 32; count--) { |
| 630 | if (get_user(reg, u++) || | 634 | if (get_user(reg, u++) || |
diff --git a/arch/sparc/kernel/rtrap_64.S b/arch/sparc/kernel/rtrap_64.S index 83f1873c6c13..090b9e9ad5e3 100644 --- a/arch/sparc/kernel/rtrap_64.S +++ b/arch/sparc/kernel/rtrap_64.S | |||
| @@ -130,7 +130,17 @@ rtrap_xcall: | |||
| 130 | nop | 130 | nop |
| 131 | call trace_hardirqs_on | 131 | call trace_hardirqs_on |
| 132 | nop | 132 | nop |
| 133 | wrpr %l4, %pil | 133 | /* Do not actually set the %pil here. We will do that |
| 134 | * below after we clear PSTATE_IE in the %pstate register. | ||
| 135 | * If we re-enable interrupts here, we can recurse down | ||
| 136 | * the hardirq stack potentially endlessly, causing a | ||
| 137 | * stack overflow. | ||
| 138 | * | ||
| 139 | * It is tempting to put this test and trace_hardirqs_on | ||
| 140 | * call at the 'rt_continue' label, but that will not work | ||
| 141 | * as that path hits unconditionally and we do not want to | ||
| 142 | * execute this in NMI return paths, for example. | ||
| 143 | */ | ||
| 134 | #endif | 144 | #endif |
| 135 | rtrap_no_irq_enable: | 145 | rtrap_no_irq_enable: |
| 136 | andcc %l1, TSTATE_PRIV, %l3 | 146 | andcc %l1, TSTATE_PRIV, %l3 |
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index a2a79e76344f..5f72de67588b 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include <linux/stddef.h> | 12 | #include <linux/stddef.h> |
| 13 | #include <linux/unistd.h> | 13 | #include <linux/unistd.h> |
| 14 | #include <linux/ptrace.h> | 14 | #include <linux/ptrace.h> |
| 15 | #include <linux/slab.h> | ||
| 16 | #include <asm/smp.h> | 15 | #include <asm/smp.h> |
| 17 | #include <linux/user.h> | 16 | #include <linux/user.h> |
| 18 | #include <linux/screen_info.h> | 17 | #include <linux/screen_info.h> |
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c index eb14844a0021..b6a2b8f47040 100644 --- a/arch/sparc/kernel/smp_64.c +++ b/arch/sparc/kernel/smp_64.c | |||
| @@ -22,7 +22,9 @@ | |||
| 22 | #include <linux/profile.h> | 22 | #include <linux/profile.h> |
| 23 | #include <linux/bootmem.h> | 23 | #include <linux/bootmem.h> |
| 24 | #include <linux/vmalloc.h> | 24 | #include <linux/vmalloc.h> |
| 25 | #include <linux/ftrace.h> | ||
| 25 | #include <linux/cpu.h> | 26 | #include <linux/cpu.h> |
| 27 | #include <linux/slab.h> | ||
| 26 | 28 | ||
| 27 | #include <asm/head.h> | 29 | #include <asm/head.h> |
| 28 | #include <asm/ptrace.h> | 30 | #include <asm/ptrace.h> |
| @@ -822,13 +824,13 @@ void arch_send_call_function_single_ipi(int cpu) | |||
| 822 | &cpumask_of_cpu(cpu)); | 824 | &cpumask_of_cpu(cpu)); |
| 823 | } | 825 | } |
| 824 | 826 | ||
| 825 | void smp_call_function_client(int irq, struct pt_regs *regs) | 827 | void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs) |
| 826 | { | 828 | { |
| 827 | clear_softint(1 << irq); | 829 | clear_softint(1 << irq); |
| 828 | generic_smp_call_function_interrupt(); | 830 | generic_smp_call_function_interrupt(); |
| 829 | } | 831 | } |
| 830 | 832 | ||
| 831 | void smp_call_function_single_client(int irq, struct pt_regs *regs) | 833 | void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs) |
| 832 | { | 834 | { |
| 833 | clear_softint(1 << irq); | 835 | clear_softint(1 << irq); |
| 834 | generic_smp_call_function_single_interrupt(); | 836 | generic_smp_call_function_single_interrupt(); |
| @@ -964,7 +966,7 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) | |||
| 964 | put_cpu(); | 966 | put_cpu(); |
| 965 | } | 967 | } |
| 966 | 968 | ||
| 967 | void smp_new_mmu_context_version_client(int irq, struct pt_regs *regs) | 969 | void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs) |
| 968 | { | 970 | { |
| 969 | struct mm_struct *mm; | 971 | struct mm_struct *mm; |
| 970 | unsigned long flags; | 972 | unsigned long flags; |
| @@ -1148,7 +1150,7 @@ void smp_release(void) | |||
| 1148 | */ | 1150 | */ |
| 1149 | extern void prom_world(int); | 1151 | extern void prom_world(int); |
| 1150 | 1152 | ||
| 1151 | void smp_penguin_jailcell(int irq, struct pt_regs *regs) | 1153 | void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs) |
| 1152 | { | 1154 | { |
| 1153 | clear_softint(1 << irq); | 1155 | clear_softint(1 << irq); |
| 1154 | 1156 | ||
| @@ -1364,7 +1366,7 @@ void smp_send_reschedule(int cpu) | |||
| 1364 | &cpumask_of_cpu(cpu)); | 1366 | &cpumask_of_cpu(cpu)); |
| 1365 | } | 1367 | } |
| 1366 | 1368 | ||
| 1367 | void smp_receive_signal_client(int irq, struct pt_regs *regs) | 1369 | void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs) |
| 1368 | { | 1370 | { |
| 1369 | clear_softint(1 << irq); | 1371 | clear_softint(1 << irq); |
| 1370 | } | 1372 | } |
diff --git a/arch/sparc/kernel/sun4c_irq.c b/arch/sparc/kernel/sun4c_irq.c index bc3adbf79c6a..892fb884910a 100644 --- a/arch/sparc/kernel/sun4c_irq.c +++ b/arch/sparc/kernel/sun4c_irq.c | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/ptrace.h> | 17 | #include <linux/ptrace.h> |
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/slab.h> | ||
| 20 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 21 | #include <linux/of.h> | 20 | #include <linux/of.h> |
| 22 | #include <linux/of_device.h> | 21 | #include <linux/of_device.h> |
diff --git a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c index 301892e2d718..7f3b97ff62c1 100644 --- a/arch/sparc/kernel/sun4m_irq.c +++ b/arch/sparc/kernel/sun4m_irq.c | |||
| @@ -17,7 +17,6 @@ | |||
| 17 | #include <linux/ptrace.h> | 17 | #include <linux/ptrace.h> |
| 18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
| 19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 20 | #include <linux/slab.h> | ||
| 21 | #include <linux/init.h> | 20 | #include <linux/init.h> |
| 22 | #include <linux/ioport.h> | 21 | #include <linux/ioport.h> |
| 23 | #include <linux/of.h> | 22 | #include <linux/of.h> |
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c index daded3b96398..c0ca87553e1c 100644 --- a/arch/sparc/kernel/sys_sparc32.c +++ b/arch/sparc/kernel/sys_sparc32.c | |||
| @@ -21,7 +21,6 @@ | |||
| 21 | #include <linux/sem.h> | 21 | #include <linux/sem.h> |
| 22 | #include <linux/msg.h> | 22 | #include <linux/msg.h> |
| 23 | #include <linux/shm.h> | 23 | #include <linux/shm.h> |
| 24 | #include <linux/slab.h> | ||
| 25 | #include <linux/uio.h> | 24 | #include <linux/uio.h> |
| 26 | #include <linux/nfs_fs.h> | 25 | #include <linux/nfs_fs.h> |
| 27 | #include <linux/quota.h> | 26 | #include <linux/quota.h> |
| @@ -44,6 +43,7 @@ | |||
| 44 | #include <linux/compat.h> | 43 | #include <linux/compat.h> |
| 45 | #include <linux/vfs.h> | 44 | #include <linux/vfs.h> |
| 46 | #include <linux/ptrace.h> | 45 | #include <linux/ptrace.h> |
| 46 | #include <linux/slab.h> | ||
| 47 | 47 | ||
| 48 | #include <asm/types.h> | 48 | #include <asm/types.h> |
| 49 | #include <asm/uaccess.h> | 49 | #include <asm/uaccess.h> |
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c index 67e165102885..c7bbe6cf7b85 100644 --- a/arch/sparc/kernel/time_64.c +++ b/arch/sparc/kernel/time_64.c | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | #include <linux/clocksource.h> | 35 | #include <linux/clocksource.h> |
| 36 | #include <linux/of_device.h> | 36 | #include <linux/of_device.h> |
| 37 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
| 38 | #include <linux/ftrace.h> | ||
| 38 | 39 | ||
| 39 | #include <asm/oplib.h> | 40 | #include <asm/oplib.h> |
| 40 | #include <asm/timer.h> | 41 | #include <asm/timer.h> |
| @@ -717,7 +718,7 @@ static struct clock_event_device sparc64_clockevent = { | |||
| 717 | }; | 718 | }; |
| 718 | static DEFINE_PER_CPU(struct clock_event_device, sparc64_events); | 719 | static DEFINE_PER_CPU(struct clock_event_device, sparc64_events); |
| 719 | 720 | ||
| 720 | void timer_interrupt(int irq, struct pt_regs *regs) | 721 | void __irq_entry timer_interrupt(int irq, struct pt_regs *regs) |
| 721 | { | 722 | { |
| 722 | struct pt_regs *old_regs = set_irq_regs(regs); | 723 | struct pt_regs *old_regs = set_irq_regs(regs); |
| 723 | unsigned long tick_mask = tick_ops->softint_mask; | 724 | unsigned long tick_mask = tick_ops->softint_mask; |
| @@ -728,6 +729,7 @@ void timer_interrupt(int irq, struct pt_regs *regs) | |||
| 728 | 729 | ||
| 729 | irq_enter(); | 730 | irq_enter(); |
| 730 | 731 | ||
| 732 | local_cpu_data().irq0_irqs++; | ||
| 731 | kstat_incr_irqs_this_cpu(0, irq_to_desc(0)); | 733 | kstat_incr_irqs_this_cpu(0, irq_to_desc(0)); |
| 732 | 734 | ||
| 733 | if (unlikely(!evt->event_handler)) { | 735 | if (unlikely(!evt->event_handler)) { |
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index bdc05a21908b..9da57f032983 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
| 18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
| 19 | #include <linux/kdebug.h> | 19 | #include <linux/kdebug.h> |
| 20 | #include <linux/gfp.h> | ||
| 20 | 21 | ||
| 21 | #include <asm/smp.h> | 22 | #include <asm/smp.h> |
| 22 | #include <asm/delay.h> | 23 | #include <asm/delay.h> |
| @@ -2202,27 +2203,6 @@ void dump_stack(void) | |||
| 2202 | 2203 | ||
| 2203 | EXPORT_SYMBOL(dump_stack); | 2204 | EXPORT_SYMBOL(dump_stack); |
| 2204 | 2205 | ||
| 2205 | static inline int is_kernel_stack(struct task_struct *task, | ||
| 2206 | struct reg_window *rw) | ||
| 2207 | { | ||
| 2208 | unsigned long rw_addr = (unsigned long) rw; | ||
| 2209 | unsigned long thread_base, thread_end; | ||
| 2210 | |||
| 2211 | if (rw_addr < PAGE_OFFSET) { | ||
| 2212 | if (task != &init_task) | ||
| 2213 | return 0; | ||
| 2214 | } | ||
| 2215 | |||
| 2216 | thread_base = (unsigned long) task_stack_page(task); | ||
| 2217 | thread_end = thread_base + sizeof(union thread_union); | ||
| 2218 | if (rw_addr >= thread_base && | ||
| 2219 | rw_addr < thread_end && | ||
| 2220 | !(rw_addr & 0x7UL)) | ||
| 2221 | return 1; | ||
| 2222 | |||
| 2223 | return 0; | ||
| 2224 | } | ||
| 2225 | |||
| 2226 | static inline struct reg_window *kernel_stack_up(struct reg_window *rw) | 2206 | static inline struct reg_window *kernel_stack_up(struct reg_window *rw) |
| 2227 | { | 2207 | { |
| 2228 | unsigned long fp = rw->ins[6]; | 2208 | unsigned long fp = rw->ins[6]; |
| @@ -2251,6 +2231,7 @@ void die_if_kernel(char *str, struct pt_regs *regs) | |||
| 2251 | show_regs(regs); | 2231 | show_regs(regs); |
| 2252 | add_taint(TAINT_DIE); | 2232 | add_taint(TAINT_DIE); |
| 2253 | if (regs->tstate & TSTATE_PRIV) { | 2233 | if (regs->tstate & TSTATE_PRIV) { |
| 2234 | struct thread_info *tp = current_thread_info(); | ||
| 2254 | struct reg_window *rw = (struct reg_window *) | 2235 | struct reg_window *rw = (struct reg_window *) |
| 2255 | (regs->u_regs[UREG_FP] + STACK_BIAS); | 2236 | (regs->u_regs[UREG_FP] + STACK_BIAS); |
| 2256 | 2237 | ||
| @@ -2258,8 +2239,8 @@ void die_if_kernel(char *str, struct pt_regs *regs) | |||
| 2258 | * find some badly aligned kernel stack. | 2239 | * find some badly aligned kernel stack. |
| 2259 | */ | 2240 | */ |
| 2260 | while (rw && | 2241 | while (rw && |
| 2261 | count++ < 30&& | 2242 | count++ < 30 && |
| 2262 | is_kernel_stack(current, rw)) { | 2243 | kstack_valid(tp, (unsigned long) rw)) { |
| 2263 | printk("Caller[%016lx]: %pS\n", rw->ins[7], | 2244 | printk("Caller[%016lx]: %pS\n", rw->ins[7], |
| 2264 | (void *) rw->ins[7]); | 2245 | (void *) rw->ins[7]); |
| 2265 | 2246 | ||
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c index ebce43018c49..c752c4c479bd 100644 --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c | |||
| @@ -50,7 +50,7 @@ static inline enum direction decode_direction(unsigned int insn) | |||
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | /* 16 = double-word, 8 = extra-word, 4 = word, 2 = half-word */ | 52 | /* 16 = double-word, 8 = extra-word, 4 = word, 2 = half-word */ |
| 53 | static inline int decode_access_size(unsigned int insn) | 53 | static inline int decode_access_size(struct pt_regs *regs, unsigned int insn) |
| 54 | { | 54 | { |
| 55 | unsigned int tmp; | 55 | unsigned int tmp; |
| 56 | 56 | ||
| @@ -66,7 +66,7 @@ static inline int decode_access_size(unsigned int insn) | |||
| 66 | return 2; | 66 | return 2; |
| 67 | else { | 67 | else { |
| 68 | printk("Impossible unaligned trap. insn=%08x\n", insn); | 68 | printk("Impossible unaligned trap. insn=%08x\n", insn); |
| 69 | die_if_kernel("Byte sized unaligned access?!?!", current_thread_info()->kregs); | 69 | die_if_kernel("Byte sized unaligned access?!?!", regs); |
| 70 | 70 | ||
| 71 | /* GCC should never warn that control reaches the end | 71 | /* GCC should never warn that control reaches the end |
| 72 | * of this function without returning a value because | 72 | * of this function without returning a value because |
| @@ -286,7 +286,7 @@ static void log_unaligned(struct pt_regs *regs) | |||
| 286 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) | 286 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) |
| 287 | { | 287 | { |
| 288 | enum direction dir = decode_direction(insn); | 288 | enum direction dir = decode_direction(insn); |
| 289 | int size = decode_access_size(insn); | 289 | int size = decode_access_size(regs, insn); |
| 290 | int orig_asi, asi; | 290 | int orig_asi, asi; |
| 291 | 291 | ||
| 292 | current_thread_info()->kern_una_regs = regs; | 292 | current_thread_info()->kern_una_regs = regs; |
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c index c28c71449a6c..3cb1def9806c 100644 --- a/arch/sparc/kernel/vio.c +++ b/arch/sparc/kernel/vio.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/slab.h> | ||
| 13 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
| 14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| 15 | 16 | ||
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S index 4e5992593967..0c1e6783657f 100644 --- a/arch/sparc/kernel/vmlinux.lds.S +++ b/arch/sparc/kernel/vmlinux.lds.S | |||
| @@ -46,11 +46,16 @@ SECTIONS | |||
| 46 | SCHED_TEXT | 46 | SCHED_TEXT |
| 47 | LOCK_TEXT | 47 | LOCK_TEXT |
| 48 | KPROBES_TEXT | 48 | KPROBES_TEXT |
| 49 | IRQENTRY_TEXT | ||
| 49 | *(.gnu.warning) | 50 | *(.gnu.warning) |
| 50 | } = 0 | 51 | } = 0 |
| 51 | _etext = .; | 52 | _etext = .; |
| 52 | 53 | ||
| 53 | RO_DATA(PAGE_SIZE) | 54 | RO_DATA(PAGE_SIZE) |
| 55 | |||
| 56 | /* Start of data section */ | ||
| 57 | _sdata = .; | ||
| 58 | |||
| 54 | .data1 : { | 59 | .data1 : { |
| 55 | *(.data1) | 60 | *(.data1) |
| 56 | } | 61 | } |
diff --git a/arch/sparc/lib/mcount.S b/arch/sparc/lib/mcount.S index 24b8b12deed2..3ad6cbdc2163 100644 --- a/arch/sparc/lib/mcount.S +++ b/arch/sparc/lib/mcount.S | |||
| @@ -7,26 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | #include <linux/linkage.h> | 8 | #include <linux/linkage.h> |
| 9 | 9 | ||
| 10 | #include <asm/ptrace.h> | ||
| 11 | #include <asm/thread_info.h> | ||
| 12 | |||
| 13 | /* | 10 | /* |
| 14 | * This is the main variant and is called by C code. GCC's -pg option | 11 | * This is the main variant and is called by C code. GCC's -pg option |
| 15 | * automatically instruments every C function with a call to this. | 12 | * automatically instruments every C function with a call to this. |
| 16 | */ | 13 | */ |
| 17 | 14 | ||
| 18 | #ifdef CONFIG_STACK_DEBUG | ||
| 19 | |||
| 20 | #define OVSTACKSIZE 4096 /* lets hope this is enough */ | ||
| 21 | |||
| 22 | .data | ||
| 23 | .align 8 | ||
| 24 | panicstring: | ||
| 25 | .asciz "Stack overflow\n" | ||
| 26 | .align 8 | ||
| 27 | ovstack: | ||
| 28 | .skip OVSTACKSIZE | ||
| 29 | #endif | ||
| 30 | .text | 15 | .text |
| 31 | .align 32 | 16 | .align 32 |
| 32 | .globl _mcount | 17 | .globl _mcount |
| @@ -35,84 +20,48 @@ ovstack: | |||
| 35 | .type mcount,#function | 20 | .type mcount,#function |
| 36 | _mcount: | 21 | _mcount: |
| 37 | mcount: | 22 | mcount: |
| 38 | #ifdef CONFIG_STACK_DEBUG | ||
| 39 | /* | ||
| 40 | * Check whether %sp is dangerously low. | ||
| 41 | */ | ||
| 42 | ldub [%g6 + TI_FPDEPTH], %g1 | ||
| 43 | srl %g1, 1, %g3 | ||
| 44 | add %g3, 1, %g3 | ||
| 45 | sllx %g3, 8, %g3 ! each fpregs frame is 256b | ||
| 46 | add %g3, 192, %g3 | ||
| 47 | add %g6, %g3, %g3 ! where does task_struct+frame end? | ||
| 48 | sub %g3, STACK_BIAS, %g3 | ||
| 49 | cmp %sp, %g3 | ||
| 50 | bg,pt %xcc, 1f | ||
| 51 | nop | ||
| 52 | lduh [%g6 + TI_CPU], %g1 | ||
| 53 | sethi %hi(hardirq_stack), %g3 | ||
| 54 | or %g3, %lo(hardirq_stack), %g3 | ||
| 55 | sllx %g1, 3, %g1 | ||
| 56 | ldx [%g3 + %g1], %g7 | ||
| 57 | sub %g7, STACK_BIAS, %g7 | ||
| 58 | cmp %sp, %g7 | ||
| 59 | bleu,pt %xcc, 2f | ||
| 60 | sethi %hi(THREAD_SIZE), %g3 | ||
| 61 | add %g7, %g3, %g7 | ||
| 62 | cmp %sp, %g7 | ||
| 63 | blu,pn %xcc, 1f | ||
| 64 | 2: sethi %hi(softirq_stack), %g3 | ||
| 65 | or %g3, %lo(softirq_stack), %g3 | ||
| 66 | ldx [%g3 + %g1], %g7 | ||
| 67 | sub %g7, STACK_BIAS, %g7 | ||
| 68 | cmp %sp, %g7 | ||
| 69 | bleu,pt %xcc, 3f | ||
| 70 | sethi %hi(THREAD_SIZE), %g3 | ||
| 71 | add %g7, %g3, %g7 | ||
| 72 | cmp %sp, %g7 | ||
| 73 | blu,pn %xcc, 1f | ||
| 74 | nop | ||
| 75 | /* If we are already on ovstack, don't hop onto it | ||
| 76 | * again, we are already trying to output the stack overflow | ||
| 77 | * message. | ||
| 78 | */ | ||
| 79 | 3: sethi %hi(ovstack), %g7 ! cant move to panic stack fast enough | ||
| 80 | or %g7, %lo(ovstack), %g7 | ||
| 81 | add %g7, OVSTACKSIZE, %g3 | ||
| 82 | sub %g3, STACK_BIAS + 192, %g3 | ||
| 83 | sub %g7, STACK_BIAS, %g7 | ||
| 84 | cmp %sp, %g7 | ||
| 85 | blu,pn %xcc, 2f | ||
| 86 | cmp %sp, %g3 | ||
| 87 | bleu,pn %xcc, 1f | ||
| 88 | nop | ||
| 89 | 2: mov %g3, %sp | ||
| 90 | sethi %hi(panicstring), %g3 | ||
| 91 | call prom_printf | ||
| 92 | or %g3, %lo(panicstring), %o0 | ||
| 93 | call prom_halt | ||
| 94 | nop | ||
| 95 | 1: | ||
| 96 | #endif | ||
| 97 | #ifdef CONFIG_FUNCTION_TRACER | 23 | #ifdef CONFIG_FUNCTION_TRACER |
| 98 | #ifdef CONFIG_DYNAMIC_FTRACE | 24 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 99 | mov %o7, %o0 | 25 | /* Do nothing, the retl/nop below is all we need. */ |
| 100 | .globl mcount_call | ||
| 101 | mcount_call: | ||
| 102 | call ftrace_stub | ||
| 103 | mov %o0, %o7 | ||
| 104 | #else | 26 | #else |
| 105 | sethi %hi(ftrace_trace_function), %g1 | 27 | sethi %hi(function_trace_stop), %g1 |
| 28 | lduw [%g1 + %lo(function_trace_stop)], %g2 | ||
| 29 | brnz,pn %g2, 2f | ||
| 30 | sethi %hi(ftrace_trace_function), %g1 | ||
| 106 | sethi %hi(ftrace_stub), %g2 | 31 | sethi %hi(ftrace_stub), %g2 |
| 107 | ldx [%g1 + %lo(ftrace_trace_function)], %g1 | 32 | ldx [%g1 + %lo(ftrace_trace_function)], %g1 |
| 108 | or %g2, %lo(ftrace_stub), %g2 | 33 | or %g2, %lo(ftrace_stub), %g2 |
| 109 | cmp %g1, %g2 | 34 | cmp %g1, %g2 |
| 110 | be,pn %icc, 1f | 35 | be,pn %icc, 1f |
| 111 | mov %i7, %o1 | 36 | mov %i7, %g3 |
| 112 | jmpl %g1, %g0 | 37 | save %sp, -176, %sp |
| 113 | mov %o7, %o0 | 38 | mov %g3, %o1 |
| 39 | jmpl %g1, %o7 | ||
| 40 | mov %i7, %o0 | ||
| 41 | ret | ||
| 42 | restore | ||
| 114 | /* not reached */ | 43 | /* not reached */ |
| 115 | 1: | 44 | 1: |
| 45 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 46 | sethi %hi(ftrace_graph_return), %g1 | ||
| 47 | ldx [%g1 + %lo(ftrace_graph_return)], %g3 | ||
| 48 | cmp %g2, %g3 | ||
| 49 | bne,pn %xcc, 5f | ||
| 50 | sethi %hi(ftrace_graph_entry_stub), %g2 | ||
| 51 | sethi %hi(ftrace_graph_entry), %g1 | ||
| 52 | or %g2, %lo(ftrace_graph_entry_stub), %g2 | ||
| 53 | ldx [%g1 + %lo(ftrace_graph_entry)], %g1 | ||
| 54 | cmp %g1, %g2 | ||
| 55 | be,pt %xcc, 2f | ||
| 56 | nop | ||
| 57 | 5: mov %i7, %g2 | ||
| 58 | mov %fp, %g3 | ||
| 59 | save %sp, -176, %sp | ||
| 60 | mov %g2, %l0 | ||
| 61 | ba,pt %xcc, ftrace_graph_caller | ||
| 62 | mov %g3, %l1 | ||
| 63 | #endif | ||
| 64 | 2: | ||
| 116 | #endif | 65 | #endif |
| 117 | #endif | 66 | #endif |
| 118 | retl | 67 | retl |
| @@ -131,14 +80,50 @@ ftrace_stub: | |||
| 131 | .globl ftrace_caller | 80 | .globl ftrace_caller |
| 132 | .type ftrace_caller,#function | 81 | .type ftrace_caller,#function |
| 133 | ftrace_caller: | 82 | ftrace_caller: |
| 134 | mov %i7, %o1 | 83 | sethi %hi(function_trace_stop), %g1 |
| 135 | mov %o7, %o0 | 84 | mov %i7, %g2 |
| 85 | lduw [%g1 + %lo(function_trace_stop)], %g1 | ||
| 86 | brnz,pn %g1, ftrace_stub | ||
| 87 | mov %fp, %g3 | ||
| 88 | save %sp, -176, %sp | ||
| 89 | mov %g2, %o1 | ||
| 90 | mov %g2, %l0 | ||
| 91 | mov %g3, %l1 | ||
| 136 | .globl ftrace_call | 92 | .globl ftrace_call |
| 137 | ftrace_call: | 93 | ftrace_call: |
| 138 | call ftrace_stub | 94 | call ftrace_stub |
| 139 | mov %o0, %o7 | 95 | mov %i7, %o0 |
| 140 | retl | 96 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
| 97 | .globl ftrace_graph_call | ||
| 98 | ftrace_graph_call: | ||
| 99 | call ftrace_stub | ||
| 141 | nop | 100 | nop |
| 101 | #endif | ||
| 102 | ret | ||
| 103 | restore | ||
| 104 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 105 | .size ftrace_graph_call,.-ftrace_graph_call | ||
| 106 | #endif | ||
| 107 | .size ftrace_call,.-ftrace_call | ||
| 142 | .size ftrace_caller,.-ftrace_caller | 108 | .size ftrace_caller,.-ftrace_caller |
| 143 | #endif | 109 | #endif |
| 144 | #endif | 110 | #endif |
| 111 | |||
| 112 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
| 113 | ENTRY(ftrace_graph_caller) | ||
| 114 | mov %l0, %o0 | ||
| 115 | mov %i7, %o1 | ||
| 116 | call prepare_ftrace_return | ||
| 117 | mov %l1, %o2 | ||
| 118 | ret | ||
| 119 | restore %o0, -8, %i7 | ||
| 120 | END(ftrace_graph_caller) | ||
| 121 | |||
| 122 | ENTRY(return_to_handler) | ||
| 123 | save %sp, -176, %sp | ||
| 124 | call ftrace_return_to_handler | ||
| 125 | mov %fp, %o0 | ||
| 126 | jmpl %o0 + 8, %g0 | ||
| 127 | restore | ||
| 128 | END(return_to_handler) | ||
| 129 | #endif | ||
diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c index f27d10369e0c..5fdddf134caa 100644 --- a/arch/sparc/mm/hugetlbpage.c +++ b/arch/sparc/mm/hugetlbpage.c | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | #include <linux/mm.h> | 10 | #include <linux/mm.h> |
| 11 | #include <linux/hugetlb.h> | 11 | #include <linux/hugetlb.h> |
| 12 | #include <linux/pagemap.h> | 12 | #include <linux/pagemap.h> |
| 13 | #include <linux/slab.h> | ||
| 14 | #include <linux/sysctl.h> | 13 | #include <linux/sysctl.h> |
| 15 | 14 | ||
| 16 | #include <asm/mman.h> | 15 | #include <asm/mman.h> |
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c index dc7c3b17a15f..6d0e02c4fe09 100644 --- a/arch/sparc/mm/init_32.c +++ b/arch/sparc/mm/init_32.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/bootmem.h> | 24 | #include <linux/bootmem.h> |
| 25 | #include <linux/pagemap.h> | 25 | #include <linux/pagemap.h> |
| 26 | #include <linux/poison.h> | 26 | #include <linux/poison.h> |
| 27 | #include <linux/gfp.h> | ||
| 27 | 28 | ||
| 28 | #include <asm/sections.h> | 29 | #include <asm/sections.h> |
| 29 | #include <asm/system.h> | 30 | #include <asm/system.h> |
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 9245a822a2f1..b2831dc3c121 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | #include <linux/bootmem.h> | 13 | #include <linux/bootmem.h> |
| 14 | #include <linux/mm.h> | 14 | #include <linux/mm.h> |
| 15 | #include <linux/hugetlb.h> | 15 | #include <linux/hugetlb.h> |
| 16 | #include <linux/slab.h> | ||
| 17 | #include <linux/initrd.h> | 16 | #include <linux/initrd.h> |
| 18 | #include <linux/swap.h> | 17 | #include <linux/swap.h> |
| 19 | #include <linux/pagemap.h> | 18 | #include <linux/pagemap.h> |
| @@ -26,6 +25,7 @@ | |||
| 26 | #include <linux/percpu.h> | 25 | #include <linux/percpu.h> |
| 27 | #include <linux/lmb.h> | 26 | #include <linux/lmb.h> |
| 28 | #include <linux/mmzone.h> | 27 | #include <linux/mmzone.h> |
| 28 | #include <linux/gfp.h> | ||
| 29 | 29 | ||
| 30 | #include <asm/head.h> | 30 | #include <asm/head.h> |
| 31 | #include <asm/system.h> | 31 | #include <asm/system.h> |
| @@ -2117,7 +2117,7 @@ int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node) | |||
| 2117 | "node=%d entry=%lu/%lu\n", start, block, nr, | 2117 | "node=%d entry=%lu/%lu\n", start, block, nr, |
| 2118 | node, | 2118 | node, |
| 2119 | addr >> VMEMMAP_CHUNK_SHIFT, | 2119 | addr >> VMEMMAP_CHUNK_SHIFT, |
| 2120 | VMEMMAP_SIZE >> VMEMMAP_CHUNK_SHIFT); | 2120 | VMEMMAP_SIZE); |
| 2121 | } | 2121 | } |
| 2122 | } | 2122 | } |
| 2123 | return 0; | 2123 | return 0; |
diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index df49b200ca4c..f5f75a58e0b3 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c | |||
| @@ -10,7 +10,6 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
| 13 | #include <linux/slab.h> | ||
| 14 | #include <linux/vmalloc.h> | 13 | #include <linux/vmalloc.h> |
| 15 | #include <linux/pagemap.h> | 14 | #include <linux/pagemap.h> |
| 16 | #include <linux/init.h> | 15 | #include <linux/init.h> |
| @@ -20,6 +19,7 @@ | |||
| 20 | #include <linux/seq_file.h> | 19 | #include <linux/seq_file.h> |
| 21 | #include <linux/kdebug.h> | 20 | #include <linux/kdebug.h> |
| 22 | #include <linux/log2.h> | 21 | #include <linux/log2.h> |
| 22 | #include <linux/gfp.h> | ||
| 23 | 23 | ||
| 24 | #include <asm/bitext.h> | 24 | #include <asm/bitext.h> |
| 25 | #include <asm/page.h> | 25 | #include <asm/page.h> |
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index 18652534b91a..cf38846753dd 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
| 14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
| 15 | #include <linux/slab.h> | ||
| 15 | #include <linux/bootmem.h> | 16 | #include <linux/bootmem.h> |
| 16 | #include <linux/highmem.h> | 17 | #include <linux/highmem.h> |
| 17 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
diff --git a/arch/sparc/mm/tsb.c b/arch/sparc/mm/tsb.c index 36a0813f9517..101d7c82870b 100644 --- a/arch/sparc/mm/tsb.c +++ b/arch/sparc/mm/tsb.c | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
| 7 | #include <linux/preempt.h> | 7 | #include <linux/preempt.h> |
| 8 | #include <linux/slab.h> | ||
| 8 | #include <asm/system.h> | 9 | #include <asm/system.h> |
| 9 | #include <asm/page.h> | 10 | #include <asm/page.h> |
| 10 | #include <asm/tlbflush.h> | 11 | #include <asm/tlbflush.h> |
