diff options
Diffstat (limited to 'arch')
223 files changed, 2020 insertions, 1429 deletions
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h index 4554ecbff7c6..1f8c72959fb6 100644 --- a/arch/alpha/include/asm/thread_info.h +++ b/arch/alpha/include/asm/thread_info.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <asm/processor.h> | 7 | #include <asm/processor.h> |
8 | #include <asm/types.h> | 8 | #include <asm/types.h> |
9 | #include <asm/hwrpb.h> | 9 | #include <asm/hwrpb.h> |
10 | #include <asm/sysinfo.h> | ||
10 | #endif | 11 | #endif |
11 | 12 | ||
12 | #ifndef __ASSEMBLY__ | 13 | #ifndef __ASSEMBLY__ |
@@ -21,6 +22,7 @@ struct thread_info { | |||
21 | mm_segment_t addr_limit; /* thread address space */ | 22 | mm_segment_t addr_limit; /* thread address space */ |
22 | unsigned cpu; /* current CPU */ | 23 | unsigned cpu; /* current CPU */ |
23 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 24 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
25 | unsigned int status; /* thread-synchronous flags */ | ||
24 | 26 | ||
25 | int bpt_nsaved; | 27 | int bpt_nsaved; |
26 | unsigned long bpt_addr[2]; /* breakpoint handling */ | 28 | unsigned long bpt_addr[2]; /* breakpoint handling */ |
@@ -63,8 +65,6 @@ register struct thread_info *__current_thread_info __asm__("$8"); | |||
63 | * - these are process state flags and used from assembly | 65 | * - these are process state flags and used from assembly |
64 | * - pending work-to-be-done flags come first and must be assigned to be | 66 | * - pending work-to-be-done flags come first and must be assigned to be |
65 | * within bits 0 to 7 to fit in and immediate operand. | 67 | * within bits 0 to 7 to fit in and immediate operand. |
66 | * - ALPHA_UAC_SHIFT below must be kept consistent with the unaligned | ||
67 | * control flags. | ||
68 | * | 68 | * |
69 | * TIF_SYSCALL_TRACE is known to be 0 via blbs. | 69 | * TIF_SYSCALL_TRACE is known to be 0 via blbs. |
70 | */ | 70 | */ |
@@ -72,18 +72,12 @@ register struct thread_info *__current_thread_info __asm__("$8"); | |||
72 | #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ | 72 | #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ |
73 | #define TIF_SIGPENDING 2 /* signal pending */ | 73 | #define TIF_SIGPENDING 2 /* signal pending */ |
74 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 74 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
75 | #define TIF_POLLING_NRFLAG 8 /* poll_idle is polling NEED_RESCHED */ | ||
76 | #define TIF_DIE_IF_KERNEL 9 /* dik recursion lock */ | 75 | #define TIF_DIE_IF_KERNEL 9 /* dik recursion lock */ |
77 | #define TIF_UAC_NOPRINT 10 /* ! Preserve sequence of following */ | ||
78 | #define TIF_UAC_NOFIX 11 /* ! flags as they match */ | ||
79 | #define TIF_UAC_SIGBUS 12 /* ! userspace part of 'osf_sysinfo' */ | ||
80 | #define TIF_MEMDIE 13 /* is terminating due to OOM killer */ | 76 | #define TIF_MEMDIE 13 /* is terminating due to OOM killer */ |
81 | #define TIF_RESTORE_SIGMASK 14 /* restore signal mask in do_signal */ | ||
82 | 77 | ||
83 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 78 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
84 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) | 79 | #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) |
85 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) | 80 | #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) |
86 | #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) | ||
87 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) | 81 | #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) |
88 | 82 | ||
89 | /* Work to do on interrupt/exception return. */ | 83 | /* Work to do on interrupt/exception return. */ |
@@ -94,29 +88,63 @@ register struct thread_info *__current_thread_info __asm__("$8"); | |||
94 | #define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ | 88 | #define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \ |
95 | | _TIF_SYSCALL_TRACE) | 89 | | _TIF_SYSCALL_TRACE) |
96 | 90 | ||
97 | #define ALPHA_UAC_SHIFT TIF_UAC_NOPRINT | 91 | #define TS_UAC_NOPRINT 0x0001 /* ! Preserve the following three */ |
98 | #define ALPHA_UAC_MASK (1 << TIF_UAC_NOPRINT | 1 << TIF_UAC_NOFIX | \ | 92 | #define TS_UAC_NOFIX 0x0002 /* ! flags as they match */ |
99 | 1 << TIF_UAC_SIGBUS) | 93 | #define TS_UAC_SIGBUS 0x0004 /* ! userspace part of 'osf_sysinfo' */ |
94 | #define TS_RESTORE_SIGMASK 0x0008 /* restore signal mask in do_signal() */ | ||
95 | #define TS_POLLING 0x0010 /* idle task polling need_resched, | ||
96 | skip sending interrupt */ | ||
100 | 97 | ||
101 | #define SET_UNALIGN_CTL(task,value) ({ \ | 98 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) |
102 | task_thread_info(task)->flags = ((task_thread_info(task)->flags & \ | 99 | |
103 | ~ALPHA_UAC_MASK) \ | 100 | #ifndef __ASSEMBLY__ |
104 | | (((value) << ALPHA_UAC_SHIFT) & (1<<TIF_UAC_NOPRINT))\ | 101 | #define HAVE_SET_RESTORE_SIGMASK 1 |
105 | | (((value) << (ALPHA_UAC_SHIFT + 1)) & (1<<TIF_UAC_SIGBUS)) \ | 102 | static inline void set_restore_sigmask(void) |
106 | | (((value) << (ALPHA_UAC_SHIFT - 1)) & (1<<TIF_UAC_NOFIX)));\ | 103 | { |
104 | struct thread_info *ti = current_thread_info(); | ||
105 | ti->status |= TS_RESTORE_SIGMASK; | ||
106 | WARN_ON(!test_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags)); | ||
107 | } | ||
108 | static inline void clear_restore_sigmask(void) | ||
109 | { | ||
110 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
111 | } | ||
112 | static inline bool test_restore_sigmask(void) | ||
113 | { | ||
114 | return current_thread_info()->status & TS_RESTORE_SIGMASK; | ||
115 | } | ||
116 | static inline bool test_and_clear_restore_sigmask(void) | ||
117 | { | ||
118 | struct thread_info *ti = current_thread_info(); | ||
119 | if (!(ti->status & TS_RESTORE_SIGMASK)) | ||
120 | return false; | ||
121 | ti->status &= ~TS_RESTORE_SIGMASK; | ||
122 | return true; | ||
123 | } | ||
124 | #endif | ||
125 | |||
126 | #define SET_UNALIGN_CTL(task,value) ({ \ | ||
127 | __u32 status = task_thread_info(task)->status & ~UAC_BITMASK; \ | ||
128 | if (value & PR_UNALIGN_NOPRINT) \ | ||
129 | status |= TS_UAC_NOPRINT; \ | ||
130 | if (value & PR_UNALIGN_SIGBUS) \ | ||
131 | status |= TS_UAC_SIGBUS; \ | ||
132 | if (value & 4) /* alpha-specific */ \ | ||
133 | status |= TS_UAC_NOFIX; \ | ||
134 | task_thread_info(task)->status = status; \ | ||
107 | 0; }) | 135 | 0; }) |
108 | 136 | ||
109 | #define GET_UNALIGN_CTL(task,value) ({ \ | 137 | #define GET_UNALIGN_CTL(task,value) ({ \ |
110 | put_user((task_thread_info(task)->flags & (1 << TIF_UAC_NOPRINT))\ | 138 | __u32 status = task_thread_info(task)->status & ~UAC_BITMASK; \ |
111 | >> ALPHA_UAC_SHIFT \ | 139 | __u32 res = 0; \ |
112 | | (task_thread_info(task)->flags & (1 << TIF_UAC_SIGBUS))\ | 140 | if (status & TS_UAC_NOPRINT) \ |
113 | >> (ALPHA_UAC_SHIFT + 1) \ | 141 | res |= PR_UNALIGN_NOPRINT; \ |
114 | | (task_thread_info(task)->flags & (1 << TIF_UAC_NOFIX))\ | 142 | if (status & TS_UAC_SIGBUS) \ |
115 | >> (ALPHA_UAC_SHIFT - 1), \ | 143 | res |= PR_UNALIGN_SIGBUS; \ |
116 | (int __user *)(value)); \ | 144 | if (status & TS_UAC_NOFIX) \ |
145 | res |= 4; \ | ||
146 | put_user(res, (int __user *)(value)); \ | ||
117 | }) | 147 | }) |
118 | 148 | ||
119 | #define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG) | ||
120 | |||
121 | #endif /* __KERNEL__ */ | 149 | #endif /* __KERNEL__ */ |
122 | #endif /* _ALPHA_THREAD_INFO_H */ | 150 | #endif /* _ALPHA_THREAD_INFO_H */ |
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 9eb090582cf1..1e6956a90608 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -793,8 +793,7 @@ SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer, | |||
793 | case GSI_UACPROC: | 793 | case GSI_UACPROC: |
794 | if (nbytes < sizeof(unsigned int)) | 794 | if (nbytes < sizeof(unsigned int)) |
795 | return -EINVAL; | 795 | return -EINVAL; |
796 | w = (current_thread_info()->flags >> ALPHA_UAC_SHIFT) & | 796 | w = current_thread_info()->status & UAC_BITMASK; |
797 | UAC_BITMASK; | ||
798 | if (put_user(w, (unsigned int __user *)buffer)) | 797 | if (put_user(w, (unsigned int __user *)buffer)) |
799 | return -EFAULT; | 798 | return -EFAULT; |
800 | return 1; | 799 | return 1; |
@@ -904,24 +903,20 @@ SYSCALL_DEFINE5(osf_setsysinfo, unsigned long, op, void __user *, buffer, | |||
904 | break; | 903 | break; |
905 | 904 | ||
906 | case SSI_NVPAIRS: { | 905 | case SSI_NVPAIRS: { |
907 | unsigned long v, w, i; | 906 | unsigned __user *p = buffer; |
908 | unsigned int old, new; | 907 | unsigned i; |
909 | 908 | ||
910 | for (i = 0; i < nbytes; ++i) { | 909 | for (i = 0, p = buffer; i < nbytes; ++i, p += 2) { |
910 | unsigned v, w, status; | ||
911 | 911 | ||
912 | if (get_user(v, 2*i + (unsigned int __user *)buffer)) | 912 | if (get_user(v, p) || get_user(w, p + 1)) |
913 | return -EFAULT; | ||
914 | if (get_user(w, 2*i + 1 + (unsigned int __user *)buffer)) | ||
915 | return -EFAULT; | 913 | return -EFAULT; |
916 | switch (v) { | 914 | switch (v) { |
917 | case SSIN_UACPROC: | 915 | case SSIN_UACPROC: |
918 | again: | 916 | w &= UAC_BITMASK; |
919 | old = current_thread_info()->flags; | 917 | status = current_thread_info()->status; |
920 | new = old & ~(UAC_BITMASK << ALPHA_UAC_SHIFT); | 918 | status = (status & ~UAC_BITMASK) | w; |
921 | new = new | (w & UAC_BITMASK) << ALPHA_UAC_SHIFT; | 919 | current_thread_info()->status = status; |
922 | if (cmpxchg(¤t_thread_info()->flags, | ||
923 | old, new) != old) | ||
924 | goto again; | ||
925 | break; | 920 | break; |
926 | 921 | ||
927 | default: | 922 | default: |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 4054e0ffe2b2..51987dcf79b8 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -49,7 +49,7 @@ EXPORT_SYMBOL(pm_power_off); | |||
49 | void | 49 | void |
50 | cpu_idle(void) | 50 | cpu_idle(void) |
51 | { | 51 | { |
52 | set_thread_flag(TIF_POLLING_NRFLAG); | 52 | current_thread_info()->status |= TS_POLLING; |
53 | 53 | ||
54 | while (1) { | 54 | while (1) { |
55 | /* FIXME -- EV6 and LCA45 know how to power down | 55 | /* FIXME -- EV6 and LCA45 know how to power down |
diff --git a/arch/alpha/kernel/traps.c b/arch/alpha/kernel/traps.c index 80d987c0e9aa..272666d006df 100644 --- a/arch/alpha/kernel/traps.c +++ b/arch/alpha/kernel/traps.c | |||
@@ -780,17 +780,17 @@ do_entUnaUser(void __user * va, unsigned long opcode, | |||
780 | /* Check the UAC bits to decide what the user wants us to do | 780 | /* Check the UAC bits to decide what the user wants us to do |
781 | with the unaliged access. */ | 781 | with the unaliged access. */ |
782 | 782 | ||
783 | if (!test_thread_flag (TIF_UAC_NOPRINT)) { | 783 | if (!(current_thread_info()->status & TS_UAC_NOPRINT)) { |
784 | if (__ratelimit(&ratelimit)) { | 784 | if (__ratelimit(&ratelimit)) { |
785 | printk("%s(%d): unaligned trap at %016lx: %p %lx %ld\n", | 785 | printk("%s(%d): unaligned trap at %016lx: %p %lx %ld\n", |
786 | current->comm, task_pid_nr(current), | 786 | current->comm, task_pid_nr(current), |
787 | regs->pc - 4, va, opcode, reg); | 787 | regs->pc - 4, va, opcode, reg); |
788 | } | 788 | } |
789 | } | 789 | } |
790 | if (test_thread_flag (TIF_UAC_SIGBUS)) | 790 | if ((current_thread_info()->status & TS_UAC_SIGBUS)) |
791 | goto give_sigbus; | 791 | goto give_sigbus; |
792 | /* Not sure why you'd want to use this, but... */ | 792 | /* Not sure why you'd want to use this, but... */ |
793 | if (test_thread_flag (TIF_UAC_NOFIX)) | 793 | if ((current_thread_info()->status & TS_UAC_NOFIX)) |
794 | return; | 794 | return; |
795 | 795 | ||
796 | /* Don't bother reading ds in the access check since we already | 796 | /* Don't bother reading ds in the access check since we already |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 73067efd4845..ade7e924bef5 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -1603,8 +1603,8 @@ config NR_CPUS | |||
1603 | default "4" | 1603 | default "4" |
1604 | 1604 | ||
1605 | config HOTPLUG_CPU | 1605 | config HOTPLUG_CPU |
1606 | bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" | 1606 | bool "Support for hot-pluggable CPUs" |
1607 | depends on SMP && HOTPLUG && EXPERIMENTAL | 1607 | depends on SMP && HOTPLUG |
1608 | help | 1608 | help |
1609 | Say Y here to experiment with turning CPUs off and on. CPUs | 1609 | Say Y here to experiment with turning CPUs off and on. CPUs |
1610 | can be controlled through /sys/devices/system/cpu. | 1610 | can be controlled through /sys/devices/system/cpu. |
@@ -1645,8 +1645,8 @@ config HZ | |||
1645 | default 100 | 1645 | default 100 |
1646 | 1646 | ||
1647 | config THUMB2_KERNEL | 1647 | config THUMB2_KERNEL |
1648 | bool "Compile the kernel in Thumb-2 mode (EXPERIMENTAL)" | 1648 | bool "Compile the kernel in Thumb-2 mode" |
1649 | depends on CPU_V7 && !CPU_V6 && !CPU_V6K && EXPERIMENTAL | 1649 | depends on CPU_V7 && !CPU_V6 && !CPU_V6K |
1650 | select AEABI | 1650 | select AEABI |
1651 | select ARM_ASM_UNIFIED | 1651 | select ARM_ASM_UNIFIED |
1652 | select ARM_UNWIND | 1652 | select ARM_UNWIND |
@@ -1850,6 +1850,7 @@ config XEN_DOM0 | |||
1850 | config XEN | 1850 | config XEN |
1851 | bool "Xen guest support on ARM (EXPERIMENTAL)" | 1851 | bool "Xen guest support on ARM (EXPERIMENTAL)" |
1852 | depends on EXPERIMENTAL && ARM && OF | 1852 | depends on EXPERIMENTAL && ARM && OF |
1853 | depends on CPU_V7 && !CPU_V6 | ||
1853 | help | 1854 | help |
1854 | Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. | 1855 | Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. |
1855 | 1856 | ||
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index f023e3acdfbd..5f914fca911b 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -21,8 +21,6 @@ endif | |||
21 | OBJCOPYFLAGS :=-O binary -R .comment -S | 21 | OBJCOPYFLAGS :=-O binary -R .comment -S |
22 | GZFLAGS :=-9 | 22 | GZFLAGS :=-9 |
23 | #KBUILD_CFLAGS +=-pipe | 23 | #KBUILD_CFLAGS +=-pipe |
24 | # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: | ||
25 | KBUILD_CFLAGS +=$(call cc-option,-marm,) | ||
26 | 24 | ||
27 | # Never generate .eh_frame | 25 | # Never generate .eh_frame |
28 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) | 26 | KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm) |
@@ -105,17 +103,20 @@ endif | |||
105 | ifeq ($(CONFIG_THUMB2_KERNEL),y) | 103 | ifeq ($(CONFIG_THUMB2_KERNEL),y) |
106 | AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it) | 104 | AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it) |
107 | AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W) | 105 | AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W) |
108 | CFLAGS_THUMB2 :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN) | 106 | CFLAGS_ISA :=-mthumb $(AFLAGS_AUTOIT) $(AFLAGS_NOWARN) |
109 | AFLAGS_THUMB2 :=$(CFLAGS_THUMB2) -Wa$(comma)-mthumb | 107 | AFLAGS_ISA :=$(CFLAGS_ISA) -Wa$(comma)-mthumb |
110 | # Work around buggy relocation from gas if requested: | 108 | # Work around buggy relocation from gas if requested: |
111 | ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y) | 109 | ifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y) |
112 | CFLAGS_MODULE +=-fno-optimize-sibling-calls | 110 | CFLAGS_MODULE +=-fno-optimize-sibling-calls |
113 | endif | 111 | endif |
112 | else | ||
113 | CFLAGS_ISA :=$(call cc-option,-marm,) | ||
114 | AFLAGS_ISA :=$(CFLAGS_ISA) | ||
114 | endif | 115 | endif |
115 | 116 | ||
116 | # Need -Uarm for gcc < 3.x | 117 | # Need -Uarm for gcc < 3.x |
117 | KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_THUMB2) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm | 118 | KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm |
118 | KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_THUMB2) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float | 119 | KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float |
119 | 120 | ||
120 | CHECKFLAGS += -D__arm__ | 121 | CHECKFLAGS += -D__arm__ |
121 | 122 | ||
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 3fdab016aa5c..f2aa09eb658e 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile | |||
@@ -33,7 +33,7 @@ ifeq ($(CONFIG_XIP_KERNEL),y) | |||
33 | 33 | ||
34 | $(obj)/xipImage: vmlinux FORCE | 34 | $(obj)/xipImage: vmlinux FORCE |
35 | $(call if_changed,objcopy) | 35 | $(call if_changed,objcopy) |
36 | @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))' | 36 | $(kecho) ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))' |
37 | 37 | ||
38 | $(obj)/Image $(obj)/zImage: FORCE | 38 | $(obj)/Image $(obj)/zImage: FORCE |
39 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' | 39 | @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)' |
@@ -48,14 +48,14 @@ $(obj)/xipImage: FORCE | |||
48 | 48 | ||
49 | $(obj)/Image: vmlinux FORCE | 49 | $(obj)/Image: vmlinux FORCE |
50 | $(call if_changed,objcopy) | 50 | $(call if_changed,objcopy) |
51 | @echo ' Kernel: $@ is ready' | 51 | $(kecho) ' Kernel: $@ is ready' |
52 | 52 | ||
53 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE | 53 | $(obj)/compressed/vmlinux: $(obj)/Image FORCE |
54 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ | 54 | $(Q)$(MAKE) $(build)=$(obj)/compressed $@ |
55 | 55 | ||
56 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | 56 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE |
57 | $(call if_changed,objcopy) | 57 | $(call if_changed,objcopy) |
58 | @echo ' Kernel: $@ is ready' | 58 | $(kecho) ' Kernel: $@ is ready' |
59 | 59 | ||
60 | endif | 60 | endif |
61 | 61 | ||
@@ -90,7 +90,7 @@ fi | |||
90 | $(obj)/uImage: $(obj)/zImage FORCE | 90 | $(obj)/uImage: $(obj)/zImage FORCE |
91 | @$(check_for_multiple_loadaddr) | 91 | @$(check_for_multiple_loadaddr) |
92 | $(call if_changed,uimage) | 92 | $(call if_changed,uimage) |
93 | @echo ' Image $@ is ready' | 93 | $(kecho) ' Image $@ is ready' |
94 | 94 | ||
95 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE | 95 | $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE |
96 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ | 96 | $(Q)$(MAKE) $(build)=$(obj)/bootp $@ |
@@ -98,7 +98,7 @@ $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE | |||
98 | 98 | ||
99 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE | 99 | $(obj)/bootpImage: $(obj)/bootp/bootp FORCE |
100 | $(call if_changed,objcopy) | 100 | $(call if_changed,objcopy) |
101 | @echo ' Kernel: $@ is ready' | 101 | $(kecho) ' Kernel: $@ is ready' |
102 | 102 | ||
103 | PHONY += initrd FORCE | 103 | PHONY += initrd FORCE |
104 | initrd: | 104 | initrd: |
diff --git a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi index b06c0db273b1..e6391a4e6649 100644 --- a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi +++ b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi | |||
@@ -126,14 +126,14 @@ | |||
126 | #size-cells = <0>; | 126 | #size-cells = <0>; |
127 | 127 | ||
128 | btn3 { | 128 | btn3 { |
129 | label = "Buttin 3"; | 129 | label = "Button 3"; |
130 | gpios = <&pioA 30 1>; | 130 | gpios = <&pioA 30 1>; |
131 | linux,code = <0x103>; | 131 | linux,code = <0x103>; |
132 | gpio-key,wakeup; | 132 | gpio-key,wakeup; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | btn4 { | 135 | btn4 { |
136 | label = "Buttin 4"; | 136 | label = "Button 4"; |
137 | gpios = <&pioA 31 1>; | 137 | gpios = <&pioA 31 1>; |
138 | linux,code = <0x104>; | 138 | linux,code = <0x104>; |
139 | gpio-key,wakeup; | 139 | gpio-key,wakeup; |
diff --git a/arch/arm/boot/dts/dbx5x0.dtsi b/arch/arm/boot/dts/dbx5x0.dtsi index 748ba7aa746c..4b0e0ca08f40 100644 --- a/arch/arm/boot/dts/dbx5x0.dtsi +++ b/arch/arm/boot/dts/dbx5x0.dtsi | |||
@@ -483,6 +483,8 @@ | |||
483 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; | 483 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; |
484 | reg = <0x80004000 0x1000>; | 484 | reg = <0x80004000 0x1000>; |
485 | interrupts = <0 21 0x4>; | 485 | interrupts = <0 21 0x4>; |
486 | arm,primecell-periphid = <0x180024>; | ||
487 | |||
486 | #address-cells = <1>; | 488 | #address-cells = <1>; |
487 | #size-cells = <0>; | 489 | #size-cells = <0>; |
488 | v-i2c-supply = <&db8500_vape_reg>; | 490 | v-i2c-supply = <&db8500_vape_reg>; |
@@ -494,6 +496,8 @@ | |||
494 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; | 496 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; |
495 | reg = <0x80122000 0x1000>; | 497 | reg = <0x80122000 0x1000>; |
496 | interrupts = <0 22 0x4>; | 498 | interrupts = <0 22 0x4>; |
499 | arm,primecell-periphid = <0x180024>; | ||
500 | |||
497 | #address-cells = <1>; | 501 | #address-cells = <1>; |
498 | #size-cells = <0>; | 502 | #size-cells = <0>; |
499 | v-i2c-supply = <&db8500_vape_reg>; | 503 | v-i2c-supply = <&db8500_vape_reg>; |
@@ -505,6 +509,8 @@ | |||
505 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; | 509 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; |
506 | reg = <0x80128000 0x1000>; | 510 | reg = <0x80128000 0x1000>; |
507 | interrupts = <0 55 0x4>; | 511 | interrupts = <0 55 0x4>; |
512 | arm,primecell-periphid = <0x180024>; | ||
513 | |||
508 | #address-cells = <1>; | 514 | #address-cells = <1>; |
509 | #size-cells = <0>; | 515 | #size-cells = <0>; |
510 | v-i2c-supply = <&db8500_vape_reg>; | 516 | v-i2c-supply = <&db8500_vape_reg>; |
@@ -516,6 +522,8 @@ | |||
516 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; | 522 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; |
517 | reg = <0x80110000 0x1000>; | 523 | reg = <0x80110000 0x1000>; |
518 | interrupts = <0 12 0x4>; | 524 | interrupts = <0 12 0x4>; |
525 | arm,primecell-periphid = <0x180024>; | ||
526 | |||
519 | #address-cells = <1>; | 527 | #address-cells = <1>; |
520 | #size-cells = <0>; | 528 | #size-cells = <0>; |
521 | v-i2c-supply = <&db8500_vape_reg>; | 529 | v-i2c-supply = <&db8500_vape_reg>; |
@@ -527,6 +535,8 @@ | |||
527 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; | 535 | compatible = "stericsson,db8500-i2c", "st,nomadik-i2c", "arm,primecell"; |
528 | reg = <0x8012a000 0x1000>; | 536 | reg = <0x8012a000 0x1000>; |
529 | interrupts = <0 51 0x4>; | 537 | interrupts = <0 51 0x4>; |
538 | arm,primecell-periphid = <0x180024>; | ||
539 | |||
530 | #address-cells = <1>; | 540 | #address-cells = <1>; |
531 | #size-cells = <0>; | 541 | #size-cells = <0>; |
532 | v-i2c-supply = <&db8500_vape_reg>; | 542 | v-i2c-supply = <&db8500_vape_reg>; |
@@ -573,33 +583,38 @@ | |||
573 | interrupts = <0 60 0x4>; | 583 | interrupts = <0 60 0x4>; |
574 | status = "disabled"; | 584 | status = "disabled"; |
575 | }; | 585 | }; |
586 | |||
576 | sdi@80118000 { | 587 | sdi@80118000 { |
577 | compatible = "arm,pl18x", "arm,primecell"; | 588 | compatible = "arm,pl18x", "arm,primecell"; |
578 | reg = <0x80118000 0x1000>; | 589 | reg = <0x80118000 0x1000>; |
579 | interrupts = <0 50 0x4>; | 590 | interrupts = <0 50 0x4>; |
580 | status = "disabled"; | 591 | status = "disabled"; |
581 | }; | 592 | }; |
593 | |||
582 | sdi@80005000 { | 594 | sdi@80005000 { |
583 | compatible = "arm,pl18x", "arm,primecell"; | 595 | compatible = "arm,pl18x", "arm,primecell"; |
584 | reg = <0x80005000 0x1000>; | 596 | reg = <0x80005000 0x1000>; |
585 | interrupts = <0 41 0x4>; | 597 | interrupts = <0 41 0x4>; |
586 | status = "disabled"; | 598 | status = "disabled"; |
587 | }; | 599 | }; |
600 | |||
588 | sdi@80119000 { | 601 | sdi@80119000 { |
589 | compatible = "arm,pl18x", "arm,primecell"; | 602 | compatible = "arm,pl18x", "arm,primecell"; |
590 | reg = <0x80119000 0x1000>; | 603 | reg = <0x80119000 0x1000>; |
591 | interrupts = <0 59 0x4>; | 604 | interrupts = <0 59 0x4>; |
592 | status = "disabled"; | 605 | status = "disabled"; |
593 | }; | 606 | }; |
607 | |||
594 | sdi@80114000 { | 608 | sdi@80114000 { |
595 | compatible = "arm,pl18x", "arm,primecell"; | 609 | compatible = "arm,pl18x", "arm,primecell"; |
596 | reg = <0x80114000 0x1000>; | 610 | reg = <0x80114000 0x1000>; |
597 | interrupts = <0 99 0x4>; | 611 | interrupts = <0 99 0x4>; |
598 | status = "disabled"; | 612 | status = "disabled"; |
599 | }; | 613 | }; |
614 | |||
600 | sdi@80008000 { | 615 | sdi@80008000 { |
601 | compatible = "arm,pl18x", "arm,primecell"; | 616 | compatible = "arm,pl18x", "arm,primecell"; |
602 | reg = <0x80114000 0x1000>; | 617 | reg = <0x80008000 0x1000>; |
603 | interrupts = <0 100 0x4>; | 618 | interrupts = <0 100 0x4>; |
604 | status = "disabled"; | 619 | status = "disabled"; |
605 | }; | 620 | }; |
diff --git a/arch/arm/boot/dts/exynos4210-trats.dts b/arch/arm/boot/dts/exynos4210-trats.dts index 73567b843e72..a21511c14071 100644 --- a/arch/arm/boot/dts/exynos4210-trats.dts +++ b/arch/arm/boot/dts/exynos4210-trats.dts | |||
@@ -20,8 +20,10 @@ | |||
20 | compatible = "samsung,trats", "samsung,exynos4210"; | 20 | compatible = "samsung,trats", "samsung,exynos4210"; |
21 | 21 | ||
22 | memory { | 22 | memory { |
23 | reg = <0x40000000 0x20000000 | 23 | reg = <0x40000000 0x10000000 |
24 | 0x60000000 0x20000000>; | 24 | 0x50000000 0x10000000 |
25 | 0x60000000 0x10000000 | ||
26 | 0x70000000 0x10000000>; | ||
25 | }; | 27 | }; |
26 | 28 | ||
27 | chosen { | 29 | chosen { |
diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi index 9ca4ca70c1bc..6d31aa383460 100644 --- a/arch/arm/boot/dts/imx23.dtsi +++ b/arch/arm/boot/dts/imx23.dtsi | |||
@@ -69,6 +69,7 @@ | |||
69 | interrupts = <13>, <56>; | 69 | interrupts = <13>, <56>; |
70 | interrupt-names = "gpmi-dma", "bch"; | 70 | interrupt-names = "gpmi-dma", "bch"; |
71 | clocks = <&clks 34>; | 71 | clocks = <&clks 34>; |
72 | clock-names = "gpmi_io"; | ||
72 | fsl,gpmi-dma-channel = <4>; | 73 | fsl,gpmi-dma-channel = <4>; |
73 | status = "disabled"; | 74 | status = "disabled"; |
74 | }; | 75 | }; |
diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi index e16d63155480..55c57ea6169e 100644 --- a/arch/arm/boot/dts/imx28.dtsi +++ b/arch/arm/boot/dts/imx28.dtsi | |||
@@ -85,6 +85,7 @@ | |||
85 | interrupts = <88>, <41>; | 85 | interrupts = <88>, <41>; |
86 | interrupt-names = "gpmi-dma", "bch"; | 86 | interrupt-names = "gpmi-dma", "bch"; |
87 | clocks = <&clks 50>; | 87 | clocks = <&clks 50>; |
88 | clock-names = "gpmi_io"; | ||
88 | fsl,gpmi-dma-channel = <4>; | 89 | fsl,gpmi-dma-channel = <4>; |
89 | status = "disabled"; | 90 | status = "disabled"; |
90 | }; | 91 | }; |
diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index f38ea8771b44..696e929d0304 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi | |||
@@ -257,7 +257,7 @@ | |||
257 | interrupt-names = "common", "tx", "rx", "sidetone"; | 257 | interrupt-names = "common", "tx", "rx", "sidetone"; |
258 | interrupt-parent = <&intc>; | 258 | interrupt-parent = <&intc>; |
259 | ti,buffer-size = <1280>; | 259 | ti,buffer-size = <1280>; |
260 | ti,hwmods = "mcbsp2"; | 260 | ti,hwmods = "mcbsp2", "mcbsp2_sidetone"; |
261 | }; | 261 | }; |
262 | 262 | ||
263 | mcbsp3: mcbsp@49024000 { | 263 | mcbsp3: mcbsp@49024000 { |
@@ -272,7 +272,7 @@ | |||
272 | interrupt-names = "common", "tx", "rx", "sidetone"; | 272 | interrupt-names = "common", "tx", "rx", "sidetone"; |
273 | interrupt-parent = <&intc>; | 273 | interrupt-parent = <&intc>; |
274 | ti,buffer-size = <128>; | 274 | ti,buffer-size = <128>; |
275 | ti,hwmods = "mcbsp3"; | 275 | ti,hwmods = "mcbsp3", "mcbsp3_sidetone"; |
276 | }; | 276 | }; |
277 | 277 | ||
278 | mcbsp4: mcbsp@49026000 { | 278 | mcbsp4: mcbsp@49026000 { |
diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index 66aa7a6db884..394ded624e37 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig | |||
@@ -139,6 +139,7 @@ CONFIG_I2C_IMX=y | |||
139 | CONFIG_SPI=y | 139 | CONFIG_SPI=y |
140 | CONFIG_SPI_IMX=y | 140 | CONFIG_SPI_IMX=y |
141 | CONFIG_GPIO_SYSFS=y | 141 | CONFIG_GPIO_SYSFS=y |
142 | CONFIG_GPIO_MC9S08DZ60=y | ||
142 | # CONFIG_HWMON is not set | 143 | # CONFIG_HWMON is not set |
143 | CONFIG_WATCHDOG=y | 144 | CONFIG_WATCHDOG=y |
144 | CONFIG_IMX2_WDT=y | 145 | CONFIG_IMX2_WDT=y |
@@ -155,6 +156,7 @@ CONFIG_SOC_CAMERA=y | |||
155 | CONFIG_SOC_CAMERA_OV2640=y | 156 | CONFIG_SOC_CAMERA_OV2640=y |
156 | CONFIG_VIDEO_MX3=y | 157 | CONFIG_VIDEO_MX3=y |
157 | CONFIG_FB=y | 158 | CONFIG_FB=y |
159 | CONFIG_LCD_PLATFORM=y | ||
158 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | 160 | CONFIG_BACKLIGHT_LCD_SUPPORT=y |
159 | CONFIG_LCD_CLASS_DEVICE=y | 161 | CONFIG_LCD_CLASS_DEVICE=y |
160 | CONFIG_LCD_L4F00242T03=y | 162 | CONFIG_LCD_L4F00242T03=y |
diff --git a/arch/arm/configs/mvebu_defconfig b/arch/arm/configs/mvebu_defconfig index 7bcf850eddcd..3458752c4bb2 100644 --- a/arch/arm/configs/mvebu_defconfig +++ b/arch/arm/configs/mvebu_defconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | CONFIG_EXPERIMENTAL=y | 1 | CONFIG_EXPERIMENTAL=y |
2 | CONFIG_SYSVIPC=y | 2 | CONFIG_SYSVIPC=y |
3 | CONFIG_NO_HZ=y | 3 | CONFIG_IRQ_DOMAIN_DEBUG=y |
4 | CONFIG_HIGH_RES_TIMERS=y | 4 | CONFIG_HIGH_RES_TIMERS=y |
5 | CONFIG_LOG_BUF_SHIFT=14 | 5 | CONFIG_LOG_BUF_SHIFT=14 |
6 | CONFIG_BLK_DEV_INITRD=y | 6 | CONFIG_BLK_DEV_INITRD=y |
@@ -9,10 +9,12 @@ CONFIG_SLAB=y | |||
9 | CONFIG_MODULES=y | 9 | CONFIG_MODULES=y |
10 | CONFIG_MODULE_UNLOAD=y | 10 | CONFIG_MODULE_UNLOAD=y |
11 | CONFIG_ARCH_MVEBU=y | 11 | CONFIG_ARCH_MVEBU=y |
12 | CONFIG_MACH_ARMADA_370_XP=y | 12 | CONFIG_MACH_ARMADA_370=y |
13 | CONFIG_MACH_ARMADA_XP=y | ||
14 | # CONFIG_CACHE_L2X0 is not set | ||
13 | CONFIG_AEABI=y | 15 | CONFIG_AEABI=y |
14 | CONFIG_HIGHMEM=y | 16 | CONFIG_HIGHMEM=y |
15 | CONFIG_USE_OF=y | 17 | # CONFIG_COMPACTION is not set |
16 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 18 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
17 | CONFIG_ZBOOT_ROM_BSS=0x0 | 19 | CONFIG_ZBOOT_ROM_BSS=0x0 |
18 | CONFIG_ARM_APPENDED_DTB=y | 20 | CONFIG_ARM_APPENDED_DTB=y |
@@ -23,6 +25,8 @@ CONFIG_SERIAL_8250_CONSOLE=y | |||
23 | CONFIG_SERIAL_OF_PLATFORM=y | 25 | CONFIG_SERIAL_OF_PLATFORM=y |
24 | CONFIG_GPIOLIB=y | 26 | CONFIG_GPIOLIB=y |
25 | CONFIG_GPIO_SYSFS=y | 27 | CONFIG_GPIO_SYSFS=y |
28 | # CONFIG_USB_SUPPORT is not set | ||
29 | # CONFIG_IOMMU_SUPPORT is not set | ||
26 | CONFIG_EXT2_FS=y | 30 | CONFIG_EXT2_FS=y |
27 | CONFIG_EXT3_FS=y | 31 | CONFIG_EXT3_FS=y |
28 | # CONFIG_EXT3_FS_XATTR is not set | 32 | # CONFIG_EXT3_FS_XATTR is not set |
diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig index cdd4d2bd3962..2ba9e63d0f17 100644 --- a/arch/arm/configs/versatile_defconfig +++ b/arch/arm/configs/versatile_defconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | CONFIG_ARCH_VERSATILE=y | ||
1 | CONFIG_EXPERIMENTAL=y | 2 | CONFIG_EXPERIMENTAL=y |
2 | # CONFIG_LOCALVERSION_AUTO is not set | 3 | # CONFIG_LOCALVERSION_AUTO is not set |
3 | CONFIG_SYSVIPC=y | 4 | CONFIG_SYSVIPC=y |
diff --git a/arch/arm/include/asm/flat.h b/arch/arm/include/asm/flat.h index 59426a4595c9..e847d23351ed 100644 --- a/arch/arm/include/asm/flat.h +++ b/arch/arm/include/asm/flat.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #define flat_argvp_envp_on_stack() 1 | 8 | #define flat_argvp_envp_on_stack() 1 |
9 | #define flat_old_ram_flag(flags) (flags) | 9 | #define flat_old_ram_flag(flags) (flags) |
10 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) | 10 | #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) |
11 | #define flat_get_addr_from_rp(rp, relval, flags, persistent) get_unaligned(rp) | 11 | #define flat_get_addr_from_rp(rp, relval, flags, persistent) ((void)persistent,get_unaligned(rp)) |
12 | #define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp) | 12 | #define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp) |
13 | #define flat_get_relocate_addr(rel) (rel) | 13 | #define flat_get_relocate_addr(rel) (rel) |
14 | #define flat_set_persistent(relval, p) 0 | 14 | #define flat_set_persistent(relval, p) 0 |
diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 35c1ed89b936..42f042ee4ada 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h | |||
@@ -64,7 +64,7 @@ extern void __raw_readsl(const void __iomem *addr, void *data, int longlen); | |||
64 | static inline void __raw_writew(u16 val, volatile void __iomem *addr) | 64 | static inline void __raw_writew(u16 val, volatile void __iomem *addr) |
65 | { | 65 | { |
66 | asm volatile("strh %1, %0" | 66 | asm volatile("strh %1, %0" |
67 | : "+Qo" (*(volatile u16 __force *)addr) | 67 | : "+Q" (*(volatile u16 __force *)addr) |
68 | : "r" (val)); | 68 | : "r" (val)); |
69 | } | 69 | } |
70 | 70 | ||
@@ -72,7 +72,7 @@ static inline u16 __raw_readw(const volatile void __iomem *addr) | |||
72 | { | 72 | { |
73 | u16 val; | 73 | u16 val; |
74 | asm volatile("ldrh %1, %0" | 74 | asm volatile("ldrh %1, %0" |
75 | : "+Qo" (*(volatile u16 __force *)addr), | 75 | : "+Q" (*(volatile u16 __force *)addr), |
76 | "=r" (val)); | 76 | "=r" (val)); |
77 | return val; | 77 | return val; |
78 | } | 78 | } |
diff --git a/arch/arm/include/asm/sched_clock.h b/arch/arm/include/asm/sched_clock.h index 05b8e82ec9f5..e3f757263438 100644 --- a/arch/arm/include/asm/sched_clock.h +++ b/arch/arm/include/asm/sched_clock.h | |||
@@ -10,7 +10,5 @@ | |||
10 | 10 | ||
11 | extern void sched_clock_postinit(void); | 11 | extern void sched_clock_postinit(void); |
12 | extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); | 12 | extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate); |
13 | extern void setup_sched_clock_needs_suspend(u32 (*read)(void), int bits, | ||
14 | unsigned long rate); | ||
15 | 13 | ||
16 | #endif | 14 | #endif |
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 77bd79f2ffdb..7e1f76027f66 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h | |||
@@ -200,8 +200,8 @@ extern int __put_user_8(void *, unsigned long long); | |||
200 | #define USER_DS KERNEL_DS | 200 | #define USER_DS KERNEL_DS |
201 | 201 | ||
202 | #define segment_eq(a,b) (1) | 202 | #define segment_eq(a,b) (1) |
203 | #define __addr_ok(addr) (1) | 203 | #define __addr_ok(addr) ((void)(addr),1) |
204 | #define __range_ok(addr,size) (0) | 204 | #define __range_ok(addr,size) ((void)(addr),0) |
205 | #define get_fs() (KERNEL_DS) | 205 | #define get_fs() (KERNEL_DS) |
206 | 206 | ||
207 | static inline void set_fs(mm_segment_t fs) | 207 | static inline void set_fs(mm_segment_t fs) |
diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h index 6a6f1e485f41..301c1db3e99b 100644 --- a/arch/arm/include/asm/vfpmacros.h +++ b/arch/arm/include/asm/vfpmacros.h | |||
@@ -27,9 +27,9 @@ | |||
27 | #if __LINUX_ARM_ARCH__ <= 6 | 27 | #if __LINUX_ARM_ARCH__ <= 6 |
28 | ldr \tmp, =elf_hwcap @ may not have MVFR regs | 28 | ldr \tmp, =elf_hwcap @ may not have MVFR regs |
29 | ldr \tmp, [\tmp, #0] | 29 | ldr \tmp, [\tmp, #0] |
30 | tst \tmp, #HWCAP_VFPv3D16 | 30 | tst \tmp, #HWCAP_VFPD32 |
31 | ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} | 31 | ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31} |
32 | addne \base, \base, #32*4 @ step over unused register space | 32 | addeq \base, \base, #32*4 @ step over unused register space |
33 | #else | 33 | #else |
34 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 | 34 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 |
35 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | 35 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field |
@@ -51,9 +51,9 @@ | |||
51 | #if __LINUX_ARM_ARCH__ <= 6 | 51 | #if __LINUX_ARM_ARCH__ <= 6 |
52 | ldr \tmp, =elf_hwcap @ may not have MVFR regs | 52 | ldr \tmp, =elf_hwcap @ may not have MVFR regs |
53 | ldr \tmp, [\tmp, #0] | 53 | ldr \tmp, [\tmp, #0] |
54 | tst \tmp, #HWCAP_VFPv3D16 | 54 | tst \tmp, #HWCAP_VFPD32 |
55 | stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} | 55 | stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31} |
56 | addne \base, \base, #32*4 @ step over unused register space | 56 | addeq \base, \base, #32*4 @ step over unused register space |
57 | #else | 57 | #else |
58 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 | 58 | VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0 |
59 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field | 59 | and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field |
diff --git a/arch/arm/include/asm/xen/interface.h b/arch/arm/include/asm/xen/interface.h index ae05e56dd17d..5000397134b4 100644 --- a/arch/arm/include/asm/xen/interface.h +++ b/arch/arm/include/asm/xen/interface.h | |||
@@ -29,16 +29,22 @@ | |||
29 | 29 | ||
30 | #ifndef __ASSEMBLY__ | 30 | #ifndef __ASSEMBLY__ |
31 | /* Explicitly size integers that represent pfns in the interface with | 31 | /* Explicitly size integers that represent pfns in the interface with |
32 | * Xen so that we can have one ABI that works for 32 and 64 bit guests. */ | 32 | * Xen so that we can have one ABI that works for 32 and 64 bit guests. |
33 | * Note that this means that the xen_pfn_t type may be capable of | ||
34 | * representing pfn's which the guest cannot represent in its own pfn | ||
35 | * type. However since pfn space is controlled by the guest this is | ||
36 | * fine since it simply wouldn't be able to create any sure pfns in | ||
37 | * the first place. | ||
38 | */ | ||
33 | typedef uint64_t xen_pfn_t; | 39 | typedef uint64_t xen_pfn_t; |
40 | #define PRI_xen_pfn "llx" | ||
34 | typedef uint64_t xen_ulong_t; | 41 | typedef uint64_t xen_ulong_t; |
42 | #define PRI_xen_ulong "llx" | ||
35 | /* Guest handles for primitive C types. */ | 43 | /* Guest handles for primitive C types. */ |
36 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); | 44 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); |
37 | __DEFINE_GUEST_HANDLE(uint, unsigned int); | 45 | __DEFINE_GUEST_HANDLE(uint, unsigned int); |
38 | __DEFINE_GUEST_HANDLE(ulong, unsigned long); | ||
39 | DEFINE_GUEST_HANDLE(char); | 46 | DEFINE_GUEST_HANDLE(char); |
40 | DEFINE_GUEST_HANDLE(int); | 47 | DEFINE_GUEST_HANDLE(int); |
41 | DEFINE_GUEST_HANDLE(long); | ||
42 | DEFINE_GUEST_HANDLE(void); | 48 | DEFINE_GUEST_HANDLE(void); |
43 | DEFINE_GUEST_HANDLE(uint64_t); | 49 | DEFINE_GUEST_HANDLE(uint64_t); |
44 | DEFINE_GUEST_HANDLE(uint32_t); | 50 | DEFINE_GUEST_HANDLE(uint32_t); |
diff --git a/arch/arm/include/asm/xen/page.h b/arch/arm/include/asm/xen/page.h index 174202318dff..c6b9096cef95 100644 --- a/arch/arm/include/asm/xen/page.h +++ b/arch/arm/include/asm/xen/page.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include <xen/interface/grant_table.h> | 10 | #include <xen/interface/grant_table.h> |
11 | 11 | ||
12 | #define pfn_to_mfn(pfn) (pfn) | 12 | #define pfn_to_mfn(pfn) (pfn) |
13 | #define phys_to_machine_mapping_valid (1) | 13 | #define phys_to_machine_mapping_valid(pfn) (1) |
14 | #define mfn_to_pfn(mfn) (mfn) | 14 | #define mfn_to_pfn(mfn) (mfn) |
15 | #define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT)) | 15 | #define mfn_to_virt(m) (__va(mfn_to_pfn(m) << PAGE_SHIFT)) |
16 | 16 | ||
@@ -30,6 +30,8 @@ typedef struct xpaddr { | |||
30 | #define XMADDR(x) ((xmaddr_t) { .maddr = (x) }) | 30 | #define XMADDR(x) ((xmaddr_t) { .maddr = (x) }) |
31 | #define XPADDR(x) ((xpaddr_t) { .paddr = (x) }) | 31 | #define XPADDR(x) ((xpaddr_t) { .paddr = (x) }) |
32 | 32 | ||
33 | #define INVALID_P2M_ENTRY (~0UL) | ||
34 | |||
33 | static inline xmaddr_t phys_to_machine(xpaddr_t phys) | 35 | static inline xmaddr_t phys_to_machine(xpaddr_t phys) |
34 | { | 36 | { |
35 | unsigned offset = phys.paddr & ~PAGE_MASK; | 37 | unsigned offset = phys.paddr & ~PAGE_MASK; |
@@ -74,9 +76,14 @@ static inline int m2p_remove_override(struct page *page, bool clear_pte) | |||
74 | return 0; | 76 | return 0; |
75 | } | 77 | } |
76 | 78 | ||
79 | static inline bool __set_phys_to_machine(unsigned long pfn, unsigned long mfn) | ||
80 | { | ||
81 | BUG_ON(pfn != mfn && mfn != INVALID_P2M_ENTRY); | ||
82 | return true; | ||
83 | } | ||
84 | |||
77 | static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn) | 85 | static inline bool set_phys_to_machine(unsigned long pfn, unsigned long mfn) |
78 | { | 86 | { |
79 | BUG(); | 87 | return __set_phys_to_machine(pfn, mfn); |
80 | return false; | ||
81 | } | 88 | } |
82 | #endif /* _ASM_ARM_XEN_PAGE_H */ | 89 | #endif /* _ASM_ARM_XEN_PAGE_H */ |
diff --git a/arch/arm/include/debug/8250_32.S b/arch/arm/include/debug/8250_32.S new file mode 100644 index 000000000000..8db01eeabbb4 --- /dev/null +++ b/arch/arm/include/debug/8250_32.S | |||
@@ -0,0 +1,27 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011 Picochip Ltd., Jamie Iles | ||
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 version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit | ||
9 | * accesses to the 8250. | ||
10 | */ | ||
11 | |||
12 | #include <linux/serial_reg.h> | ||
13 | |||
14 | .macro senduart,rd,rx | ||
15 | str \rd, [\rx, #UART_TX << UART_SHIFT] | ||
16 | .endm | ||
17 | |||
18 | .macro busyuart,rd,rx | ||
19 | 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] | ||
20 | and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
21 | teq \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
22 | bne 1002b | ||
23 | .endm | ||
24 | |||
25 | /* The UART's don't have any flow control IO's wired up. */ | ||
26 | .macro waituart,rd,rx | ||
27 | .endm | ||
diff --git a/arch/arm/include/debug/picoxcell.S b/arch/arm/include/debug/picoxcell.S index 7419deb1b948..bc1f07c49cd4 100644 --- a/arch/arm/include/debug/picoxcell.S +++ b/arch/arm/include/debug/picoxcell.S | |||
@@ -5,10 +5,7 @@ | |||
5 | * it under the terms of the GNU General Public License version 2 as | 5 | * it under the terms of the GNU General Public License version 2 as |
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | * | 7 | * |
8 | * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit | ||
9 | * accesses to the 8250. | ||
10 | */ | 8 | */ |
11 | #include <linux/serial_reg.h> | ||
12 | 9 | ||
13 | #define UART_SHIFT 2 | 10 | #define UART_SHIFT 2 |
14 | #define PICOXCELL_UART1_BASE 0x80230000 | 11 | #define PICOXCELL_UART1_BASE 0x80230000 |
@@ -19,17 +16,4 @@ | |||
19 | ldr \rp, =PICOXCELL_UART1_BASE | 16 | ldr \rp, =PICOXCELL_UART1_BASE |
20 | .endm | 17 | .endm |
21 | 18 | ||
22 | .macro senduart,rd,rx | 19 | #include "8250_32.S" |
23 | str \rd, [\rx, #UART_TX << UART_SHIFT] | ||
24 | .endm | ||
25 | |||
26 | .macro busyuart,rd,rx | ||
27 | 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] | ||
28 | and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
29 | teq \rd, #UART_LSR_TEMT | UART_LSR_THRE | ||
30 | bne 1002b | ||
31 | .endm | ||
32 | |||
33 | /* The UART's don't have any flow control IO's wired up. */ | ||
34 | .macro waituart,rd,rx | ||
35 | .endm | ||
diff --git a/arch/arm/include/debug/socfpga.S b/arch/arm/include/debug/socfpga.S index d6f26d23374f..966b2f994946 100644 --- a/arch/arm/include/debug/socfpga.S +++ b/arch/arm/include/debug/socfpga.S | |||
@@ -7,6 +7,9 @@ | |||
7 | * published by the Free Software Foundation. | 7 | * published by the Free Software Foundation. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #define UART_SHIFT 2 | ||
11 | #define DEBUG_LL_UART_OFFSET 0x00002000 | ||
12 | |||
10 | .macro addruart, rp, rv, tmp | 13 | .macro addruart, rp, rv, tmp |
11 | mov \rp, #DEBUG_LL_UART_OFFSET | 14 | mov \rp, #DEBUG_LL_UART_OFFSET |
12 | orr \rp, \rp, #0x00c00000 | 15 | orr \rp, \rp, #0x00c00000 |
@@ -14,3 +17,5 @@ | |||
14 | orr \rp, \rp, #0xff000000 @ physical base | 17 | orr \rp, \rp, #0xff000000 @ physical base |
15 | .endm | 18 | .endm |
16 | 19 | ||
20 | #include "8250_32.S" | ||
21 | |||
diff --git a/arch/arm/include/uapi/asm/hwcap.h b/arch/arm/include/uapi/asm/hwcap.h index f254f6503cce..3688fd15a32d 100644 --- a/arch/arm/include/uapi/asm/hwcap.h +++ b/arch/arm/include/uapi/asm/hwcap.h | |||
@@ -18,11 +18,12 @@ | |||
18 | #define HWCAP_THUMBEE (1 << 11) | 18 | #define HWCAP_THUMBEE (1 << 11) |
19 | #define HWCAP_NEON (1 << 12) | 19 | #define HWCAP_NEON (1 << 12) |
20 | #define HWCAP_VFPv3 (1 << 13) | 20 | #define HWCAP_VFPv3 (1 << 13) |
21 | #define HWCAP_VFPv3D16 (1 << 14) | 21 | #define HWCAP_VFPv3D16 (1 << 14) /* also set for VFPv4-D16 */ |
22 | #define HWCAP_TLS (1 << 15) | 22 | #define HWCAP_TLS (1 << 15) |
23 | #define HWCAP_VFPv4 (1 << 16) | 23 | #define HWCAP_VFPv4 (1 << 16) |
24 | #define HWCAP_IDIVA (1 << 17) | 24 | #define HWCAP_IDIVA (1 << 17) |
25 | #define HWCAP_IDIVT (1 << 18) | 25 | #define HWCAP_IDIVT (1 << 18) |
26 | #define HWCAP_VFPD32 (1 << 19) /* set if VFP has 32 regs (not 16) */ | ||
26 | #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) | 27 | #define HWCAP_IDIV (HWCAP_IDIVA | HWCAP_IDIVT) |
27 | 28 | ||
28 | 29 | ||
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 16cedb42c0c3..896165096d6a 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/list.h> | 34 | #include <linux/list.h> |
35 | #include <linux/kallsyms.h> | 35 | #include <linux/kallsyms.h> |
36 | #include <linux/proc_fs.h> | 36 | #include <linux/proc_fs.h> |
37 | #include <linux/export.h> | ||
37 | 38 | ||
38 | #include <asm/exception.h> | 39 | #include <asm/exception.h> |
39 | #include <asm/mach/arch.h> | 40 | #include <asm/mach/arch.h> |
@@ -109,6 +110,7 @@ void set_irq_flags(unsigned int irq, unsigned int iflags) | |||
109 | /* Order is clear bits in "clr" then set bits in "set" */ | 110 | /* Order is clear bits in "clr" then set bits in "set" */ |
110 | irq_modify_status(irq, clr, set & ~clr); | 111 | irq_modify_status(irq, clr, set & ~clr); |
111 | } | 112 | } |
113 | EXPORT_SYMBOL_GPL(set_irq_flags); | ||
112 | 114 | ||
113 | void __init init_IRQ(void) | 115 | void __init init_IRQ(void) |
114 | { | 116 | { |
diff --git a/arch/arm/kernel/kprobes-test-arm.c b/arch/arm/kernel/kprobes-test-arm.c index 38c1a3b103a0..839312905067 100644 --- a/arch/arm/kernel/kprobes-test-arm.c +++ b/arch/arm/kernel/kprobes-test-arm.c | |||
@@ -366,7 +366,9 @@ void kprobe_arm_test_cases(void) | |||
366 | TEST_UNSUPPORTED(".word 0xe04f0392 @ umaal r0, pc, r2, r3") | 366 | TEST_UNSUPPORTED(".word 0xe04f0392 @ umaal r0, pc, r2, r3") |
367 | TEST_UNSUPPORTED(".word 0xe0500090 @ undef") | 367 | TEST_UNSUPPORTED(".word 0xe0500090 @ undef") |
368 | TEST_UNSUPPORTED(".word 0xe05fff9f @ undef") | 368 | TEST_UNSUPPORTED(".word 0xe05fff9f @ undef") |
369 | #endif | ||
369 | 370 | ||
371 | #if __LINUX_ARM_ARCH__ >= 7 | ||
370 | TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") | 372 | TEST_RRR( "mls r0, r",1, VAL1,", r",2, VAL2,", r",3, VAL3,"") |
371 | TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") | 373 | TEST_RRR( "mlshi r7, r",8, VAL3,", r",9, VAL1,", r",10, VAL2,"") |
372 | TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13") | 374 | TEST_RR( "mls lr, r",1, VAL2,", r",2, VAL3,", r13") |
@@ -456,6 +458,8 @@ void kprobe_arm_test_cases(void) | |||
456 | TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */ | 458 | TEST_UNSUPPORTED(".word 0xe1700090") /* Unallocated space */ |
457 | #if __LINUX_ARM_ARCH__ >= 6 | 459 | #if __LINUX_ARM_ARCH__ >= 6 |
458 | TEST_UNSUPPORTED("ldrex r2, [sp]") | 460 | TEST_UNSUPPORTED("ldrex r2, [sp]") |
461 | #endif | ||
462 | #if (__LINUX_ARM_ARCH__ >= 7) || defined(CONFIG_CPU_32v6K) | ||
459 | TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]") | 463 | TEST_UNSUPPORTED("strexd r0, r2, r3, [sp]") |
460 | TEST_UNSUPPORTED("ldrexd r2, r3, [sp]") | 464 | TEST_UNSUPPORTED("ldrexd r2, r3, [sp]") |
461 | TEST_UNSUPPORTED("strexb r0, r2, [sp]") | 465 | TEST_UNSUPPORTED("strexb r0, r2, [sp]") |
diff --git a/arch/arm/kernel/machine_kexec.c b/arch/arm/kernel/machine_kexec.c index e29c3337ca81..8ef8c9337809 100644 --- a/arch/arm/kernel/machine_kexec.c +++ b/arch/arm/kernel/machine_kexec.c | |||
@@ -45,10 +45,9 @@ int machine_kexec_prepare(struct kimage *image) | |||
45 | for (i = 0; i < image->nr_segments; i++) { | 45 | for (i = 0; i < image->nr_segments; i++) { |
46 | current_segment = &image->segment[i]; | 46 | current_segment = &image->segment[i]; |
47 | 47 | ||
48 | err = memblock_is_region_memory(current_segment->mem, | 48 | if (!memblock_is_region_memory(current_segment->mem, |
49 | current_segment->memsz); | 49 | current_segment->memsz)) |
50 | if (err) | 50 | return -EINVAL; |
51 | return - EINVAL; | ||
52 | 51 | ||
53 | err = get_user(header, (__be32*)current_segment->buf); | 52 | err = get_user(header, (__be32*)current_segment->buf); |
54 | if (err) | 53 | if (err) |
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index 93971b1a4f0b..53c0304b734a 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -96,6 +96,10 @@ armpmu_event_set_period(struct perf_event *event, | |||
96 | s64 period = hwc->sample_period; | 96 | s64 period = hwc->sample_period; |
97 | int ret = 0; | 97 | int ret = 0; |
98 | 98 | ||
99 | /* The period may have been changed by PERF_EVENT_IOC_PERIOD */ | ||
100 | if (unlikely(period != hwc->last_period)) | ||
101 | left = period - (hwc->last_period - left); | ||
102 | |||
99 | if (unlikely(left <= -period)) { | 103 | if (unlikely(left <= -period)) { |
100 | left = period; | 104 | left = period; |
101 | local64_set(&hwc->period_left, left); | 105 | local64_set(&hwc->period_left, left); |
diff --git a/arch/arm/kernel/sched_clock.c b/arch/arm/kernel/sched_clock.c index e21bac20d90d..fc6692e2b603 100644 --- a/arch/arm/kernel/sched_clock.c +++ b/arch/arm/kernel/sched_clock.c | |||
@@ -107,13 +107,6 @@ static void sched_clock_poll(unsigned long wrap_ticks) | |||
107 | update_sched_clock(); | 107 | update_sched_clock(); |
108 | } | 108 | } |
109 | 109 | ||
110 | void __init setup_sched_clock_needs_suspend(u32 (*read)(void), int bits, | ||
111 | unsigned long rate) | ||
112 | { | ||
113 | setup_sched_clock(read, bits, rate); | ||
114 | cd.needs_suspend = true; | ||
115 | } | ||
116 | |||
117 | void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) | 110 | void __init setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate) |
118 | { | 111 | { |
119 | unsigned long r, w; | 112 | unsigned long r, w; |
@@ -189,18 +182,15 @@ void __init sched_clock_postinit(void) | |||
189 | static int sched_clock_suspend(void) | 182 | static int sched_clock_suspend(void) |
190 | { | 183 | { |
191 | sched_clock_poll(sched_clock_timer.data); | 184 | sched_clock_poll(sched_clock_timer.data); |
192 | if (cd.needs_suspend) | 185 | cd.suspended = true; |
193 | cd.suspended = true; | ||
194 | return 0; | 186 | return 0; |
195 | } | 187 | } |
196 | 188 | ||
197 | static void sched_clock_resume(void) | 189 | static void sched_clock_resume(void) |
198 | { | 190 | { |
199 | if (cd.needs_suspend) { | 191 | cd.epoch_cyc = read_sched_clock(); |
200 | cd.epoch_cyc = read_sched_clock(); | 192 | cd.epoch_cyc_copy = cd.epoch_cyc; |
201 | cd.epoch_cyc_copy = cd.epoch_cyc; | 193 | cd.suspended = false; |
202 | cd.suspended = false; | ||
203 | } | ||
204 | } | 194 | } |
205 | 195 | ||
206 | static struct syscore_ops sched_clock_ops = { | 196 | static struct syscore_ops sched_clock_ops = { |
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index 8e20754dd31d..fbc8b2623d82 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c | |||
@@ -294,18 +294,24 @@ static void percpu_timer_setup(void); | |||
294 | asmlinkage void __cpuinit secondary_start_kernel(void) | 294 | asmlinkage void __cpuinit secondary_start_kernel(void) |
295 | { | 295 | { |
296 | struct mm_struct *mm = &init_mm; | 296 | struct mm_struct *mm = &init_mm; |
297 | unsigned int cpu = smp_processor_id(); | 297 | unsigned int cpu; |
298 | |||
299 | /* | ||
300 | * The identity mapping is uncached (strongly ordered), so | ||
301 | * switch away from it before attempting any exclusive accesses. | ||
302 | */ | ||
303 | cpu_switch_mm(mm->pgd, mm); | ||
304 | enter_lazy_tlb(mm, current); | ||
305 | local_flush_tlb_all(); | ||
298 | 306 | ||
299 | /* | 307 | /* |
300 | * All kernel threads share the same mm context; grab a | 308 | * All kernel threads share the same mm context; grab a |
301 | * reference and switch to it. | 309 | * reference and switch to it. |
302 | */ | 310 | */ |
311 | cpu = smp_processor_id(); | ||
303 | atomic_inc(&mm->mm_count); | 312 | atomic_inc(&mm->mm_count); |
304 | current->active_mm = mm; | 313 | current->active_mm = mm; |
305 | cpumask_set_cpu(cpu, mm_cpumask(mm)); | 314 | cpumask_set_cpu(cpu, mm_cpumask(mm)); |
306 | cpu_switch_mm(mm->pgd, mm); | ||
307 | enter_lazy_tlb(mm, current); | ||
308 | local_flush_tlb_all(); | ||
309 | 315 | ||
310 | printk("CPU%u: Booted secondary processor\n", cpu); | 316 | printk("CPU%u: Booted secondary processor\n", cpu); |
311 | 317 | ||
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c index e1f906989bb8..b22d700fea27 100644 --- a/arch/arm/kernel/smp_twd.c +++ b/arch/arm/kernel/smp_twd.c | |||
@@ -42,10 +42,10 @@ static void twd_set_mode(enum clock_event_mode mode, | |||
42 | 42 | ||
43 | switch (mode) { | 43 | switch (mode) { |
44 | case CLOCK_EVT_MODE_PERIODIC: | 44 | case CLOCK_EVT_MODE_PERIODIC: |
45 | /* timer load already set up */ | ||
46 | ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE | 45 | ctrl = TWD_TIMER_CONTROL_ENABLE | TWD_TIMER_CONTROL_IT_ENABLE |
47 | | TWD_TIMER_CONTROL_PERIODIC; | 46 | | TWD_TIMER_CONTROL_PERIODIC; |
48 | __raw_writel(twd_timer_rate / HZ, twd_base + TWD_TIMER_LOAD); | 47 | __raw_writel(DIV_ROUND_CLOSEST(twd_timer_rate, HZ), |
48 | twd_base + TWD_TIMER_LOAD); | ||
49 | break; | 49 | break; |
50 | case CLOCK_EVT_MODE_ONESHOT: | 50 | case CLOCK_EVT_MODE_ONESHOT: |
51 | /* period set, and timer enabled in 'next_event' hook */ | 51 | /* period set, and timer enabled in 'next_event' hook */ |
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c index 9d0a30032d7f..0dc53854a5d8 100644 --- a/arch/arm/lib/delay.c +++ b/arch/arm/lib/delay.c | |||
@@ -45,6 +45,7 @@ int read_current_timer(unsigned long *timer_val) | |||
45 | *timer_val = delay_timer->read_current_timer(); | 45 | *timer_val = delay_timer->read_current_timer(); |
46 | return 0; | 46 | return 0; |
47 | } | 47 | } |
48 | EXPORT_SYMBOL_GPL(read_current_timer); | ||
48 | 49 | ||
49 | static void __timer_delay(unsigned long cycles) | 50 | static void __timer_delay(unsigned long cycles) |
50 | { | 51 | { |
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig index b14207101938..043624219b55 100644 --- a/arch/arm/mach-at91/Kconfig +++ b/arch/arm/mach-at91/Kconfig | |||
@@ -21,19 +21,13 @@ config SOC_AT91SAM9 | |||
21 | bool | 21 | bool |
22 | select CPU_ARM926T | 22 | select CPU_ARM926T |
23 | select GENERIC_CLOCKEVENTS | 23 | select GENERIC_CLOCKEVENTS |
24 | select MULTI_IRQ_HANDLER | ||
25 | select SPARSE_IRQ | ||
24 | 26 | ||
25 | menu "Atmel AT91 System-on-Chip" | 27 | menu "Atmel AT91 System-on-Chip" |
26 | 28 | ||
27 | comment "Atmel AT91 Processor" | 29 | comment "Atmel AT91 Processor" |
28 | 30 | ||
29 | config SOC_AT91SAM9 | ||
30 | bool | ||
31 | select AT91_SAM9_SMC | ||
32 | select AT91_SAM9_TIME | ||
33 | select CPU_ARM926T | ||
34 | select MULTI_IRQ_HANDLER | ||
35 | select SPARSE_IRQ | ||
36 | |||
37 | config SOC_AT91RM9200 | 31 | config SOC_AT91RM9200 |
38 | bool "AT91RM9200" | 32 | bool "AT91RM9200" |
39 | select CPU_ARM920T | 33 | select CPU_ARM920T |
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c index b4f0565aff63..5269825194a8 100644 --- a/arch/arm/mach-at91/at91rm9200.c +++ b/arch/arm/mach-at91/at91rm9200.c | |||
@@ -187,7 +187,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
187 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), | 187 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk), |
188 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 188 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
189 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), | 189 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), |
190 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200", &twi_clk), | 190 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91rm9200.0", &twi_clk), |
191 | /* fake hclk clock */ | 191 | /* fake hclk clock */ |
192 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | 192 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
193 | CLKDEV_CON_ID("pioA", &pioA_clk), | 193 | CLKDEV_CON_ID("pioA", &pioA_clk), |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index a563189cdfc3..1e122bcd7845 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -479,7 +479,7 @@ static struct i2c_gpio_platform_data pdata = { | |||
479 | 479 | ||
480 | static struct platform_device at91rm9200_twi_device = { | 480 | static struct platform_device at91rm9200_twi_device = { |
481 | .name = "i2c-gpio", | 481 | .name = "i2c-gpio", |
482 | .id = -1, | 482 | .id = 0, |
483 | .dev.platform_data = &pdata, | 483 | .dev.platform_data = &pdata, |
484 | }; | 484 | }; |
485 | 485 | ||
@@ -512,7 +512,7 @@ static struct resource twi_resources[] = { | |||
512 | 512 | ||
513 | static struct platform_device at91rm9200_twi_device = { | 513 | static struct platform_device at91rm9200_twi_device = { |
514 | .name = "i2c-at91rm9200", | 514 | .name = "i2c-at91rm9200", |
515 | .id = -1, | 515 | .id = 0, |
516 | .resource = twi_resources, | 516 | .resource = twi_resources, |
517 | .num_resources = ARRAY_SIZE(twi_resources), | 517 | .num_resources = ARRAY_SIZE(twi_resources), |
518 | }; | 518 | }; |
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c index ad29f93f20ca..f8202615f4a8 100644 --- a/arch/arm/mach-at91/at91sam9260.c +++ b/arch/arm/mach-at91/at91sam9260.c | |||
@@ -211,8 +211,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
211 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), | 211 | CLKDEV_CON_DEV_ID("t1_clk", "atmel_tcb.1", &tc4_clk), |
212 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), | 212 | CLKDEV_CON_DEV_ID("t2_clk", "atmel_tcb.1", &tc5_clk), |
213 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), | 213 | CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc_clk), |
214 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk), | 214 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260.0", &twi_clk), |
215 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20", &twi_clk), | 215 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi_clk), |
216 | /* more usart lookup table for DT entries */ | 216 | /* more usart lookup table for DT entries */ |
217 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), | 217 | CLKDEV_CON_DEV_ID("usart", "fffff200.serial", &mck), |
218 | CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk), | 218 | CLKDEV_CON_DEV_ID("usart", "fffb0000.serial", &usart0_clk), |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index a76b8684f52d..aa1e58729885 100644 --- a/arch/arm/mach-at91/at91sam9260_devices.c +++ b/arch/arm/mach-at91/at91sam9260_devices.c | |||
@@ -389,7 +389,7 @@ static struct i2c_gpio_platform_data pdata = { | |||
389 | 389 | ||
390 | static struct platform_device at91sam9260_twi_device = { | 390 | static struct platform_device at91sam9260_twi_device = { |
391 | .name = "i2c-gpio", | 391 | .name = "i2c-gpio", |
392 | .id = -1, | 392 | .id = 0, |
393 | .dev.platform_data = &pdata, | 393 | .dev.platform_data = &pdata, |
394 | }; | 394 | }; |
395 | 395 | ||
@@ -421,7 +421,7 @@ static struct resource twi_resources[] = { | |||
421 | }; | 421 | }; |
422 | 422 | ||
423 | static struct platform_device at91sam9260_twi_device = { | 423 | static struct platform_device at91sam9260_twi_device = { |
424 | .id = -1, | 424 | .id = 0, |
425 | .resource = twi_resources, | 425 | .resource = twi_resources, |
426 | .num_resources = ARRAY_SIZE(twi_resources), | 426 | .num_resources = ARRAY_SIZE(twi_resources), |
427 | }; | 427 | }; |
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c index 8d999eb1a137..04295c04b3e0 100644 --- a/arch/arm/mach-at91/at91sam9261.c +++ b/arch/arm/mach-at91/at91sam9261.c | |||
@@ -178,8 +178,8 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
178 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), | 178 | CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk), |
179 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), | 179 | CLKDEV_CON_DEV_ID("pclk", "ssc.2", &ssc2_clk), |
180 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), | 180 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &hck0), |
181 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261", &twi_clk), | 181 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9261.0", &twi_clk), |
182 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10", &twi_clk), | 182 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g10.0", &twi_clk), |
183 | CLKDEV_CON_ID("pioA", &pioA_clk), | 183 | CLKDEV_CON_ID("pioA", &pioA_clk), |
184 | CLKDEV_CON_ID("pioB", &pioB_clk), | 184 | CLKDEV_CON_ID("pioB", &pioB_clk), |
185 | CLKDEV_CON_ID("pioC", &pioC_clk), | 185 | CLKDEV_CON_ID("pioC", &pioC_clk), |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 9752f17efba9..b9487696b7be 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -285,7 +285,7 @@ static struct i2c_gpio_platform_data pdata = { | |||
285 | 285 | ||
286 | static struct platform_device at91sam9261_twi_device = { | 286 | static struct platform_device at91sam9261_twi_device = { |
287 | .name = "i2c-gpio", | 287 | .name = "i2c-gpio", |
288 | .id = -1, | 288 | .id = 0, |
289 | .dev.platform_data = &pdata, | 289 | .dev.platform_data = &pdata, |
290 | }; | 290 | }; |
291 | 291 | ||
@@ -317,7 +317,7 @@ static struct resource twi_resources[] = { | |||
317 | }; | 317 | }; |
318 | 318 | ||
319 | static struct platform_device at91sam9261_twi_device = { | 319 | static struct platform_device at91sam9261_twi_device = { |
320 | .id = -1, | 320 | .id = 0, |
321 | .resource = twi_resources, | 321 | .resource = twi_resources, |
322 | .num_resources = ARRAY_SIZE(twi_resources), | 322 | .num_resources = ARRAY_SIZE(twi_resources), |
323 | }; | 323 | }; |
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c index 6a01d0360dfb..d6f9c23927c4 100644 --- a/arch/arm/mach-at91/at91sam9263.c +++ b/arch/arm/mach-at91/at91sam9263.c | |||
@@ -193,7 +193,7 @@ static struct clk_lookup periph_clocks_lookups[] = { | |||
193 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), | 193 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk), |
194 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), | 194 | CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk), |
195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), | 195 | CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk), |
196 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260", &twi_clk), | 196 | CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260.0", &twi_clk), |
197 | /* fake hclk clock */ | 197 | /* fake hclk clock */ |
198 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), | 198 | CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk), |
199 | CLKDEV_CON_ID("pioA", &pioA_clk), | 199 | CLKDEV_CON_ID("pioA", &pioA_clk), |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index 8dde220b42b6..cb85da2eccea 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_devices.c | |||
@@ -567,7 +567,7 @@ static struct i2c_gpio_platform_data pdata = { | |||
567 | 567 | ||
568 | static struct platform_device at91sam9263_twi_device = { | 568 | static struct platform_device at91sam9263_twi_device = { |
569 | .name = "i2c-gpio", | 569 | .name = "i2c-gpio", |
570 | .id = -1, | 570 | .id = 0, |
571 | .dev.platform_data = &pdata, | 571 | .dev.platform_data = &pdata, |
572 | }; | 572 | }; |
573 | 573 | ||
@@ -600,7 +600,7 @@ static struct resource twi_resources[] = { | |||
600 | 600 | ||
601 | static struct platform_device at91sam9263_twi_device = { | 601 | static struct platform_device at91sam9263_twi_device = { |
602 | .name = "i2c-at91sam9260", | 602 | .name = "i2c-at91sam9260", |
603 | .id = -1, | 603 | .id = 0, |
604 | .resource = twi_resources, | 604 | .resource = twi_resources, |
605 | .num_resources = ARRAY_SIZE(twi_resources), | 605 | .num_resources = ARRAY_SIZE(twi_resources), |
606 | }; | 606 | }; |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index d6ca0543ce8d..5047bdc92adf 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -314,7 +314,7 @@ static struct i2c_gpio_platform_data pdata = { | |||
314 | 314 | ||
315 | static struct platform_device at91sam9rl_twi_device = { | 315 | static struct platform_device at91sam9rl_twi_device = { |
316 | .name = "i2c-gpio", | 316 | .name = "i2c-gpio", |
317 | .id = -1, | 317 | .id = 0, |
318 | .dev.platform_data = &pdata, | 318 | .dev.platform_data = &pdata, |
319 | }; | 319 | }; |
320 | 320 | ||
@@ -347,7 +347,7 @@ static struct resource twi_resources[] = { | |||
347 | 347 | ||
348 | static struct platform_device at91sam9rl_twi_device = { | 348 | static struct platform_device at91sam9rl_twi_device = { |
349 | .name = "i2c-at91sam9g20", | 349 | .name = "i2c-at91sam9g20", |
350 | .id = -1, | 350 | .id = 0, |
351 | .resource = twi_resources, | 351 | .resource = twi_resources, |
352 | .num_resources = ARRAY_SIZE(twi_resources), | 352 | .num_resources = ARRAY_SIZE(twi_resources), |
353 | }; | 353 | }; |
diff --git a/arch/arm/mach-at91/at91x40.c b/arch/arm/mach-at91/at91x40.c index 6bd7300a2bc5..bb7f54474b92 100644 --- a/arch/arm/mach-at91/at91x40.c +++ b/arch/arm/mach-at91/at91x40.c | |||
@@ -88,6 +88,6 @@ void __init at91x40_init_interrupts(unsigned int priority[NR_AIC_IRQS]) | |||
88 | if (!priority) | 88 | if (!priority) |
89 | priority = at91x40_default_irq_priority; | 89 | priority = at91x40_default_irq_priority; |
90 | 90 | ||
91 | at91_aic_init(priority); | 91 | at91_aic_init(priority, at91_extern_irq); |
92 | } | 92 | } |
93 | 93 | ||
diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c index 9cda3fd346ae..6960778af4c2 100644 --- a/arch/arm/mach-at91/board-neocore926.c +++ b/arch/arm/mach-at91/board-neocore926.c | |||
@@ -129,7 +129,7 @@ static struct spi_board_info neocore926_spi_devices[] = { | |||
129 | .max_speed_hz = 125000 * 16, | 129 | .max_speed_hz = 125000 * 16, |
130 | .bus_num = 0, | 130 | .bus_num = 0, |
131 | .platform_data = &ads_info, | 131 | .platform_data = &ads_info, |
132 | .irq = AT91SAM9263_ID_IRQ1, | 132 | .irq = NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1, |
133 | }, | 133 | }, |
134 | #endif | 134 | #endif |
135 | }; | 135 | }; |
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c index 27b3af1a3047..a9167dd45f96 100644 --- a/arch/arm/mach-at91/board-sam9261ek.c +++ b/arch/arm/mach-at91/board-sam9261ek.c | |||
@@ -309,7 +309,7 @@ static struct spi_board_info ek_spi_devices[] = { | |||
309 | .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ | 309 | .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ |
310 | .bus_num = 0, | 310 | .bus_num = 0, |
311 | .platform_data = &ads_info, | 311 | .platform_data = &ads_info, |
312 | .irq = AT91SAM9261_ID_IRQ0, | 312 | .irq = NR_IRQS_LEGACY + AT91SAM9261_ID_IRQ0, |
313 | .controller_data = (void *) AT91_PIN_PA28, /* CS pin */ | 313 | .controller_data = (void *) AT91_PIN_PA28, /* CS pin */ |
314 | }, | 314 | }, |
315 | #endif | 315 | #endif |
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index 073e17403d98..b87dbe2be0d6 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c | |||
@@ -132,7 +132,7 @@ static struct spi_board_info ek_spi_devices[] = { | |||
132 | .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ | 132 | .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */ |
133 | .bus_num = 0, | 133 | .bus_num = 0, |
134 | .platform_data = &ads_info, | 134 | .platform_data = &ads_info, |
135 | .irq = AT91SAM9263_ID_IRQ1, | 135 | .irq = NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1, |
136 | }, | 136 | }, |
137 | #endif | 137 | #endif |
138 | }; | 138 | }; |
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h index f49650677653..b62f560e6c75 100644 --- a/arch/arm/mach-at91/generic.h +++ b/arch/arm/mach-at91/generic.h | |||
@@ -26,7 +26,8 @@ extern void __init at91_dt_initialize(void); | |||
26 | extern void __init at91_init_irq_default(void); | 26 | extern void __init at91_init_irq_default(void); |
27 | extern void __init at91_init_interrupts(unsigned int priority[]); | 27 | extern void __init at91_init_interrupts(unsigned int priority[]); |
28 | extern void __init at91x40_init_interrupts(unsigned int priority[]); | 28 | extern void __init at91x40_init_interrupts(unsigned int priority[]); |
29 | extern void __init at91_aic_init(unsigned int priority[]); | 29 | extern void __init at91_aic_init(unsigned int priority[], |
30 | unsigned int ext_irq_mask); | ||
30 | extern int __init at91_aic_of_init(struct device_node *node, | 31 | extern int __init at91_aic_of_init(struct device_node *node, |
31 | struct device_node *parent); | 32 | struct device_node *parent); |
32 | extern int __init at91_aic5_of_init(struct device_node *node, | 33 | extern int __init at91_aic5_of_init(struct device_node *node, |
diff --git a/arch/arm/mach-at91/irq.c b/arch/arm/mach-at91/irq.c index 1e02c0e49dcc..febc2ee901a5 100644 --- a/arch/arm/mach-at91/irq.c +++ b/arch/arm/mach-at91/irq.c | |||
@@ -502,14 +502,19 @@ int __init at91_aic5_of_init(struct device_node *node, | |||
502 | /* | 502 | /* |
503 | * Initialize the AIC interrupt controller. | 503 | * Initialize the AIC interrupt controller. |
504 | */ | 504 | */ |
505 | void __init at91_aic_init(unsigned int *priority) | 505 | void __init at91_aic_init(unsigned int *priority, unsigned int ext_irq_mask) |
506 | { | 506 | { |
507 | unsigned int i; | 507 | unsigned int i; |
508 | int irq_base; | 508 | int irq_base; |
509 | 509 | ||
510 | if (at91_aic_pm_init()) | 510 | at91_extern_irq = kzalloc(BITS_TO_LONGS(n_irqs) |
511 | * sizeof(*at91_extern_irq), GFP_KERNEL); | ||
512 | |||
513 | if (at91_aic_pm_init() || at91_extern_irq == NULL) | ||
511 | panic("Unable to allocate bit maps\n"); | 514 | panic("Unable to allocate bit maps\n"); |
512 | 515 | ||
516 | *at91_extern_irq = ext_irq_mask; | ||
517 | |||
513 | at91_aic_base = ioremap(AT91_AIC, 512); | 518 | at91_aic_base = ioremap(AT91_AIC, 512); |
514 | if (!at91_aic_base) | 519 | if (!at91_aic_base) |
515 | panic("Unable to ioremap AIC registers\n"); | 520 | panic("Unable to ioremap AIC registers\n"); |
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c index da9881b161e1..0b32c81730a5 100644 --- a/arch/arm/mach-at91/setup.c +++ b/arch/arm/mach-at91/setup.c | |||
@@ -47,7 +47,7 @@ void __init at91_init_irq_default(void) | |||
47 | void __init at91_init_interrupts(unsigned int *priority) | 47 | void __init at91_init_interrupts(unsigned int *priority) |
48 | { | 48 | { |
49 | /* Initialize the AIC interrupt controller */ | 49 | /* Initialize the AIC interrupt controller */ |
50 | at91_aic_init(priority); | 50 | at91_aic_init(priority, at91_extern_irq); |
51 | 51 | ||
52 | /* Enable GPIO interrupts */ | 52 | /* Enable GPIO interrupts */ |
53 | at91_gpio_irq_setup(); | 53 | at91_gpio_irq_setup(); |
@@ -151,7 +151,7 @@ static void __init soc_detect(u32 dbgu_base) | |||
151 | } | 151 | } |
152 | 152 | ||
153 | /* at91sam9g10 */ | 153 | /* at91sam9g10 */ |
154 | if ((cidr & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { | 154 | if ((socid & ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) { |
155 | at91_soc_initdata.type = AT91_SOC_SAM9G10; | 155 | at91_soc_initdata.type = AT91_SOC_SAM9G10; |
156 | at91_boot_soc = at91sam9261_soc; | 156 | at91_boot_soc = at91sam9261_soc; |
157 | } | 157 | } |
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c index 715b690e5009..1947be8e5f5b 100644 --- a/arch/arm/mach-exynos/common.c +++ b/arch/arm/mach-exynos/common.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <plat/fimc-core.h> | 47 | #include <plat/fimc-core.h> |
48 | #include <plat/iic-core.h> | 48 | #include <plat/iic-core.h> |
49 | #include <plat/tv-core.h> | 49 | #include <plat/tv-core.h> |
50 | #include <plat/spi-core.h> | ||
50 | #include <plat/regs-serial.h> | 51 | #include <plat/regs-serial.h> |
51 | 52 | ||
52 | #include "common.h" | 53 | #include "common.h" |
@@ -346,6 +347,8 @@ static void __init exynos4_map_io(void) | |||
346 | 347 | ||
347 | s5p_fb_setname(0, "exynos4-fb"); | 348 | s5p_fb_setname(0, "exynos4-fb"); |
348 | s5p_hdmi_setname("exynos4-hdmi"); | 349 | s5p_hdmi_setname("exynos4-hdmi"); |
350 | |||
351 | s3c64xx_spi_setname("exynos4210-spi"); | ||
349 | } | 352 | } |
350 | 353 | ||
351 | static void __init exynos5_map_io(void) | 354 | static void __init exynos5_map_io(void) |
@@ -366,6 +369,8 @@ static void __init exynos5_map_io(void) | |||
366 | s3c_i2c0_setname("s3c2440-i2c"); | 369 | s3c_i2c0_setname("s3c2440-i2c"); |
367 | s3c_i2c1_setname("s3c2440-i2c"); | 370 | s3c_i2c1_setname("s3c2440-i2c"); |
368 | s3c_i2c2_setname("s3c2440-i2c"); | 371 | s3c_i2c2_setname("s3c2440-i2c"); |
372 | |||
373 | s3c64xx_spi_setname("exynos4210-spi"); | ||
369 | } | 374 | } |
370 | 375 | ||
371 | static void __init exynos4_init_clocks(int xtal) | 376 | static void __init exynos4_init_clocks(int xtal) |
diff --git a/arch/arm/mach-exynos/mach-exynos4-dt.c b/arch/arm/mach-exynos/mach-exynos4-dt.c index e58d786faf78..eadf4b59e7d2 100644 --- a/arch/arm/mach-exynos/mach-exynos4-dt.c +++ b/arch/arm/mach-exynos/mach-exynos4-dt.c | |||
@@ -99,6 +99,7 @@ static char const *exynos4_dt_compat[] __initdata = { | |||
99 | 99 | ||
100 | DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") | 100 | DT_MACHINE_START(EXYNOS4210_DT, "Samsung Exynos4 (Flattened Device Tree)") |
101 | /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */ | 101 | /* Maintainer: Thomas Abraham <thomas.abraham@linaro.org> */ |
102 | .smp = smp_ops(exynos_smp_ops), | ||
102 | .init_irq = exynos4_init_irq, | 103 | .init_irq = exynos4_init_irq, |
103 | .map_io = exynos4_dt_map_io, | 104 | .map_io = exynos4_dt_map_io, |
104 | .handle_irq = gic_handle_irq, | 105 | .handle_irq = gic_handle_irq, |
diff --git a/arch/arm/mach-imx/clk-busy.c b/arch/arm/mach-imx/clk-busy.c index 1a7a8dd045a1..1ab91b5209e6 100644 --- a/arch/arm/mach-imx/clk-busy.c +++ b/arch/arm/mach-imx/clk-busy.c | |||
@@ -108,7 +108,7 @@ struct clk *imx_clk_busy_divider(const char *name, const char *parent_name, | |||
108 | busy->div.hw.init = &init; | 108 | busy->div.hw.init = &init; |
109 | 109 | ||
110 | clk = clk_register(NULL, &busy->div.hw); | 110 | clk = clk_register(NULL, &busy->div.hw); |
111 | if (!clk) | 111 | if (IS_ERR(clk)) |
112 | kfree(busy); | 112 | kfree(busy); |
113 | 113 | ||
114 | return clk; | 114 | return clk; |
diff --git a/arch/arm/mach-imx/clk-imx25.c b/arch/arm/mach-imx/clk-imx25.c index d20d4795f4ea..01e2f843bf2e 100644 --- a/arch/arm/mach-imx/clk-imx25.c +++ b/arch/arm/mach-imx/clk-imx25.c | |||
@@ -127,8 +127,8 @@ int __init mx25_clocks_init(void) | |||
127 | clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0), 4); | 127 | clk[esdhc2_ipg_per] = imx_clk_gate("esdhc2_ipg_per", "per4", ccm(CCM_CGCR0), 4); |
128 | clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0), 5); | 128 | clk[gpt_ipg_per] = imx_clk_gate("gpt_ipg_per", "per5", ccm(CCM_CGCR0), 5); |
129 | clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0), 6); | 129 | clk[i2c_ipg_per] = imx_clk_gate("i2c_ipg_per", "per6", ccm(CCM_CGCR0), 6); |
130 | clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per8", ccm(CCM_CGCR0), 7); | 130 | clk[lcdc_ipg_per] = imx_clk_gate("lcdc_ipg_per", "per7", ccm(CCM_CGCR0), 7); |
131 | clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "ipg_per", ccm(CCM_CGCR0), 8); | 131 | clk[nfc_ipg_per] = imx_clk_gate("nfc_ipg_per", "per8", ccm(CCM_CGCR0), 8); |
132 | clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13); | 132 | clk[ssi1_ipg_per] = imx_clk_gate("ssi1_ipg_per", "per13", ccm(CCM_CGCR0), 13); |
133 | clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14); | 133 | clk[ssi2_ipg_per] = imx_clk_gate("ssi2_ipg_per", "per14", ccm(CCM_CGCR0), 14); |
134 | clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15); | 134 | clk[uart_ipg_per] = imx_clk_gate("uart_ipg_per", "per15", ccm(CCM_CGCR0), 15); |
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c index 3b6b640eed24..366e5d59d886 100644 --- a/arch/arm/mach-imx/clk-imx27.c +++ b/arch/arm/mach-imx/clk-imx27.c | |||
@@ -109,7 +109,7 @@ int __init mx27_clocks_init(unsigned long fref) | |||
109 | clk[per3_div] = imx_clk_divider("per3_div", "mpll_main2", CCM_PCDR1, 16, 6); | 109 | clk[per3_div] = imx_clk_divider("per3_div", "mpll_main2", CCM_PCDR1, 16, 6); |
110 | clk[per4_div] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6); | 110 | clk[per4_div] = imx_clk_divider("per4_div", "mpll_main2", CCM_PCDR1, 24, 6); |
111 | clk[vpu_sel] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks)); | 111 | clk[vpu_sel] = imx_clk_mux("vpu_sel", CCM_CSCR, 21, 1, vpu_sel_clks, ARRAY_SIZE(vpu_sel_clks)); |
112 | clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 3); | 112 | clk[vpu_div] = imx_clk_divider("vpu_div", "vpu_sel", CCM_PCDR0, 10, 6); |
113 | clk[usb_div] = imx_clk_divider("usb_div", "spll", CCM_CSCR, 28, 3); | 113 | clk[usb_div] = imx_clk_divider("usb_div", "spll", CCM_CSCR, 28, 3); |
114 | clk[cpu_sel] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks)); | 114 | clk[cpu_sel] = imx_clk_mux("cpu_sel", CCM_CSCR, 15, 1, cpu_sel_clks, ARRAY_SIZE(cpu_sel_clks)); |
115 | clk[clko_sel] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks)); | 115 | clk[clko_sel] = imx_clk_mux("clko_sel", CCM_CCSR, 0, 5, clko_sel_clks, ARRAY_SIZE(clko_sel_clks)); |
@@ -121,7 +121,7 @@ int __init mx27_clocks_init(unsigned long fref) | |||
121 | clk[ssi1_sel] = imx_clk_mux("ssi1_sel", CCM_CSCR, 22, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks)); | 121 | clk[ssi1_sel] = imx_clk_mux("ssi1_sel", CCM_CSCR, 22, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks)); |
122 | clk[ssi2_sel] = imx_clk_mux("ssi2_sel", CCM_CSCR, 23, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks)); | 122 | clk[ssi2_sel] = imx_clk_mux("ssi2_sel", CCM_CSCR, 23, 1, ssi_sel_clks, ARRAY_SIZE(ssi_sel_clks)); |
123 | clk[ssi1_div] = imx_clk_divider("ssi1_div", "ssi1_sel", CCM_PCDR0, 16, 6); | 123 | clk[ssi1_div] = imx_clk_divider("ssi1_div", "ssi1_sel", CCM_PCDR0, 16, 6); |
124 | clk[ssi2_div] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 3); | 124 | clk[ssi2_div] = imx_clk_divider("ssi2_div", "ssi2_sel", CCM_PCDR0, 26, 6); |
125 | clk[clko_en] = imx_clk_gate("clko_en", "clko_div", CCM_PCCR0, 0); | 125 | clk[clko_en] = imx_clk_gate("clko_en", "clko_div", CCM_PCCR0, 0); |
126 | clk[ssi2_ipg_gate] = imx_clk_gate("ssi2_ipg_gate", "ipg", CCM_PCCR0, 0); | 126 | clk[ssi2_ipg_gate] = imx_clk_gate("ssi2_ipg_gate", "ipg", CCM_PCCR0, 0); |
127 | clk[ssi1_ipg_gate] = imx_clk_gate("ssi1_ipg_gate", "ipg", CCM_PCCR0, 1); | 127 | clk[ssi1_ipg_gate] = imx_clk_gate("ssi1_ipg_gate", "ipg", CCM_PCCR0, 1); |
diff --git a/arch/arm/mach-imx/mm-imx3.c b/arch/arm/mach-imx/mm-imx3.c index 9d2c843bde02..b5deb0554552 100644 --- a/arch/arm/mach-imx/mm-imx3.c +++ b/arch/arm/mach-imx/mm-imx3.c | |||
@@ -108,9 +108,8 @@ void __init imx3_init_l2x0(void) | |||
108 | } | 108 | } |
109 | 109 | ||
110 | l2x0_base = ioremap(MX3x_L2CC_BASE_ADDR, 4096); | 110 | l2x0_base = ioremap(MX3x_L2CC_BASE_ADDR, 4096); |
111 | if (IS_ERR(l2x0_base)) { | 111 | if (!l2x0_base) { |
112 | printk(KERN_ERR "remapping L2 cache area failed with %ld\n", | 112 | printk(KERN_ERR "remapping L2 cache area failed\n"); |
113 | PTR_ERR(l2x0_base)); | ||
114 | return; | 113 | return; |
115 | } | 114 | } |
116 | 115 | ||
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 2a1a898c7f90..d669e227e00c 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig | |||
@@ -11,7 +11,6 @@ config ARCH_OMAP2PLUS_TYPICAL | |||
11 | select I2C_OMAP | 11 | select I2C_OMAP |
12 | select MENELAUS if ARCH_OMAP2 | 12 | select MENELAUS if ARCH_OMAP2 |
13 | select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5 | 13 | select NEON if ARCH_OMAP3 || ARCH_OMAP4 || SOC_OMAP5 |
14 | select PINCTRL | ||
15 | select PM_RUNTIME | 14 | select PM_RUNTIME |
16 | select REGULATOR | 15 | select REGULATOR |
17 | select SERIAL_OMAP | 16 | select SERIAL_OMAP |
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 388c431c745a..d41ab98890ff 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/input.h> | 24 | #include <linux/input.h> |
25 | #include <linux/gpio_keys.h> | 25 | #include <linux/gpio_keys.h> |
26 | #include <linux/opp.h> | 26 | #include <linux/opp.h> |
27 | #include <linux/cpu.h> | ||
27 | 28 | ||
28 | #include <linux/mtd/mtd.h> | 29 | #include <linux/mtd/mtd.h> |
29 | #include <linux/mtd/partitions.h> | 30 | #include <linux/mtd/partitions.h> |
@@ -444,27 +445,31 @@ static struct omap_board_mux board_mux[] __initdata = { | |||
444 | }; | 445 | }; |
445 | #endif | 446 | #endif |
446 | 447 | ||
447 | static void __init beagle_opp_init(void) | 448 | static int __init beagle_opp_init(void) |
448 | { | 449 | { |
449 | int r = 0; | 450 | int r = 0; |
450 | 451 | ||
451 | /* Initialize the omap3 opp table */ | 452 | if (!machine_is_omap3_beagle()) |
452 | if (omap3_opp_init()) { | 453 | return 0; |
454 | |||
455 | /* Initialize the omap3 opp table if not already created. */ | ||
456 | r = omap3_opp_init(); | ||
457 | if (IS_ERR_VALUE(r) && (r != -EEXIST)) { | ||
453 | pr_err("%s: opp default init failed\n", __func__); | 458 | pr_err("%s: opp default init failed\n", __func__); |
454 | return; | 459 | return r; |
455 | } | 460 | } |
456 | 461 | ||
457 | /* Custom OPP enabled for all xM versions */ | 462 | /* Custom OPP enabled for all xM versions */ |
458 | if (cpu_is_omap3630()) { | 463 | if (cpu_is_omap3630()) { |
459 | struct device *mpu_dev, *iva_dev; | 464 | struct device *mpu_dev, *iva_dev; |
460 | 465 | ||
461 | mpu_dev = omap_device_get_by_hwmod_name("mpu"); | 466 | mpu_dev = get_cpu_device(0); |
462 | iva_dev = omap_device_get_by_hwmod_name("iva"); | 467 | iva_dev = omap_device_get_by_hwmod_name("iva"); |
463 | 468 | ||
464 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { | 469 | if (IS_ERR(mpu_dev) || IS_ERR(iva_dev)) { |
465 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", | 470 | pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", |
466 | __func__, mpu_dev, iva_dev); | 471 | __func__, mpu_dev, iva_dev); |
467 | return; | 472 | return -ENODEV; |
468 | } | 473 | } |
469 | /* Enable MPU 1GHz and lower opps */ | 474 | /* Enable MPU 1GHz and lower opps */ |
470 | r = opp_enable(mpu_dev, 800000000); | 475 | r = opp_enable(mpu_dev, 800000000); |
@@ -484,8 +489,9 @@ static void __init beagle_opp_init(void) | |||
484 | opp_disable(iva_dev, 660000000); | 489 | opp_disable(iva_dev, 660000000); |
485 | } | 490 | } |
486 | } | 491 | } |
487 | return; | 492 | return 0; |
488 | } | 493 | } |
494 | device_initcall(beagle_opp_init); | ||
489 | 495 | ||
490 | static void __init omap3_beagle_init(void) | 496 | static void __init omap3_beagle_init(void) |
491 | { | 497 | { |
@@ -522,8 +528,6 @@ static void __init omap3_beagle_init(void) | |||
522 | /* Ensure SDRC pins are mux'd for self-refresh */ | 528 | /* Ensure SDRC pins are mux'd for self-refresh */ |
523 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); | 529 | omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); |
524 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); | 530 | omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); |
525 | |||
526 | beagle_opp_init(); | ||
527 | } | 531 | } |
528 | 532 | ||
529 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") | 533 | MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") |
diff --git a/arch/arm/mach-omap2/clock33xx_data.c b/arch/arm/mach-omap2/clock33xx_data.c index 114ab4b8e0e3..1a45d6bd2539 100644 --- a/arch/arm/mach-omap2/clock33xx_data.c +++ b/arch/arm/mach-omap2/clock33xx_data.c | |||
@@ -1073,6 +1073,8 @@ static struct omap_clk am33xx_clks[] = { | |||
1073 | CLK(NULL, "gfx_fck_div_ck", &gfx_fck_div_ck, CK_AM33XX), | 1073 | CLK(NULL, "gfx_fck_div_ck", &gfx_fck_div_ck, CK_AM33XX), |
1074 | CLK(NULL, "sysclkout_pre_ck", &sysclkout_pre_ck, CK_AM33XX), | 1074 | CLK(NULL, "sysclkout_pre_ck", &sysclkout_pre_ck, CK_AM33XX), |
1075 | CLK(NULL, "clkout2_ck", &clkout2_ck, CK_AM33XX), | 1075 | CLK(NULL, "clkout2_ck", &clkout2_ck, CK_AM33XX), |
1076 | CLK(NULL, "timer_32k_ck", &clkdiv32k_ick, CK_AM33XX), | ||
1077 | CLK(NULL, "timer_sys_ck", &sys_clkin_ck, CK_AM33XX), | ||
1076 | }; | 1078 | }; |
1077 | 1079 | ||
1078 | int __init am33xx_clk_init(void) | 1080 | int __init am33xx_clk_init(void) |
diff --git a/arch/arm/mach-omap2/mux34xx.c b/arch/arm/mach-omap2/mux34xx.c index 17f80e4ab162..c47140bbbec4 100644 --- a/arch/arm/mach-omap2/mux34xx.c +++ b/arch/arm/mach-omap2/mux34xx.c | |||
@@ -614,16 +614,16 @@ static struct omap_mux __initdata omap3_muxmodes[] = { | |||
614 | "sys_off_mode", NULL, NULL, NULL, | 614 | "sys_off_mode", NULL, NULL, NULL, |
615 | "gpio_9", NULL, NULL, "safe_mode"), | 615 | "gpio_9", NULL, NULL, "safe_mode"), |
616 | _OMAP3_MUXENTRY(UART1_CTS, 150, | 616 | _OMAP3_MUXENTRY(UART1_CTS, 150, |
617 | "uart1_cts", NULL, NULL, NULL, | 617 | "uart1_cts", "ssi1_rdy_tx", NULL, NULL, |
618 | "gpio_150", "hsusb3_tll_clk", NULL, "safe_mode"), | 618 | "gpio_150", "hsusb3_tll_clk", NULL, "safe_mode"), |
619 | _OMAP3_MUXENTRY(UART1_RTS, 149, | 619 | _OMAP3_MUXENTRY(UART1_RTS, 149, |
620 | "uart1_rts", NULL, NULL, NULL, | 620 | "uart1_rts", "ssi1_flag_tx", NULL, NULL, |
621 | "gpio_149", NULL, NULL, "safe_mode"), | 621 | "gpio_149", NULL, NULL, "safe_mode"), |
622 | _OMAP3_MUXENTRY(UART1_RX, 151, | 622 | _OMAP3_MUXENTRY(UART1_RX, 151, |
623 | "uart1_rx", NULL, "mcbsp1_clkr", "mcspi4_clk", | 623 | "uart1_rx", "ss1_wake_tx", "mcbsp1_clkr", "mcspi4_clk", |
624 | "gpio_151", NULL, NULL, "safe_mode"), | 624 | "gpio_151", NULL, NULL, "safe_mode"), |
625 | _OMAP3_MUXENTRY(UART1_TX, 148, | 625 | _OMAP3_MUXENTRY(UART1_TX, 148, |
626 | "uart1_tx", NULL, NULL, NULL, | 626 | "uart1_tx", "ssi1_dat_tx", NULL, NULL, |
627 | "gpio_148", NULL, NULL, "safe_mode"), | 627 | "gpio_148", NULL, NULL, "safe_mode"), |
628 | _OMAP3_MUXENTRY(UART2_CTS, 144, | 628 | _OMAP3_MUXENTRY(UART2_CTS, 144, |
629 | "uart2_cts", "mcbsp3_dx", "gpt9_pwm_evt", NULL, | 629 | "uart2_cts", "mcbsp3_dx", "gpt9_pwm_evt", NULL, |
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 686137d164da..67d66131cfa7 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
@@ -91,6 +91,7 @@ extern void omap3_save_scratchpad_contents(void); | |||
91 | 91 | ||
92 | #define PM_RTA_ERRATUM_i608 (1 << 0) | 92 | #define PM_RTA_ERRATUM_i608 (1 << 0) |
93 | #define PM_SDRC_WAKEUP_ERRATUM_i583 (1 << 1) | 93 | #define PM_SDRC_WAKEUP_ERRATUM_i583 (1 << 1) |
94 | #define PM_PER_MEMORIES_ERRATUM_i582 (1 << 2) | ||
94 | 95 | ||
95 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) | 96 | #if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP3) |
96 | extern u16 pm34xx_errata; | 97 | extern u16 pm34xx_errata; |
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index ba670db1fd37..3a904de4313e 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -652,14 +652,17 @@ static void __init pm_errata_configure(void) | |||
652 | /* Enable the l2 cache toggling in sleep logic */ | 652 | /* Enable the l2 cache toggling in sleep logic */ |
653 | enable_omap3630_toggle_l2_on_restore(); | 653 | enable_omap3630_toggle_l2_on_restore(); |
654 | if (omap_rev() < OMAP3630_REV_ES1_2) | 654 | if (omap_rev() < OMAP3630_REV_ES1_2) |
655 | pm34xx_errata |= PM_SDRC_WAKEUP_ERRATUM_i583; | 655 | pm34xx_errata |= (PM_SDRC_WAKEUP_ERRATUM_i583 | |
656 | PM_PER_MEMORIES_ERRATUM_i582); | ||
657 | } else if (cpu_is_omap34xx()) { | ||
658 | pm34xx_errata |= PM_PER_MEMORIES_ERRATUM_i582; | ||
656 | } | 659 | } |
657 | } | 660 | } |
658 | 661 | ||
659 | int __init omap3_pm_init(void) | 662 | int __init omap3_pm_init(void) |
660 | { | 663 | { |
661 | struct power_state *pwrst, *tmp; | 664 | struct power_state *pwrst, *tmp; |
662 | struct clockdomain *neon_clkdm, *mpu_clkdm; | 665 | struct clockdomain *neon_clkdm, *mpu_clkdm, *per_clkdm, *wkup_clkdm; |
663 | int ret; | 666 | int ret; |
664 | 667 | ||
665 | if (!omap3_has_io_chain_ctrl()) | 668 | if (!omap3_has_io_chain_ctrl()) |
@@ -711,6 +714,8 @@ int __init omap3_pm_init(void) | |||
711 | 714 | ||
712 | neon_clkdm = clkdm_lookup("neon_clkdm"); | 715 | neon_clkdm = clkdm_lookup("neon_clkdm"); |
713 | mpu_clkdm = clkdm_lookup("mpu_clkdm"); | 716 | mpu_clkdm = clkdm_lookup("mpu_clkdm"); |
717 | per_clkdm = clkdm_lookup("per_clkdm"); | ||
718 | wkup_clkdm = clkdm_lookup("wkup_clkdm"); | ||
714 | 719 | ||
715 | #ifdef CONFIG_SUSPEND | 720 | #ifdef CONFIG_SUSPEND |
716 | omap_pm_suspend = omap3_pm_suspend; | 721 | omap_pm_suspend = omap3_pm_suspend; |
@@ -727,6 +732,27 @@ int __init omap3_pm_init(void) | |||
727 | if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608)) | 732 | if (IS_PM34XX_ERRATUM(PM_RTA_ERRATUM_i608)) |
728 | omap3630_ctrl_disable_rta(); | 733 | omap3630_ctrl_disable_rta(); |
729 | 734 | ||
735 | /* | ||
736 | * The UART3/4 FIFO and the sidetone memory in McBSP2/3 are | ||
737 | * not correctly reset when the PER powerdomain comes back | ||
738 | * from OFF or OSWR when the CORE powerdomain is kept active. | ||
739 | * See OMAP36xx Erratum i582 "PER Domain reset issue after | ||
740 | * Domain-OFF/OSWR Wakeup". This wakeup dependency is not a | ||
741 | * complete workaround. The kernel must also prevent the PER | ||
742 | * powerdomain from going to OSWR/OFF while the CORE | ||
743 | * powerdomain is not going to OSWR/OFF. And if PER last | ||
744 | * power state was off while CORE last power state was ON, the | ||
745 | * UART3/4 and McBSP2/3 SIDETONE devices need to run a | ||
746 | * self-test using their loopback tests; if that fails, those | ||
747 | * devices are unusable until the PER/CORE can complete a transition | ||
748 | * from ON to OSWR/OFF and then back to ON. | ||
749 | * | ||
750 | * XXX Technically this workaround is only needed if off-mode | ||
751 | * or OSWR is enabled. | ||
752 | */ | ||
753 | if (IS_PM34XX_ERRATUM(PM_PER_MEMORIES_ERRATUM_i582)) | ||
754 | clkdm_add_wkdep(per_clkdm, wkup_clkdm); | ||
755 | |||
730 | clkdm_add_wkdep(neon_clkdm, mpu_clkdm); | 756 | clkdm_add_wkdep(neon_clkdm, mpu_clkdm); |
731 | if (omap_type() != OMAP2_DEVICE_TYPE_GP) { | 757 | if (omap_type() != OMAP2_DEVICE_TYPE_GP) { |
732 | omap3_secure_ram_storage = | 758 | omap3_secure_ram_storage = |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 0405c8190803..a507cd6cf4f1 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c | |||
@@ -329,6 +329,11 @@ void __init omap_serial_init_port(struct omap_board_data *bdata, | |||
329 | 329 | ||
330 | oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); | 330 | oh->mux = omap_hwmod_mux_init(bdata->pads, bdata->pads_cnt); |
331 | 331 | ||
332 | if (console_uart_id == bdata->id) { | ||
333 | omap_device_enable(pdev); | ||
334 | pm_runtime_set_active(&pdev->dev); | ||
335 | } | ||
336 | |||
332 | oh->dev_attr = uart; | 337 | oh->dev_attr = uart; |
333 | 338 | ||
334 | if (((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads) | 339 | if (((cpu_is_omap34xx() || cpu_is_omap44xx()) && bdata->pads) |
diff --git a/arch/arm/mach-s3c24xx/s3c2416.c b/arch/arm/mach-s3c24xx/s3c2416.c index ed5a95ece9eb..77ee0b732237 100644 --- a/arch/arm/mach-s3c24xx/s3c2416.c +++ b/arch/arm/mach-s3c24xx/s3c2416.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <plat/nand-core.h> | 61 | #include <plat/nand-core.h> |
62 | #include <plat/adc-core.h> | 62 | #include <plat/adc-core.h> |
63 | #include <plat/rtc-core.h> | 63 | #include <plat/rtc-core.h> |
64 | #include <plat/spi-core.h> | ||
64 | 65 | ||
65 | static struct map_desc s3c2416_iodesc[] __initdata = { | 66 | static struct map_desc s3c2416_iodesc[] __initdata = { |
66 | IODESC_ENT(WATCHDOG), | 67 | IODESC_ENT(WATCHDOG), |
@@ -132,6 +133,7 @@ void __init s3c2416_map_io(void) | |||
132 | /* initialize device information early */ | 133 | /* initialize device information early */ |
133 | s3c2416_default_sdhci0(); | 134 | s3c2416_default_sdhci0(); |
134 | s3c2416_default_sdhci1(); | 135 | s3c2416_default_sdhci1(); |
136 | s3c64xx_spi_setname("s3c2443-spi"); | ||
135 | 137 | ||
136 | iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); | 138 | iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc)); |
137 | } | 139 | } |
diff --git a/arch/arm/mach-s3c24xx/s3c2443.c b/arch/arm/mach-s3c24xx/s3c2443.c index ab648ad8fa50..165b6a6b3daa 100644 --- a/arch/arm/mach-s3c24xx/s3c2443.c +++ b/arch/arm/mach-s3c24xx/s3c2443.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <plat/nand-core.h> | 43 | #include <plat/nand-core.h> |
44 | #include <plat/adc-core.h> | 44 | #include <plat/adc-core.h> |
45 | #include <plat/rtc-core.h> | 45 | #include <plat/rtc-core.h> |
46 | #include <plat/spi-core.h> | ||
46 | 47 | ||
47 | static struct map_desc s3c2443_iodesc[] __initdata = { | 48 | static struct map_desc s3c2443_iodesc[] __initdata = { |
48 | IODESC_ENT(WATCHDOG), | 49 | IODESC_ENT(WATCHDOG), |
@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void) | |||
100 | s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull; | 101 | s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull; |
101 | s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull; | 102 | s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull; |
102 | 103 | ||
104 | /* initialize device information early */ | ||
105 | s3c64xx_spi_setname("s3c2443-spi"); | ||
106 | |||
103 | iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); | 107 | iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc)); |
104 | } | 108 | } |
105 | 109 | ||
diff --git a/arch/arm/mach-s5p64x0/common.c b/arch/arm/mach-s5p64x0/common.c index 6e6a0a9d6778..111e404a81fd 100644 --- a/arch/arm/mach-s5p64x0/common.c +++ b/arch/arm/mach-s5p64x0/common.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <plat/sdhci.h> | 44 | #include <plat/sdhci.h> |
45 | #include <plat/adc-core.h> | 45 | #include <plat/adc-core.h> |
46 | #include <plat/fb-core.h> | 46 | #include <plat/fb-core.h> |
47 | #include <plat/spi-core.h> | ||
47 | #include <plat/gpio-cfg.h> | 48 | #include <plat/gpio-cfg.h> |
48 | #include <plat/regs-irqtype.h> | 49 | #include <plat/regs-irqtype.h> |
49 | #include <plat/regs-serial.h> | 50 | #include <plat/regs-serial.h> |
@@ -179,6 +180,7 @@ void __init s5p6440_map_io(void) | |||
179 | /* initialize any device information early */ | 180 | /* initialize any device information early */ |
180 | s3c_adc_setname("s3c64xx-adc"); | 181 | s3c_adc_setname("s3c64xx-adc"); |
181 | s3c_fb_setname("s5p64x0-fb"); | 182 | s3c_fb_setname("s5p64x0-fb"); |
183 | s3c64xx_spi_setname("s5p64x0-spi"); | ||
182 | 184 | ||
183 | s5p64x0_default_sdhci0(); | 185 | s5p64x0_default_sdhci0(); |
184 | s5p64x0_default_sdhci1(); | 186 | s5p64x0_default_sdhci1(); |
@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void) | |||
193 | /* initialize any device information early */ | 195 | /* initialize any device information early */ |
194 | s3c_adc_setname("s3c64xx-adc"); | 196 | s3c_adc_setname("s3c64xx-adc"); |
195 | s3c_fb_setname("s5p64x0-fb"); | 197 | s3c_fb_setname("s5p64x0-fb"); |
198 | s3c64xx_spi_setname("s5p64x0-spi"); | ||
196 | 199 | ||
197 | s5p64x0_default_sdhci0(); | 200 | s5p64x0_default_sdhci0(); |
198 | s5p64x0_default_sdhci1(); | 201 | s5p64x0_default_sdhci1(); |
diff --git a/arch/arm/mach-s5pc100/common.c b/arch/arm/mach-s5pc100/common.c index 621908658861..cc6e561c9958 100644 --- a/arch/arm/mach-s5pc100/common.c +++ b/arch/arm/mach-s5pc100/common.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <plat/fb-core.h> | 45 | #include <plat/fb-core.h> |
46 | #include <plat/iic-core.h> | 46 | #include <plat/iic-core.h> |
47 | #include <plat/onenand-core.h> | 47 | #include <plat/onenand-core.h> |
48 | #include <plat/spi-core.h> | ||
48 | #include <plat/regs-serial.h> | 49 | #include <plat/regs-serial.h> |
49 | #include <plat/watchdog-reset.h> | 50 | #include <plat/watchdog-reset.h> |
50 | 51 | ||
@@ -165,6 +166,8 @@ void __init s5pc100_map_io(void) | |||
165 | s3c_onenand_setname("s5pc100-onenand"); | 166 | s3c_onenand_setname("s5pc100-onenand"); |
166 | s3c_fb_setname("s5pc100-fb"); | 167 | s3c_fb_setname("s5pc100-fb"); |
167 | s3c_cfcon_setname("s5pc100-pata"); | 168 | s3c_cfcon_setname("s5pc100-pata"); |
169 | |||
170 | s3c64xx_spi_setname("s5pc100-spi"); | ||
168 | } | 171 | } |
169 | 172 | ||
170 | void __init s5pc100_init_clocks(int xtal) | 173 | void __init s5pc100_init_clocks(int xtal) |
diff --git a/arch/arm/mach-s5pv210/common.c b/arch/arm/mach-s5pv210/common.c index 4c9e9027df9a..a0c50efe8145 100644 --- a/arch/arm/mach-s5pv210/common.c +++ b/arch/arm/mach-s5pv210/common.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include <plat/iic-core.h> | 43 | #include <plat/iic-core.h> |
44 | #include <plat/keypad-core.h> | 44 | #include <plat/keypad-core.h> |
45 | #include <plat/tv-core.h> | 45 | #include <plat/tv-core.h> |
46 | #include <plat/spi-core.h> | ||
46 | #include <plat/regs-serial.h> | 47 | #include <plat/regs-serial.h> |
47 | 48 | ||
48 | #include "common.h" | 49 | #include "common.h" |
@@ -196,6 +197,8 @@ void __init s5pv210_map_io(void) | |||
196 | 197 | ||
197 | /* setup TV devices */ | 198 | /* setup TV devices */ |
198 | s5p_hdmi_setname("s5pv210-hdmi"); | 199 | s5p_hdmi_setname("s5pv210-hdmi"); |
200 | |||
201 | s3c64xx_spi_setname("s5pv210-spi"); | ||
199 | } | 202 | } |
200 | 203 | ||
201 | void __init s5pv210_init_clocks(int xtal) | 204 | void __init s5pv210_init_clocks(int xtal) |
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 2917668f0091..ebbffc25f24f 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c | |||
@@ -247,7 +247,7 @@ void __init r8a7779_add_standard_devices(void) | |||
247 | { | 247 | { |
248 | #ifdef CONFIG_CACHE_L2X0 | 248 | #ifdef CONFIG_CACHE_L2X0 |
249 | /* Early BRESP enable, Shared attribute override enable, 64K*16way */ | 249 | /* Early BRESP enable, Shared attribute override enable, 64K*16way */ |
250 | l2x0_init((void __iomem __force *)(0xf0100000), 0x40470000, 0x82000fff); | 250 | l2x0_init(IOMEM(0xf0100000), 0x40470000, 0x82000fff); |
251 | #endif | 251 | #endif |
252 | r8a7779_pm_init(); | 252 | r8a7779_pm_init(); |
253 | 253 | ||
diff --git a/arch/arm/mach-spear13xx/include/mach/spear1310_misc_regs.h b/arch/arm/mach-spear13xx/include/mach/spear1310_misc_regs.h deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/arch/arm/mach-spear13xx/include/mach/spear1310_misc_regs.h +++ /dev/null | |||
diff --git a/arch/arm/mach-spear13xx/include/mach/spear1340_misc_regs.h b/arch/arm/mach-spear13xx/include/mach/spear1340_misc_regs.h deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/arch/arm/mach-spear13xx/include/mach/spear1340_misc_regs.h +++ /dev/null | |||
diff --git a/arch/arm/mach-ux500/cpu.c b/arch/arm/mach-ux500/cpu.c index 2236cbd03cd7..1f3fbc2bb776 100644 --- a/arch/arm/mach-ux500/cpu.c +++ b/arch/arm/mach-ux500/cpu.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/stat.h> | 16 | #include <linux/stat.h> |
17 | #include <linux/of.h> | 17 | #include <linux/of.h> |
18 | #include <linux/of_irq.h> | 18 | #include <linux/of_irq.h> |
19 | #include <linux/irq.h> | ||
19 | #include <linux/platform_data/clk-ux500.h> | 20 | #include <linux/platform_data/clk-ux500.h> |
20 | 21 | ||
21 | #include <asm/hardware/gic.h> | 22 | #include <asm/hardware/gic.h> |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index b9f60ebe3bc4..b820edaf3184 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -745,7 +745,7 @@ do_alignment_t32_to_handler(unsigned long *pinstr, struct pt_regs *regs, | |||
745 | static int | 745 | static int |
746 | do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | 746 | do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) |
747 | { | 747 | { |
748 | union offset_union offset; | 748 | union offset_union uninitialized_var(offset); |
749 | unsigned long instr = 0, instrptr; | 749 | unsigned long instr = 0, instrptr; |
750 | int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); | 750 | int (*handler)(unsigned long addr, unsigned long instr, struct pt_regs *regs); |
751 | unsigned int type; | 751 | unsigned int type; |
@@ -856,8 +856,10 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs) | |||
856 | if (thumb2_32b) { | 856 | if (thumb2_32b) { |
857 | offset.un = 0; | 857 | offset.un = 0; |
858 | handler = do_alignment_t32_to_handler(&instr, regs, &offset); | 858 | handler = do_alignment_t32_to_handler(&instr, regs, &offset); |
859 | } else | 859 | } else { |
860 | offset.un = 0; | ||
860 | handler = do_alignment_ldmstm; | 861 | handler = do_alignment_ldmstm; |
862 | } | ||
861 | break; | 863 | break; |
862 | 864 | ||
863 | default: | 865 | default: |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 477a2d23ddf1..58bc3e4d3bd0 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -610,7 +610,7 @@ static void *__dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, | |||
610 | gfp_t gfp, pgprot_t prot, bool is_coherent, const void *caller) | 610 | gfp_t gfp, pgprot_t prot, bool is_coherent, const void *caller) |
611 | { | 611 | { |
612 | u64 mask = get_coherent_dma_mask(dev); | 612 | u64 mask = get_coherent_dma_mask(dev); |
613 | struct page *page; | 613 | struct page *page = NULL; |
614 | void *addr; | 614 | void *addr; |
615 | 615 | ||
616 | #ifdef CONFIG_DMA_API_DEBUG | 616 | #ifdef CONFIG_DMA_API_DEBUG |
diff --git a/arch/arm/mm/vmregion.h b/arch/arm/mm/vmregion.h index bf312c354a21..0f5a5f2a2c7b 100644 --- a/arch/arm/mm/vmregion.h +++ b/arch/arm/mm/vmregion.h | |||
@@ -17,7 +17,6 @@ struct arm_vmregion { | |||
17 | struct list_head vm_list; | 17 | struct list_head vm_list; |
18 | unsigned long vm_start; | 18 | unsigned long vm_start; |
19 | unsigned long vm_end; | 19 | unsigned long vm_end; |
20 | void *priv; | ||
21 | int vm_active; | 20 | int vm_active; |
22 | const void *caller; | 21 | const void *caller; |
23 | }; | 22 | }; |
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c index 540d3a7d92df..e7b920b58675 100644 --- a/arch/arm/plat-mxc/devices/platform-mxc-mmc.c +++ b/arch/arm/plat-mxc/devices/platform-mxc-mmc.c | |||
@@ -55,7 +55,7 @@ struct platform_device *__init imx_add_mxc_mmc( | |||
55 | struct resource res[] = { | 55 | struct resource res[] = { |
56 | { | 56 | { |
57 | .start = data->iobase, | 57 | .start = data->iobase, |
58 | .end = data->iobase + SZ_4K - 1, | 58 | .end = data->iobase + data->iosize - 1, |
59 | .flags = IORESOURCE_MEM, | 59 | .flags = IORESOURCE_MEM, |
60 | }, { | 60 | }, { |
61 | .start = data->irq, | 61 | .start = data->irq, |
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 7cd56ed5cd94..82fcb206b5b2 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig | |||
@@ -26,6 +26,7 @@ config ARCH_OMAP2PLUS | |||
26 | select CLKDEV_LOOKUP | 26 | select CLKDEV_LOOKUP |
27 | select GENERIC_IRQ_CHIP | 27 | select GENERIC_IRQ_CHIP |
28 | select OMAP_DM_TIMER | 28 | select OMAP_DM_TIMER |
29 | select PINCTRL | ||
29 | select PROC_DEVICETREE if PROC_FS | 30 | select PROC_DEVICETREE if PROC_FS |
30 | select SPARSE_IRQ | 31 | select SPARSE_IRQ |
31 | select USE_OF | 32 | select USE_OF |
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h index f4a4cd014795..1957a8516e93 100644 --- a/arch/arm/plat-omap/include/plat/omap-serial.h +++ b/arch/arm/plat-omap/include/plat/omap-serial.h | |||
@@ -40,10 +40,10 @@ | |||
40 | #define OMAP_UART_WER_MOD_WKUP 0X7F | 40 | #define OMAP_UART_WER_MOD_WKUP 0X7F |
41 | 41 | ||
42 | /* Enable XON/XOFF flow control on output */ | 42 | /* Enable XON/XOFF flow control on output */ |
43 | #define OMAP_UART_SW_TX 0x8 | 43 | #define OMAP_UART_SW_TX 0x04 |
44 | 44 | ||
45 | /* Enable XON/XOFF flow control on input */ | 45 | /* Enable XON/XOFF flow control on input */ |
46 | #define OMAP_UART_SW_RX 0x2 | 46 | #define OMAP_UART_SW_RX 0x04 |
47 | 47 | ||
48 | #define OMAP_UART_SYSC_RESET 0X07 | 48 | #define OMAP_UART_SYSC_RESET 0X07 |
49 | #define OMAP_UART_TCR_TRIG 0X0F | 49 | #define OMAP_UART_TCR_TRIG 0X0F |
diff --git a/arch/arm/plat-samsung/include/plat/spi-core.h b/arch/arm/plat-samsung/include/plat/spi-core.h new file mode 100644 index 000000000000..0b9428ab3fc3 --- /dev/null +++ b/arch/arm/plat-samsung/include/plat/spi-core.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2012 Heiko Stuebner <heiko@sntech.de> | ||
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 version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #ifndef __PLAT_S3C_SPI_CORE_H | ||
10 | #define __PLAT_S3C_SPI_CORE_H | ||
11 | |||
12 | /* These functions are only for use with the core support code, such as | ||
13 | * the cpu specific initialisation code | ||
14 | */ | ||
15 | |||
16 | /* re-define device name depending on support. */ | ||
17 | static inline void s3c64xx_spi_setname(char *name) | ||
18 | { | ||
19 | #ifdef CONFIG_S3C64XX_DEV_SPI0 | ||
20 | s3c64xx_device_spi0.name = name; | ||
21 | #endif | ||
22 | #ifdef CONFIG_S3C64XX_DEV_SPI1 | ||
23 | s3c64xx_device_spi1.name = name; | ||
24 | #endif | ||
25 | #ifdef CONFIG_S3C64XX_DEV_SPI2 | ||
26 | s3c64xx_device_spi2.name = name; | ||
27 | #endif | ||
28 | } | ||
29 | |||
30 | #endif /* __PLAT_S3C_SPI_CORE_H */ | ||
diff --git a/arch/arm/tools/Makefile b/arch/arm/tools/Makefile index 635cb1865e4d..cd60a81163e9 100644 --- a/arch/arm/tools/Makefile +++ b/arch/arm/tools/Makefile | |||
@@ -5,6 +5,6 @@ | |||
5 | # | 5 | # |
6 | 6 | ||
7 | include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types | 7 | include/generated/mach-types.h: $(src)/gen-mach-types $(src)/mach-types |
8 | @echo ' Generating $@' | 8 | $(kecho) ' Generating $@' |
9 | @mkdir -p $(dir $@) | 9 | @mkdir -p $(dir $@) |
10 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } | 10 | $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; } |
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index c834b32af275..3b44e0dd0a93 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
@@ -701,11 +701,14 @@ static int __init vfp_init(void) | |||
701 | elf_hwcap |= HWCAP_VFPv3; | 701 | elf_hwcap |= HWCAP_VFPv3; |
702 | 702 | ||
703 | /* | 703 | /* |
704 | * Check for VFPv3 D16. CPUs in this configuration | 704 | * Check for VFPv3 D16 and VFPv4 D16. CPUs in |
705 | * only have 16 x 64bit registers. | 705 | * this configuration only have 16 x 64bit |
706 | * registers. | ||
706 | */ | 707 | */ |
707 | if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK)) == 1) | 708 | if (((fmrx(MVFR0) & MVFR0_A_SIMD_MASK)) == 1) |
708 | elf_hwcap |= HWCAP_VFPv3D16; | 709 | elf_hwcap |= HWCAP_VFPv3D16; /* also v4-D16 */ |
710 | else | ||
711 | elf_hwcap |= HWCAP_VFPD32; | ||
709 | } | 712 | } |
710 | #endif | 713 | #endif |
711 | /* | 714 | /* |
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 59bcb96ac369..f57609275449 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -166,3 +166,14 @@ void free_xenballooned_pages(int nr_pages, struct page **pages) | |||
166 | *pages = NULL; | 166 | *pages = NULL; |
167 | } | 167 | } |
168 | EXPORT_SYMBOL_GPL(free_xenballooned_pages); | 168 | EXPORT_SYMBOL_GPL(free_xenballooned_pages); |
169 | |||
170 | /* In the hypervisor.S file. */ | ||
171 | EXPORT_SYMBOL_GPL(HYPERVISOR_event_channel_op); | ||
172 | EXPORT_SYMBOL_GPL(HYPERVISOR_grant_table_op); | ||
173 | EXPORT_SYMBOL_GPL(HYPERVISOR_xen_version); | ||
174 | EXPORT_SYMBOL_GPL(HYPERVISOR_console_io); | ||
175 | EXPORT_SYMBOL_GPL(HYPERVISOR_sched_op); | ||
176 | EXPORT_SYMBOL_GPL(HYPERVISOR_hvm_op); | ||
177 | EXPORT_SYMBOL_GPL(HYPERVISOR_memory_op); | ||
178 | EXPORT_SYMBOL_GPL(HYPERVISOR_physdev_op); | ||
179 | EXPORT_SYMBOL_GPL(privcmd_call); | ||
diff --git a/arch/arm/xen/grant-table.c b/arch/arm/xen/grant-table.c index dbd1330c0196..859a9bb002d5 100644 --- a/arch/arm/xen/grant-table.c +++ b/arch/arm/xen/grant-table.c | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <xen/page.h> | 33 | #include <xen/page.h> |
34 | #include <xen/grant_table.h> | 34 | #include <xen/grant_table.h> |
35 | 35 | ||
36 | int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, | 36 | int arch_gnttab_map_shared(xen_pfn_t *frames, unsigned long nr_gframes, |
37 | unsigned long max_nr_gframes, | 37 | unsigned long max_nr_gframes, |
38 | void **__shared) | 38 | void **__shared) |
39 | { | 39 | { |
diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S index 074f5ed101b9..71f723984cbd 100644 --- a/arch/arm/xen/hypercall.S +++ b/arch/arm/xen/hypercall.S | |||
@@ -48,20 +48,16 @@ | |||
48 | 48 | ||
49 | #include <linux/linkage.h> | 49 | #include <linux/linkage.h> |
50 | #include <asm/assembler.h> | 50 | #include <asm/assembler.h> |
51 | #include <asm/opcodes-virt.h> | ||
51 | #include <xen/interface/xen.h> | 52 | #include <xen/interface/xen.h> |
52 | 53 | ||
53 | 54 | ||
54 | /* HVC 0xEA1 */ | 55 | #define XEN_IMM 0xEA1 |
55 | #ifdef CONFIG_THUMB2_KERNEL | ||
56 | #define xen_hvc .word 0xf7e08ea1 | ||
57 | #else | ||
58 | #define xen_hvc .word 0xe140ea71 | ||
59 | #endif | ||
60 | 56 | ||
61 | #define HYPERCALL_SIMPLE(hypercall) \ | 57 | #define HYPERCALL_SIMPLE(hypercall) \ |
62 | ENTRY(HYPERVISOR_##hypercall) \ | 58 | ENTRY(HYPERVISOR_##hypercall) \ |
63 | mov r12, #__HYPERVISOR_##hypercall; \ | 59 | mov r12, #__HYPERVISOR_##hypercall; \ |
64 | xen_hvc; \ | 60 | __HVC(XEN_IMM); \ |
65 | mov pc, lr; \ | 61 | mov pc, lr; \ |
66 | ENDPROC(HYPERVISOR_##hypercall) | 62 | ENDPROC(HYPERVISOR_##hypercall) |
67 | 63 | ||
@@ -76,7 +72,7 @@ ENTRY(HYPERVISOR_##hypercall) \ | |||
76 | stmdb sp!, {r4} \ | 72 | stmdb sp!, {r4} \ |
77 | ldr r4, [sp, #4] \ | 73 | ldr r4, [sp, #4] \ |
78 | mov r12, #__HYPERVISOR_##hypercall; \ | 74 | mov r12, #__HYPERVISOR_##hypercall; \ |
79 | xen_hvc \ | 75 | __HVC(XEN_IMM); \ |
80 | ldm sp!, {r4} \ | 76 | ldm sp!, {r4} \ |
81 | mov pc, lr \ | 77 | mov pc, lr \ |
82 | ENDPROC(HYPERVISOR_##hypercall) | 78 | ENDPROC(HYPERVISOR_##hypercall) |
@@ -100,7 +96,7 @@ ENTRY(privcmd_call) | |||
100 | mov r2, r3 | 96 | mov r2, r3 |
101 | ldr r3, [sp, #8] | 97 | ldr r3, [sp, #8] |
102 | ldr r4, [sp, #4] | 98 | ldr r4, [sp, #4] |
103 | xen_hvc | 99 | __HVC(XEN_IMM) |
104 | ldm sp!, {r4} | 100 | ldm sp!, {r4} |
105 | mov pc, lr | 101 | mov pc, lr |
106 | ENDPROC(privcmd_call); | 102 | ENDPROC(privcmd_call); |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index ef54a59a9e89..15ac18a56c93 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -1,6 +1,7 @@ | |||
1 | config ARM64 | 1 | config ARM64 |
2 | def_bool y | 2 | def_bool y |
3 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE | 3 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE |
4 | select ARCH_WANT_COMPAT_IPC_PARSE_VERSION | ||
4 | select GENERIC_CLOCKEVENTS | 5 | select GENERIC_CLOCKEVENTS |
5 | select GENERIC_HARDIRQS_NO_DEPRECATED | 6 | select GENERIC_HARDIRQS_NO_DEPRECATED |
6 | select GENERIC_IOMAP | 7 | select GENERIC_IOMAP |
diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h index cf284649dfcb..07fea290d7c1 100644 --- a/arch/arm64/include/asm/elf.h +++ b/arch/arm64/include/asm/elf.h | |||
@@ -25,12 +25,10 @@ | |||
25 | #include <asm/user.h> | 25 | #include <asm/user.h> |
26 | 26 | ||
27 | typedef unsigned long elf_greg_t; | 27 | typedef unsigned long elf_greg_t; |
28 | typedef unsigned long elf_freg_t[3]; | ||
29 | 28 | ||
30 | #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) | 29 | #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) |
31 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; | 30 | typedef elf_greg_t elf_gregset_t[ELF_NGREG]; |
32 | 31 | typedef struct user_fpsimd_state elf_fpregset_t; | |
33 | typedef struct user_fp elf_fpregset_t; | ||
34 | 32 | ||
35 | #define EM_AARCH64 183 | 33 | #define EM_AARCH64 183 |
36 | 34 | ||
@@ -87,7 +85,6 @@ typedef struct user_fp elf_fpregset_t; | |||
87 | #define R_AARCH64_MOVW_PREL_G2_NC 292 | 85 | #define R_AARCH64_MOVW_PREL_G2_NC 292 |
88 | #define R_AARCH64_MOVW_PREL_G3 293 | 86 | #define R_AARCH64_MOVW_PREL_G3 293 |
89 | 87 | ||
90 | |||
91 | /* | 88 | /* |
92 | * These are used to set parameters in the core dumps. | 89 | * These are used to set parameters in the core dumps. |
93 | */ | 90 | */ |
diff --git a/arch/arm64/include/asm/fpsimd.h b/arch/arm64/include/asm/fpsimd.h index b42fab9f62a9..c43b4ac13008 100644 --- a/arch/arm64/include/asm/fpsimd.h +++ b/arch/arm64/include/asm/fpsimd.h | |||
@@ -25,9 +25,8 @@ | |||
25 | * - FPSR and FPCR | 25 | * - FPSR and FPCR |
26 | * - 32 128-bit data registers | 26 | * - 32 128-bit data registers |
27 | * | 27 | * |
28 | * Note that user_fp forms a prefix of this structure, which is relied | 28 | * Note that user_fpsimd forms a prefix of this structure, which is |
29 | * upon in the ptrace FP/SIMD accessors. struct user_fpsimd_state must | 29 | * relied upon in the ptrace FP/SIMD accessors. |
30 | * form a prefix of struct fpsimd_state. | ||
31 | */ | 30 | */ |
32 | struct fpsimd_state { | 31 | struct fpsimd_state { |
33 | union { | 32 | union { |
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h index 74a2a7d304a9..54f6116697f7 100644 --- a/arch/arm64/include/asm/io.h +++ b/arch/arm64/include/asm/io.h | |||
@@ -114,7 +114,7 @@ static inline u64 __raw_readq(const volatile void __iomem *addr) | |||
114 | * I/O port access primitives. | 114 | * I/O port access primitives. |
115 | */ | 115 | */ |
116 | #define IO_SPACE_LIMIT 0xffff | 116 | #define IO_SPACE_LIMIT 0xffff |
117 | #define PCI_IOBASE ((void __iomem *)0xffffffbbfffe0000UL) | 117 | #define PCI_IOBASE ((void __iomem *)(MODULES_VADDR - SZ_2M)) |
118 | 118 | ||
119 | static inline u8 inb(unsigned long addr) | 119 | static inline u8 inb(unsigned long addr) |
120 | { | 120 | { |
@@ -225,9 +225,9 @@ extern void __iounmap(volatile void __iomem *addr); | |||
225 | #define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_XN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) | 225 | #define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_XN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) |
226 | #define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) | 226 | #define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) |
227 | 227 | ||
228 | #define ioremap(addr, size) __ioremap((addr), (size), PROT_DEVICE_nGnRE) | 228 | #define ioremap(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) |
229 | #define ioremap_nocache(addr, size) __ioremap((addr), (size), PROT_DEVICE_nGnRE) | 229 | #define ioremap_nocache(addr, size) __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE)) |
230 | #define ioremap_wc(addr, size) __ioremap((addr), (size), PROT_NORMAL_NC) | 230 | #define ioremap_wc(addr, size) __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC)) |
231 | #define iounmap __iounmap | 231 | #define iounmap __iounmap |
232 | 232 | ||
233 | #define ARCH_HAS_IOREMAP_WC | 233 | #define ARCH_HAS_IOREMAP_WC |
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 5d810044feda..77f696c14339 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h | |||
@@ -43,6 +43,8 @@ | |||
43 | #else | 43 | #else |
44 | #define STACK_TOP STACK_TOP_MAX | 44 | #define STACK_TOP STACK_TOP_MAX |
45 | #endif /* CONFIG_COMPAT */ | 45 | #endif /* CONFIG_COMPAT */ |
46 | |||
47 | #define ARCH_LOW_ADDRESS_LIMIT PHYS_MASK | ||
46 | #endif /* __KERNEL__ */ | 48 | #endif /* __KERNEL__ */ |
47 | 49 | ||
48 | struct debug_info { | 50 | struct debug_info { |
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 63f853f8b718..68aff2816e86 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h | |||
@@ -14,7 +14,6 @@ | |||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | */ | 15 | */ |
16 | #ifdef CONFIG_COMPAT | 16 | #ifdef CONFIG_COMPAT |
17 | #define __ARCH_WANT_COMPAT_IPC_PARSE_VERSION | ||
18 | #define __ARCH_WANT_COMPAT_STAT64 | 17 | #define __ARCH_WANT_COMPAT_STAT64 |
19 | #define __ARCH_WANT_SYS_GETHOSTNAME | 18 | #define __ARCH_WANT_SYS_GETHOSTNAME |
20 | #define __ARCH_WANT_SYS_PAUSE | 19 | #define __ARCH_WANT_SYS_PAUSE |
diff --git a/arch/arm64/kernel/perf_event.c b/arch/arm64/kernel/perf_event.c index ecbf2d81ec5c..c76c7241125b 100644 --- a/arch/arm64/kernel/perf_event.c +++ b/arch/arm64/kernel/perf_event.c | |||
@@ -613,17 +613,11 @@ enum armv8_pmuv3_perf_types { | |||
613 | ARMV8_PMUV3_PERFCTR_BUS_ACCESS = 0x19, | 613 | ARMV8_PMUV3_PERFCTR_BUS_ACCESS = 0x19, |
614 | ARMV8_PMUV3_PERFCTR_MEM_ERROR = 0x1A, | 614 | ARMV8_PMUV3_PERFCTR_MEM_ERROR = 0x1A, |
615 | ARMV8_PMUV3_PERFCTR_BUS_CYCLES = 0x1D, | 615 | ARMV8_PMUV3_PERFCTR_BUS_CYCLES = 0x1D, |
616 | |||
617 | /* | ||
618 | * This isn't an architected event. | ||
619 | * We detect this event number and use the cycle counter instead. | ||
620 | */ | ||
621 | ARMV8_PMUV3_PERFCTR_CPU_CYCLES = 0xFF, | ||
622 | }; | 616 | }; |
623 | 617 | ||
624 | /* PMUv3 HW events mapping. */ | 618 | /* PMUv3 HW events mapping. */ |
625 | static const unsigned armv8_pmuv3_perf_map[PERF_COUNT_HW_MAX] = { | 619 | static const unsigned armv8_pmuv3_perf_map[PERF_COUNT_HW_MAX] = { |
626 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CPU_CYCLES, | 620 | [PERF_COUNT_HW_CPU_CYCLES] = ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES, |
627 | [PERF_COUNT_HW_INSTRUCTIONS] = ARMV8_PMUV3_PERFCTR_INSTR_EXECUTED, | 621 | [PERF_COUNT_HW_INSTRUCTIONS] = ARMV8_PMUV3_PERFCTR_INSTR_EXECUTED, |
628 | [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_ACCESS, | 622 | [PERF_COUNT_HW_CACHE_REFERENCES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_ACCESS, |
629 | [PERF_COUNT_HW_CACHE_MISSES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_REFILL, | 623 | [PERF_COUNT_HW_CACHE_MISSES] = ARMV8_PMUV3_PERFCTR_L1_DCACHE_REFILL, |
@@ -1106,7 +1100,7 @@ static int armv8pmu_get_event_idx(struct pmu_hw_events *cpuc, | |||
1106 | unsigned long evtype = event->config_base & ARMV8_EVTYPE_EVENT; | 1100 | unsigned long evtype = event->config_base & ARMV8_EVTYPE_EVENT; |
1107 | 1101 | ||
1108 | /* Always place a cycle counter into the cycle counter. */ | 1102 | /* Always place a cycle counter into the cycle counter. */ |
1109 | if (evtype == ARMV8_PMUV3_PERFCTR_CPU_CYCLES) { | 1103 | if (evtype == ARMV8_PMUV3_PERFCTR_CLOCK_CYCLES) { |
1110 | if (test_and_set_bit(ARMV8_IDX_CYCLE_COUNTER, cpuc->used_mask)) | 1104 | if (test_and_set_bit(ARMV8_IDX_CYCLE_COUNTER, cpuc->used_mask)) |
1111 | return -EAGAIN; | 1105 | return -EAGAIN; |
1112 | 1106 | ||
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index f22965ea1cfc..e04cebdbb47f 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c | |||
@@ -310,24 +310,6 @@ struct task_struct *__switch_to(struct task_struct *prev, | |||
310 | } | 310 | } |
311 | 311 | ||
312 | /* | 312 | /* |
313 | * Fill in the task's elfregs structure for a core dump. | ||
314 | */ | ||
315 | int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs) | ||
316 | { | ||
317 | elf_core_copy_regs(elfregs, task_pt_regs(t)); | ||
318 | return 1; | ||
319 | } | ||
320 | |||
321 | /* | ||
322 | * fill in the fpe structure for a core dump... | ||
323 | */ | ||
324 | int dump_fpu (struct pt_regs *regs, struct user_fp *fp) | ||
325 | { | ||
326 | return 0; | ||
327 | } | ||
328 | EXPORT_SYMBOL(dump_fpu); | ||
329 | |||
330 | /* | ||
331 | * Shuffle the argument into the correct register before calling the | 313 | * Shuffle the argument into the correct register before calling the |
332 | * thread function. x1 is the thread argument, x2 is the pointer to | 314 | * thread function. x1 is the thread argument, x2 is the pointer to |
333 | * the thread function, and x3 points to the exit function. | 315 | * the thread function, and x3 points to the exit function. |
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 226b6bf6e9c2..538300f2273d 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c | |||
@@ -211,8 +211,7 @@ asmlinkage void __cpuinit secondary_start_kernel(void) | |||
211 | * before we continue. | 211 | * before we continue. |
212 | */ | 212 | */ |
213 | set_cpu_online(cpu, true); | 213 | set_cpu_online(cpu, true); |
214 | while (!cpu_active(cpu)) | 214 | complete(&cpu_running); |
215 | cpu_relax(); | ||
216 | 215 | ||
217 | /* | 216 | /* |
218 | * OK, it's off to the idle thread for us | 217 | * OK, it's off to the idle thread for us |
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index efbf7df05d3f..4cd28931dba9 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c | |||
@@ -80,7 +80,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) | |||
80 | #ifdef CONFIG_ZONE_DMA32 | 80 | #ifdef CONFIG_ZONE_DMA32 |
81 | /* 4GB maximum for 32-bit only capable devices */ | 81 | /* 4GB maximum for 32-bit only capable devices */ |
82 | max_dma32 = min(max, MAX_DMA32_PFN); | 82 | max_dma32 = min(max, MAX_DMA32_PFN); |
83 | zone_size[ZONE_DMA32] = max_dma32 - min; | 83 | zone_size[ZONE_DMA32] = max(min, max_dma32) - min; |
84 | #endif | 84 | #endif |
85 | zone_size[ZONE_NORMAL] = max - max_dma32; | 85 | zone_size[ZONE_NORMAL] = max - max_dma32; |
86 | 86 | ||
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index b7412504f08a..df2eb4bd9fa2 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
@@ -13,6 +13,7 @@ config FRV | |||
13 | select GENERIC_CPU_DEVICES | 13 | select GENERIC_CPU_DEVICES |
14 | select ARCH_WANT_IPC_PARSE_VERSION | 14 | select ARCH_WANT_IPC_PARSE_VERSION |
15 | select GENERIC_KERNEL_THREAD | 15 | select GENERIC_KERNEL_THREAD |
16 | select GENERIC_KERNEL_EXECVE | ||
16 | 17 | ||
17 | config ZONE_DMA | 18 | config ZONE_DMA |
18 | bool | 19 | bool |
diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile index 6ae3254da019..636d5bbcd53f 100644 --- a/arch/frv/boot/Makefile +++ b/arch/frv/boot/Makefile | |||
@@ -17,6 +17,8 @@ PARAMS_PHYS = 0x0207c000 | |||
17 | INITRD_PHYS = 0x02180000 | 17 | INITRD_PHYS = 0x02180000 |
18 | INITRD_VIRT = 0x02180000 | 18 | INITRD_VIRT = 0x02180000 |
19 | 19 | ||
20 | OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment | ||
21 | |||
20 | # | 22 | # |
21 | # If you don't define ZRELADDR above, | 23 | # If you don't define ZRELADDR above, |
22 | # then it defaults to ZTEXTADDR | 24 | # then it defaults to ZTEXTADDR |
@@ -32,18 +34,18 @@ Image: $(obj)/Image | |||
32 | targets: $(obj)/Image | 34 | targets: $(obj)/Image |
33 | 35 | ||
34 | $(obj)/Image: vmlinux FORCE | 36 | $(obj)/Image: vmlinux FORCE |
35 | $(OBJCOPY) -O binary -R .note -R .comment -S vmlinux $@ | 37 | $(OBJCOPY) $(OBJCOPYFLAGS) -S vmlinux $@ |
36 | 38 | ||
37 | #$(obj)/Image: $(CONFIGURE) $(SYSTEM) | 39 | #$(obj)/Image: $(CONFIGURE) $(SYSTEM) |
38 | # $(OBJCOPY) -O binary -R .note -R .comment -g -S $(SYSTEM) $@ | 40 | # $(OBJCOPY) $(OBJCOPYFLAGS) -g -S $(SYSTEM) $@ |
39 | 41 | ||
40 | bzImage: zImage | 42 | bzImage: zImage |
41 | 43 | ||
42 | zImage: $(CONFIGURE) compressed/$(LINUX) | 44 | zImage: $(CONFIGURE) compressed/$(LINUX) |
43 | $(OBJCOPY) -O binary -R .note -R .comment -S compressed/$(LINUX) $@ | 45 | $(OBJCOPY) $(OBJCOPYFLAGS) -S compressed/$(LINUX) $@ |
44 | 46 | ||
45 | bootpImage: bootp/bootp | 47 | bootpImage: bootp/bootp |
46 | $(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@ | 48 | $(OBJCOPY) $(OBJCOPYFLAGS) -S bootp/bootp $@ |
47 | 49 | ||
48 | compressed/$(LINUX): $(LINUX) dep | 50 | compressed/$(LINUX): $(LINUX) dep |
49 | @$(MAKE) -C compressed $(LINUX) | 51 | @$(MAKE) -C compressed $(LINUX) |
diff --git a/arch/frv/include/asm/unistd.h b/arch/frv/include/asm/unistd.h index 266a5b25a0c1..2358634cacca 100644 --- a/arch/frv/include/asm/unistd.h +++ b/arch/frv/include/asm/unistd.h | |||
@@ -30,7 +30,6 @@ | |||
30 | #define __ARCH_WANT_SYS_RT_SIGACTION | 30 | #define __ARCH_WANT_SYS_RT_SIGACTION |
31 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 31 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
32 | #define __ARCH_WANT_SYS_EXECVE | 32 | #define __ARCH_WANT_SYS_EXECVE |
33 | #define __ARCH_WANT_KERNEL_EXECVE | ||
34 | 33 | ||
35 | /* | 34 | /* |
36 | * "Conditional" syscalls | 35 | * "Conditional" syscalls |
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S index ee0beb354e4d..dfcd263c0517 100644 --- a/arch/frv/kernel/entry.S +++ b/arch/frv/kernel/entry.S | |||
@@ -869,11 +869,6 @@ ret_from_kernel_thread: | |||
869 | call schedule_tail | 869 | call schedule_tail |
870 | calll.p @(gr21,gr0) | 870 | calll.p @(gr21,gr0) |
871 | or gr20,gr20,gr8 | 871 | or gr20,gr20,gr8 |
872 | bra sys_exit | ||
873 | |||
874 | .globl ret_from_kernel_execve | ||
875 | ret_from_kernel_execve: | ||
876 | ori gr28,0,sp | ||
877 | bra __syscall_exit | 872 | bra __syscall_exit |
878 | 873 | ||
879 | ################################################################################################### | 874 | ################################################################################################### |
@@ -1080,27 +1075,10 @@ __entry_return_from_kernel_interrupt: | |||
1080 | subicc gr5,#0,gr0,icc0 | 1075 | subicc gr5,#0,gr0,icc0 |
1081 | beq icc0,#0,__entry_return_direct | 1076 | beq icc0,#0,__entry_return_direct |
1082 | 1077 | ||
1083 | __entry_preempt_need_resched: | 1078 | subcc gr0,gr0,gr0,icc2 /* set Z and clear C */ |
1084 | ldi @(gr15,#TI_FLAGS),gr4 | 1079 | call preempt_schedule_irq |
1085 | andicc gr4,#_TIF_NEED_RESCHED,gr0,icc0 | ||
1086 | beq icc0,#1,__entry_return_direct | ||
1087 | |||
1088 | setlos #PREEMPT_ACTIVE,gr5 | ||
1089 | sti gr5,@(gr15,#TI_FLAGS) | ||
1090 | |||
1091 | andi gr23,#~PSR_PIL,gr23 | ||
1092 | movgs gr23,psr | ||
1093 | |||
1094 | call schedule | ||
1095 | sti gr0,@(gr15,#TI_PRE_COUNT) | ||
1096 | |||
1097 | movsg psr,gr23 | ||
1098 | ori gr23,#PSR_PIL_14,gr23 | ||
1099 | movgs gr23,psr | ||
1100 | bra __entry_preempt_need_resched | ||
1101 | #else | ||
1102 | bra __entry_return_direct | ||
1103 | #endif | 1080 | #endif |
1081 | bra __entry_return_direct | ||
1104 | 1082 | ||
1105 | 1083 | ||
1106 | ############################################################################### | 1084 | ############################################################################### |
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index e1e3aa196aa4..7e33215f1d8f 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c | |||
@@ -181,6 +181,9 @@ int copy_thread(unsigned long clone_flags, | |||
181 | childregs = (struct pt_regs *) | 181 | childregs = (struct pt_regs *) |
182 | (task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE); | 182 | (task_stack_page(p) + THREAD_SIZE - FRV_FRAME0_SIZE); |
183 | 183 | ||
184 | /* set up the userspace frame (the only place that the USP is stored) */ | ||
185 | *childregs = *__kernel_frame0_ptr; | ||
186 | |||
184 | p->set_child_tid = p->clear_child_tid = NULL; | 187 | p->set_child_tid = p->clear_child_tid = NULL; |
185 | 188 | ||
186 | p->thread.frame = childregs; | 189 | p->thread.frame = childregs; |
@@ -191,10 +194,8 @@ int copy_thread(unsigned long clone_flags, | |||
191 | p->thread.frame0 = childregs; | 194 | p->thread.frame0 = childregs; |
192 | 195 | ||
193 | if (unlikely(!regs)) { | 196 | if (unlikely(!regs)) { |
194 | memset(childregs, 0, sizeof(struct pt_regs)); | ||
195 | childregs->gr9 = usp; /* function */ | 197 | childregs->gr9 = usp; /* function */ |
196 | childregs->gr8 = arg; | 198 | childregs->gr8 = arg; |
197 | childregs->psr = PSR_S; | ||
198 | p->thread.pc = (unsigned long) ret_from_kernel_thread; | 199 | p->thread.pc = (unsigned long) ret_from_kernel_thread; |
199 | save_user_regs(p->thread.user); | 200 | save_user_regs(p->thread.user); |
200 | return 0; | 201 | return 0; |
diff --git a/arch/frv/mb93090-mb00/pci-dma-nommu.c b/arch/frv/mb93090-mb00/pci-dma-nommu.c index e47857f889b6..b99c2a7cc7a4 100644 --- a/arch/frv/mb93090-mb00/pci-dma-nommu.c +++ b/arch/frv/mb93090-mb00/pci-dma-nommu.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/export.h> | ||
14 | #include <linux/dma-mapping.h> | 15 | #include <linux/dma-mapping.h> |
15 | #include <linux/list.h> | 16 | #include <linux/list.h> |
16 | #include <linux/pci.h> | 17 | #include <linux/pci.h> |
diff --git a/arch/h8300/include/asm/cache.h b/arch/h8300/include/asm/cache.h index c6350283649d..05887a1d80e5 100644 --- a/arch/h8300/include/asm/cache.h +++ b/arch/h8300/include/asm/cache.h | |||
@@ -2,7 +2,8 @@ | |||
2 | #define __ARCH_H8300_CACHE_H | 2 | #define __ARCH_H8300_CACHE_H |
3 | 3 | ||
4 | /* bytes per L1 cache line */ | 4 | /* bytes per L1 cache line */ |
5 | #define L1_CACHE_BYTES 4 | 5 | #define L1_CACHE_SHIFT 2 |
6 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) | ||
6 | 7 | ||
7 | /* m68k-elf-gcc 2.95.2 doesn't like these */ | 8 | /* m68k-elf-gcc 2.95.2 doesn't like these */ |
8 | 9 | ||
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild index 4a159da23633..dd02f09b6eda 100644 --- a/arch/ia64/include/asm/Kbuild +++ b/arch/ia64/include/asm/Kbuild | |||
@@ -1,3 +1,4 @@ | |||
1 | 1 | ||
2 | generic-y += clkdev.h | 2 | generic-y += clkdev.h |
3 | generic-y += exec.h | 3 | generic-y += exec.h |
4 | generic-y += kvm_para.h | ||
diff --git a/arch/ia64/include/asm/kvm_para.h b/arch/ia64/include/asm/kvm_para.h deleted file mode 100644 index 47c00f910434..000000000000 --- a/arch/ia64/include/asm/kvm_para.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
17 | */ | ||
18 | #ifndef __IA64_KVM_PARA_H | ||
19 | #define __IA64_KVM_PARA_H | ||
20 | |||
21 | #include <uapi/asm/kvm_para.h> | ||
22 | |||
23 | |||
24 | static inline unsigned int kvm_arch_para_features(void) | ||
25 | { | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | static inline bool kvm_check_and_clear_guest_paused(void) | ||
30 | { | ||
31 | return false; | ||
32 | } | ||
33 | |||
34 | #endif | ||
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild index ecb540810ab3..88fa3ac86fae 100644 --- a/arch/m68k/include/asm/Kbuild +++ b/arch/m68k/include/asm/Kbuild | |||
@@ -1,5 +1,3 @@ | |||
1 | include include/asm-generic/Kbuild.asm | ||
2 | header-y += cachectl.h | ||
3 | 1 | ||
4 | generic-y += bitsperlong.h | 2 | generic-y += bitsperlong.h |
5 | generic-y += clkdev.h | 3 | generic-y += clkdev.h |
diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h index 5e08b597f012..0f717045bdde 100644 --- a/arch/m68k/include/asm/ptrace.h +++ b/arch/m68k/include/asm/ptrace.h | |||
@@ -1,82 +1,10 @@ | |||
1 | #ifndef _M68K_PTRACE_H | 1 | #ifndef _M68K_PTRACE_H |
2 | #define _M68K_PTRACE_H | 2 | #define _M68K_PTRACE_H |
3 | 3 | ||
4 | #define PT_D1 0 | 4 | #include <uapi/asm/ptrace.h> |
5 | #define PT_D2 1 | ||
6 | #define PT_D3 2 | ||
7 | #define PT_D4 3 | ||
8 | #define PT_D5 4 | ||
9 | #define PT_D6 5 | ||
10 | #define PT_D7 6 | ||
11 | #define PT_A0 7 | ||
12 | #define PT_A1 8 | ||
13 | #define PT_A2 9 | ||
14 | #define PT_A3 10 | ||
15 | #define PT_A4 11 | ||
16 | #define PT_A5 12 | ||
17 | #define PT_A6 13 | ||
18 | #define PT_D0 14 | ||
19 | #define PT_USP 15 | ||
20 | #define PT_ORIG_D0 16 | ||
21 | #define PT_SR 17 | ||
22 | #define PT_PC 18 | ||
23 | 5 | ||
24 | #ifndef __ASSEMBLY__ | 6 | #ifndef __ASSEMBLY__ |
25 | 7 | ||
26 | /* this struct defines the way the registers are stored on the | ||
27 | stack during a system call. */ | ||
28 | |||
29 | struct pt_regs { | ||
30 | long d1; | ||
31 | long d2; | ||
32 | long d3; | ||
33 | long d4; | ||
34 | long d5; | ||
35 | long a0; | ||
36 | long a1; | ||
37 | long a2; | ||
38 | long d0; | ||
39 | long orig_d0; | ||
40 | long stkadj; | ||
41 | #ifdef CONFIG_COLDFIRE | ||
42 | unsigned format : 4; /* frame format specifier */ | ||
43 | unsigned vector : 12; /* vector offset */ | ||
44 | unsigned short sr; | ||
45 | unsigned long pc; | ||
46 | #else | ||
47 | unsigned short sr; | ||
48 | unsigned long pc; | ||
49 | unsigned format : 4; /* frame format specifier */ | ||
50 | unsigned vector : 12; /* vector offset */ | ||
51 | #endif | ||
52 | }; | ||
53 | |||
54 | /* | ||
55 | * This is the extended stack used by signal handlers and the context | ||
56 | * switcher: it's pushed after the normal "struct pt_regs". | ||
57 | */ | ||
58 | struct switch_stack { | ||
59 | unsigned long d6; | ||
60 | unsigned long d7; | ||
61 | unsigned long a3; | ||
62 | unsigned long a4; | ||
63 | unsigned long a5; | ||
64 | unsigned long a6; | ||
65 | unsigned long retpc; | ||
66 | }; | ||
67 | |||
68 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | ||
69 | #define PTRACE_GETREGS 12 | ||
70 | #define PTRACE_SETREGS 13 | ||
71 | #define PTRACE_GETFPREGS 14 | ||
72 | #define PTRACE_SETFPREGS 15 | ||
73 | |||
74 | #define PTRACE_GET_THREAD_AREA 25 | ||
75 | |||
76 | #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ | ||
77 | |||
78 | #ifdef __KERNEL__ | ||
79 | |||
80 | #ifndef PS_S | 8 | #ifndef PS_S |
81 | #define PS_S (0x2000) | 9 | #define PS_S (0x2000) |
82 | #define PS_M (0x1000) | 10 | #define PS_M (0x1000) |
@@ -94,6 +22,5 @@ struct switch_stack { | |||
94 | #define arch_has_block_step() (1) | 22 | #define arch_has_block_step() (1) |
95 | #endif | 23 | #endif |
96 | 24 | ||
97 | #endif /* __KERNEL__ */ | ||
98 | #endif /* __ASSEMBLY__ */ | 25 | #endif /* __ASSEMBLY__ */ |
99 | #endif /* _M68K_PTRACE_H */ | 26 | #endif /* _M68K_PTRACE_H */ |
diff --git a/arch/m68k/include/asm/setup.h b/arch/m68k/include/asm/setup.h index 00c2c5397d37..65e78a2dad64 100644 --- a/arch/m68k/include/asm/setup.h +++ b/arch/m68k/include/asm/setup.h | |||
@@ -19,33 +19,12 @@ | |||
19 | ** Redesign of the boot information structure; moved boot information | 19 | ** Redesign of the boot information structure; moved boot information |
20 | ** structure to bootinfo.h | 20 | ** structure to bootinfo.h |
21 | */ | 21 | */ |
22 | |||
23 | #ifndef _M68K_SETUP_H | 22 | #ifndef _M68K_SETUP_H |
24 | #define _M68K_SETUP_H | 23 | #define _M68K_SETUP_H |
25 | 24 | ||
25 | #include <uapi/asm/setup.h> | ||
26 | 26 | ||
27 | 27 | ||
28 | /* | ||
29 | * Linux/m68k Architectures | ||
30 | */ | ||
31 | |||
32 | #define MACH_AMIGA 1 | ||
33 | #define MACH_ATARI 2 | ||
34 | #define MACH_MAC 3 | ||
35 | #define MACH_APOLLO 4 | ||
36 | #define MACH_SUN3 5 | ||
37 | #define MACH_MVME147 6 | ||
38 | #define MACH_MVME16x 7 | ||
39 | #define MACH_BVME6000 8 | ||
40 | #define MACH_HP300 9 | ||
41 | #define MACH_Q40 10 | ||
42 | #define MACH_SUN3X 11 | ||
43 | #define MACH_M54XX 12 | ||
44 | |||
45 | #define COMMAND_LINE_SIZE 256 | ||
46 | |||
47 | #ifdef __KERNEL__ | ||
48 | |||
49 | #define CL_SIZE COMMAND_LINE_SIZE | 28 | #define CL_SIZE COMMAND_LINE_SIZE |
50 | 29 | ||
51 | #ifndef __ASSEMBLY__ | 30 | #ifndef __ASSEMBLY__ |
@@ -194,63 +173,6 @@ extern unsigned long m68k_machtype; | |||
194 | # define MACH_TYPE (m68k_machtype) | 173 | # define MACH_TYPE (m68k_machtype) |
195 | #endif | 174 | #endif |
196 | 175 | ||
197 | #endif /* __KERNEL__ */ | ||
198 | |||
199 | |||
200 | /* | ||
201 | * CPU, FPU and MMU types | ||
202 | * | ||
203 | * Note: we may rely on the following equalities: | ||
204 | * | ||
205 | * CPU_68020 == MMU_68851 | ||
206 | * CPU_68030 == MMU_68030 | ||
207 | * CPU_68040 == FPU_68040 == MMU_68040 | ||
208 | * CPU_68060 == FPU_68060 == MMU_68060 | ||
209 | */ | ||
210 | |||
211 | #define CPUB_68020 0 | ||
212 | #define CPUB_68030 1 | ||
213 | #define CPUB_68040 2 | ||
214 | #define CPUB_68060 3 | ||
215 | #define CPUB_COLDFIRE 4 | ||
216 | |||
217 | #define CPU_68020 (1<<CPUB_68020) | ||
218 | #define CPU_68030 (1<<CPUB_68030) | ||
219 | #define CPU_68040 (1<<CPUB_68040) | ||
220 | #define CPU_68060 (1<<CPUB_68060) | ||
221 | #define CPU_COLDFIRE (1<<CPUB_COLDFIRE) | ||
222 | |||
223 | #define FPUB_68881 0 | ||
224 | #define FPUB_68882 1 | ||
225 | #define FPUB_68040 2 /* Internal FPU */ | ||
226 | #define FPUB_68060 3 /* Internal FPU */ | ||
227 | #define FPUB_SUNFPA 4 /* Sun-3 FPA */ | ||
228 | #define FPUB_COLDFIRE 5 /* ColdFire FPU */ | ||
229 | |||
230 | #define FPU_68881 (1<<FPUB_68881) | ||
231 | #define FPU_68882 (1<<FPUB_68882) | ||
232 | #define FPU_68040 (1<<FPUB_68040) | ||
233 | #define FPU_68060 (1<<FPUB_68060) | ||
234 | #define FPU_SUNFPA (1<<FPUB_SUNFPA) | ||
235 | #define FPU_COLDFIRE (1<<FPUB_COLDFIRE) | ||
236 | |||
237 | #define MMUB_68851 0 | ||
238 | #define MMUB_68030 1 /* Internal MMU */ | ||
239 | #define MMUB_68040 2 /* Internal MMU */ | ||
240 | #define MMUB_68060 3 /* Internal MMU */ | ||
241 | #define MMUB_APOLLO 4 /* Custom Apollo */ | ||
242 | #define MMUB_SUN3 5 /* Custom Sun-3 */ | ||
243 | #define MMUB_COLDFIRE 6 /* Internal MMU */ | ||
244 | |||
245 | #define MMU_68851 (1<<MMUB_68851) | ||
246 | #define MMU_68030 (1<<MMUB_68030) | ||
247 | #define MMU_68040 (1<<MMUB_68040) | ||
248 | #define MMU_68060 (1<<MMUB_68060) | ||
249 | #define MMU_SUN3 (1<<MMUB_SUN3) | ||
250 | #define MMU_APOLLO (1<<MMUB_APOLLO) | ||
251 | #define MMU_COLDFIRE (1<<MMUB_COLDFIRE) | ||
252 | |||
253 | #ifdef __KERNEL__ | ||
254 | 176 | ||
255 | #ifndef __ASSEMBLY__ | 177 | #ifndef __ASSEMBLY__ |
256 | extern unsigned long m68k_cputype; | 178 | extern unsigned long m68k_cputype; |
@@ -385,6 +307,4 @@ extern int m68k_realnum_memory; /* real # of memory blocks found */ | |||
385 | extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ | 307 | extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ |
386 | #endif | 308 | #endif |
387 | 309 | ||
388 | #endif /* __KERNEL__ */ | ||
389 | |||
390 | #endif /* _M68K_SETUP_H */ | 310 | #endif /* _M68K_SETUP_H */ |
diff --git a/arch/m68k/include/asm/signal.h b/arch/m68k/include/asm/signal.h index 60e88660169c..67e489d8d1bd 100644 --- a/arch/m68k/include/asm/signal.h +++ b/arch/m68k/include/asm/signal.h | |||
@@ -1,12 +1,8 @@ | |||
1 | #ifndef _M68K_SIGNAL_H | 1 | #ifndef _M68K_SIGNAL_H |
2 | #define _M68K_SIGNAL_H | 2 | #define _M68K_SIGNAL_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <uapi/asm/signal.h> |
5 | 5 | ||
6 | /* Avoid too many header ordering problems. */ | ||
7 | struct siginfo; | ||
8 | |||
9 | #ifdef __KERNEL__ | ||
10 | /* Most things should be clean enough to redefine this at will, if care | 6 | /* Most things should be clean enough to redefine this at will, if care |
11 | is taken to make libc match. */ | 7 | is taken to make libc match. */ |
12 | 8 | ||
@@ -20,92 +16,6 @@ typedef struct { | |||
20 | unsigned long sig[_NSIG_WORDS]; | 16 | unsigned long sig[_NSIG_WORDS]; |
21 | } sigset_t; | 17 | } sigset_t; |
22 | 18 | ||
23 | #else | ||
24 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
25 | |||
26 | #define NSIG 32 | ||
27 | typedef unsigned long sigset_t; | ||
28 | |||
29 | #endif /* __KERNEL__ */ | ||
30 | |||
31 | #define SIGHUP 1 | ||
32 | #define SIGINT 2 | ||
33 | #define SIGQUIT 3 | ||
34 | #define SIGILL 4 | ||
35 | #define SIGTRAP 5 | ||
36 | #define SIGABRT 6 | ||
37 | #define SIGIOT 6 | ||
38 | #define SIGBUS 7 | ||
39 | #define SIGFPE 8 | ||
40 | #define SIGKILL 9 | ||
41 | #define SIGUSR1 10 | ||
42 | #define SIGSEGV 11 | ||
43 | #define SIGUSR2 12 | ||
44 | #define SIGPIPE 13 | ||
45 | #define SIGALRM 14 | ||
46 | #define SIGTERM 15 | ||
47 | #define SIGSTKFLT 16 | ||
48 | #define SIGCHLD 17 | ||
49 | #define SIGCONT 18 | ||
50 | #define SIGSTOP 19 | ||
51 | #define SIGTSTP 20 | ||
52 | #define SIGTTIN 21 | ||
53 | #define SIGTTOU 22 | ||
54 | #define SIGURG 23 | ||
55 | #define SIGXCPU 24 | ||
56 | #define SIGXFSZ 25 | ||
57 | #define SIGVTALRM 26 | ||
58 | #define SIGPROF 27 | ||
59 | #define SIGWINCH 28 | ||
60 | #define SIGIO 29 | ||
61 | #define SIGPOLL SIGIO | ||
62 | /* | ||
63 | #define SIGLOST 29 | ||
64 | */ | ||
65 | #define SIGPWR 30 | ||
66 | #define SIGSYS 31 | ||
67 | #define SIGUNUSED 31 | ||
68 | |||
69 | /* These should not be considered constants from userland. */ | ||
70 | #define SIGRTMIN 32 | ||
71 | #define SIGRTMAX _NSIG | ||
72 | |||
73 | /* | ||
74 | * SA_FLAGS values: | ||
75 | * | ||
76 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
77 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
78 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
79 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
80 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
81 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
82 | * | ||
83 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
84 | * Unix names RESETHAND and NODEFER respectively. | ||
85 | */ | ||
86 | #define SA_NOCLDSTOP 0x00000001 | ||
87 | #define SA_NOCLDWAIT 0x00000002 | ||
88 | #define SA_SIGINFO 0x00000004 | ||
89 | #define SA_ONSTACK 0x08000000 | ||
90 | #define SA_RESTART 0x10000000 | ||
91 | #define SA_NODEFER 0x40000000 | ||
92 | #define SA_RESETHAND 0x80000000 | ||
93 | |||
94 | #define SA_NOMASK SA_NODEFER | ||
95 | #define SA_ONESHOT SA_RESETHAND | ||
96 | |||
97 | /* | ||
98 | * sigaltstack controls | ||
99 | */ | ||
100 | #define SS_ONSTACK 1 | ||
101 | #define SS_DISABLE 2 | ||
102 | |||
103 | #define MINSIGSTKSZ 2048 | ||
104 | #define SIGSTKSZ 8192 | ||
105 | |||
106 | #include <asm-generic/signal-defs.h> | ||
107 | |||
108 | #ifdef __KERNEL__ | ||
109 | struct old_sigaction { | 19 | struct old_sigaction { |
110 | __sighandler_t sa_handler; | 20 | __sighandler_t sa_handler; |
111 | old_sigset_t sa_mask; | 21 | old_sigset_t sa_mask; |
@@ -123,31 +33,6 @@ struct sigaction { | |||
123 | struct k_sigaction { | 33 | struct k_sigaction { |
124 | struct sigaction sa; | 34 | struct sigaction sa; |
125 | }; | 35 | }; |
126 | #else | ||
127 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
128 | |||
129 | struct sigaction { | ||
130 | union { | ||
131 | __sighandler_t _sa_handler; | ||
132 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
133 | } _u; | ||
134 | sigset_t sa_mask; | ||
135 | unsigned long sa_flags; | ||
136 | void (*sa_restorer)(void); | ||
137 | }; | ||
138 | |||
139 | #define sa_handler _u._sa_handler | ||
140 | #define sa_sigaction _u._sa_sigaction | ||
141 | |||
142 | #endif /* __KERNEL__ */ | ||
143 | |||
144 | typedef struct sigaltstack { | ||
145 | void __user *ss_sp; | ||
146 | int ss_flags; | ||
147 | size_t ss_size; | ||
148 | } stack_t; | ||
149 | |||
150 | #ifdef __KERNEL__ | ||
151 | #include <asm/sigcontext.h> | 36 | #include <asm/sigcontext.h> |
152 | 37 | ||
153 | #ifndef CONFIG_CPU_HAS_NO_BITFIELDS | 38 | #ifndef CONFIG_CPU_HAS_NO_BITFIELDS |
@@ -208,5 +93,4 @@ struct pt_regs; | |||
208 | extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie); | 93 | extern void ptrace_signal_deliver(struct pt_regs *regs, void *cookie); |
209 | #endif /* __uClinux__ */ | 94 | #endif /* __uClinux__ */ |
210 | 95 | ||
211 | #endif /* __KERNEL__ */ | ||
212 | #endif /* _M68K_SIGNAL_H */ | 96 | #endif /* _M68K_SIGNAL_H */ |
diff --git a/arch/m68k/include/asm/termios.h b/arch/m68k/include/asm/termios.h index 0823032e4045..ad8efb098663 100644 --- a/arch/m68k/include/asm/termios.h +++ b/arch/m68k/include/asm/termios.h | |||
@@ -1,27 +1,8 @@ | |||
1 | #ifndef _M68K_TERMIOS_H | 1 | #ifndef _M68K_TERMIOS_H |
2 | #define _M68K_TERMIOS_H | 2 | #define _M68K_TERMIOS_H |
3 | 3 | ||
4 | #include <asm/termbits.h> | 4 | #include <uapi/asm/termios.h> |
5 | #include <asm/ioctls.h> | ||
6 | 5 | ||
7 | struct winsize { | ||
8 | unsigned short ws_row; | ||
9 | unsigned short ws_col; | ||
10 | unsigned short ws_xpixel; | ||
11 | unsigned short ws_ypixel; | ||
12 | }; | ||
13 | |||
14 | #define NCC 8 | ||
15 | struct termio { | ||
16 | unsigned short c_iflag; /* input mode flags */ | ||
17 | unsigned short c_oflag; /* output mode flags */ | ||
18 | unsigned short c_cflag; /* control mode flags */ | ||
19 | unsigned short c_lflag; /* local mode flags */ | ||
20 | unsigned char c_line; /* line discipline */ | ||
21 | unsigned char c_cc[NCC]; /* control characters */ | ||
22 | }; | ||
23 | |||
24 | #ifdef __KERNEL__ | ||
25 | /* intr=^C quit=^| erase=del kill=^U | 6 | /* intr=^C quit=^| erase=del kill=^U |
26 | eof=^D vtime=\0 vmin=\1 sxtc=\0 | 7 | eof=^D vtime=\0 vmin=\1 sxtc=\0 |
27 | start=^Q stop=^S susp=^Z eol=\0 | 8 | start=^Q stop=^S susp=^Z eol=\0 |
@@ -29,27 +10,6 @@ struct termio { | |||
29 | eol2=\0 | 10 | eol2=\0 |
30 | */ | 11 | */ |
31 | #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" | 12 | #define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" |
32 | #endif | ||
33 | |||
34 | /* modem lines */ | ||
35 | #define TIOCM_LE 0x001 | ||
36 | #define TIOCM_DTR 0x002 | ||
37 | #define TIOCM_RTS 0x004 | ||
38 | #define TIOCM_ST 0x008 | ||
39 | #define TIOCM_SR 0x010 | ||
40 | #define TIOCM_CTS 0x020 | ||
41 | #define TIOCM_CAR 0x040 | ||
42 | #define TIOCM_RNG 0x080 | ||
43 | #define TIOCM_DSR 0x100 | ||
44 | #define TIOCM_CD TIOCM_CAR | ||
45 | #define TIOCM_RI TIOCM_RNG | ||
46 | #define TIOCM_OUT1 0x2000 | ||
47 | #define TIOCM_OUT2 0x4000 | ||
48 | #define TIOCM_LOOP 0x8000 | ||
49 | |||
50 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
51 | |||
52 | #ifdef __KERNEL__ | ||
53 | 13 | ||
54 | /* | 14 | /* |
55 | * Translate a "termio" structure into a "termios". Ugh. | 15 | * Translate a "termio" structure into a "termios". Ugh. |
@@ -87,6 +47,4 @@ struct termio { | |||
87 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) | 47 | #define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) |
88 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) | 48 | #define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) |
89 | 49 | ||
90 | #endif /* __KERNEL__ */ | ||
91 | |||
92 | #endif /* _M68K_TERMIOS_H */ | 50 | #endif /* _M68K_TERMIOS_H */ |
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index c702ad716791..5fc7f7bec1c8 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
@@ -1,361 +1,10 @@ | |||
1 | #ifndef _ASM_M68K_UNISTD_H_ | 1 | #ifndef _ASM_M68K_UNISTD_H_ |
2 | #define _ASM_M68K_UNISTD_H_ | 2 | #define _ASM_M68K_UNISTD_H_ |
3 | 3 | ||
4 | /* | 4 | #include <uapi/asm/unistd.h> |
5 | * This file contains the system call numbers. | ||
6 | */ | ||
7 | |||
8 | #define __NR_restart_syscall 0 | ||
9 | #define __NR_exit 1 | ||
10 | #define __NR_fork 2 | ||
11 | #define __NR_read 3 | ||
12 | #define __NR_write 4 | ||
13 | #define __NR_open 5 | ||
14 | #define __NR_close 6 | ||
15 | #define __NR_waitpid 7 | ||
16 | #define __NR_creat 8 | ||
17 | #define __NR_link 9 | ||
18 | #define __NR_unlink 10 | ||
19 | #define __NR_execve 11 | ||
20 | #define __NR_chdir 12 | ||
21 | #define __NR_time 13 | ||
22 | #define __NR_mknod 14 | ||
23 | #define __NR_chmod 15 | ||
24 | #define __NR_chown 16 | ||
25 | /*#define __NR_break 17*/ | ||
26 | #define __NR_oldstat 18 | ||
27 | #define __NR_lseek 19 | ||
28 | #define __NR_getpid 20 | ||
29 | #define __NR_mount 21 | ||
30 | #define __NR_umount 22 | ||
31 | #define __NR_setuid 23 | ||
32 | #define __NR_getuid 24 | ||
33 | #define __NR_stime 25 | ||
34 | #define __NR_ptrace 26 | ||
35 | #define __NR_alarm 27 | ||
36 | #define __NR_oldfstat 28 | ||
37 | #define __NR_pause 29 | ||
38 | #define __NR_utime 30 | ||
39 | /*#define __NR_stty 31*/ | ||
40 | /*#define __NR_gtty 32*/ | ||
41 | #define __NR_access 33 | ||
42 | #define __NR_nice 34 | ||
43 | /*#define __NR_ftime 35*/ | ||
44 | #define __NR_sync 36 | ||
45 | #define __NR_kill 37 | ||
46 | #define __NR_rename 38 | ||
47 | #define __NR_mkdir 39 | ||
48 | #define __NR_rmdir 40 | ||
49 | #define __NR_dup 41 | ||
50 | #define __NR_pipe 42 | ||
51 | #define __NR_times 43 | ||
52 | /*#define __NR_prof 44*/ | ||
53 | #define __NR_brk 45 | ||
54 | #define __NR_setgid 46 | ||
55 | #define __NR_getgid 47 | ||
56 | #define __NR_signal 48 | ||
57 | #define __NR_geteuid 49 | ||
58 | #define __NR_getegid 50 | ||
59 | #define __NR_acct 51 | ||
60 | #define __NR_umount2 52 | ||
61 | /*#define __NR_lock 53*/ | ||
62 | #define __NR_ioctl 54 | ||
63 | #define __NR_fcntl 55 | ||
64 | /*#define __NR_mpx 56*/ | ||
65 | #define __NR_setpgid 57 | ||
66 | /*#define __NR_ulimit 58*/ | ||
67 | /*#define __NR_oldolduname 59*/ | ||
68 | #define __NR_umask 60 | ||
69 | #define __NR_chroot 61 | ||
70 | #define __NR_ustat 62 | ||
71 | #define __NR_dup2 63 | ||
72 | #define __NR_getppid 64 | ||
73 | #define __NR_getpgrp 65 | ||
74 | #define __NR_setsid 66 | ||
75 | #define __NR_sigaction 67 | ||
76 | #define __NR_sgetmask 68 | ||
77 | #define __NR_ssetmask 69 | ||
78 | #define __NR_setreuid 70 | ||
79 | #define __NR_setregid 71 | ||
80 | #define __NR_sigsuspend 72 | ||
81 | #define __NR_sigpending 73 | ||
82 | #define __NR_sethostname 74 | ||
83 | #define __NR_setrlimit 75 | ||
84 | #define __NR_getrlimit 76 | ||
85 | #define __NR_getrusage 77 | ||
86 | #define __NR_gettimeofday 78 | ||
87 | #define __NR_settimeofday 79 | ||
88 | #define __NR_getgroups 80 | ||
89 | #define __NR_setgroups 81 | ||
90 | #define __NR_select 82 | ||
91 | #define __NR_symlink 83 | ||
92 | #define __NR_oldlstat 84 | ||
93 | #define __NR_readlink 85 | ||
94 | #define __NR_uselib 86 | ||
95 | #define __NR_swapon 87 | ||
96 | #define __NR_reboot 88 | ||
97 | #define __NR_readdir 89 | ||
98 | #define __NR_mmap 90 | ||
99 | #define __NR_munmap 91 | ||
100 | #define __NR_truncate 92 | ||
101 | #define __NR_ftruncate 93 | ||
102 | #define __NR_fchmod 94 | ||
103 | #define __NR_fchown 95 | ||
104 | #define __NR_getpriority 96 | ||
105 | #define __NR_setpriority 97 | ||
106 | /*#define __NR_profil 98*/ | ||
107 | #define __NR_statfs 99 | ||
108 | #define __NR_fstatfs 100 | ||
109 | /*#define __NR_ioperm 101*/ | ||
110 | #define __NR_socketcall 102 | ||
111 | #define __NR_syslog 103 | ||
112 | #define __NR_setitimer 104 | ||
113 | #define __NR_getitimer 105 | ||
114 | #define __NR_stat 106 | ||
115 | #define __NR_lstat 107 | ||
116 | #define __NR_fstat 108 | ||
117 | /*#define __NR_olduname 109*/ | ||
118 | /*#define __NR_iopl 110*/ /* not supported */ | ||
119 | #define __NR_vhangup 111 | ||
120 | /*#define __NR_idle 112*/ /* Obsolete */ | ||
121 | /*#define __NR_vm86 113*/ /* not supported */ | ||
122 | #define __NR_wait4 114 | ||
123 | #define __NR_swapoff 115 | ||
124 | #define __NR_sysinfo 116 | ||
125 | #define __NR_ipc 117 | ||
126 | #define __NR_fsync 118 | ||
127 | #define __NR_sigreturn 119 | ||
128 | #define __NR_clone 120 | ||
129 | #define __NR_setdomainname 121 | ||
130 | #define __NR_uname 122 | ||
131 | #define __NR_cacheflush 123 | ||
132 | #define __NR_adjtimex 124 | ||
133 | #define __NR_mprotect 125 | ||
134 | #define __NR_sigprocmask 126 | ||
135 | #define __NR_create_module 127 | ||
136 | #define __NR_init_module 128 | ||
137 | #define __NR_delete_module 129 | ||
138 | #define __NR_get_kernel_syms 130 | ||
139 | #define __NR_quotactl 131 | ||
140 | #define __NR_getpgid 132 | ||
141 | #define __NR_fchdir 133 | ||
142 | #define __NR_bdflush 134 | ||
143 | #define __NR_sysfs 135 | ||
144 | #define __NR_personality 136 | ||
145 | /*#define __NR_afs_syscall 137*/ /* Syscall for Andrew File System */ | ||
146 | #define __NR_setfsuid 138 | ||
147 | #define __NR_setfsgid 139 | ||
148 | #define __NR__llseek 140 | ||
149 | #define __NR_getdents 141 | ||
150 | #define __NR__newselect 142 | ||
151 | #define __NR_flock 143 | ||
152 | #define __NR_msync 144 | ||
153 | #define __NR_readv 145 | ||
154 | #define __NR_writev 146 | ||
155 | #define __NR_getsid 147 | ||
156 | #define __NR_fdatasync 148 | ||
157 | #define __NR__sysctl 149 | ||
158 | #define __NR_mlock 150 | ||
159 | #define __NR_munlock 151 | ||
160 | #define __NR_mlockall 152 | ||
161 | #define __NR_munlockall 153 | ||
162 | #define __NR_sched_setparam 154 | ||
163 | #define __NR_sched_getparam 155 | ||
164 | #define __NR_sched_setscheduler 156 | ||
165 | #define __NR_sched_getscheduler 157 | ||
166 | #define __NR_sched_yield 158 | ||
167 | #define __NR_sched_get_priority_max 159 | ||
168 | #define __NR_sched_get_priority_min 160 | ||
169 | #define __NR_sched_rr_get_interval 161 | ||
170 | #define __NR_nanosleep 162 | ||
171 | #define __NR_mremap 163 | ||
172 | #define __NR_setresuid 164 | ||
173 | #define __NR_getresuid 165 | ||
174 | #define __NR_getpagesize 166 | ||
175 | #define __NR_query_module 167 | ||
176 | #define __NR_poll 168 | ||
177 | #define __NR_nfsservctl 169 | ||
178 | #define __NR_setresgid 170 | ||
179 | #define __NR_getresgid 171 | ||
180 | #define __NR_prctl 172 | ||
181 | #define __NR_rt_sigreturn 173 | ||
182 | #define __NR_rt_sigaction 174 | ||
183 | #define __NR_rt_sigprocmask 175 | ||
184 | #define __NR_rt_sigpending 176 | ||
185 | #define __NR_rt_sigtimedwait 177 | ||
186 | #define __NR_rt_sigqueueinfo 178 | ||
187 | #define __NR_rt_sigsuspend 179 | ||
188 | #define __NR_pread64 180 | ||
189 | #define __NR_pwrite64 181 | ||
190 | #define __NR_lchown 182 | ||
191 | #define __NR_getcwd 183 | ||
192 | #define __NR_capget 184 | ||
193 | #define __NR_capset 185 | ||
194 | #define __NR_sigaltstack 186 | ||
195 | #define __NR_sendfile 187 | ||
196 | #define __NR_getpmsg 188 /* some people actually want streams */ | ||
197 | #define __NR_putpmsg 189 /* some people actually want streams */ | ||
198 | #define __NR_vfork 190 | ||
199 | #define __NR_ugetrlimit 191 | ||
200 | #define __NR_mmap2 192 | ||
201 | #define __NR_truncate64 193 | ||
202 | #define __NR_ftruncate64 194 | ||
203 | #define __NR_stat64 195 | ||
204 | #define __NR_lstat64 196 | ||
205 | #define __NR_fstat64 197 | ||
206 | #define __NR_chown32 198 | ||
207 | #define __NR_getuid32 199 | ||
208 | #define __NR_getgid32 200 | ||
209 | #define __NR_geteuid32 201 | ||
210 | #define __NR_getegid32 202 | ||
211 | #define __NR_setreuid32 203 | ||
212 | #define __NR_setregid32 204 | ||
213 | #define __NR_getgroups32 205 | ||
214 | #define __NR_setgroups32 206 | ||
215 | #define __NR_fchown32 207 | ||
216 | #define __NR_setresuid32 208 | ||
217 | #define __NR_getresuid32 209 | ||
218 | #define __NR_setresgid32 210 | ||
219 | #define __NR_getresgid32 211 | ||
220 | #define __NR_lchown32 212 | ||
221 | #define __NR_setuid32 213 | ||
222 | #define __NR_setgid32 214 | ||
223 | #define __NR_setfsuid32 215 | ||
224 | #define __NR_setfsgid32 216 | ||
225 | #define __NR_pivot_root 217 | ||
226 | /* 218*/ | ||
227 | /* 219*/ | ||
228 | #define __NR_getdents64 220 | ||
229 | #define __NR_gettid 221 | ||
230 | #define __NR_tkill 222 | ||
231 | #define __NR_setxattr 223 | ||
232 | #define __NR_lsetxattr 224 | ||
233 | #define __NR_fsetxattr 225 | ||
234 | #define __NR_getxattr 226 | ||
235 | #define __NR_lgetxattr 227 | ||
236 | #define __NR_fgetxattr 228 | ||
237 | #define __NR_listxattr 229 | ||
238 | #define __NR_llistxattr 230 | ||
239 | #define __NR_flistxattr 231 | ||
240 | #define __NR_removexattr 232 | ||
241 | #define __NR_lremovexattr 233 | ||
242 | #define __NR_fremovexattr 234 | ||
243 | #define __NR_futex 235 | ||
244 | #define __NR_sendfile64 236 | ||
245 | #define __NR_mincore 237 | ||
246 | #define __NR_madvise 238 | ||
247 | #define __NR_fcntl64 239 | ||
248 | #define __NR_readahead 240 | ||
249 | #define __NR_io_setup 241 | ||
250 | #define __NR_io_destroy 242 | ||
251 | #define __NR_io_getevents 243 | ||
252 | #define __NR_io_submit 244 | ||
253 | #define __NR_io_cancel 245 | ||
254 | #define __NR_fadvise64 246 | ||
255 | #define __NR_exit_group 247 | ||
256 | #define __NR_lookup_dcookie 248 | ||
257 | #define __NR_epoll_create 249 | ||
258 | #define __NR_epoll_ctl 250 | ||
259 | #define __NR_epoll_wait 251 | ||
260 | #define __NR_remap_file_pages 252 | ||
261 | #define __NR_set_tid_address 253 | ||
262 | #define __NR_timer_create 254 | ||
263 | #define __NR_timer_settime 255 | ||
264 | #define __NR_timer_gettime 256 | ||
265 | #define __NR_timer_getoverrun 257 | ||
266 | #define __NR_timer_delete 258 | ||
267 | #define __NR_clock_settime 259 | ||
268 | #define __NR_clock_gettime 260 | ||
269 | #define __NR_clock_getres 261 | ||
270 | #define __NR_clock_nanosleep 262 | ||
271 | #define __NR_statfs64 263 | ||
272 | #define __NR_fstatfs64 264 | ||
273 | #define __NR_tgkill 265 | ||
274 | #define __NR_utimes 266 | ||
275 | #define __NR_fadvise64_64 267 | ||
276 | #define __NR_mbind 268 | ||
277 | #define __NR_get_mempolicy 269 | ||
278 | #define __NR_set_mempolicy 270 | ||
279 | #define __NR_mq_open 271 | ||
280 | #define __NR_mq_unlink 272 | ||
281 | #define __NR_mq_timedsend 273 | ||
282 | #define __NR_mq_timedreceive 274 | ||
283 | #define __NR_mq_notify 275 | ||
284 | #define __NR_mq_getsetattr 276 | ||
285 | #define __NR_waitid 277 | ||
286 | /*#define __NR_vserver 278*/ | ||
287 | #define __NR_add_key 279 | ||
288 | #define __NR_request_key 280 | ||
289 | #define __NR_keyctl 281 | ||
290 | #define __NR_ioprio_set 282 | ||
291 | #define __NR_ioprio_get 283 | ||
292 | #define __NR_inotify_init 284 | ||
293 | #define __NR_inotify_add_watch 285 | ||
294 | #define __NR_inotify_rm_watch 286 | ||
295 | #define __NR_migrate_pages 287 | ||
296 | #define __NR_openat 288 | ||
297 | #define __NR_mkdirat 289 | ||
298 | #define __NR_mknodat 290 | ||
299 | #define __NR_fchownat 291 | ||
300 | #define __NR_futimesat 292 | ||
301 | #define __NR_fstatat64 293 | ||
302 | #define __NR_unlinkat 294 | ||
303 | #define __NR_renameat 295 | ||
304 | #define __NR_linkat 296 | ||
305 | #define __NR_symlinkat 297 | ||
306 | #define __NR_readlinkat 298 | ||
307 | #define __NR_fchmodat 299 | ||
308 | #define __NR_faccessat 300 | ||
309 | #define __NR_pselect6 301 | ||
310 | #define __NR_ppoll 302 | ||
311 | #define __NR_unshare 303 | ||
312 | #define __NR_set_robust_list 304 | ||
313 | #define __NR_get_robust_list 305 | ||
314 | #define __NR_splice 306 | ||
315 | #define __NR_sync_file_range 307 | ||
316 | #define __NR_tee 308 | ||
317 | #define __NR_vmsplice 309 | ||
318 | #define __NR_move_pages 310 | ||
319 | #define __NR_sched_setaffinity 311 | ||
320 | #define __NR_sched_getaffinity 312 | ||
321 | #define __NR_kexec_load 313 | ||
322 | #define __NR_getcpu 314 | ||
323 | #define __NR_epoll_pwait 315 | ||
324 | #define __NR_utimensat 316 | ||
325 | #define __NR_signalfd 317 | ||
326 | #define __NR_timerfd_create 318 | ||
327 | #define __NR_eventfd 319 | ||
328 | #define __NR_fallocate 320 | ||
329 | #define __NR_timerfd_settime 321 | ||
330 | #define __NR_timerfd_gettime 322 | ||
331 | #define __NR_signalfd4 323 | ||
332 | #define __NR_eventfd2 324 | ||
333 | #define __NR_epoll_create1 325 | ||
334 | #define __NR_dup3 326 | ||
335 | #define __NR_pipe2 327 | ||
336 | #define __NR_inotify_init1 328 | ||
337 | #define __NR_preadv 329 | ||
338 | #define __NR_pwritev 330 | ||
339 | #define __NR_rt_tgsigqueueinfo 331 | ||
340 | #define __NR_perf_event_open 332 | ||
341 | #define __NR_get_thread_area 333 | ||
342 | #define __NR_set_thread_area 334 | ||
343 | #define __NR_atomic_cmpxchg_32 335 | ||
344 | #define __NR_atomic_barrier 336 | ||
345 | #define __NR_fanotify_init 337 | ||
346 | #define __NR_fanotify_mark 338 | ||
347 | #define __NR_prlimit64 339 | ||
348 | #define __NR_name_to_handle_at 340 | ||
349 | #define __NR_open_by_handle_at 341 | ||
350 | #define __NR_clock_adjtime 342 | ||
351 | #define __NR_syncfs 343 | ||
352 | #define __NR_setns 344 | ||
353 | #define __NR_process_vm_readv 345 | ||
354 | #define __NR_process_vm_writev 346 | ||
355 | 5 | ||
356 | #ifdef __KERNEL__ | ||
357 | 6 | ||
358 | #define NR_syscalls 347 | 7 | #define NR_syscalls 348 |
359 | 8 | ||
360 | #define __ARCH_WANT_OLD_READDIR | 9 | #define __ARCH_WANT_OLD_READDIR |
361 | #define __ARCH_WANT_OLD_STAT | 10 | #define __ARCH_WANT_OLD_STAT |
@@ -393,5 +42,4 @@ | |||
393 | */ | 42 | */ |
394 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | 43 | #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") |
395 | 44 | ||
396 | #endif /* __KERNEL__ */ | ||
397 | #endif /* _ASM_M68K_UNISTD_H_ */ | 45 | #endif /* _ASM_M68K_UNISTD_H_ */ |
diff --git a/arch/m68k/include/uapi/asm/Kbuild b/arch/m68k/include/uapi/asm/Kbuild index baebb3da1d44..972bce120e1e 100644 --- a/arch/m68k/include/uapi/asm/Kbuild +++ b/arch/m68k/include/uapi/asm/Kbuild | |||
@@ -1,3 +1,26 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
3 | 3 | ||
4 | header-y += a.out.h | ||
5 | header-y += auxvec.h | ||
6 | header-y += byteorder.h | ||
7 | header-y += cachectl.h | ||
8 | header-y += fcntl.h | ||
9 | header-y += ioctls.h | ||
10 | header-y += msgbuf.h | ||
11 | header-y += param.h | ||
12 | header-y += poll.h | ||
13 | header-y += posix_types.h | ||
14 | header-y += ptrace.h | ||
15 | header-y += sembuf.h | ||
16 | header-y += setup.h | ||
17 | header-y += shmbuf.h | ||
18 | header-y += sigcontext.h | ||
19 | header-y += signal.h | ||
20 | header-y += socket.h | ||
21 | header-y += sockios.h | ||
22 | header-y += stat.h | ||
23 | header-y += swab.h | ||
24 | header-y += termbits.h | ||
25 | header-y += termios.h | ||
26 | header-y += unistd.h | ||
diff --git a/arch/m68k/include/asm/a.out.h b/arch/m68k/include/uapi/asm/a.out.h index 3885fe43432a..3885fe43432a 100644 --- a/arch/m68k/include/asm/a.out.h +++ b/arch/m68k/include/uapi/asm/a.out.h | |||
diff --git a/arch/m68k/include/asm/auxvec.h b/arch/m68k/include/uapi/asm/auxvec.h index 844d6d52204b..844d6d52204b 100644 --- a/arch/m68k/include/asm/auxvec.h +++ b/arch/m68k/include/uapi/asm/auxvec.h | |||
diff --git a/arch/m68k/include/asm/byteorder.h b/arch/m68k/include/uapi/asm/byteorder.h index 31b260a88803..31b260a88803 100644 --- a/arch/m68k/include/asm/byteorder.h +++ b/arch/m68k/include/uapi/asm/byteorder.h | |||
diff --git a/arch/m68k/include/asm/cachectl.h b/arch/m68k/include/uapi/asm/cachectl.h index 525978e959e3..525978e959e3 100644 --- a/arch/m68k/include/asm/cachectl.h +++ b/arch/m68k/include/uapi/asm/cachectl.h | |||
diff --git a/arch/m68k/include/asm/fcntl.h b/arch/m68k/include/uapi/asm/fcntl.h index 1c369b20dc45..1c369b20dc45 100644 --- a/arch/m68k/include/asm/fcntl.h +++ b/arch/m68k/include/uapi/asm/fcntl.h | |||
diff --git a/arch/m68k/include/asm/ioctls.h b/arch/m68k/include/uapi/asm/ioctls.h index 1332bb4ca5b0..1332bb4ca5b0 100644 --- a/arch/m68k/include/asm/ioctls.h +++ b/arch/m68k/include/uapi/asm/ioctls.h | |||
diff --git a/arch/m68k/include/asm/msgbuf.h b/arch/m68k/include/uapi/asm/msgbuf.h index 243cb798de8f..243cb798de8f 100644 --- a/arch/m68k/include/asm/msgbuf.h +++ b/arch/m68k/include/uapi/asm/msgbuf.h | |||
diff --git a/arch/m68k/include/asm/param.h b/arch/m68k/include/uapi/asm/param.h index 36265ccf5c7b..36265ccf5c7b 100644 --- a/arch/m68k/include/asm/param.h +++ b/arch/m68k/include/uapi/asm/param.h | |||
diff --git a/arch/m68k/include/asm/poll.h b/arch/m68k/include/uapi/asm/poll.h index f080fcdb61bf..f080fcdb61bf 100644 --- a/arch/m68k/include/asm/poll.h +++ b/arch/m68k/include/uapi/asm/poll.h | |||
diff --git a/arch/m68k/include/asm/posix_types.h b/arch/m68k/include/uapi/asm/posix_types.h index cf4dbf70fdc7..cf4dbf70fdc7 100644 --- a/arch/m68k/include/asm/posix_types.h +++ b/arch/m68k/include/uapi/asm/posix_types.h | |||
diff --git a/arch/m68k/include/uapi/asm/ptrace.h b/arch/m68k/include/uapi/asm/ptrace.h new file mode 100644 index 000000000000..caf92fd34939 --- /dev/null +++ b/arch/m68k/include/uapi/asm/ptrace.h | |||
@@ -0,0 +1,79 @@ | |||
1 | #ifndef _UAPI_M68K_PTRACE_H | ||
2 | #define _UAPI_M68K_PTRACE_H | ||
3 | |||
4 | #define PT_D1 0 | ||
5 | #define PT_D2 1 | ||
6 | #define PT_D3 2 | ||
7 | #define PT_D4 3 | ||
8 | #define PT_D5 4 | ||
9 | #define PT_D6 5 | ||
10 | #define PT_D7 6 | ||
11 | #define PT_A0 7 | ||
12 | #define PT_A1 8 | ||
13 | #define PT_A2 9 | ||
14 | #define PT_A3 10 | ||
15 | #define PT_A4 11 | ||
16 | #define PT_A5 12 | ||
17 | #define PT_A6 13 | ||
18 | #define PT_D0 14 | ||
19 | #define PT_USP 15 | ||
20 | #define PT_ORIG_D0 16 | ||
21 | #define PT_SR 17 | ||
22 | #define PT_PC 18 | ||
23 | |||
24 | #ifndef __ASSEMBLY__ | ||
25 | |||
26 | /* this struct defines the way the registers are stored on the | ||
27 | stack during a system call. */ | ||
28 | |||
29 | struct pt_regs { | ||
30 | long d1; | ||
31 | long d2; | ||
32 | long d3; | ||
33 | long d4; | ||
34 | long d5; | ||
35 | long a0; | ||
36 | long a1; | ||
37 | long a2; | ||
38 | long d0; | ||
39 | long orig_d0; | ||
40 | long stkadj; | ||
41 | #ifdef CONFIG_COLDFIRE | ||
42 | unsigned format : 4; /* frame format specifier */ | ||
43 | unsigned vector : 12; /* vector offset */ | ||
44 | unsigned short sr; | ||
45 | unsigned long pc; | ||
46 | #else | ||
47 | unsigned short sr; | ||
48 | unsigned long pc; | ||
49 | unsigned format : 4; /* frame format specifier */ | ||
50 | unsigned vector : 12; /* vector offset */ | ||
51 | #endif | ||
52 | }; | ||
53 | |||
54 | /* | ||
55 | * This is the extended stack used by signal handlers and the context | ||
56 | * switcher: it's pushed after the normal "struct pt_regs". | ||
57 | */ | ||
58 | struct switch_stack { | ||
59 | unsigned long d6; | ||
60 | unsigned long d7; | ||
61 | unsigned long a3; | ||
62 | unsigned long a4; | ||
63 | unsigned long a5; | ||
64 | unsigned long a6; | ||
65 | unsigned long retpc; | ||
66 | }; | ||
67 | |||
68 | /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ | ||
69 | #define PTRACE_GETREGS 12 | ||
70 | #define PTRACE_SETREGS 13 | ||
71 | #define PTRACE_GETFPREGS 14 | ||
72 | #define PTRACE_SETFPREGS 15 | ||
73 | |||
74 | #define PTRACE_GET_THREAD_AREA 25 | ||
75 | |||
76 | #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ | ||
77 | |||
78 | #endif /* __ASSEMBLY__ */ | ||
79 | #endif /* _UAPI_M68K_PTRACE_H */ | ||
diff --git a/arch/m68k/include/asm/sembuf.h b/arch/m68k/include/uapi/asm/sembuf.h index 2308052a8c24..2308052a8c24 100644 --- a/arch/m68k/include/asm/sembuf.h +++ b/arch/m68k/include/uapi/asm/sembuf.h | |||
diff --git a/arch/m68k/include/uapi/asm/setup.h b/arch/m68k/include/uapi/asm/setup.h new file mode 100644 index 000000000000..85579bff455c --- /dev/null +++ b/arch/m68k/include/uapi/asm/setup.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | ** asm/setup.h -- Definition of the Linux/m68k setup information | ||
3 | ** | ||
4 | ** Copyright 1992 by Greg Harp | ||
5 | ** | ||
6 | ** This file is subject to the terms and conditions of the GNU General Public | ||
7 | ** License. See the file COPYING in the main directory of this archive | ||
8 | ** for more details. | ||
9 | ** | ||
10 | ** Created 09/29/92 by Greg Harp | ||
11 | ** | ||
12 | ** 5/2/94 Roman Hodek: | ||
13 | ** Added bi_atari part of the machine dependent union bi_un; for now it | ||
14 | ** contains just a model field to distinguish between TT and Falcon. | ||
15 | ** 26/7/96 Roman Zippel: | ||
16 | ** Renamed to setup.h; added some useful macros to allow gcc some | ||
17 | ** optimizations if possible. | ||
18 | ** 5/10/96 Geert Uytterhoeven: | ||
19 | ** Redesign of the boot information structure; moved boot information | ||
20 | ** structure to bootinfo.h | ||
21 | */ | ||
22 | |||
23 | #ifndef _UAPI_M68K_SETUP_H | ||
24 | #define _UAPI_M68K_SETUP_H | ||
25 | |||
26 | |||
27 | |||
28 | /* | ||
29 | * Linux/m68k Architectures | ||
30 | */ | ||
31 | |||
32 | #define MACH_AMIGA 1 | ||
33 | #define MACH_ATARI 2 | ||
34 | #define MACH_MAC 3 | ||
35 | #define MACH_APOLLO 4 | ||
36 | #define MACH_SUN3 5 | ||
37 | #define MACH_MVME147 6 | ||
38 | #define MACH_MVME16x 7 | ||
39 | #define MACH_BVME6000 8 | ||
40 | #define MACH_HP300 9 | ||
41 | #define MACH_Q40 10 | ||
42 | #define MACH_SUN3X 11 | ||
43 | #define MACH_M54XX 12 | ||
44 | |||
45 | #define COMMAND_LINE_SIZE 256 | ||
46 | |||
47 | |||
48 | |||
49 | /* | ||
50 | * CPU, FPU and MMU types | ||
51 | * | ||
52 | * Note: we may rely on the following equalities: | ||
53 | * | ||
54 | * CPU_68020 == MMU_68851 | ||
55 | * CPU_68030 == MMU_68030 | ||
56 | * CPU_68040 == FPU_68040 == MMU_68040 | ||
57 | * CPU_68060 == FPU_68060 == MMU_68060 | ||
58 | */ | ||
59 | |||
60 | #define CPUB_68020 0 | ||
61 | #define CPUB_68030 1 | ||
62 | #define CPUB_68040 2 | ||
63 | #define CPUB_68060 3 | ||
64 | #define CPUB_COLDFIRE 4 | ||
65 | |||
66 | #define CPU_68020 (1<<CPUB_68020) | ||
67 | #define CPU_68030 (1<<CPUB_68030) | ||
68 | #define CPU_68040 (1<<CPUB_68040) | ||
69 | #define CPU_68060 (1<<CPUB_68060) | ||
70 | #define CPU_COLDFIRE (1<<CPUB_COLDFIRE) | ||
71 | |||
72 | #define FPUB_68881 0 | ||
73 | #define FPUB_68882 1 | ||
74 | #define FPUB_68040 2 /* Internal FPU */ | ||
75 | #define FPUB_68060 3 /* Internal FPU */ | ||
76 | #define FPUB_SUNFPA 4 /* Sun-3 FPA */ | ||
77 | #define FPUB_COLDFIRE 5 /* ColdFire FPU */ | ||
78 | |||
79 | #define FPU_68881 (1<<FPUB_68881) | ||
80 | #define FPU_68882 (1<<FPUB_68882) | ||
81 | #define FPU_68040 (1<<FPUB_68040) | ||
82 | #define FPU_68060 (1<<FPUB_68060) | ||
83 | #define FPU_SUNFPA (1<<FPUB_SUNFPA) | ||
84 | #define FPU_COLDFIRE (1<<FPUB_COLDFIRE) | ||
85 | |||
86 | #define MMUB_68851 0 | ||
87 | #define MMUB_68030 1 /* Internal MMU */ | ||
88 | #define MMUB_68040 2 /* Internal MMU */ | ||
89 | #define MMUB_68060 3 /* Internal MMU */ | ||
90 | #define MMUB_APOLLO 4 /* Custom Apollo */ | ||
91 | #define MMUB_SUN3 5 /* Custom Sun-3 */ | ||
92 | #define MMUB_COLDFIRE 6 /* Internal MMU */ | ||
93 | |||
94 | #define MMU_68851 (1<<MMUB_68851) | ||
95 | #define MMU_68030 (1<<MMUB_68030) | ||
96 | #define MMU_68040 (1<<MMUB_68040) | ||
97 | #define MMU_68060 (1<<MMUB_68060) | ||
98 | #define MMU_SUN3 (1<<MMUB_SUN3) | ||
99 | #define MMU_APOLLO (1<<MMUB_APOLLO) | ||
100 | #define MMU_COLDFIRE (1<<MMUB_COLDFIRE) | ||
101 | |||
102 | |||
103 | #endif /* _UAPI_M68K_SETUP_H */ | ||
diff --git a/arch/m68k/include/asm/shmbuf.h b/arch/m68k/include/uapi/asm/shmbuf.h index f8928d62f1b7..f8928d62f1b7 100644 --- a/arch/m68k/include/asm/shmbuf.h +++ b/arch/m68k/include/uapi/asm/shmbuf.h | |||
diff --git a/arch/m68k/include/asm/sigcontext.h b/arch/m68k/include/uapi/asm/sigcontext.h index 523db2a51cf3..523db2a51cf3 100644 --- a/arch/m68k/include/asm/sigcontext.h +++ b/arch/m68k/include/uapi/asm/sigcontext.h | |||
diff --git a/arch/m68k/include/uapi/asm/signal.h b/arch/m68k/include/uapi/asm/signal.h new file mode 100644 index 000000000000..2b450f311bd9 --- /dev/null +++ b/arch/m68k/include/uapi/asm/signal.h | |||
@@ -0,0 +1,118 @@ | |||
1 | #ifndef _UAPI_M68K_SIGNAL_H | ||
2 | #define _UAPI_M68K_SIGNAL_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Avoid too many header ordering problems. */ | ||
7 | struct siginfo; | ||
8 | |||
9 | #ifndef __KERNEL__ | ||
10 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
11 | |||
12 | #define NSIG 32 | ||
13 | typedef unsigned long sigset_t; | ||
14 | |||
15 | #endif /* __KERNEL__ */ | ||
16 | |||
17 | #define SIGHUP 1 | ||
18 | #define SIGINT 2 | ||
19 | #define SIGQUIT 3 | ||
20 | #define SIGILL 4 | ||
21 | #define SIGTRAP 5 | ||
22 | #define SIGABRT 6 | ||
23 | #define SIGIOT 6 | ||
24 | #define SIGBUS 7 | ||
25 | #define SIGFPE 8 | ||
26 | #define SIGKILL 9 | ||
27 | #define SIGUSR1 10 | ||
28 | #define SIGSEGV 11 | ||
29 | #define SIGUSR2 12 | ||
30 | #define SIGPIPE 13 | ||
31 | #define SIGALRM 14 | ||
32 | #define SIGTERM 15 | ||
33 | #define SIGSTKFLT 16 | ||
34 | #define SIGCHLD 17 | ||
35 | #define SIGCONT 18 | ||
36 | #define SIGSTOP 19 | ||
37 | #define SIGTSTP 20 | ||
38 | #define SIGTTIN 21 | ||
39 | #define SIGTTOU 22 | ||
40 | #define SIGURG 23 | ||
41 | #define SIGXCPU 24 | ||
42 | #define SIGXFSZ 25 | ||
43 | #define SIGVTALRM 26 | ||
44 | #define SIGPROF 27 | ||
45 | #define SIGWINCH 28 | ||
46 | #define SIGIO 29 | ||
47 | #define SIGPOLL SIGIO | ||
48 | /* | ||
49 | #define SIGLOST 29 | ||
50 | */ | ||
51 | #define SIGPWR 30 | ||
52 | #define SIGSYS 31 | ||
53 | #define SIGUNUSED 31 | ||
54 | |||
55 | /* These should not be considered constants from userland. */ | ||
56 | #define SIGRTMIN 32 | ||
57 | #define SIGRTMAX _NSIG | ||
58 | |||
59 | /* | ||
60 | * SA_FLAGS values: | ||
61 | * | ||
62 | * SA_ONSTACK indicates that a registered stack_t will be used. | ||
63 | * SA_RESTART flag to get restarting signals (which were the default long ago) | ||
64 | * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. | ||
65 | * SA_RESETHAND clears the handler when the signal is delivered. | ||
66 | * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies. | ||
67 | * SA_NODEFER prevents the current signal from being masked in the handler. | ||
68 | * | ||
69 | * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single | ||
70 | * Unix names RESETHAND and NODEFER respectively. | ||
71 | */ | ||
72 | #define SA_NOCLDSTOP 0x00000001 | ||
73 | #define SA_NOCLDWAIT 0x00000002 | ||
74 | #define SA_SIGINFO 0x00000004 | ||
75 | #define SA_ONSTACK 0x08000000 | ||
76 | #define SA_RESTART 0x10000000 | ||
77 | #define SA_NODEFER 0x40000000 | ||
78 | #define SA_RESETHAND 0x80000000 | ||
79 | |||
80 | #define SA_NOMASK SA_NODEFER | ||
81 | #define SA_ONESHOT SA_RESETHAND | ||
82 | |||
83 | /* | ||
84 | * sigaltstack controls | ||
85 | */ | ||
86 | #define SS_ONSTACK 1 | ||
87 | #define SS_DISABLE 2 | ||
88 | |||
89 | #define MINSIGSTKSZ 2048 | ||
90 | #define SIGSTKSZ 8192 | ||
91 | |||
92 | #include <asm-generic/signal-defs.h> | ||
93 | |||
94 | #ifndef __KERNEL__ | ||
95 | /* Here we must cater to libcs that poke about in kernel headers. */ | ||
96 | |||
97 | struct sigaction { | ||
98 | union { | ||
99 | __sighandler_t _sa_handler; | ||
100 | void (*_sa_sigaction)(int, struct siginfo *, void *); | ||
101 | } _u; | ||
102 | sigset_t sa_mask; | ||
103 | unsigned long sa_flags; | ||
104 | void (*sa_restorer)(void); | ||
105 | }; | ||
106 | |||
107 | #define sa_handler _u._sa_handler | ||
108 | #define sa_sigaction _u._sa_sigaction | ||
109 | |||
110 | #endif /* __KERNEL__ */ | ||
111 | |||
112 | typedef struct sigaltstack { | ||
113 | void __user *ss_sp; | ||
114 | int ss_flags; | ||
115 | size_t ss_size; | ||
116 | } stack_t; | ||
117 | |||
118 | #endif /* _UAPI_M68K_SIGNAL_H */ | ||
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/uapi/asm/socket.h index d1be684edf97..d1be684edf97 100644 --- a/arch/m68k/include/asm/socket.h +++ b/arch/m68k/include/uapi/asm/socket.h | |||
diff --git a/arch/m68k/include/asm/sockios.h b/arch/m68k/include/uapi/asm/sockios.h index c04a23943cb7..c04a23943cb7 100644 --- a/arch/m68k/include/asm/sockios.h +++ b/arch/m68k/include/uapi/asm/sockios.h | |||
diff --git a/arch/m68k/include/asm/stat.h b/arch/m68k/include/uapi/asm/stat.h index dd38bc2e9f98..dd38bc2e9f98 100644 --- a/arch/m68k/include/asm/stat.h +++ b/arch/m68k/include/uapi/asm/stat.h | |||
diff --git a/arch/m68k/include/asm/swab.h b/arch/m68k/include/uapi/asm/swab.h index b7b37a40defc..b7b37a40defc 100644 --- a/arch/m68k/include/asm/swab.h +++ b/arch/m68k/include/uapi/asm/swab.h | |||
diff --git a/arch/m68k/include/asm/termbits.h b/arch/m68k/include/uapi/asm/termbits.h index aea1e37b765a..aea1e37b765a 100644 --- a/arch/m68k/include/asm/termbits.h +++ b/arch/m68k/include/uapi/asm/termbits.h | |||
diff --git a/arch/m68k/include/uapi/asm/termios.h b/arch/m68k/include/uapi/asm/termios.h new file mode 100644 index 000000000000..ce2142c9ac1d --- /dev/null +++ b/arch/m68k/include/uapi/asm/termios.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef _UAPI_M68K_TERMIOS_H | ||
2 | #define _UAPI_M68K_TERMIOS_H | ||
3 | |||
4 | #include <asm/termbits.h> | ||
5 | #include <asm/ioctls.h> | ||
6 | |||
7 | struct winsize { | ||
8 | unsigned short ws_row; | ||
9 | unsigned short ws_col; | ||
10 | unsigned short ws_xpixel; | ||
11 | unsigned short ws_ypixel; | ||
12 | }; | ||
13 | |||
14 | #define NCC 8 | ||
15 | struct termio { | ||
16 | unsigned short c_iflag; /* input mode flags */ | ||
17 | unsigned short c_oflag; /* output mode flags */ | ||
18 | unsigned short c_cflag; /* control mode flags */ | ||
19 | unsigned short c_lflag; /* local mode flags */ | ||
20 | unsigned char c_line; /* line discipline */ | ||
21 | unsigned char c_cc[NCC]; /* control characters */ | ||
22 | }; | ||
23 | |||
24 | |||
25 | /* modem lines */ | ||
26 | #define TIOCM_LE 0x001 | ||
27 | #define TIOCM_DTR 0x002 | ||
28 | #define TIOCM_RTS 0x004 | ||
29 | #define TIOCM_ST 0x008 | ||
30 | #define TIOCM_SR 0x010 | ||
31 | #define TIOCM_CTS 0x020 | ||
32 | #define TIOCM_CAR 0x040 | ||
33 | #define TIOCM_RNG 0x080 | ||
34 | #define TIOCM_DSR 0x100 | ||
35 | #define TIOCM_CD TIOCM_CAR | ||
36 | #define TIOCM_RI TIOCM_RNG | ||
37 | #define TIOCM_OUT1 0x2000 | ||
38 | #define TIOCM_OUT2 0x4000 | ||
39 | #define TIOCM_LOOP 0x8000 | ||
40 | |||
41 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
42 | |||
43 | |||
44 | #endif /* _UAPI_M68K_TERMIOS_H */ | ||
diff --git a/arch/m68k/include/uapi/asm/unistd.h b/arch/m68k/include/uapi/asm/unistd.h new file mode 100644 index 000000000000..b94bfbf90705 --- /dev/null +++ b/arch/m68k/include/uapi/asm/unistd.h | |||
@@ -0,0 +1,357 @@ | |||
1 | #ifndef _UAPI_ASM_M68K_UNISTD_H_ | ||
2 | #define _UAPI_ASM_M68K_UNISTD_H_ | ||
3 | |||
4 | /* | ||
5 | * This file contains the system call numbers. | ||
6 | */ | ||
7 | |||
8 | #define __NR_restart_syscall 0 | ||
9 | #define __NR_exit 1 | ||
10 | #define __NR_fork 2 | ||
11 | #define __NR_read 3 | ||
12 | #define __NR_write 4 | ||
13 | #define __NR_open 5 | ||
14 | #define __NR_close 6 | ||
15 | #define __NR_waitpid 7 | ||
16 | #define __NR_creat 8 | ||
17 | #define __NR_link 9 | ||
18 | #define __NR_unlink 10 | ||
19 | #define __NR_execve 11 | ||
20 | #define __NR_chdir 12 | ||
21 | #define __NR_time 13 | ||
22 | #define __NR_mknod 14 | ||
23 | #define __NR_chmod 15 | ||
24 | #define __NR_chown 16 | ||
25 | /*#define __NR_break 17*/ | ||
26 | #define __NR_oldstat 18 | ||
27 | #define __NR_lseek 19 | ||
28 | #define __NR_getpid 20 | ||
29 | #define __NR_mount 21 | ||
30 | #define __NR_umount 22 | ||
31 | #define __NR_setuid 23 | ||
32 | #define __NR_getuid 24 | ||
33 | #define __NR_stime 25 | ||
34 | #define __NR_ptrace 26 | ||
35 | #define __NR_alarm 27 | ||
36 | #define __NR_oldfstat 28 | ||
37 | #define __NR_pause 29 | ||
38 | #define __NR_utime 30 | ||
39 | /*#define __NR_stty 31*/ | ||
40 | /*#define __NR_gtty 32*/ | ||
41 | #define __NR_access 33 | ||
42 | #define __NR_nice 34 | ||
43 | /*#define __NR_ftime 35*/ | ||
44 | #define __NR_sync 36 | ||
45 | #define __NR_kill 37 | ||
46 | #define __NR_rename 38 | ||
47 | #define __NR_mkdir 39 | ||
48 | #define __NR_rmdir 40 | ||
49 | #define __NR_dup 41 | ||
50 | #define __NR_pipe 42 | ||
51 | #define __NR_times 43 | ||
52 | /*#define __NR_prof 44*/ | ||
53 | #define __NR_brk 45 | ||
54 | #define __NR_setgid 46 | ||
55 | #define __NR_getgid 47 | ||
56 | #define __NR_signal 48 | ||
57 | #define __NR_geteuid 49 | ||
58 | #define __NR_getegid 50 | ||
59 | #define __NR_acct 51 | ||
60 | #define __NR_umount2 52 | ||
61 | /*#define __NR_lock 53*/ | ||
62 | #define __NR_ioctl 54 | ||
63 | #define __NR_fcntl 55 | ||
64 | /*#define __NR_mpx 56*/ | ||
65 | #define __NR_setpgid 57 | ||
66 | /*#define __NR_ulimit 58*/ | ||
67 | /*#define __NR_oldolduname 59*/ | ||
68 | #define __NR_umask 60 | ||
69 | #define __NR_chroot 61 | ||
70 | #define __NR_ustat 62 | ||
71 | #define __NR_dup2 63 | ||
72 | #define __NR_getppid 64 | ||
73 | #define __NR_getpgrp 65 | ||
74 | #define __NR_setsid 66 | ||
75 | #define __NR_sigaction 67 | ||
76 | #define __NR_sgetmask 68 | ||
77 | #define __NR_ssetmask 69 | ||
78 | #define __NR_setreuid 70 | ||
79 | #define __NR_setregid 71 | ||
80 | #define __NR_sigsuspend 72 | ||
81 | #define __NR_sigpending 73 | ||
82 | #define __NR_sethostname 74 | ||
83 | #define __NR_setrlimit 75 | ||
84 | #define __NR_getrlimit 76 | ||
85 | #define __NR_getrusage 77 | ||
86 | #define __NR_gettimeofday 78 | ||
87 | #define __NR_settimeofday 79 | ||
88 | #define __NR_getgroups 80 | ||
89 | #define __NR_setgroups 81 | ||
90 | #define __NR_select 82 | ||
91 | #define __NR_symlink 83 | ||
92 | #define __NR_oldlstat 84 | ||
93 | #define __NR_readlink 85 | ||
94 | #define __NR_uselib 86 | ||
95 | #define __NR_swapon 87 | ||
96 | #define __NR_reboot 88 | ||
97 | #define __NR_readdir 89 | ||
98 | #define __NR_mmap 90 | ||
99 | #define __NR_munmap 91 | ||
100 | #define __NR_truncate 92 | ||
101 | #define __NR_ftruncate 93 | ||
102 | #define __NR_fchmod 94 | ||
103 | #define __NR_fchown 95 | ||
104 | #define __NR_getpriority 96 | ||
105 | #define __NR_setpriority 97 | ||
106 | /*#define __NR_profil 98*/ | ||
107 | #define __NR_statfs 99 | ||
108 | #define __NR_fstatfs 100 | ||
109 | /*#define __NR_ioperm 101*/ | ||
110 | #define __NR_socketcall 102 | ||
111 | #define __NR_syslog 103 | ||
112 | #define __NR_setitimer 104 | ||
113 | #define __NR_getitimer 105 | ||
114 | #define __NR_stat 106 | ||
115 | #define __NR_lstat 107 | ||
116 | #define __NR_fstat 108 | ||
117 | /*#define __NR_olduname 109*/ | ||
118 | /*#define __NR_iopl 110*/ /* not supported */ | ||
119 | #define __NR_vhangup 111 | ||
120 | /*#define __NR_idle 112*/ /* Obsolete */ | ||
121 | /*#define __NR_vm86 113*/ /* not supported */ | ||
122 | #define __NR_wait4 114 | ||
123 | #define __NR_swapoff 115 | ||
124 | #define __NR_sysinfo 116 | ||
125 | #define __NR_ipc 117 | ||
126 | #define __NR_fsync 118 | ||
127 | #define __NR_sigreturn 119 | ||
128 | #define __NR_clone 120 | ||
129 | #define __NR_setdomainname 121 | ||
130 | #define __NR_uname 122 | ||
131 | #define __NR_cacheflush 123 | ||
132 | #define __NR_adjtimex 124 | ||
133 | #define __NR_mprotect 125 | ||
134 | #define __NR_sigprocmask 126 | ||
135 | #define __NR_create_module 127 | ||
136 | #define __NR_init_module 128 | ||
137 | #define __NR_delete_module 129 | ||
138 | #define __NR_get_kernel_syms 130 | ||
139 | #define __NR_quotactl 131 | ||
140 | #define __NR_getpgid 132 | ||
141 | #define __NR_fchdir 133 | ||
142 | #define __NR_bdflush 134 | ||
143 | #define __NR_sysfs 135 | ||
144 | #define __NR_personality 136 | ||
145 | /*#define __NR_afs_syscall 137*/ /* Syscall for Andrew File System */ | ||
146 | #define __NR_setfsuid 138 | ||
147 | #define __NR_setfsgid 139 | ||
148 | #define __NR__llseek 140 | ||
149 | #define __NR_getdents 141 | ||
150 | #define __NR__newselect 142 | ||
151 | #define __NR_flock 143 | ||
152 | #define __NR_msync 144 | ||
153 | #define __NR_readv 145 | ||
154 | #define __NR_writev 146 | ||
155 | #define __NR_getsid 147 | ||
156 | #define __NR_fdatasync 148 | ||
157 | #define __NR__sysctl 149 | ||
158 | #define __NR_mlock 150 | ||
159 | #define __NR_munlock 151 | ||
160 | #define __NR_mlockall 152 | ||
161 | #define __NR_munlockall 153 | ||
162 | #define __NR_sched_setparam 154 | ||
163 | #define __NR_sched_getparam 155 | ||
164 | #define __NR_sched_setscheduler 156 | ||
165 | #define __NR_sched_getscheduler 157 | ||
166 | #define __NR_sched_yield 158 | ||
167 | #define __NR_sched_get_priority_max 159 | ||
168 | #define __NR_sched_get_priority_min 160 | ||
169 | #define __NR_sched_rr_get_interval 161 | ||
170 | #define __NR_nanosleep 162 | ||
171 | #define __NR_mremap 163 | ||
172 | #define __NR_setresuid 164 | ||
173 | #define __NR_getresuid 165 | ||
174 | #define __NR_getpagesize 166 | ||
175 | #define __NR_query_module 167 | ||
176 | #define __NR_poll 168 | ||
177 | #define __NR_nfsservctl 169 | ||
178 | #define __NR_setresgid 170 | ||
179 | #define __NR_getresgid 171 | ||
180 | #define __NR_prctl 172 | ||
181 | #define __NR_rt_sigreturn 173 | ||
182 | #define __NR_rt_sigaction 174 | ||
183 | #define __NR_rt_sigprocmask 175 | ||
184 | #define __NR_rt_sigpending 176 | ||
185 | #define __NR_rt_sigtimedwait 177 | ||
186 | #define __NR_rt_sigqueueinfo 178 | ||
187 | #define __NR_rt_sigsuspend 179 | ||
188 | #define __NR_pread64 180 | ||
189 | #define __NR_pwrite64 181 | ||
190 | #define __NR_lchown 182 | ||
191 | #define __NR_getcwd 183 | ||
192 | #define __NR_capget 184 | ||
193 | #define __NR_capset 185 | ||
194 | #define __NR_sigaltstack 186 | ||
195 | #define __NR_sendfile 187 | ||
196 | #define __NR_getpmsg 188 /* some people actually want streams */ | ||
197 | #define __NR_putpmsg 189 /* some people actually want streams */ | ||
198 | #define __NR_vfork 190 | ||
199 | #define __NR_ugetrlimit 191 | ||
200 | #define __NR_mmap2 192 | ||
201 | #define __NR_truncate64 193 | ||
202 | #define __NR_ftruncate64 194 | ||
203 | #define __NR_stat64 195 | ||
204 | #define __NR_lstat64 196 | ||
205 | #define __NR_fstat64 197 | ||
206 | #define __NR_chown32 198 | ||
207 | #define __NR_getuid32 199 | ||
208 | #define __NR_getgid32 200 | ||
209 | #define __NR_geteuid32 201 | ||
210 | #define __NR_getegid32 202 | ||
211 | #define __NR_setreuid32 203 | ||
212 | #define __NR_setregid32 204 | ||
213 | #define __NR_getgroups32 205 | ||
214 | #define __NR_setgroups32 206 | ||
215 | #define __NR_fchown32 207 | ||
216 | #define __NR_setresuid32 208 | ||
217 | #define __NR_getresuid32 209 | ||
218 | #define __NR_setresgid32 210 | ||
219 | #define __NR_getresgid32 211 | ||
220 | #define __NR_lchown32 212 | ||
221 | #define __NR_setuid32 213 | ||
222 | #define __NR_setgid32 214 | ||
223 | #define __NR_setfsuid32 215 | ||
224 | #define __NR_setfsgid32 216 | ||
225 | #define __NR_pivot_root 217 | ||
226 | /* 218*/ | ||
227 | /* 219*/ | ||
228 | #define __NR_getdents64 220 | ||
229 | #define __NR_gettid 221 | ||
230 | #define __NR_tkill 222 | ||
231 | #define __NR_setxattr 223 | ||
232 | #define __NR_lsetxattr 224 | ||
233 | #define __NR_fsetxattr 225 | ||
234 | #define __NR_getxattr 226 | ||
235 | #define __NR_lgetxattr 227 | ||
236 | #define __NR_fgetxattr 228 | ||
237 | #define __NR_listxattr 229 | ||
238 | #define __NR_llistxattr 230 | ||
239 | #define __NR_flistxattr 231 | ||
240 | #define __NR_removexattr 232 | ||
241 | #define __NR_lremovexattr 233 | ||
242 | #define __NR_fremovexattr 234 | ||
243 | #define __NR_futex 235 | ||
244 | #define __NR_sendfile64 236 | ||
245 | #define __NR_mincore 237 | ||
246 | #define __NR_madvise 238 | ||
247 | #define __NR_fcntl64 239 | ||
248 | #define __NR_readahead 240 | ||
249 | #define __NR_io_setup 241 | ||
250 | #define __NR_io_destroy 242 | ||
251 | #define __NR_io_getevents 243 | ||
252 | #define __NR_io_submit 244 | ||
253 | #define __NR_io_cancel 245 | ||
254 | #define __NR_fadvise64 246 | ||
255 | #define __NR_exit_group 247 | ||
256 | #define __NR_lookup_dcookie 248 | ||
257 | #define __NR_epoll_create 249 | ||
258 | #define __NR_epoll_ctl 250 | ||
259 | #define __NR_epoll_wait 251 | ||
260 | #define __NR_remap_file_pages 252 | ||
261 | #define __NR_set_tid_address 253 | ||
262 | #define __NR_timer_create 254 | ||
263 | #define __NR_timer_settime 255 | ||
264 | #define __NR_timer_gettime 256 | ||
265 | #define __NR_timer_getoverrun 257 | ||
266 | #define __NR_timer_delete 258 | ||
267 | #define __NR_clock_settime 259 | ||
268 | #define __NR_clock_gettime 260 | ||
269 | #define __NR_clock_getres 261 | ||
270 | #define __NR_clock_nanosleep 262 | ||
271 | #define __NR_statfs64 263 | ||
272 | #define __NR_fstatfs64 264 | ||
273 | #define __NR_tgkill 265 | ||
274 | #define __NR_utimes 266 | ||
275 | #define __NR_fadvise64_64 267 | ||
276 | #define __NR_mbind 268 | ||
277 | #define __NR_get_mempolicy 269 | ||
278 | #define __NR_set_mempolicy 270 | ||
279 | #define __NR_mq_open 271 | ||
280 | #define __NR_mq_unlink 272 | ||
281 | #define __NR_mq_timedsend 273 | ||
282 | #define __NR_mq_timedreceive 274 | ||
283 | #define __NR_mq_notify 275 | ||
284 | #define __NR_mq_getsetattr 276 | ||
285 | #define __NR_waitid 277 | ||
286 | /*#define __NR_vserver 278*/ | ||
287 | #define __NR_add_key 279 | ||
288 | #define __NR_request_key 280 | ||
289 | #define __NR_keyctl 281 | ||
290 | #define __NR_ioprio_set 282 | ||
291 | #define __NR_ioprio_get 283 | ||
292 | #define __NR_inotify_init 284 | ||
293 | #define __NR_inotify_add_watch 285 | ||
294 | #define __NR_inotify_rm_watch 286 | ||
295 | #define __NR_migrate_pages 287 | ||
296 | #define __NR_openat 288 | ||
297 | #define __NR_mkdirat 289 | ||
298 | #define __NR_mknodat 290 | ||
299 | #define __NR_fchownat 291 | ||
300 | #define __NR_futimesat 292 | ||
301 | #define __NR_fstatat64 293 | ||
302 | #define __NR_unlinkat 294 | ||
303 | #define __NR_renameat 295 | ||
304 | #define __NR_linkat 296 | ||
305 | #define __NR_symlinkat 297 | ||
306 | #define __NR_readlinkat 298 | ||
307 | #define __NR_fchmodat 299 | ||
308 | #define __NR_faccessat 300 | ||
309 | #define __NR_pselect6 301 | ||
310 | #define __NR_ppoll 302 | ||
311 | #define __NR_unshare 303 | ||
312 | #define __NR_set_robust_list 304 | ||
313 | #define __NR_get_robust_list 305 | ||
314 | #define __NR_splice 306 | ||
315 | #define __NR_sync_file_range 307 | ||
316 | #define __NR_tee 308 | ||
317 | #define __NR_vmsplice 309 | ||
318 | #define __NR_move_pages 310 | ||
319 | #define __NR_sched_setaffinity 311 | ||
320 | #define __NR_sched_getaffinity 312 | ||
321 | #define __NR_kexec_load 313 | ||
322 | #define __NR_getcpu 314 | ||
323 | #define __NR_epoll_pwait 315 | ||
324 | #define __NR_utimensat 316 | ||
325 | #define __NR_signalfd 317 | ||
326 | #define __NR_timerfd_create 318 | ||
327 | #define __NR_eventfd 319 | ||
328 | #define __NR_fallocate 320 | ||
329 | #define __NR_timerfd_settime 321 | ||
330 | #define __NR_timerfd_gettime 322 | ||
331 | #define __NR_signalfd4 323 | ||
332 | #define __NR_eventfd2 324 | ||
333 | #define __NR_epoll_create1 325 | ||
334 | #define __NR_dup3 326 | ||
335 | #define __NR_pipe2 327 | ||
336 | #define __NR_inotify_init1 328 | ||
337 | #define __NR_preadv 329 | ||
338 | #define __NR_pwritev 330 | ||
339 | #define __NR_rt_tgsigqueueinfo 331 | ||
340 | #define __NR_perf_event_open 332 | ||
341 | #define __NR_get_thread_area 333 | ||
342 | #define __NR_set_thread_area 334 | ||
343 | #define __NR_atomic_cmpxchg_32 335 | ||
344 | #define __NR_atomic_barrier 336 | ||
345 | #define __NR_fanotify_init 337 | ||
346 | #define __NR_fanotify_mark 338 | ||
347 | #define __NR_prlimit64 339 | ||
348 | #define __NR_name_to_handle_at 340 | ||
349 | #define __NR_open_by_handle_at 341 | ||
350 | #define __NR_clock_adjtime 342 | ||
351 | #define __NR_syncfs 343 | ||
352 | #define __NR_setns 344 | ||
353 | #define __NR_process_vm_readv 345 | ||
354 | #define __NR_process_vm_writev 346 | ||
355 | #define __NR_kcmp 347 | ||
356 | |||
357 | #endif /* _UAPI_ASM_M68K_UNISTD_H_ */ | ||
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S index ce827b376110..4fc2e29b771b 100644 --- a/arch/m68k/kernel/syscalltable.S +++ b/arch/m68k/kernel/syscalltable.S | |||
@@ -367,4 +367,5 @@ ENTRY(sys_call_table) | |||
367 | .long sys_setns | 367 | .long sys_setns |
368 | .long sys_process_vm_readv /* 345 */ | 368 | .long sys_process_vm_readv /* 345 */ |
369 | .long sys_process_vm_writev | 369 | .long sys_process_vm_writev |
370 | .long sys_kcmp | ||
370 | 371 | ||
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index 3f3d9ca7a5b6..5dba755a43e6 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -130,6 +130,7 @@ config S390 | |||
130 | select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE | 130 | select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE |
131 | select HAVE_UID16 if 32BIT | 131 | select HAVE_UID16 if 32BIT |
132 | select ARCH_WANT_IPC_PARSE_VERSION | 132 | select ARCH_WANT_IPC_PARSE_VERSION |
133 | select HAVE_ARCH_TRANSPARENT_HUGEPAGE if 64BIT | ||
133 | select GENERIC_SMP_IDLE_THREAD | 134 | select GENERIC_SMP_IDLE_THREAD |
134 | select GENERIC_TIME_VSYSCALL_OLD | 135 | select GENERIC_TIME_VSYSCALL_OLD |
135 | select GENERIC_CLOCKEVENTS | 136 | select GENERIC_CLOCKEVENTS |
diff --git a/arch/s390/boot/compressed/vmlinux.lds.S b/arch/s390/boot/compressed/vmlinux.lds.S index d80f79d8dd9c..8e1fb8239287 100644 --- a/arch/s390/boot/compressed/vmlinux.lds.S +++ b/arch/s390/boot/compressed/vmlinux.lds.S | |||
@@ -5,7 +5,7 @@ OUTPUT_FORMAT("elf64-s390", "elf64-s390", "elf64-s390") | |||
5 | OUTPUT_ARCH(s390:64-bit) | 5 | OUTPUT_ARCH(s390:64-bit) |
6 | #else | 6 | #else |
7 | OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") | 7 | OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") |
8 | OUTPUT_ARCH(s390) | 8 | OUTPUT_ARCH(s390:31-bit) |
9 | #endif | 9 | #endif |
10 | 10 | ||
11 | ENTRY(startup) | 11 | ENTRY(startup) |
diff --git a/arch/s390/include/asm/cio.h b/arch/s390/include/asm/cio.h index 55bde6035216..ad2b924167d7 100644 --- a/arch/s390/include/asm/cio.h +++ b/arch/s390/include/asm/cio.h | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #define LPM_ANYPATH 0xff | 10 | #define LPM_ANYPATH 0xff |
11 | #define __MAX_CSSID 0 | 11 | #define __MAX_CSSID 0 |
12 | #define __MAX_SUBCHANNEL 65535 | ||
13 | #define __MAX_SSID 3 | ||
12 | 14 | ||
13 | #include <asm/scsw.h> | 15 | #include <asm/scsw.h> |
14 | 16 | ||
diff --git a/arch/s390/include/asm/perf_event.h b/arch/s390/include/asm/perf_event.h index 7941968e12b4..5f0173a31693 100644 --- a/arch/s390/include/asm/perf_event.h +++ b/arch/s390/include/asm/perf_event.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #include <asm/cpu_mf.h> | 9 | #include <asm/cpu_mf.h> |
10 | 10 | ||
11 | /* CPU-measurement counter facility */ | 11 | /* CPU-measurement counter facility */ |
12 | #define PERF_CPUM_CF_MAX_CTR 160 | 12 | #define PERF_CPUM_CF_MAX_CTR 256 |
13 | 13 | ||
14 | /* Per-CPU flags for PMU states */ | 14 | /* Per-CPU flags for PMU states */ |
15 | #define PMU_F_RESERVED 0x1000 | 15 | #define PMU_F_RESERVED 0x1000 |
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index dd647c919a66..2d3b7cb26005 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -506,12 +506,15 @@ static inline int pud_bad(pud_t pud) | |||
506 | 506 | ||
507 | static inline int pmd_present(pmd_t pmd) | 507 | static inline int pmd_present(pmd_t pmd) |
508 | { | 508 | { |
509 | return (pmd_val(pmd) & _SEGMENT_ENTRY_ORIGIN) != 0UL; | 509 | unsigned long mask = _SEGMENT_ENTRY_INV | _SEGMENT_ENTRY_RO; |
510 | return (pmd_val(pmd) & mask) == _HPAGE_TYPE_NONE || | ||
511 | !(pmd_val(pmd) & _SEGMENT_ENTRY_INV); | ||
510 | } | 512 | } |
511 | 513 | ||
512 | static inline int pmd_none(pmd_t pmd) | 514 | static inline int pmd_none(pmd_t pmd) |
513 | { | 515 | { |
514 | return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) != 0UL; | 516 | return (pmd_val(pmd) & _SEGMENT_ENTRY_INV) && |
517 | !(pmd_val(pmd) & _SEGMENT_ENTRY_RO); | ||
515 | } | 518 | } |
516 | 519 | ||
517 | static inline int pmd_large(pmd_t pmd) | 520 | static inline int pmd_large(pmd_t pmd) |
@@ -1223,6 +1226,11 @@ static inline void __pmd_idte(unsigned long address, pmd_t *pmdp) | |||
1223 | } | 1226 | } |
1224 | 1227 | ||
1225 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 1228 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
1229 | |||
1230 | #define SEGMENT_NONE __pgprot(_HPAGE_TYPE_NONE) | ||
1231 | #define SEGMENT_RO __pgprot(_HPAGE_TYPE_RO) | ||
1232 | #define SEGMENT_RW __pgprot(_HPAGE_TYPE_RW) | ||
1233 | |||
1226 | #define __HAVE_ARCH_PGTABLE_DEPOSIT | 1234 | #define __HAVE_ARCH_PGTABLE_DEPOSIT |
1227 | extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pgtable_t pgtable); | 1235 | extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pgtable_t pgtable); |
1228 | 1236 | ||
@@ -1242,16 +1250,15 @@ static inline void set_pmd_at(struct mm_struct *mm, unsigned long addr, | |||
1242 | 1250 | ||
1243 | static inline unsigned long massage_pgprot_pmd(pgprot_t pgprot) | 1251 | static inline unsigned long massage_pgprot_pmd(pgprot_t pgprot) |
1244 | { | 1252 | { |
1245 | unsigned long pgprot_pmd = 0; | 1253 | /* |
1246 | 1254 | * pgprot is PAGE_NONE, PAGE_RO, or PAGE_RW (see __Pxxx / __Sxxx) | |
1247 | if (pgprot_val(pgprot) & _PAGE_INVALID) { | 1255 | * Convert to segment table entry format. |
1248 | if (pgprot_val(pgprot) & _PAGE_SWT) | 1256 | */ |
1249 | pgprot_pmd |= _HPAGE_TYPE_NONE; | 1257 | if (pgprot_val(pgprot) == pgprot_val(PAGE_NONE)) |
1250 | pgprot_pmd |= _SEGMENT_ENTRY_INV; | 1258 | return pgprot_val(SEGMENT_NONE); |
1251 | } | 1259 | if (pgprot_val(pgprot) == pgprot_val(PAGE_RO)) |
1252 | if (pgprot_val(pgprot) & _PAGE_RO) | 1260 | return pgprot_val(SEGMENT_RO); |
1253 | pgprot_pmd |= _SEGMENT_ENTRY_RO; | 1261 | return pgprot_val(SEGMENT_RW); |
1254 | return pgprot_pmd; | ||
1255 | } | 1262 | } |
1256 | 1263 | ||
1257 | static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) | 1264 | static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot) |
@@ -1269,7 +1276,9 @@ static inline pmd_t pmd_mkhuge(pmd_t pmd) | |||
1269 | 1276 | ||
1270 | static inline pmd_t pmd_mkwrite(pmd_t pmd) | 1277 | static inline pmd_t pmd_mkwrite(pmd_t pmd) |
1271 | { | 1278 | { |
1272 | pmd_val(pmd) &= ~_SEGMENT_ENTRY_RO; | 1279 | /* Do not clobber _HPAGE_TYPE_NONE pages! */ |
1280 | if (!(pmd_val(pmd) & _SEGMENT_ENTRY_INV)) | ||
1281 | pmd_val(pmd) &= ~_SEGMENT_ENTRY_RO; | ||
1273 | return pmd; | 1282 | return pmd; |
1274 | } | 1283 | } |
1275 | 1284 | ||
diff --git a/arch/s390/include/uapi/asm/Kbuild b/arch/s390/include/uapi/asm/Kbuild index 59b67ed423b4..7bf68fff7c5d 100644 --- a/arch/s390/include/uapi/asm/Kbuild +++ b/arch/s390/include/uapi/asm/Kbuild | |||
@@ -1,8 +1,6 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
3 | 3 | ||
4 | generic-y += kvm_para.h | ||
5 | |||
6 | header-y += auxvec.h | 4 | header-y += auxvec.h |
7 | header-y += bitsperlong.h | 5 | header-y += bitsperlong.h |
8 | header-y += byteorder.h | 6 | header-y += byteorder.h |
diff --git a/arch/s390/include/uapi/asm/chpid.h b/arch/s390/include/uapi/asm/chpid.h index 581992dfae27..6b4fb29cc197 100644 --- a/arch/s390/include/uapi/asm/chpid.h +++ b/arch/s390/include/uapi/asm/chpid.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright IBM Corp. 2007 | 2 | * Copyright IBM Corp. 2007, 2012 |
3 | * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | 3 | * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com> |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -12,10 +12,10 @@ | |||
12 | #define __MAX_CHPID 255 | 12 | #define __MAX_CHPID 255 |
13 | 13 | ||
14 | struct chp_id { | 14 | struct chp_id { |
15 | u8 reserved1; | 15 | __u8 reserved1; |
16 | u8 cssid; | 16 | __u8 cssid; |
17 | u8 reserved2; | 17 | __u8 reserved2; |
18 | u8 id; | 18 | __u8 id; |
19 | } __attribute__((packed)); | 19 | } __attribute__((packed)); |
20 | 20 | ||
21 | 21 | ||
diff --git a/arch/s390/include/uapi/asm/kvm_para.h b/arch/s390/include/uapi/asm/kvm_para.h new file mode 100644 index 000000000000..ff1f4e7b3015 --- /dev/null +++ b/arch/s390/include/uapi/asm/kvm_para.h | |||
@@ -0,0 +1,11 @@ | |||
1 | /* | ||
2 | * User API definitions for paravirtual devices on s390 | ||
3 | * | ||
4 | * Copyright IBM Corp. 2008 | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License (version 2 only) | ||
8 | * as published by the Free Software Foundation. | ||
9 | * | ||
10 | * Author(s): Christian Borntraeger <borntraeger@de.ibm.com> | ||
11 | */ | ||
diff --git a/arch/s390/kernel/cache.c b/arch/s390/kernel/cache.c index 8df8d8a19c98..64b24650e4f8 100644 --- a/arch/s390/kernel/cache.c +++ b/arch/s390/kernel/cache.c | |||
@@ -59,8 +59,8 @@ enum { | |||
59 | 59 | ||
60 | enum { | 60 | enum { |
61 | CACHE_TI_UNIFIED = 0, | 61 | CACHE_TI_UNIFIED = 0, |
62 | CACHE_TI_INSTRUCTION = 0, | 62 | CACHE_TI_DATA = 0, |
63 | CACHE_TI_DATA, | 63 | CACHE_TI_INSTRUCTION, |
64 | }; | 64 | }; |
65 | 65 | ||
66 | struct cache_info { | 66 | struct cache_info { |
@@ -121,7 +121,10 @@ static int __init cache_add(int level, int private, int type) | |||
121 | cache = kzalloc(sizeof(*cache), GFP_KERNEL); | 121 | cache = kzalloc(sizeof(*cache), GFP_KERNEL); |
122 | if (!cache) | 122 | if (!cache) |
123 | return -ENOMEM; | 123 | return -ENOMEM; |
124 | ti = type == CACHE_TYPE_DATA ? CACHE_TI_DATA : CACHE_TI_UNIFIED; | 124 | if (type == CACHE_TYPE_INSTRUCTION) |
125 | ti = CACHE_TI_INSTRUCTION; | ||
126 | else | ||
127 | ti = CACHE_TI_UNIFIED; | ||
125 | cache->size = ecag(EXTRACT_SIZE, level, ti); | 128 | cache->size = ecag(EXTRACT_SIZE, level, ti); |
126 | cache->line_size = ecag(EXTRACT_LINE_SIZE, level, ti); | 129 | cache->line_size = ecag(EXTRACT_LINE_SIZE, level, ti); |
127 | cache->associativity = ecag(EXTRACT_ASSOCIATIVITY, level, ti); | 130 | cache->associativity = ecag(EXTRACT_ASSOCIATIVITY, level, ti); |
diff --git a/arch/s390/kernel/head_kdump.S b/arch/s390/kernel/head_kdump.S index acaaaf4b7055..085a95eb315f 100644 --- a/arch/s390/kernel/head_kdump.S +++ b/arch/s390/kernel/head_kdump.S | |||
@@ -85,16 +85,10 @@ | |||
85 | .align 2 | 85 | .align 2 |
86 | startup_kdump_relocated: | 86 | startup_kdump_relocated: |
87 | basr %r13,0 | 87 | basr %r13,0 |
88 | 0: | 88 | 0: lpswe .Lrestart_psw-0b(%r13) # Start new kernel... |
89 | mvc 0(8,%r0),.Lrestart_psw-0b(%r13) # Setup restart PSW | ||
90 | sam31 # Switch to 31 bit addr mode | ||
91 | sr %r1,%r1 # Erase register r1 | ||
92 | sr %r2,%r2 # Erase register r2 | ||
93 | sigp %r1,%r2,SIGP_SET_ARCHITECTURE # Switch to 31 bit arch mode | ||
94 | lpsw 0 # Start new kernel... | ||
95 | .align 8 | 89 | .align 8 |
96 | .Lrestart_psw: | 90 | .Lrestart_psw: |
97 | .long 0x00080000,0x80000000 + startup | 91 | .quad 0x0000000080000000,0x0000000000000000 + startup |
98 | #else | 92 | #else |
99 | .align 2 | 93 | .align 2 |
100 | .Lep_startup_kdump: | 94 | .Lep_startup_kdump: |
diff --git a/arch/s390/kernel/perf_cpum_cf.c b/arch/s390/kernel/perf_cpum_cf.c index 9871b1971ed7..c4e7269d4a09 100644 --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c | |||
@@ -94,7 +94,7 @@ static int get_counter_set(u64 event) | |||
94 | set = CPUMF_CTR_SET_USER; | 94 | set = CPUMF_CTR_SET_USER; |
95 | else if (event < 128) | 95 | else if (event < 128) |
96 | set = CPUMF_CTR_SET_CRYPTO; | 96 | set = CPUMF_CTR_SET_CRYPTO; |
97 | else if (event < 160) | 97 | else if (event < 256) |
98 | set = CPUMF_CTR_SET_EXT; | 98 | set = CPUMF_CTR_SET_EXT; |
99 | 99 | ||
100 | return set; | 100 | return set; |
@@ -138,6 +138,10 @@ static int validate_ctr_version(const struct hw_perf_event *hwc) | |||
138 | case CPUMF_CTR_SET_EXT: | 138 | case CPUMF_CTR_SET_EXT: |
139 | if (cpuhw->info.csvn < 1) | 139 | if (cpuhw->info.csvn < 1) |
140 | err = -EOPNOTSUPP; | 140 | err = -EOPNOTSUPP; |
141 | if ((cpuhw->info.csvn == 1 && hwc->config > 159) || | ||
142 | (cpuhw->info.csvn == 2 && hwc->config > 175) || | ||
143 | (cpuhw->info.csvn > 2 && hwc->config > 255)) | ||
144 | err = -EOPNOTSUPP; | ||
141 | break; | 145 | break; |
142 | } | 146 | } |
143 | 147 | ||
diff --git a/arch/s390/kernel/sclp.S b/arch/s390/kernel/sclp.S index bf053898630d..b6506ee32a36 100644 --- a/arch/s390/kernel/sclp.S +++ b/arch/s390/kernel/sclp.S | |||
@@ -44,6 +44,12 @@ _sclp_wait_int: | |||
44 | #endif | 44 | #endif |
45 | mvc .LoldpswS1-.LbaseS1(16,%r13),0(%r8) | 45 | mvc .LoldpswS1-.LbaseS1(16,%r13),0(%r8) |
46 | mvc 0(16,%r8),0(%r9) | 46 | mvc 0(16,%r8),0(%r9) |
47 | #ifdef CONFIG_64BIT | ||
48 | epsw %r6,%r7 # set current addressing mode | ||
49 | nill %r6,0x1 # in new psw (31 or 64 bit mode) | ||
50 | nilh %r7,0x8000 | ||
51 | stm %r6,%r7,0(%r8) | ||
52 | #endif | ||
47 | lhi %r6,0x0200 # cr mask for ext int (cr0.54) | 53 | lhi %r6,0x0200 # cr mask for ext int (cr0.54) |
48 | ltr %r2,%r2 | 54 | ltr %r2,%r2 |
49 | jz .LsetctS1 | 55 | jz .LsetctS1 |
@@ -87,7 +93,7 @@ _sclp_wait_int: | |||
87 | .long 0x00080000, 0x80000000+.LwaitS1 # PSW to handle ext int | 93 | .long 0x00080000, 0x80000000+.LwaitS1 # PSW to handle ext int |
88 | #ifdef CONFIG_64BIT | 94 | #ifdef CONFIG_64BIT |
89 | .LextpswS1_64: | 95 | .LextpswS1_64: |
90 | .quad 0x0000000180000000, .LwaitS1 # PSW to handle ext int, 64 bit | 96 | .quad 0, .LwaitS1 # PSW to handle ext int, 64 bit |
91 | #endif | 97 | #endif |
92 | .LwaitpswS1: | 98 | .LwaitpswS1: |
93 | .long 0x010a0000, 0x00000000+.LloopS1 # PSW to wait for ext int | 99 | .long 0x010a0000, 0x00000000+.LloopS1 # PSW to wait for ext int |
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index de8fa9bbd35e..79cb51adc741 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #ifndef CONFIG_64BIT | 9 | #ifndef CONFIG_64BIT |
10 | OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") | 10 | OUTPUT_FORMAT("elf32-s390", "elf32-s390", "elf32-s390") |
11 | OUTPUT_ARCH(s390) | 11 | OUTPUT_ARCH(s390:31-bit) |
12 | ENTRY(startup) | 12 | ENTRY(startup) |
13 | jiffies = jiffies_64 + 4; | 13 | jiffies = jiffies_64 + 4; |
14 | #else | 14 | #else |
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index 2d37bb861faf..9017a63dda3d 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
@@ -39,7 +39,7 @@ static __always_inline unsigned long follow_table(struct mm_struct *mm, | |||
39 | pmd = pmd_offset(pud, addr); | 39 | pmd = pmd_offset(pud, addr); |
40 | if (pmd_none(*pmd)) | 40 | if (pmd_none(*pmd)) |
41 | return -0x10UL; | 41 | return -0x10UL; |
42 | if (pmd_huge(*pmd)) { | 42 | if (pmd_large(*pmd)) { |
43 | if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO)) | 43 | if (write && (pmd_val(*pmd) & _SEGMENT_ENTRY_RO)) |
44 | return -0x04UL; | 44 | return -0x04UL; |
45 | return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK); | 45 | return (pmd_val(*pmd) & HPAGE_MASK) + (addr & ~HPAGE_MASK); |
diff --git a/arch/s390/mm/gup.c b/arch/s390/mm/gup.c index 60acb93a4680..8b8285310b5a 100644 --- a/arch/s390/mm/gup.c +++ b/arch/s390/mm/gup.c | |||
@@ -126,7 +126,7 @@ static inline int gup_pmd_range(pud_t *pudp, pud_t pud, unsigned long addr, | |||
126 | */ | 126 | */ |
127 | if (pmd_none(pmd) || pmd_trans_splitting(pmd)) | 127 | if (pmd_none(pmd) || pmd_trans_splitting(pmd)) |
128 | return 0; | 128 | return 0; |
129 | if (unlikely(pmd_huge(pmd))) { | 129 | if (unlikely(pmd_large(pmd))) { |
130 | if (!gup_huge_pmd(pmdp, pmd, addr, next, | 130 | if (!gup_huge_pmd(pmdp, pmd, addr, next, |
131 | write, pages, nr)) | 131 | write, pages, nr)) |
132 | return 0; | 132 | return 0; |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index b6b442b0d793..9f2edb5c5551 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -20,6 +20,7 @@ config SPARC | |||
20 | select HAVE_ARCH_TRACEHOOK | 20 | select HAVE_ARCH_TRACEHOOK |
21 | select SYSCTL_EXCEPTION_TRACE | 21 | select SYSCTL_EXCEPTION_TRACE |
22 | select ARCH_WANT_OPTIONAL_GPIOLIB | 22 | select ARCH_WANT_OPTIONAL_GPIOLIB |
23 | select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE | ||
23 | select RTC_CLASS | 24 | select RTC_CLASS |
24 | select RTC_DRV_M48T59 | 25 | select RTC_DRV_M48T59 |
25 | select HAVE_IRQ_WORK | 26 | select HAVE_IRQ_WORK |
diff --git a/arch/sparc/crypto/Makefile b/arch/sparc/crypto/Makefile index 6ae1ad5e502b..5d469d81761f 100644 --- a/arch/sparc/crypto/Makefile +++ b/arch/sparc/crypto/Makefile | |||
@@ -13,13 +13,13 @@ obj-$(CONFIG_CRYPTO_DES_SPARC64) += camellia-sparc64.o | |||
13 | 13 | ||
14 | obj-$(CONFIG_CRYPTO_CRC32C_SPARC64) += crc32c-sparc64.o | 14 | obj-$(CONFIG_CRYPTO_CRC32C_SPARC64) += crc32c-sparc64.o |
15 | 15 | ||
16 | sha1-sparc64-y := sha1_asm.o sha1_glue.o crop_devid.o | 16 | sha1-sparc64-y := sha1_asm.o sha1_glue.o |
17 | sha256-sparc64-y := sha256_asm.o sha256_glue.o crop_devid.o | 17 | sha256-sparc64-y := sha256_asm.o sha256_glue.o |
18 | sha512-sparc64-y := sha512_asm.o sha512_glue.o crop_devid.o | 18 | sha512-sparc64-y := sha512_asm.o sha512_glue.o |
19 | md5-sparc64-y := md5_asm.o md5_glue.o crop_devid.o | 19 | md5-sparc64-y := md5_asm.o md5_glue.o |
20 | 20 | ||
21 | aes-sparc64-y := aes_asm.o aes_glue.o crop_devid.o | 21 | aes-sparc64-y := aes_asm.o aes_glue.o |
22 | des-sparc64-y := des_asm.o des_glue.o crop_devid.o | 22 | des-sparc64-y := des_asm.o des_glue.o |
23 | camellia-sparc64-y := camellia_asm.o camellia_glue.o crop_devid.o | 23 | camellia-sparc64-y := camellia_asm.o camellia_glue.o |
24 | 24 | ||
25 | crc32c-sparc64-y := crc32c_asm.o crc32c_glue.o crop_devid.o | 25 | crc32c-sparc64-y := crc32c_asm.o crc32c_glue.o |
diff --git a/arch/sparc/crypto/aes_glue.c b/arch/sparc/crypto/aes_glue.c index 8f1c9980f637..3965d1d36dfa 100644 --- a/arch/sparc/crypto/aes_glue.c +++ b/arch/sparc/crypto/aes_glue.c | |||
@@ -475,3 +475,5 @@ MODULE_LICENSE("GPL"); | |||
475 | MODULE_DESCRIPTION("AES Secure Hash Algorithm, sparc64 aes opcode accelerated"); | 475 | MODULE_DESCRIPTION("AES Secure Hash Algorithm, sparc64 aes opcode accelerated"); |
476 | 476 | ||
477 | MODULE_ALIAS("aes"); | 477 | MODULE_ALIAS("aes"); |
478 | |||
479 | #include "crop_devid.c" | ||
diff --git a/arch/sparc/crypto/camellia_glue.c b/arch/sparc/crypto/camellia_glue.c index 42905c084299..62c89af3fd3f 100644 --- a/arch/sparc/crypto/camellia_glue.c +++ b/arch/sparc/crypto/camellia_glue.c | |||
@@ -320,3 +320,5 @@ MODULE_LICENSE("GPL"); | |||
320 | MODULE_DESCRIPTION("Camellia Cipher Algorithm, sparc64 camellia opcode accelerated"); | 320 | MODULE_DESCRIPTION("Camellia Cipher Algorithm, sparc64 camellia opcode accelerated"); |
321 | 321 | ||
322 | MODULE_ALIAS("aes"); | 322 | MODULE_ALIAS("aes"); |
323 | |||
324 | #include "crop_devid.c" | ||
diff --git a/arch/sparc/crypto/crc32c_glue.c b/arch/sparc/crypto/crc32c_glue.c index 0bd89cea8d8e..5162fad912ce 100644 --- a/arch/sparc/crypto/crc32c_glue.c +++ b/arch/sparc/crypto/crc32c_glue.c | |||
@@ -177,3 +177,5 @@ MODULE_LICENSE("GPL"); | |||
177 | MODULE_DESCRIPTION("CRC32c (Castagnoli), sparc64 crc32c opcode accelerated"); | 177 | MODULE_DESCRIPTION("CRC32c (Castagnoli), sparc64 crc32c opcode accelerated"); |
178 | 178 | ||
179 | MODULE_ALIAS("crc32c"); | 179 | MODULE_ALIAS("crc32c"); |
180 | |||
181 | #include "crop_devid.c" | ||
diff --git a/arch/sparc/crypto/des_glue.c b/arch/sparc/crypto/des_glue.c index c4940c2d3073..41524cebcc49 100644 --- a/arch/sparc/crypto/des_glue.c +++ b/arch/sparc/crypto/des_glue.c | |||
@@ -527,3 +527,5 @@ MODULE_LICENSE("GPL"); | |||
527 | MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms, sparc64 des opcode accelerated"); | 527 | MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms, sparc64 des opcode accelerated"); |
528 | 528 | ||
529 | MODULE_ALIAS("des"); | 529 | MODULE_ALIAS("des"); |
530 | |||
531 | #include "crop_devid.c" | ||
diff --git a/arch/sparc/crypto/md5_glue.c b/arch/sparc/crypto/md5_glue.c index 603d723038ce..09a9ea1dfb69 100644 --- a/arch/sparc/crypto/md5_glue.c +++ b/arch/sparc/crypto/md5_glue.c | |||
@@ -186,3 +186,5 @@ MODULE_LICENSE("GPL"); | |||
186 | MODULE_DESCRIPTION("MD5 Secure Hash Algorithm, sparc64 md5 opcode accelerated"); | 186 | MODULE_DESCRIPTION("MD5 Secure Hash Algorithm, sparc64 md5 opcode accelerated"); |
187 | 187 | ||
188 | MODULE_ALIAS("md5"); | 188 | MODULE_ALIAS("md5"); |
189 | |||
190 | #include "crop_devid.c" | ||
diff --git a/arch/sparc/crypto/sha1_glue.c b/arch/sparc/crypto/sha1_glue.c index 2bbb20bee9f1..6cd5f29e1e0d 100644 --- a/arch/sparc/crypto/sha1_glue.c +++ b/arch/sparc/crypto/sha1_glue.c | |||
@@ -181,3 +181,5 @@ MODULE_LICENSE("GPL"); | |||
181 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, sparc64 sha1 opcode accelerated"); | 181 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, sparc64 sha1 opcode accelerated"); |
182 | 182 | ||
183 | MODULE_ALIAS("sha1"); | 183 | MODULE_ALIAS("sha1"); |
184 | |||
185 | #include "crop_devid.c" | ||
diff --git a/arch/sparc/crypto/sha256_glue.c b/arch/sparc/crypto/sha256_glue.c index 591e656bd891..04f555ab2680 100644 --- a/arch/sparc/crypto/sha256_glue.c +++ b/arch/sparc/crypto/sha256_glue.c | |||
@@ -239,3 +239,5 @@ MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm, sparc64 sha256 op | |||
239 | 239 | ||
240 | MODULE_ALIAS("sha224"); | 240 | MODULE_ALIAS("sha224"); |
241 | MODULE_ALIAS("sha256"); | 241 | MODULE_ALIAS("sha256"); |
242 | |||
243 | #include "crop_devid.c" | ||
diff --git a/arch/sparc/crypto/sha512_glue.c b/arch/sparc/crypto/sha512_glue.c index 486f0a2b7001..f04d1994d19a 100644 --- a/arch/sparc/crypto/sha512_glue.c +++ b/arch/sparc/crypto/sha512_glue.c | |||
@@ -224,3 +224,5 @@ MODULE_DESCRIPTION("SHA-384 and SHA-512 Secure Hash Algorithm, sparc64 sha512 op | |||
224 | 224 | ||
225 | MODULE_ALIAS("sha384"); | 225 | MODULE_ALIAS("sha384"); |
226 | MODULE_ALIAS("sha512"); | 226 | MODULE_ALIAS("sha512"); |
227 | |||
228 | #include "crop_devid.c" | ||
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h index ce35a1cf1a20..be56a244c9cf 100644 --- a/arch/sparc/include/asm/atomic_64.h +++ b/arch/sparc/include/asm/atomic_64.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* atomic.h: Thankfully the V9 is at least reasonable for this | 1 | /* atomic.h: Thankfully the V9 is at least reasonable for this |
2 | * stuff. | 2 | * stuff. |
3 | * | 3 | * |
4 | * Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com) | 4 | * Copyright (C) 1996, 1997, 2000, 2012 David S. Miller (davem@redhat.com) |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #ifndef __ARCH_SPARC64_ATOMIC__ | 7 | #ifndef __ARCH_SPARC64_ATOMIC__ |
@@ -106,6 +106,8 @@ static inline long atomic64_add_unless(atomic64_t *v, long a, long u) | |||
106 | 106 | ||
107 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) | 107 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) |
108 | 108 | ||
109 | extern long atomic64_dec_if_positive(atomic64_t *v); | ||
110 | |||
109 | /* Atomic operations are already serializing */ | 111 | /* Atomic operations are already serializing */ |
110 | #define smp_mb__before_atomic_dec() barrier() | 112 | #define smp_mb__before_atomic_dec() barrier() |
111 | #define smp_mb__after_atomic_dec() barrier() | 113 | #define smp_mb__after_atomic_dec() barrier() |
diff --git a/arch/sparc/include/asm/backoff.h b/arch/sparc/include/asm/backoff.h index db3af0d30fb1..4e02086b839c 100644 --- a/arch/sparc/include/asm/backoff.h +++ b/arch/sparc/include/asm/backoff.h | |||
@@ -1,6 +1,46 @@ | |||
1 | #ifndef _SPARC64_BACKOFF_H | 1 | #ifndef _SPARC64_BACKOFF_H |
2 | #define _SPARC64_BACKOFF_H | 2 | #define _SPARC64_BACKOFF_H |
3 | 3 | ||
4 | /* The macros in this file implement an exponential backoff facility | ||
5 | * for atomic operations. | ||
6 | * | ||
7 | * When multiple threads compete on an atomic operation, it is | ||
8 | * possible for one thread to be continually denied a successful | ||
9 | * completion of the compare-and-swap instruction. Heavily | ||
10 | * threaded cpu implementations like Niagara can compound this | ||
11 | * problem even further. | ||
12 | * | ||
13 | * When an atomic operation fails and needs to be retried, we spin a | ||
14 | * certain number of times. At each subsequent failure of the same | ||
15 | * operation we double the spin count, realizing an exponential | ||
16 | * backoff. | ||
17 | * | ||
18 | * When we spin, we try to use an operation that will cause the | ||
19 | * current cpu strand to block, and therefore make the core fully | ||
20 | * available to any other other runnable strands. There are two | ||
21 | * options, based upon cpu capabilities. | ||
22 | * | ||
23 | * On all cpus prior to SPARC-T4 we do three dummy reads of the | ||
24 | * condition code register. Each read blocks the strand for something | ||
25 | * between 40 and 50 cpu cycles. | ||
26 | * | ||
27 | * For SPARC-T4 and later we have a special "pause" instruction | ||
28 | * available. This is implemented using writes to register %asr27. | ||
29 | * The cpu will block the number of cycles written into the register, | ||
30 | * unless a disrupting trap happens first. SPARC-T4 specifically | ||
31 | * implements pause with a granularity of 8 cycles. Each strand has | ||
32 | * an internal pause counter which decrements every 8 cycles. So the | ||
33 | * chip shifts the %asr27 value down by 3 bits, and writes the result | ||
34 | * into the pause counter. If a value smaller than 8 is written, the | ||
35 | * chip blocks for 1 cycle. | ||
36 | * | ||
37 | * To achieve the same amount of backoff as the three %ccr reads give | ||
38 | * on earlier chips, we shift the backoff value up by 7 bits. (Three | ||
39 | * %ccr reads block for about 128 cycles, 1 << 7 == 128) We write the | ||
40 | * whole amount we want to block into the pause register, rather than | ||
41 | * loop writing 128 each time. | ||
42 | */ | ||
43 | |||
4 | #define BACKOFF_LIMIT (4 * 1024) | 44 | #define BACKOFF_LIMIT (4 * 1024) |
5 | 45 | ||
6 | #ifdef CONFIG_SMP | 46 | #ifdef CONFIG_SMP |
@@ -11,16 +51,25 @@ | |||
11 | #define BACKOFF_LABEL(spin_label, continue_label) \ | 51 | #define BACKOFF_LABEL(spin_label, continue_label) \ |
12 | spin_label | 52 | spin_label |
13 | 53 | ||
14 | #define BACKOFF_SPIN(reg, tmp, label) \ | 54 | #define BACKOFF_SPIN(reg, tmp, label) \ |
15 | mov reg, tmp; \ | 55 | mov reg, tmp; \ |
16 | 88: brnz,pt tmp, 88b; \ | 56 | 88: rd %ccr, %g0; \ |
17 | sub tmp, 1, tmp; \ | 57 | rd %ccr, %g0; \ |
18 | set BACKOFF_LIMIT, tmp; \ | 58 | rd %ccr, %g0; \ |
19 | cmp reg, tmp; \ | 59 | .section .pause_3insn_patch,"ax";\ |
20 | bg,pn %xcc, label; \ | 60 | .word 88b; \ |
21 | nop; \ | 61 | sllx tmp, 7, tmp; \ |
22 | ba,pt %xcc, label; \ | 62 | wr tmp, 0, %asr27; \ |
23 | sllx reg, 1, reg; | 63 | clr tmp; \ |
64 | .previous; \ | ||
65 | brnz,pt tmp, 88b; \ | ||
66 | sub tmp, 1, tmp; \ | ||
67 | set BACKOFF_LIMIT, tmp; \ | ||
68 | cmp reg, tmp; \ | ||
69 | bg,pn %xcc, label; \ | ||
70 | nop; \ | ||
71 | ba,pt %xcc, label; \ | ||
72 | sllx reg, 1, reg; | ||
24 | 73 | ||
25 | #else | 74 | #else |
26 | 75 | ||
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index cef99fbc0a21..830502fe62b4 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h | |||
@@ -232,9 +232,10 @@ static inline void __user *arch_compat_alloc_user_space(long len) | |||
232 | struct pt_regs *regs = current_thread_info()->kregs; | 232 | struct pt_regs *regs = current_thread_info()->kregs; |
233 | unsigned long usp = regs->u_regs[UREG_I6]; | 233 | unsigned long usp = regs->u_regs[UREG_I6]; |
234 | 234 | ||
235 | if (!(test_thread_flag(TIF_32BIT))) | 235 | if (test_thread_64bit_stack(usp)) |
236 | usp += STACK_BIAS; | 236 | usp += STACK_BIAS; |
237 | else | 237 | |
238 | if (test_thread_flag(TIF_32BIT)) | ||
238 | usp &= 0xffffffffUL; | 239 | usp &= 0xffffffffUL; |
239 | 240 | ||
240 | usp -= len; | 241 | usp -= len; |
diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h index 4e5a483122a0..721e25f0e2ea 100644 --- a/arch/sparc/include/asm/processor_64.h +++ b/arch/sparc/include/asm/processor_64.h | |||
@@ -196,7 +196,22 @@ extern unsigned long get_wchan(struct task_struct *task); | |||
196 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc) | 196 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->tpc) |
197 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->u_regs[UREG_FP]) | 197 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->u_regs[UREG_FP]) |
198 | 198 | ||
199 | #define cpu_relax() barrier() | 199 | /* Please see the commentary in asm/backoff.h for a description of |
200 | * what these instructions are doing and how they have been choosen. | ||
201 | * To make a long story short, we are trying to yield the current cpu | ||
202 | * strand during busy loops. | ||
203 | */ | ||
204 | #define cpu_relax() asm volatile("\n99:\n\t" \ | ||
205 | "rd %%ccr, %%g0\n\t" \ | ||
206 | "rd %%ccr, %%g0\n\t" \ | ||
207 | "rd %%ccr, %%g0\n\t" \ | ||
208 | ".section .pause_3insn_patch,\"ax\"\n\t"\ | ||
209 | ".word 99b\n\t" \ | ||
210 | "wr %%g0, 128, %%asr27\n\t" \ | ||
211 | "nop\n\t" \ | ||
212 | "nop\n\t" \ | ||
213 | ".previous" \ | ||
214 | ::: "memory") | ||
200 | 215 | ||
201 | /* Prefetch support. This is tuned for UltraSPARC-III and later. | 216 | /* Prefetch support. This is tuned for UltraSPARC-III and later. |
202 | * UltraSPARC-I will treat these as nops, and UltraSPARC-II has | 217 | * UltraSPARC-I will treat these as nops, and UltraSPARC-II has |
diff --git a/arch/sparc/include/asm/prom.h b/arch/sparc/include/asm/prom.h index c28765110706..f93003123bce 100644 --- a/arch/sparc/include/asm/prom.h +++ b/arch/sparc/include/asm/prom.h | |||
@@ -63,5 +63,10 @@ extern char *of_console_options; | |||
63 | extern void irq_trans_init(struct device_node *dp); | 63 | extern void irq_trans_init(struct device_node *dp); |
64 | extern char *build_path_component(struct device_node *dp); | 64 | extern char *build_path_component(struct device_node *dp); |
65 | 65 | ||
66 | /* SPARC has a local implementation */ | ||
67 | extern int of_address_to_resource(struct device_node *dev, int index, | ||
68 | struct resource *r); | ||
69 | #define of_address_to_resource of_address_to_resource | ||
70 | |||
66 | #endif /* __KERNEL__ */ | 71 | #endif /* __KERNEL__ */ |
67 | #endif /* _SPARC_PROM_H */ | 72 | #endif /* _SPARC_PROM_H */ |
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h index 4e2276631081..a3fe4dcc0aa6 100644 --- a/arch/sparc/include/asm/thread_info_64.h +++ b/arch/sparc/include/asm/thread_info_64.h | |||
@@ -259,6 +259,11 @@ static inline bool test_and_clear_restore_sigmask(void) | |||
259 | 259 | ||
260 | #define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG) | 260 | #define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG) |
261 | 261 | ||
262 | #define thread32_stack_is_64bit(__SP) (((__SP) & 0x1) != 0) | ||
263 | #define test_thread_64bit_stack(__SP) \ | ||
264 | ((test_thread_flag(TIF_32BIT) && !thread32_stack_is_64bit(__SP)) ? \ | ||
265 | false : true) | ||
266 | |||
262 | #endif /* !__ASSEMBLY__ */ | 267 | #endif /* !__ASSEMBLY__ */ |
263 | 268 | ||
264 | #endif /* __KERNEL__ */ | 269 | #endif /* __KERNEL__ */ |
diff --git a/arch/sparc/include/asm/ttable.h b/arch/sparc/include/asm/ttable.h index 48f2807d3265..71b5a67522ab 100644 --- a/arch/sparc/include/asm/ttable.h +++ b/arch/sparc/include/asm/ttable.h | |||
@@ -372,7 +372,9 @@ etrap_spill_fixup_64bit: \ | |||
372 | 372 | ||
373 | /* Normal 32bit spill */ | 373 | /* Normal 32bit spill */ |
374 | #define SPILL_2_GENERIC(ASI) \ | 374 | #define SPILL_2_GENERIC(ASI) \ |
375 | srl %sp, 0, %sp; \ | 375 | and %sp, 1, %g3; \ |
376 | brnz,pn %g3, (. - (128 + 4)); \ | ||
377 | srl %sp, 0, %sp; \ | ||
376 | stwa %l0, [%sp + %g0] ASI; \ | 378 | stwa %l0, [%sp + %g0] ASI; \ |
377 | mov 0x04, %g3; \ | 379 | mov 0x04, %g3; \ |
378 | stwa %l1, [%sp + %g3] ASI; \ | 380 | stwa %l1, [%sp + %g3] ASI; \ |
@@ -398,14 +400,16 @@ etrap_spill_fixup_64bit: \ | |||
398 | stwa %i6, [%g1 + %g0] ASI; \ | 400 | stwa %i6, [%g1 + %g0] ASI; \ |
399 | stwa %i7, [%g1 + %g3] ASI; \ | 401 | stwa %i7, [%g1 + %g3] ASI; \ |
400 | saved; \ | 402 | saved; \ |
401 | retry; nop; nop; \ | 403 | retry; \ |
402 | b,a,pt %xcc, spill_fixup_dax; \ | 404 | b,a,pt %xcc, spill_fixup_dax; \ |
403 | b,a,pt %xcc, spill_fixup_mna; \ | 405 | b,a,pt %xcc, spill_fixup_mna; \ |
404 | b,a,pt %xcc, spill_fixup; | 406 | b,a,pt %xcc, spill_fixup; |
405 | 407 | ||
406 | #define SPILL_2_GENERIC_ETRAP \ | 408 | #define SPILL_2_GENERIC_ETRAP \ |
407 | etrap_user_spill_32bit: \ | 409 | etrap_user_spill_32bit: \ |
408 | srl %sp, 0, %sp; \ | 410 | and %sp, 1, %g3; \ |
411 | brnz,pn %g3, etrap_user_spill_64bit; \ | ||
412 | srl %sp, 0, %sp; \ | ||
409 | stwa %l0, [%sp + 0x00] %asi; \ | 413 | stwa %l0, [%sp + 0x00] %asi; \ |
410 | stwa %l1, [%sp + 0x04] %asi; \ | 414 | stwa %l1, [%sp + 0x04] %asi; \ |
411 | stwa %l2, [%sp + 0x08] %asi; \ | 415 | stwa %l2, [%sp + 0x08] %asi; \ |
@@ -427,7 +431,7 @@ etrap_user_spill_32bit: \ | |||
427 | ba,pt %xcc, etrap_save; \ | 431 | ba,pt %xcc, etrap_save; \ |
428 | wrpr %g1, %cwp; \ | 432 | wrpr %g1, %cwp; \ |
429 | nop; nop; nop; nop; \ | 433 | nop; nop; nop; nop; \ |
430 | nop; nop; nop; nop; \ | 434 | nop; nop; \ |
431 | ba,a,pt %xcc, etrap_spill_fixup_32bit; \ | 435 | ba,a,pt %xcc, etrap_spill_fixup_32bit; \ |
432 | ba,a,pt %xcc, etrap_spill_fixup_32bit; \ | 436 | ba,a,pt %xcc, etrap_spill_fixup_32bit; \ |
433 | ba,a,pt %xcc, etrap_spill_fixup_32bit; | 437 | ba,a,pt %xcc, etrap_spill_fixup_32bit; |
@@ -592,7 +596,9 @@ user_rtt_fill_64bit: \ | |||
592 | 596 | ||
593 | /* Normal 32bit fill */ | 597 | /* Normal 32bit fill */ |
594 | #define FILL_2_GENERIC(ASI) \ | 598 | #define FILL_2_GENERIC(ASI) \ |
595 | srl %sp, 0, %sp; \ | 599 | and %sp, 1, %g3; \ |
600 | brnz,pn %g3, (. - (128 + 4)); \ | ||
601 | srl %sp, 0, %sp; \ | ||
596 | lduwa [%sp + %g0] ASI, %l0; \ | 602 | lduwa [%sp + %g0] ASI, %l0; \ |
597 | mov 0x04, %g2; \ | 603 | mov 0x04, %g2; \ |
598 | mov 0x08, %g3; \ | 604 | mov 0x08, %g3; \ |
@@ -616,14 +622,16 @@ user_rtt_fill_64bit: \ | |||
616 | lduwa [%g1 + %g3] ASI, %i6; \ | 622 | lduwa [%g1 + %g3] ASI, %i6; \ |
617 | lduwa [%g1 + %g5] ASI, %i7; \ | 623 | lduwa [%g1 + %g5] ASI, %i7; \ |
618 | restored; \ | 624 | restored; \ |
619 | retry; nop; nop; nop; nop; \ | 625 | retry; nop; nop; \ |
620 | b,a,pt %xcc, fill_fixup_dax; \ | 626 | b,a,pt %xcc, fill_fixup_dax; \ |
621 | b,a,pt %xcc, fill_fixup_mna; \ | 627 | b,a,pt %xcc, fill_fixup_mna; \ |
622 | b,a,pt %xcc, fill_fixup; | 628 | b,a,pt %xcc, fill_fixup; |
623 | 629 | ||
624 | #define FILL_2_GENERIC_RTRAP \ | 630 | #define FILL_2_GENERIC_RTRAP \ |
625 | user_rtt_fill_32bit: \ | 631 | user_rtt_fill_32bit: \ |
626 | srl %sp, 0, %sp; \ | 632 | and %sp, 1, %g3; \ |
633 | brnz,pn %g3, user_rtt_fill_64bit; \ | ||
634 | srl %sp, 0, %sp; \ | ||
627 | lduwa [%sp + 0x00] %asi, %l0; \ | 635 | lduwa [%sp + 0x00] %asi, %l0; \ |
628 | lduwa [%sp + 0x04] %asi, %l1; \ | 636 | lduwa [%sp + 0x04] %asi, %l1; \ |
629 | lduwa [%sp + 0x08] %asi, %l2; \ | 637 | lduwa [%sp + 0x08] %asi, %l2; \ |
@@ -643,7 +651,7 @@ user_rtt_fill_32bit: \ | |||
643 | ba,pt %xcc, user_rtt_pre_restore; \ | 651 | ba,pt %xcc, user_rtt_pre_restore; \ |
644 | restored; \ | 652 | restored; \ |
645 | nop; nop; nop; nop; nop; \ | 653 | nop; nop; nop; nop; nop; \ |
646 | nop; nop; nop; nop; nop; \ | 654 | nop; nop; nop; \ |
647 | ba,a,pt %xcc, user_rtt_fill_fixup; \ | 655 | ba,a,pt %xcc, user_rtt_fill_fixup; \ |
648 | ba,a,pt %xcc, user_rtt_fill_fixup; \ | 656 | ba,a,pt %xcc, user_rtt_fill_fixup; \ |
649 | ba,a,pt %xcc, user_rtt_fill_fixup; | 657 | ba,a,pt %xcc, user_rtt_fill_fixup; |
diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h index 8974ef7ae920..cac719d1bc5c 100644 --- a/arch/sparc/include/uapi/asm/unistd.h +++ b/arch/sparc/include/uapi/asm/unistd.h | |||
@@ -405,8 +405,13 @@ | |||
405 | #define __NR_setns 337 | 405 | #define __NR_setns 337 |
406 | #define __NR_process_vm_readv 338 | 406 | #define __NR_process_vm_readv 338 |
407 | #define __NR_process_vm_writev 339 | 407 | #define __NR_process_vm_writev 339 |
408 | #define __NR_kern_features 340 | ||
409 | #define __NR_kcmp 341 | ||
408 | 410 | ||
409 | #define NR_syscalls 340 | 411 | #define NR_syscalls 342 |
412 | |||
413 | /* Bitmask values returned from kern_features system call. */ | ||
414 | #define KERN_FEATURE_MIXED_MODE_STACK 0x00000001 | ||
410 | 415 | ||
411 | #ifdef __32bit_syscall_numbers__ | 416 | #ifdef __32bit_syscall_numbers__ |
412 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, | 417 | /* Sparc 32-bit only has the "setresuid32", "getresuid32" variants, |
diff --git a/arch/sparc/kernel/entry.h b/arch/sparc/kernel/entry.h index 0c218e4c0881..cc3c5cb47cda 100644 --- a/arch/sparc/kernel/entry.h +++ b/arch/sparc/kernel/entry.h | |||
@@ -59,6 +59,13 @@ struct popc_6insn_patch_entry { | |||
59 | extern struct popc_6insn_patch_entry __popc_6insn_patch, | 59 | extern struct popc_6insn_patch_entry __popc_6insn_patch, |
60 | __popc_6insn_patch_end; | 60 | __popc_6insn_patch_end; |
61 | 61 | ||
62 | struct pause_patch_entry { | ||
63 | unsigned int addr; | ||
64 | unsigned int insns[3]; | ||
65 | }; | ||
66 | extern struct pause_patch_entry __pause_3insn_patch, | ||
67 | __pause_3insn_patch_end; | ||
68 | |||
62 | extern void __init per_cpu_patch(void); | 69 | extern void __init per_cpu_patch(void); |
63 | extern void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *, | 70 | extern void sun4v_patch_1insn_range(struct sun4v_1insn_patch_entry *, |
64 | struct sun4v_1insn_patch_entry *); | 71 | struct sun4v_1insn_patch_entry *); |
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index f8b6eee40bde..87f60ee65433 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
@@ -56,11 +56,13 @@ static inline unsigned int leon_eirq_get(int cpu) | |||
56 | static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc) | 56 | static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc) |
57 | { | 57 | { |
58 | unsigned int eirq; | 58 | unsigned int eirq; |
59 | struct irq_bucket *p; | ||
59 | int cpu = sparc_leon3_cpuid(); | 60 | int cpu = sparc_leon3_cpuid(); |
60 | 61 | ||
61 | eirq = leon_eirq_get(cpu); | 62 | eirq = leon_eirq_get(cpu); |
62 | if ((eirq & 0x10) && irq_map[eirq]->irq) /* bit4 tells if IRQ happened */ | 63 | p = irq_map[eirq]; |
63 | generic_handle_irq(irq_map[eirq]->irq); | 64 | if ((eirq & 0x10) && p && p->irq) /* bit4 tells if IRQ happened */ |
65 | generic_handle_irq(p->irq); | ||
64 | } | 66 | } |
65 | 67 | ||
66 | /* The extended IRQ controller has been found, this function registers it */ | 68 | /* The extended IRQ controller has been found, this function registers it */ |
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index 885a8af74064..b5c38faa4ead 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -1762,15 +1762,25 @@ static void perf_callchain_user_32(struct perf_callchain_entry *entry, | |||
1762 | 1762 | ||
1763 | ufp = regs->u_regs[UREG_I6] & 0xffffffffUL; | 1763 | ufp = regs->u_regs[UREG_I6] & 0xffffffffUL; |
1764 | do { | 1764 | do { |
1765 | struct sparc_stackf32 *usf, sf; | ||
1766 | unsigned long pc; | 1765 | unsigned long pc; |
1767 | 1766 | ||
1768 | usf = (struct sparc_stackf32 *) ufp; | 1767 | if (thread32_stack_is_64bit(ufp)) { |
1769 | if (__copy_from_user_inatomic(&sf, usf, sizeof(sf))) | 1768 | struct sparc_stackf *usf, sf; |
1770 | break; | ||
1771 | 1769 | ||
1772 | pc = sf.callers_pc; | 1770 | ufp += STACK_BIAS; |
1773 | ufp = (unsigned long)sf.fp; | 1771 | usf = (struct sparc_stackf *) ufp; |
1772 | if (__copy_from_user_inatomic(&sf, usf, sizeof(sf))) | ||
1773 | break; | ||
1774 | pc = sf.callers_pc & 0xffffffff; | ||
1775 | ufp = ((unsigned long) sf.fp) & 0xffffffff; | ||
1776 | } else { | ||
1777 | struct sparc_stackf32 *usf, sf; | ||
1778 | usf = (struct sparc_stackf32 *) ufp; | ||
1779 | if (__copy_from_user_inatomic(&sf, usf, sizeof(sf))) | ||
1780 | break; | ||
1781 | pc = sf.callers_pc; | ||
1782 | ufp = (unsigned long)sf.fp; | ||
1783 | } | ||
1774 | perf_callchain_store(entry, pc); | 1784 | perf_callchain_store(entry, pc); |
1775 | } while (entry->nr < PERF_MAX_STACK_DEPTH); | 1785 | } while (entry->nr < PERF_MAX_STACK_DEPTH); |
1776 | } | 1786 | } |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index d778248ef3f8..c6e0c2910043 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -452,13 +452,16 @@ void flush_thread(void) | |||
452 | /* It's a bit more tricky when 64-bit tasks are involved... */ | 452 | /* It's a bit more tricky when 64-bit tasks are involved... */ |
453 | static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) | 453 | static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) |
454 | { | 454 | { |
455 | bool stack_64bit = test_thread_64bit_stack(psp); | ||
455 | unsigned long fp, distance, rval; | 456 | unsigned long fp, distance, rval; |
456 | 457 | ||
457 | if (!(test_thread_flag(TIF_32BIT))) { | 458 | if (stack_64bit) { |
458 | csp += STACK_BIAS; | 459 | csp += STACK_BIAS; |
459 | psp += STACK_BIAS; | 460 | psp += STACK_BIAS; |
460 | __get_user(fp, &(((struct reg_window __user *)psp)->ins[6])); | 461 | __get_user(fp, &(((struct reg_window __user *)psp)->ins[6])); |
461 | fp += STACK_BIAS; | 462 | fp += STACK_BIAS; |
463 | if (test_thread_flag(TIF_32BIT)) | ||
464 | fp &= 0xffffffff; | ||
462 | } else | 465 | } else |
463 | __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6])); | 466 | __get_user(fp, &(((struct reg_window32 __user *)psp)->ins[6])); |
464 | 467 | ||
@@ -472,7 +475,7 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp) | |||
472 | rval = (csp - distance); | 475 | rval = (csp - distance); |
473 | if (copy_in_user((void __user *) rval, (void __user *) psp, distance)) | 476 | if (copy_in_user((void __user *) rval, (void __user *) psp, distance)) |
474 | rval = 0; | 477 | rval = 0; |
475 | else if (test_thread_flag(TIF_32BIT)) { | 478 | else if (!stack_64bit) { |
476 | if (put_user(((u32)csp), | 479 | if (put_user(((u32)csp), |
477 | &(((struct reg_window32 __user *)rval)->ins[6]))) | 480 | &(((struct reg_window32 __user *)rval)->ins[6]))) |
478 | rval = 0; | 481 | rval = 0; |
@@ -507,18 +510,18 @@ void synchronize_user_stack(void) | |||
507 | 510 | ||
508 | flush_user_windows(); | 511 | flush_user_windows(); |
509 | if ((window = get_thread_wsaved()) != 0) { | 512 | if ((window = get_thread_wsaved()) != 0) { |
510 | int winsize = sizeof(struct reg_window); | ||
511 | int bias = 0; | ||
512 | |||
513 | if (test_thread_flag(TIF_32BIT)) | ||
514 | winsize = sizeof(struct reg_window32); | ||
515 | else | ||
516 | bias = STACK_BIAS; | ||
517 | |||
518 | window -= 1; | 513 | window -= 1; |
519 | do { | 514 | do { |
520 | unsigned long sp = (t->rwbuf_stkptrs[window] + bias); | ||
521 | struct reg_window *rwin = &t->reg_window[window]; | 515 | struct reg_window *rwin = &t->reg_window[window]; |
516 | int winsize = sizeof(struct reg_window); | ||
517 | unsigned long sp; | ||
518 | |||
519 | sp = t->rwbuf_stkptrs[window]; | ||
520 | |||
521 | if (test_thread_64bit_stack(sp)) | ||
522 | sp += STACK_BIAS; | ||
523 | else | ||
524 | winsize = sizeof(struct reg_window32); | ||
522 | 525 | ||
523 | if (!copy_to_user((char __user *)sp, rwin, winsize)) { | 526 | if (!copy_to_user((char __user *)sp, rwin, winsize)) { |
524 | shift_window_buffer(window, get_thread_wsaved() - 1, t); | 527 | shift_window_buffer(window, get_thread_wsaved() - 1, t); |
@@ -544,13 +547,6 @@ void fault_in_user_windows(void) | |||
544 | { | 547 | { |
545 | struct thread_info *t = current_thread_info(); | 548 | struct thread_info *t = current_thread_info(); |
546 | unsigned long window; | 549 | unsigned long window; |
547 | int winsize = sizeof(struct reg_window); | ||
548 | int bias = 0; | ||
549 | |||
550 | if (test_thread_flag(TIF_32BIT)) | ||
551 | winsize = sizeof(struct reg_window32); | ||
552 | else | ||
553 | bias = STACK_BIAS; | ||
554 | 550 | ||
555 | flush_user_windows(); | 551 | flush_user_windows(); |
556 | window = get_thread_wsaved(); | 552 | window = get_thread_wsaved(); |
@@ -558,8 +554,16 @@ void fault_in_user_windows(void) | |||
558 | if (likely(window != 0)) { | 554 | if (likely(window != 0)) { |
559 | window -= 1; | 555 | window -= 1; |
560 | do { | 556 | do { |
561 | unsigned long sp = (t->rwbuf_stkptrs[window] + bias); | ||
562 | struct reg_window *rwin = &t->reg_window[window]; | 557 | struct reg_window *rwin = &t->reg_window[window]; |
558 | int winsize = sizeof(struct reg_window); | ||
559 | unsigned long sp; | ||
560 | |||
561 | sp = t->rwbuf_stkptrs[window]; | ||
562 | |||
563 | if (test_thread_64bit_stack(sp)) | ||
564 | sp += STACK_BIAS; | ||
565 | else | ||
566 | winsize = sizeof(struct reg_window32); | ||
563 | 567 | ||
564 | if (unlikely(sp & 0x7UL)) | 568 | if (unlikely(sp & 0x7UL)) |
565 | stack_unaligned(sp); | 569 | stack_unaligned(sp); |
diff --git a/arch/sparc/kernel/ptrace_64.c b/arch/sparc/kernel/ptrace_64.c index 484dabac7045..7ff45e4ba681 100644 --- a/arch/sparc/kernel/ptrace_64.c +++ b/arch/sparc/kernel/ptrace_64.c | |||
@@ -151,7 +151,7 @@ static int regwindow64_get(struct task_struct *target, | |||
151 | { | 151 | { |
152 | unsigned long rw_addr = regs->u_regs[UREG_I6]; | 152 | unsigned long rw_addr = regs->u_regs[UREG_I6]; |
153 | 153 | ||
154 | if (test_tsk_thread_flag(current, TIF_32BIT)) { | 154 | if (!test_thread_64bit_stack(rw_addr)) { |
155 | struct reg_window32 win32; | 155 | struct reg_window32 win32; |
156 | int i; | 156 | int i; |
157 | 157 | ||
@@ -176,7 +176,7 @@ static int regwindow64_set(struct task_struct *target, | |||
176 | { | 176 | { |
177 | unsigned long rw_addr = regs->u_regs[UREG_I6]; | 177 | unsigned long rw_addr = regs->u_regs[UREG_I6]; |
178 | 178 | ||
179 | if (test_tsk_thread_flag(current, TIF_32BIT)) { | 179 | if (!test_thread_64bit_stack(rw_addr)) { |
180 | struct reg_window32 win32; | 180 | struct reg_window32 win32; |
181 | int i; | 181 | int i; |
182 | 182 | ||
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c index 0800e71d8a88..0eaf0059aaef 100644 --- a/arch/sparc/kernel/setup_64.c +++ b/arch/sparc/kernel/setup_64.c | |||
@@ -316,6 +316,25 @@ static void __init popc_patch(void) | |||
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||
319 | static void __init pause_patch(void) | ||
320 | { | ||
321 | struct pause_patch_entry *p; | ||
322 | |||
323 | p = &__pause_3insn_patch; | ||
324 | while (p < &__pause_3insn_patch_end) { | ||
325 | unsigned long i, addr = p->addr; | ||
326 | |||
327 | for (i = 0; i < 3; i++) { | ||
328 | *(unsigned int *) (addr + (i * 4)) = p->insns[i]; | ||
329 | wmb(); | ||
330 | __asm__ __volatile__("flush %0" | ||
331 | : : "r" (addr + (i * 4))); | ||
332 | } | ||
333 | |||
334 | p++; | ||
335 | } | ||
336 | } | ||
337 | |||
319 | #ifdef CONFIG_SMP | 338 | #ifdef CONFIG_SMP |
320 | void __init boot_cpu_id_too_large(int cpu) | 339 | void __init boot_cpu_id_too_large(int cpu) |
321 | { | 340 | { |
@@ -528,6 +547,8 @@ static void __init init_sparc64_elf_hwcap(void) | |||
528 | 547 | ||
529 | if (sparc64_elf_hwcap & AV_SPARC_POPC) | 548 | if (sparc64_elf_hwcap & AV_SPARC_POPC) |
530 | popc_patch(); | 549 | popc_patch(); |
550 | if (sparc64_elf_hwcap & AV_SPARC_PAUSE) | ||
551 | pause_patch(); | ||
531 | } | 552 | } |
532 | 553 | ||
533 | void __init setup_arch(char **cmdline_p) | 554 | void __init setup_arch(char **cmdline_p) |
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c index 11c6c9603e71..878ef3d5fec5 100644 --- a/arch/sparc/kernel/sys_sparc_64.c +++ b/arch/sparc/kernel/sys_sparc_64.c | |||
@@ -751,3 +751,8 @@ int kernel_execve(const char *filename, | |||
751 | : "cc"); | 751 | : "cc"); |
752 | return __res; | 752 | return __res; |
753 | } | 753 | } |
754 | |||
755 | asmlinkage long sys_kern_features(void) | ||
756 | { | ||
757 | return KERN_FEATURE_MIXED_MODE_STACK; | ||
758 | } | ||
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S index 63402f9e9f51..5147f574f125 100644 --- a/arch/sparc/kernel/systbls_32.S +++ b/arch/sparc/kernel/systbls_32.S | |||
@@ -85,3 +85,4 @@ sys_call_table: | |||
85 | /*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init | 85 | /*325*/ .long sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init |
86 | /*330*/ .long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime | 86 | /*330*/ .long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime |
87 | /*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev | 87 | /*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev |
88 | /*340*/ .long sys_ni_syscall, sys_kcmp | ||
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index 3a58e0d66f51..1c9af9fa38e9 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
@@ -86,6 +86,7 @@ sys_call_table32: | |||
86 | .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init | 86 | .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init |
87 | /*330*/ .word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime | 87 | /*330*/ .word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime |
88 | .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev | 88 | .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev |
89 | /*340*/ .word sys_kern_features, sys_kcmp | ||
89 | 90 | ||
90 | #endif /* CONFIG_COMPAT */ | 91 | #endif /* CONFIG_COMPAT */ |
91 | 92 | ||
@@ -163,3 +164,4 @@ sys_call_table: | |||
163 | .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init | 164 | .word sys_pwritev, sys_rt_tgsigqueueinfo, sys_perf_event_open, sys_recvmmsg, sys_fanotify_init |
164 | /*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime | 165 | /*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime |
165 | .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev | 166 | .word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev |
167 | /*340*/ .word sys_kern_features, sys_kcmp | ||
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c index f81d038f7340..8201c25e7669 100644 --- a/arch/sparc/kernel/unaligned_64.c +++ b/arch/sparc/kernel/unaligned_64.c | |||
@@ -113,21 +113,24 @@ static inline long sign_extend_imm13(long imm) | |||
113 | 113 | ||
114 | static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) | 114 | static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) |
115 | { | 115 | { |
116 | unsigned long value; | 116 | unsigned long value, fp; |
117 | 117 | ||
118 | if (reg < 16) | 118 | if (reg < 16) |
119 | return (!reg ? 0 : regs->u_regs[reg]); | 119 | return (!reg ? 0 : regs->u_regs[reg]); |
120 | |||
121 | fp = regs->u_regs[UREG_FP]; | ||
122 | |||
120 | if (regs->tstate & TSTATE_PRIV) { | 123 | if (regs->tstate & TSTATE_PRIV) { |
121 | struct reg_window *win; | 124 | struct reg_window *win; |
122 | win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); | 125 | win = (struct reg_window *)(fp + STACK_BIAS); |
123 | value = win->locals[reg - 16]; | 126 | value = win->locals[reg - 16]; |
124 | } else if (test_thread_flag(TIF_32BIT)) { | 127 | } else if (!test_thread_64bit_stack(fp)) { |
125 | struct reg_window32 __user *win32; | 128 | struct reg_window32 __user *win32; |
126 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP])); | 129 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)fp)); |
127 | get_user(value, &win32->locals[reg - 16]); | 130 | get_user(value, &win32->locals[reg - 16]); |
128 | } else { | 131 | } else { |
129 | struct reg_window __user *win; | 132 | struct reg_window __user *win; |
130 | win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS); | 133 | win = (struct reg_window __user *)(fp + STACK_BIAS); |
131 | get_user(value, &win->locals[reg - 16]); | 134 | get_user(value, &win->locals[reg - 16]); |
132 | } | 135 | } |
133 | return value; | 136 | return value; |
@@ -135,19 +138,24 @@ static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) | |||
135 | 138 | ||
136 | static unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *regs) | 139 | static unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *regs) |
137 | { | 140 | { |
141 | unsigned long fp; | ||
142 | |||
138 | if (reg < 16) | 143 | if (reg < 16) |
139 | return ®s->u_regs[reg]; | 144 | return ®s->u_regs[reg]; |
145 | |||
146 | fp = regs->u_regs[UREG_FP]; | ||
147 | |||
140 | if (regs->tstate & TSTATE_PRIV) { | 148 | if (regs->tstate & TSTATE_PRIV) { |
141 | struct reg_window *win; | 149 | struct reg_window *win; |
142 | win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); | 150 | win = (struct reg_window *)(fp + STACK_BIAS); |
143 | return &win->locals[reg - 16]; | 151 | return &win->locals[reg - 16]; |
144 | } else if (test_thread_flag(TIF_32BIT)) { | 152 | } else if (!test_thread_64bit_stack(fp)) { |
145 | struct reg_window32 *win32; | 153 | struct reg_window32 *win32; |
146 | win32 = (struct reg_window32 *)((unsigned long)((u32)regs->u_regs[UREG_FP])); | 154 | win32 = (struct reg_window32 *)((unsigned long)((u32)fp)); |
147 | return (unsigned long *)&win32->locals[reg - 16]; | 155 | return (unsigned long *)&win32->locals[reg - 16]; |
148 | } else { | 156 | } else { |
149 | struct reg_window *win; | 157 | struct reg_window *win; |
150 | win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); | 158 | win = (struct reg_window *)(fp + STACK_BIAS); |
151 | return &win->locals[reg - 16]; | 159 | return &win->locals[reg - 16]; |
152 | } | 160 | } |
153 | } | 161 | } |
@@ -392,13 +400,15 @@ int handle_popc(u32 insn, struct pt_regs *regs) | |||
392 | if (rd) | 400 | if (rd) |
393 | regs->u_regs[rd] = ret; | 401 | regs->u_regs[rd] = ret; |
394 | } else { | 402 | } else { |
395 | if (test_thread_flag(TIF_32BIT)) { | 403 | unsigned long fp = regs->u_regs[UREG_FP]; |
404 | |||
405 | if (!test_thread_64bit_stack(fp)) { | ||
396 | struct reg_window32 __user *win32; | 406 | struct reg_window32 __user *win32; |
397 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP])); | 407 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)fp)); |
398 | put_user(ret, &win32->locals[rd - 16]); | 408 | put_user(ret, &win32->locals[rd - 16]); |
399 | } else { | 409 | } else { |
400 | struct reg_window __user *win; | 410 | struct reg_window __user *win; |
401 | win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS); | 411 | win = (struct reg_window __user *)(fp + STACK_BIAS); |
402 | put_user(ret, &win->locals[rd - 16]); | 412 | put_user(ret, &win->locals[rd - 16]); |
403 | } | 413 | } |
404 | } | 414 | } |
@@ -554,7 +564,7 @@ void handle_ld_nf(u32 insn, struct pt_regs *regs) | |||
554 | reg[0] = 0; | 564 | reg[0] = 0; |
555 | if ((insn & 0x780000) == 0x180000) | 565 | if ((insn & 0x780000) == 0x180000) |
556 | reg[1] = 0; | 566 | reg[1] = 0; |
557 | } else if (test_thread_flag(TIF_32BIT)) { | 567 | } else if (!test_thread_64bit_stack(regs->u_regs[UREG_FP])) { |
558 | put_user(0, (int __user *) reg); | 568 | put_user(0, (int __user *) reg); |
559 | if ((insn & 0x780000) == 0x180000) | 569 | if ((insn & 0x780000) == 0x180000) |
560 | put_user(0, ((int __user *) reg) + 1); | 570 | put_user(0, ((int __user *) reg) + 1); |
diff --git a/arch/sparc/kernel/visemul.c b/arch/sparc/kernel/visemul.c index 08e074b7eb6a..c096c624ac4d 100644 --- a/arch/sparc/kernel/visemul.c +++ b/arch/sparc/kernel/visemul.c | |||
@@ -149,21 +149,24 @@ static inline void maybe_flush_windows(unsigned int rs1, unsigned int rs2, | |||
149 | 149 | ||
150 | static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) | 150 | static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) |
151 | { | 151 | { |
152 | unsigned long value; | 152 | unsigned long value, fp; |
153 | 153 | ||
154 | if (reg < 16) | 154 | if (reg < 16) |
155 | return (!reg ? 0 : regs->u_regs[reg]); | 155 | return (!reg ? 0 : regs->u_regs[reg]); |
156 | |||
157 | fp = regs->u_regs[UREG_FP]; | ||
158 | |||
156 | if (regs->tstate & TSTATE_PRIV) { | 159 | if (regs->tstate & TSTATE_PRIV) { |
157 | struct reg_window *win; | 160 | struct reg_window *win; |
158 | win = (struct reg_window *)(regs->u_regs[UREG_FP] + STACK_BIAS); | 161 | win = (struct reg_window *)(fp + STACK_BIAS); |
159 | value = win->locals[reg - 16]; | 162 | value = win->locals[reg - 16]; |
160 | } else if (test_thread_flag(TIF_32BIT)) { | 163 | } else if (!test_thread_64bit_stack(fp)) { |
161 | struct reg_window32 __user *win32; | 164 | struct reg_window32 __user *win32; |
162 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP])); | 165 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)fp)); |
163 | get_user(value, &win32->locals[reg - 16]); | 166 | get_user(value, &win32->locals[reg - 16]); |
164 | } else { | 167 | } else { |
165 | struct reg_window __user *win; | 168 | struct reg_window __user *win; |
166 | win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS); | 169 | win = (struct reg_window __user *)(fp + STACK_BIAS); |
167 | get_user(value, &win->locals[reg - 16]); | 170 | get_user(value, &win->locals[reg - 16]); |
168 | } | 171 | } |
169 | return value; | 172 | return value; |
@@ -172,16 +175,18 @@ static unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) | |||
172 | static inline unsigned long __user *__fetch_reg_addr_user(unsigned int reg, | 175 | static inline unsigned long __user *__fetch_reg_addr_user(unsigned int reg, |
173 | struct pt_regs *regs) | 176 | struct pt_regs *regs) |
174 | { | 177 | { |
178 | unsigned long fp = regs->u_regs[UREG_FP]; | ||
179 | |||
175 | BUG_ON(reg < 16); | 180 | BUG_ON(reg < 16); |
176 | BUG_ON(regs->tstate & TSTATE_PRIV); | 181 | BUG_ON(regs->tstate & TSTATE_PRIV); |
177 | 182 | ||
178 | if (test_thread_flag(TIF_32BIT)) { | 183 | if (!test_thread_64bit_stack(fp)) { |
179 | struct reg_window32 __user *win32; | 184 | struct reg_window32 __user *win32; |
180 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP])); | 185 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)fp)); |
181 | return (unsigned long __user *)&win32->locals[reg - 16]; | 186 | return (unsigned long __user *)&win32->locals[reg - 16]; |
182 | } else { | 187 | } else { |
183 | struct reg_window __user *win; | 188 | struct reg_window __user *win; |
184 | win = (struct reg_window __user *)(regs->u_regs[UREG_FP] + STACK_BIAS); | 189 | win = (struct reg_window __user *)(fp + STACK_BIAS); |
185 | return &win->locals[reg - 16]; | 190 | return &win->locals[reg - 16]; |
186 | } | 191 | } |
187 | } | 192 | } |
@@ -204,7 +209,7 @@ static void store_reg(struct pt_regs *regs, unsigned long val, unsigned long rd) | |||
204 | } else { | 209 | } else { |
205 | unsigned long __user *rd_user = __fetch_reg_addr_user(rd, regs); | 210 | unsigned long __user *rd_user = __fetch_reg_addr_user(rd, regs); |
206 | 211 | ||
207 | if (test_thread_flag(TIF_32BIT)) | 212 | if (!test_thread_64bit_stack(regs->u_regs[UREG_FP])) |
208 | __put_user((u32)val, (u32 __user *)rd_user); | 213 | __put_user((u32)val, (u32 __user *)rd_user); |
209 | else | 214 | else |
210 | __put_user(val, rd_user); | 215 | __put_user(val, rd_user); |
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S index 89c2c29f154b..0bacceb19150 100644 --- a/arch/sparc/kernel/vmlinux.lds.S +++ b/arch/sparc/kernel/vmlinux.lds.S | |||
@@ -132,6 +132,11 @@ SECTIONS | |||
132 | *(.popc_6insn_patch) | 132 | *(.popc_6insn_patch) |
133 | __popc_6insn_patch_end = .; | 133 | __popc_6insn_patch_end = .; |
134 | } | 134 | } |
135 | .pause_3insn_patch : { | ||
136 | __pause_3insn_patch = .; | ||
137 | *(.pause_3insn_patch) | ||
138 | __pause_3insn_patch_end = .; | ||
139 | } | ||
135 | PERCPU_SECTION(SMP_CACHE_BYTES) | 140 | PERCPU_SECTION(SMP_CACHE_BYTES) |
136 | 141 | ||
137 | . = ALIGN(PAGE_SIZE); | 142 | . = ALIGN(PAGE_SIZE); |
diff --git a/arch/sparc/kernel/winfixup.S b/arch/sparc/kernel/winfixup.S index a6b0863c27df..1e67ce958369 100644 --- a/arch/sparc/kernel/winfixup.S +++ b/arch/sparc/kernel/winfixup.S | |||
@@ -43,6 +43,8 @@ spill_fixup_mna: | |||
43 | spill_fixup_dax: | 43 | spill_fixup_dax: |
44 | TRAP_LOAD_THREAD_REG(%g6, %g1) | 44 | TRAP_LOAD_THREAD_REG(%g6, %g1) |
45 | ldx [%g6 + TI_FLAGS], %g1 | 45 | ldx [%g6 + TI_FLAGS], %g1 |
46 | andcc %sp, 0x1, %g0 | ||
47 | movne %icc, 0, %g1 | ||
46 | andcc %g1, _TIF_32BIT, %g0 | 48 | andcc %g1, _TIF_32BIT, %g0 |
47 | ldub [%g6 + TI_WSAVED], %g1 | 49 | ldub [%g6 + TI_WSAVED], %g1 |
48 | sll %g1, 3, %g3 | 50 | sll %g1, 3, %g3 |
diff --git a/arch/sparc/lib/atomic_64.S b/arch/sparc/lib/atomic_64.S index 4d502da3de78..85c233d0a340 100644 --- a/arch/sparc/lib/atomic_64.S +++ b/arch/sparc/lib/atomic_64.S | |||
@@ -1,6 +1,6 @@ | |||
1 | /* atomic.S: These things are too big to do inline. | 1 | /* atomic.S: These things are too big to do inline. |
2 | * | 2 | * |
3 | * Copyright (C) 1999, 2007 David S. Miller (davem@davemloft.net) | 3 | * Copyright (C) 1999, 2007 2012 David S. Miller (davem@davemloft.net) |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <linux/linkage.h> | 6 | #include <linux/linkage.h> |
@@ -117,3 +117,17 @@ ENTRY(atomic64_sub_ret) /* %o0 = decrement, %o1 = atomic_ptr */ | |||
117 | sub %g1, %o0, %o0 | 117 | sub %g1, %o0, %o0 |
118 | 2: BACKOFF_SPIN(%o2, %o3, 1b) | 118 | 2: BACKOFF_SPIN(%o2, %o3, 1b) |
119 | ENDPROC(atomic64_sub_ret) | 119 | ENDPROC(atomic64_sub_ret) |
120 | |||
121 | ENTRY(atomic64_dec_if_positive) /* %o0 = atomic_ptr */ | ||
122 | BACKOFF_SETUP(%o2) | ||
123 | 1: ldx [%o0], %g1 | ||
124 | brlez,pn %g1, 3f | ||
125 | sub %g1, 1, %g7 | ||
126 | casx [%o0], %g1, %g7 | ||
127 | cmp %g1, %g7 | ||
128 | bne,pn %xcc, BACKOFF_LABEL(2f, 1b) | ||
129 | nop | ||
130 | 3: retl | ||
131 | sub %g1, 1, %o0 | ||
132 | 2: BACKOFF_SPIN(%o2, %o3, 1b) | ||
133 | ENDPROC(atomic64_dec_if_positive) | ||
diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c index ee31b884c61b..0c4e35e522fa 100644 --- a/arch/sparc/lib/ksyms.c +++ b/arch/sparc/lib/ksyms.c | |||
@@ -116,6 +116,7 @@ EXPORT_SYMBOL(atomic64_add); | |||
116 | EXPORT_SYMBOL(atomic64_add_ret); | 116 | EXPORT_SYMBOL(atomic64_add_ret); |
117 | EXPORT_SYMBOL(atomic64_sub); | 117 | EXPORT_SYMBOL(atomic64_sub); |
118 | EXPORT_SYMBOL(atomic64_sub_ret); | 118 | EXPORT_SYMBOL(atomic64_sub_ret); |
119 | EXPORT_SYMBOL(atomic64_dec_if_positive); | ||
119 | 120 | ||
120 | /* Atomic bit operations. */ | 121 | /* Atomic bit operations. */ |
121 | EXPORT_SYMBOL(test_and_set_bit); | 122 | EXPORT_SYMBOL(test_and_set_bit); |
diff --git a/arch/sparc/math-emu/math_64.c b/arch/sparc/math-emu/math_64.c index 1704068da928..034aadbff036 100644 --- a/arch/sparc/math-emu/math_64.c +++ b/arch/sparc/math-emu/math_64.c | |||
@@ -320,7 +320,7 @@ int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap) | |||
320 | XR = 0; | 320 | XR = 0; |
321 | else if (freg < 16) | 321 | else if (freg < 16) |
322 | XR = regs->u_regs[freg]; | 322 | XR = regs->u_regs[freg]; |
323 | else if (test_thread_flag(TIF_32BIT)) { | 323 | else if (!test_thread_64bit_stack(regs->u_regs[UREG_FP])) { |
324 | struct reg_window32 __user *win32; | 324 | struct reg_window32 __user *win32; |
325 | flushw_user (); | 325 | flushw_user (); |
326 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP])); | 326 | win32 = (struct reg_window32 __user *)((unsigned long)((u32)regs->u_regs[UREG_FP])); |
diff --git a/arch/tile/Makefile b/arch/tile/Makefile index 55640cf92597..3d15364c6071 100644 --- a/arch/tile/Makefile +++ b/arch/tile/Makefile | |||
@@ -26,6 +26,10 @@ $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH)) | |||
26 | endif | 26 | endif |
27 | endif | 27 | endif |
28 | 28 | ||
29 | # The tile compiler may emit .eh_frame information for backtracing. | ||
30 | # In kernel modules, this causes load failures due to unsupported relocations. | ||
31 | KBUILD_CFLAGS += -fno-asynchronous-unwind-tables | ||
32 | |||
29 | ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"") | 33 | ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"") |
30 | KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS) | 34 | KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS) |
31 | endif | 35 | endif |
diff --git a/arch/tile/kernel/module.c b/arch/tile/kernel/module.c index 001cbfa10ac6..243ffebe38d6 100644 --- a/arch/tile/kernel/module.c +++ b/arch/tile/kernel/module.c | |||
@@ -24,16 +24,6 @@ | |||
24 | #include <asm/homecache.h> | 24 | #include <asm/homecache.h> |
25 | #include <arch/opcode.h> | 25 | #include <arch/opcode.h> |
26 | 26 | ||
27 | #ifdef __tilegx__ | ||
28 | # define Elf_Rela Elf64_Rela | ||
29 | # define ELF_R_SYM ELF64_R_SYM | ||
30 | # define ELF_R_TYPE ELF64_R_TYPE | ||
31 | #else | ||
32 | # define Elf_Rela Elf32_Rela | ||
33 | # define ELF_R_SYM ELF32_R_SYM | ||
34 | # define ELF_R_TYPE ELF32_R_TYPE | ||
35 | #endif | ||
36 | |||
37 | #ifdef MODULE_DEBUG | 27 | #ifdef MODULE_DEBUG |
38 | #define DEBUGP printk | 28 | #define DEBUGP printk |
39 | #else | 29 | #else |
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h index c9dcc181d4d1..6e8fdf5ad113 100644 --- a/arch/x86/include/asm/efi.h +++ b/arch/x86/include/asm/efi.h | |||
@@ -35,7 +35,7 @@ extern unsigned long asmlinkage efi_call_phys(void *, ...); | |||
35 | #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ | 35 | #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ |
36 | efi_call_virt(f, a1, a2, a3, a4, a5, a6) | 36 | efi_call_virt(f, a1, a2, a3, a4, a5, a6) |
37 | 37 | ||
38 | #define efi_ioremap(addr, size, type) ioremap_cache(addr, size) | 38 | #define efi_ioremap(addr, size, type, attr) ioremap_cache(addr, size) |
39 | 39 | ||
40 | #else /* !CONFIG_X86_32 */ | 40 | #else /* !CONFIG_X86_32 */ |
41 | 41 | ||
@@ -89,7 +89,7 @@ extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3, | |||
89 | (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) | 89 | (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) |
90 | 90 | ||
91 | extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, | 91 | extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size, |
92 | u32 type); | 92 | u32 type, u64 attribute); |
93 | 93 | ||
94 | #endif /* CONFIG_X86_32 */ | 94 | #endif /* CONFIG_X86_32 */ |
95 | 95 | ||
@@ -98,6 +98,8 @@ extern void efi_set_executable(efi_memory_desc_t *md, bool executable); | |||
98 | extern int efi_memblock_x86_reserve_range(void); | 98 | extern int efi_memblock_x86_reserve_range(void); |
99 | extern void efi_call_phys_prelog(void); | 99 | extern void efi_call_phys_prelog(void); |
100 | extern void efi_call_phys_epilog(void); | 100 | extern void efi_call_phys_epilog(void); |
101 | extern void efi_unmap_memmap(void); | ||
102 | extern void efi_memory_uc(u64 addr, unsigned long size); | ||
101 | 103 | ||
102 | #ifndef CONFIG_EFI | 104 | #ifndef CONFIG_EFI |
103 | /* | 105 | /* |
diff --git a/arch/x86/include/asm/xen/hypercall.h b/arch/x86/include/asm/xen/hypercall.h index 59c226d120cd..c20d1ce62dc6 100644 --- a/arch/x86/include/asm/xen/hypercall.h +++ b/arch/x86/include/asm/xen/hypercall.h | |||
@@ -359,18 +359,14 @@ HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val, | |||
359 | return _hypercall4(int, update_va_mapping, va, | 359 | return _hypercall4(int, update_va_mapping, va, |
360 | new_val.pte, new_val.pte >> 32, flags); | 360 | new_val.pte, new_val.pte >> 32, flags); |
361 | } | 361 | } |
362 | extern int __must_check xen_event_channel_op_compat(int, void *); | ||
362 | 363 | ||
363 | static inline int | 364 | static inline int |
364 | HYPERVISOR_event_channel_op(int cmd, void *arg) | 365 | HYPERVISOR_event_channel_op(int cmd, void *arg) |
365 | { | 366 | { |
366 | int rc = _hypercall2(int, event_channel_op, cmd, arg); | 367 | int rc = _hypercall2(int, event_channel_op, cmd, arg); |
367 | if (unlikely(rc == -ENOSYS)) { | 368 | if (unlikely(rc == -ENOSYS)) |
368 | struct evtchn_op op; | 369 | rc = xen_event_channel_op_compat(cmd, arg); |
369 | op.cmd = cmd; | ||
370 | memcpy(&op.u, arg, sizeof(op.u)); | ||
371 | rc = _hypercall1(int, event_channel_op_compat, &op); | ||
372 | memcpy(arg, &op.u, sizeof(op.u)); | ||
373 | } | ||
374 | return rc; | 370 | return rc; |
375 | } | 371 | } |
376 | 372 | ||
@@ -386,17 +382,14 @@ HYPERVISOR_console_io(int cmd, int count, char *str) | |||
386 | return _hypercall3(int, console_io, cmd, count, str); | 382 | return _hypercall3(int, console_io, cmd, count, str); |
387 | } | 383 | } |
388 | 384 | ||
385 | extern int __must_check HYPERVISOR_physdev_op_compat(int, void *); | ||
386 | |||
389 | static inline int | 387 | static inline int |
390 | HYPERVISOR_physdev_op(int cmd, void *arg) | 388 | HYPERVISOR_physdev_op(int cmd, void *arg) |
391 | { | 389 | { |
392 | int rc = _hypercall2(int, physdev_op, cmd, arg); | 390 | int rc = _hypercall2(int, physdev_op, cmd, arg); |
393 | if (unlikely(rc == -ENOSYS)) { | 391 | if (unlikely(rc == -ENOSYS)) |
394 | struct physdev_op op; | 392 | rc = HYPERVISOR_physdev_op_compat(cmd, arg); |
395 | op.cmd = cmd; | ||
396 | memcpy(&op.u, arg, sizeof(op.u)); | ||
397 | rc = _hypercall1(int, physdev_op_compat, &op); | ||
398 | memcpy(arg, &op.u, sizeof(op.u)); | ||
399 | } | ||
400 | return rc; | 393 | return rc; |
401 | } | 394 | } |
402 | 395 | ||
diff --git a/arch/x86/include/asm/xen/hypervisor.h b/arch/x86/include/asm/xen/hypervisor.h index 66d0fff1ee84..125f344f06a9 100644 --- a/arch/x86/include/asm/xen/hypervisor.h +++ b/arch/x86/include/asm/xen/hypervisor.h | |||
@@ -33,7 +33,6 @@ | |||
33 | #ifndef _ASM_X86_XEN_HYPERVISOR_H | 33 | #ifndef _ASM_X86_XEN_HYPERVISOR_H |
34 | #define _ASM_X86_XEN_HYPERVISOR_H | 34 | #define _ASM_X86_XEN_HYPERVISOR_H |
35 | 35 | ||
36 | /* arch/i386/kernel/setup.c */ | ||
37 | extern struct shared_info *HYPERVISOR_shared_info; | 36 | extern struct shared_info *HYPERVISOR_shared_info; |
38 | extern struct start_info *xen_start_info; | 37 | extern struct start_info *xen_start_info; |
39 | 38 | ||
diff --git a/arch/x86/include/asm/xen/interface.h b/arch/x86/include/asm/xen/interface.h index 6d2f75a82a14..54d52ff1304a 100644 --- a/arch/x86/include/asm/xen/interface.h +++ b/arch/x86/include/asm/xen/interface.h | |||
@@ -51,14 +51,14 @@ | |||
51 | * with Xen so that on ARM we can have one ABI that works for 32 and 64 | 51 | * with Xen so that on ARM we can have one ABI that works for 32 and 64 |
52 | * bit guests. */ | 52 | * bit guests. */ |
53 | typedef unsigned long xen_pfn_t; | 53 | typedef unsigned long xen_pfn_t; |
54 | #define PRI_xen_pfn "lx" | ||
54 | typedef unsigned long xen_ulong_t; | 55 | typedef unsigned long xen_ulong_t; |
56 | #define PRI_xen_ulong "lx" | ||
55 | /* Guest handles for primitive C types. */ | 57 | /* Guest handles for primitive C types. */ |
56 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); | 58 | __DEFINE_GUEST_HANDLE(uchar, unsigned char); |
57 | __DEFINE_GUEST_HANDLE(uint, unsigned int); | 59 | __DEFINE_GUEST_HANDLE(uint, unsigned int); |
58 | __DEFINE_GUEST_HANDLE(ulong, unsigned long); | ||
59 | DEFINE_GUEST_HANDLE(char); | 60 | DEFINE_GUEST_HANDLE(char); |
60 | DEFINE_GUEST_HANDLE(int); | 61 | DEFINE_GUEST_HANDLE(int); |
61 | DEFINE_GUEST_HANDLE(long); | ||
62 | DEFINE_GUEST_HANDLE(void); | 62 | DEFINE_GUEST_HANDLE(void); |
63 | DEFINE_GUEST_HANDLE(uint64_t); | 63 | DEFINE_GUEST_HANDLE(uint64_t); |
64 | DEFINE_GUEST_HANDLE(uint32_t); | 64 | DEFINE_GUEST_HANDLE(uint32_t); |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index c265593ec2cd..1817fa911024 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -2257,6 +2257,9 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void) | |||
2257 | continue; | 2257 | continue; |
2258 | 2258 | ||
2259 | cfg = irq_cfg(irq); | 2259 | cfg = irq_cfg(irq); |
2260 | if (!cfg) | ||
2261 | continue; | ||
2262 | |||
2260 | raw_spin_lock(&desc->lock); | 2263 | raw_spin_lock(&desc->lock); |
2261 | 2264 | ||
2262 | /* | 2265 | /* |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 3373f84d1397..4a3374e61a93 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -208,12 +208,14 @@ static bool check_hw_exists(void) | |||
208 | } | 208 | } |
209 | 209 | ||
210 | /* | 210 | /* |
211 | * Now write a value and read it back to see if it matches, | 211 | * Read the current value, change it and read it back to see if it |
212 | * this is needed to detect certain hardware emulators (qemu/kvm) | 212 | * matches, this is needed to detect certain hardware emulators |
213 | * that don't trap on the MSR access and always return 0s. | 213 | * (qemu/kvm) that don't trap on the MSR access and always return 0s. |
214 | */ | 214 | */ |
215 | val = 0xabcdUL; | ||
216 | reg = x86_pmu_event_addr(0); | 215 | reg = x86_pmu_event_addr(0); |
216 | if (rdmsrl_safe(reg, &val)) | ||
217 | goto msr_fail; | ||
218 | val ^= 0xffffUL; | ||
217 | ret = wrmsrl_safe(reg, val); | 219 | ret = wrmsrl_safe(reg, val); |
218 | ret |= rdmsrl_safe(reg, &val_new); | 220 | ret |= rdmsrl_safe(reg, &val_new); |
219 | if (ret || val != val_new) | 221 | if (ret || val != val_new) |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_uncore.c b/arch/x86/kernel/cpu/perf_event_intel_uncore.c index 99d96a4978b5..3cf3d97cce3a 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_uncore.c +++ b/arch/x86/kernel/cpu/perf_event_intel_uncore.c | |||
@@ -118,22 +118,24 @@ static void snbep_uncore_pci_disable_box(struct intel_uncore_box *box) | |||
118 | { | 118 | { |
119 | struct pci_dev *pdev = box->pci_dev; | 119 | struct pci_dev *pdev = box->pci_dev; |
120 | int box_ctl = uncore_pci_box_ctl(box); | 120 | int box_ctl = uncore_pci_box_ctl(box); |
121 | u32 config; | 121 | u32 config = 0; |
122 | 122 | ||
123 | pci_read_config_dword(pdev, box_ctl, &config); | 123 | if (!pci_read_config_dword(pdev, box_ctl, &config)) { |
124 | config |= SNBEP_PMON_BOX_CTL_FRZ; | 124 | config |= SNBEP_PMON_BOX_CTL_FRZ; |
125 | pci_write_config_dword(pdev, box_ctl, config); | 125 | pci_write_config_dword(pdev, box_ctl, config); |
126 | } | ||
126 | } | 127 | } |
127 | 128 | ||
128 | static void snbep_uncore_pci_enable_box(struct intel_uncore_box *box) | 129 | static void snbep_uncore_pci_enable_box(struct intel_uncore_box *box) |
129 | { | 130 | { |
130 | struct pci_dev *pdev = box->pci_dev; | 131 | struct pci_dev *pdev = box->pci_dev; |
131 | int box_ctl = uncore_pci_box_ctl(box); | 132 | int box_ctl = uncore_pci_box_ctl(box); |
132 | u32 config; | 133 | u32 config = 0; |
133 | 134 | ||
134 | pci_read_config_dword(pdev, box_ctl, &config); | 135 | if (!pci_read_config_dword(pdev, box_ctl, &config)) { |
135 | config &= ~SNBEP_PMON_BOX_CTL_FRZ; | 136 | config &= ~SNBEP_PMON_BOX_CTL_FRZ; |
136 | pci_write_config_dword(pdev, box_ctl, config); | 137 | pci_write_config_dword(pdev, box_ctl, config); |
138 | } | ||
137 | } | 139 | } |
138 | 140 | ||
139 | static void snbep_uncore_pci_enable_event(struct intel_uncore_box *box, struct perf_event *event) | 141 | static void snbep_uncore_pci_enable_event(struct intel_uncore_box *box, struct perf_event *event) |
@@ -156,7 +158,7 @@ static u64 snbep_uncore_pci_read_counter(struct intel_uncore_box *box, struct pe | |||
156 | { | 158 | { |
157 | struct pci_dev *pdev = box->pci_dev; | 159 | struct pci_dev *pdev = box->pci_dev; |
158 | struct hw_perf_event *hwc = &event->hw; | 160 | struct hw_perf_event *hwc = &event->hw; |
159 | u64 count; | 161 | u64 count = 0; |
160 | 162 | ||
161 | pci_read_config_dword(pdev, hwc->event_base, (u32 *)&count); | 163 | pci_read_config_dword(pdev, hwc->event_base, (u32 *)&count); |
162 | pci_read_config_dword(pdev, hwc->event_base + 4, (u32 *)&count + 1); | 164 | pci_read_config_dword(pdev, hwc->event_base + 4, (u32 *)&count + 1); |
@@ -603,11 +605,12 @@ static struct pci_driver snbep_uncore_pci_driver = { | |||
603 | /* | 605 | /* |
604 | * build pci bus to socket mapping | 606 | * build pci bus to socket mapping |
605 | */ | 607 | */ |
606 | static void snbep_pci2phy_map_init(void) | 608 | static int snbep_pci2phy_map_init(void) |
607 | { | 609 | { |
608 | struct pci_dev *ubox_dev = NULL; | 610 | struct pci_dev *ubox_dev = NULL; |
609 | int i, bus, nodeid; | 611 | int i, bus, nodeid; |
610 | u32 config; | 612 | int err = 0; |
613 | u32 config = 0; | ||
611 | 614 | ||
612 | while (1) { | 615 | while (1) { |
613 | /* find the UBOX device */ | 616 | /* find the UBOX device */ |
@@ -618,10 +621,14 @@ static void snbep_pci2phy_map_init(void) | |||
618 | break; | 621 | break; |
619 | bus = ubox_dev->bus->number; | 622 | bus = ubox_dev->bus->number; |
620 | /* get the Node ID of the local register */ | 623 | /* get the Node ID of the local register */ |
621 | pci_read_config_dword(ubox_dev, 0x40, &config); | 624 | err = pci_read_config_dword(ubox_dev, 0x40, &config); |
625 | if (err) | ||
626 | break; | ||
622 | nodeid = config; | 627 | nodeid = config; |
623 | /* get the Node ID mapping */ | 628 | /* get the Node ID mapping */ |
624 | pci_read_config_dword(ubox_dev, 0x54, &config); | 629 | err = pci_read_config_dword(ubox_dev, 0x54, &config); |
630 | if (err) | ||
631 | break; | ||
625 | /* | 632 | /* |
626 | * every three bits in the Node ID mapping register maps | 633 | * every three bits in the Node ID mapping register maps |
627 | * to a particular node. | 634 | * to a particular node. |
@@ -633,7 +640,11 @@ static void snbep_pci2phy_map_init(void) | |||
633 | } | 640 | } |
634 | } | 641 | } |
635 | }; | 642 | }; |
636 | return; | 643 | |
644 | if (ubox_dev) | ||
645 | pci_dev_put(ubox_dev); | ||
646 | |||
647 | return err ? pcibios_err_to_errno(err) : 0; | ||
637 | } | 648 | } |
638 | /* end of Sandy Bridge-EP uncore support */ | 649 | /* end of Sandy Bridge-EP uncore support */ |
639 | 650 | ||
@@ -1547,7 +1558,6 @@ void nhmex_rbox_alter_er(struct intel_uncore_box *box, struct perf_event *event) | |||
1547 | { | 1558 | { |
1548 | struct hw_perf_event *hwc = &event->hw; | 1559 | struct hw_perf_event *hwc = &event->hw; |
1549 | struct hw_perf_event_extra *reg1 = &hwc->extra_reg; | 1560 | struct hw_perf_event_extra *reg1 = &hwc->extra_reg; |
1550 | int port; | ||
1551 | 1561 | ||
1552 | /* adjust the main event selector and extra register index */ | 1562 | /* adjust the main event selector and extra register index */ |
1553 | if (reg1->idx % 2) { | 1563 | if (reg1->idx % 2) { |
@@ -1559,7 +1569,6 @@ void nhmex_rbox_alter_er(struct intel_uncore_box *box, struct perf_event *event) | |||
1559 | } | 1569 | } |
1560 | 1570 | ||
1561 | /* adjust extra register config */ | 1571 | /* adjust extra register config */ |
1562 | port = reg1->idx / 6 + box->pmu->pmu_idx * 4; | ||
1563 | switch (reg1->idx % 6) { | 1572 | switch (reg1->idx % 6) { |
1564 | case 2: | 1573 | case 2: |
1565 | /* shift the 8~15 bits to the 0~7 bits */ | 1574 | /* shift the 8~15 bits to the 0~7 bits */ |
@@ -2578,9 +2587,11 @@ static int __init uncore_pci_init(void) | |||
2578 | 2587 | ||
2579 | switch (boot_cpu_data.x86_model) { | 2588 | switch (boot_cpu_data.x86_model) { |
2580 | case 45: /* Sandy Bridge-EP */ | 2589 | case 45: /* Sandy Bridge-EP */ |
2590 | ret = snbep_pci2phy_map_init(); | ||
2591 | if (ret) | ||
2592 | return ret; | ||
2581 | pci_uncores = snbep_pci_uncores; | 2593 | pci_uncores = snbep_pci_uncores; |
2582 | uncore_pci_driver = &snbep_uncore_pci_driver; | 2594 | uncore_pci_driver = &snbep_uncore_pci_driver; |
2583 | snbep_pci2phy_map_init(); | ||
2584 | break; | 2595 | break; |
2585 | default: | 2596 | default: |
2586 | return 0; | 2597 | return 0; |
@@ -2926,6 +2937,9 @@ static int __init intel_uncore_init(void) | |||
2926 | if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) | 2937 | if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL) |
2927 | return -ENODEV; | 2938 | return -ENODEV; |
2928 | 2939 | ||
2940 | if (cpu_has_hypervisor) | ||
2941 | return -ENODEV; | ||
2942 | |||
2929 | ret = uncore_pci_init(); | 2943 | ret = uncore_pci_init(); |
2930 | if (ret) | 2944 | if (ret) |
2931 | goto fail; | 2945 | goto fail; |
diff --git a/arch/x86/kernel/cpu/perf_event_knc.c b/arch/x86/kernel/cpu/perf_event_knc.c index 7c46bfdbc373..4b7731bf23a8 100644 --- a/arch/x86/kernel/cpu/perf_event_knc.c +++ b/arch/x86/kernel/cpu/perf_event_knc.c | |||
@@ -3,6 +3,8 @@ | |||
3 | #include <linux/perf_event.h> | 3 | #include <linux/perf_event.h> |
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | #include <asm/hardirq.h> | ||
7 | |||
6 | #include "perf_event.h" | 8 | #include "perf_event.h" |
7 | 9 | ||
8 | static const u64 knc_perfmon_event_map[] = | 10 | static const u64 knc_perfmon_event_map[] = |
@@ -173,30 +175,100 @@ static void knc_pmu_enable_all(int added) | |||
173 | static inline void | 175 | static inline void |
174 | knc_pmu_disable_event(struct perf_event *event) | 176 | knc_pmu_disable_event(struct perf_event *event) |
175 | { | 177 | { |
176 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
177 | struct hw_perf_event *hwc = &event->hw; | 178 | struct hw_perf_event *hwc = &event->hw; |
178 | u64 val; | 179 | u64 val; |
179 | 180 | ||
180 | val = hwc->config; | 181 | val = hwc->config; |
181 | if (cpuc->enabled) | 182 | val &= ~ARCH_PERFMON_EVENTSEL_ENABLE; |
182 | val &= ~ARCH_PERFMON_EVENTSEL_ENABLE; | ||
183 | 183 | ||
184 | (void)wrmsrl_safe(hwc->config_base + hwc->idx, val); | 184 | (void)wrmsrl_safe(hwc->config_base + hwc->idx, val); |
185 | } | 185 | } |
186 | 186 | ||
187 | static void knc_pmu_enable_event(struct perf_event *event) | 187 | static void knc_pmu_enable_event(struct perf_event *event) |
188 | { | 188 | { |
189 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
190 | struct hw_perf_event *hwc = &event->hw; | 189 | struct hw_perf_event *hwc = &event->hw; |
191 | u64 val; | 190 | u64 val; |
192 | 191 | ||
193 | val = hwc->config; | 192 | val = hwc->config; |
194 | if (cpuc->enabled) | 193 | val |= ARCH_PERFMON_EVENTSEL_ENABLE; |
195 | val |= ARCH_PERFMON_EVENTSEL_ENABLE; | ||
196 | 194 | ||
197 | (void)wrmsrl_safe(hwc->config_base + hwc->idx, val); | 195 | (void)wrmsrl_safe(hwc->config_base + hwc->idx, val); |
198 | } | 196 | } |
199 | 197 | ||
198 | static inline u64 knc_pmu_get_status(void) | ||
199 | { | ||
200 | u64 status; | ||
201 | |||
202 | rdmsrl(MSR_KNC_IA32_PERF_GLOBAL_STATUS, status); | ||
203 | |||
204 | return status; | ||
205 | } | ||
206 | |||
207 | static inline void knc_pmu_ack_status(u64 ack) | ||
208 | { | ||
209 | wrmsrl(MSR_KNC_IA32_PERF_GLOBAL_OVF_CONTROL, ack); | ||
210 | } | ||
211 | |||
212 | static int knc_pmu_handle_irq(struct pt_regs *regs) | ||
213 | { | ||
214 | struct perf_sample_data data; | ||
215 | struct cpu_hw_events *cpuc; | ||
216 | int handled = 0; | ||
217 | int bit, loops; | ||
218 | u64 status; | ||
219 | |||
220 | cpuc = &__get_cpu_var(cpu_hw_events); | ||
221 | |||
222 | knc_pmu_disable_all(); | ||
223 | |||
224 | status = knc_pmu_get_status(); | ||
225 | if (!status) { | ||
226 | knc_pmu_enable_all(0); | ||
227 | return handled; | ||
228 | } | ||
229 | |||
230 | loops = 0; | ||
231 | again: | ||
232 | knc_pmu_ack_status(status); | ||
233 | if (++loops > 100) { | ||
234 | WARN_ONCE(1, "perf: irq loop stuck!\n"); | ||
235 | perf_event_print_debug(); | ||
236 | goto done; | ||
237 | } | ||
238 | |||
239 | inc_irq_stat(apic_perf_irqs); | ||
240 | |||
241 | for_each_set_bit(bit, (unsigned long *)&status, X86_PMC_IDX_MAX) { | ||
242 | struct perf_event *event = cpuc->events[bit]; | ||
243 | |||
244 | handled++; | ||
245 | |||
246 | if (!test_bit(bit, cpuc->active_mask)) | ||
247 | continue; | ||
248 | |||
249 | if (!intel_pmu_save_and_restart(event)) | ||
250 | continue; | ||
251 | |||
252 | perf_sample_data_init(&data, 0, event->hw.last_period); | ||
253 | |||
254 | if (perf_event_overflow(event, &data, regs)) | ||
255 | x86_pmu_stop(event, 0); | ||
256 | } | ||
257 | |||
258 | /* | ||
259 | * Repeat if there is more work to be done: | ||
260 | */ | ||
261 | status = knc_pmu_get_status(); | ||
262 | if (status) | ||
263 | goto again; | ||
264 | |||
265 | done: | ||
266 | knc_pmu_enable_all(0); | ||
267 | |||
268 | return handled; | ||
269 | } | ||
270 | |||
271 | |||
200 | PMU_FORMAT_ATTR(event, "config:0-7" ); | 272 | PMU_FORMAT_ATTR(event, "config:0-7" ); |
201 | PMU_FORMAT_ATTR(umask, "config:8-15" ); | 273 | PMU_FORMAT_ATTR(umask, "config:8-15" ); |
202 | PMU_FORMAT_ATTR(edge, "config:18" ); | 274 | PMU_FORMAT_ATTR(edge, "config:18" ); |
@@ -214,7 +286,7 @@ static struct attribute *intel_knc_formats_attr[] = { | |||
214 | 286 | ||
215 | static __initconst struct x86_pmu knc_pmu = { | 287 | static __initconst struct x86_pmu knc_pmu = { |
216 | .name = "knc", | 288 | .name = "knc", |
217 | .handle_irq = x86_pmu_handle_irq, | 289 | .handle_irq = knc_pmu_handle_irq, |
218 | .disable_all = knc_pmu_disable_all, | 290 | .disable_all = knc_pmu_disable_all, |
219 | .enable_all = knc_pmu_enable_all, | 291 | .enable_all = knc_pmu_enable_all, |
220 | .enable = knc_pmu_enable_event, | 292 | .enable = knc_pmu_enable_event, |
@@ -226,12 +298,11 @@ static __initconst struct x86_pmu knc_pmu = { | |||
226 | .event_map = knc_pmu_event_map, | 298 | .event_map = knc_pmu_event_map, |
227 | .max_events = ARRAY_SIZE(knc_perfmon_event_map), | 299 | .max_events = ARRAY_SIZE(knc_perfmon_event_map), |
228 | .apic = 1, | 300 | .apic = 1, |
229 | .max_period = (1ULL << 31) - 1, | 301 | .max_period = (1ULL << 39) - 1, |
230 | .version = 0, | 302 | .version = 0, |
231 | .num_counters = 2, | 303 | .num_counters = 2, |
232 | /* in theory 40 bits, early silicon is buggy though */ | 304 | .cntval_bits = 40, |
233 | .cntval_bits = 32, | 305 | .cntval_mask = (1ULL << 40) - 1, |
234 | .cntval_mask = (1ULL << 32) - 1, | ||
235 | .get_event_constraints = x86_get_event_constraints, | 306 | .get_event_constraints = x86_get_event_constraints, |
236 | .event_constraints = knc_event_constraints, | 307 | .event_constraints = knc_event_constraints, |
237 | .format_attrs = intel_knc_formats_attr, | 308 | .format_attrs = intel_knc_formats_attr, |
diff --git a/arch/x86/kernel/cpu/perf_event_p6.c b/arch/x86/kernel/cpu/perf_event_p6.c index e4dd0f7a0453..7d0270bd793e 100644 --- a/arch/x86/kernel/cpu/perf_event_p6.c +++ b/arch/x86/kernel/cpu/perf_event_p6.c | |||
@@ -8,13 +8,106 @@ | |||
8 | */ | 8 | */ |
9 | static const u64 p6_perfmon_event_map[] = | 9 | static const u64 p6_perfmon_event_map[] = |
10 | { | 10 | { |
11 | [PERF_COUNT_HW_CPU_CYCLES] = 0x0079, | 11 | [PERF_COUNT_HW_CPU_CYCLES] = 0x0079, /* CPU_CLK_UNHALTED */ |
12 | [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, | 12 | [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, /* INST_RETIRED */ |
13 | [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0f2e, | 13 | [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0f2e, /* L2_RQSTS:M:E:S:I */ |
14 | [PERF_COUNT_HW_CACHE_MISSES] = 0x012e, | 14 | [PERF_COUNT_HW_CACHE_MISSES] = 0x012e, /* L2_RQSTS:I */ |
15 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4, | 15 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4, /* BR_INST_RETIRED */ |
16 | [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5, | 16 | [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5, /* BR_MISS_PRED_RETIRED */ |
17 | [PERF_COUNT_HW_BUS_CYCLES] = 0x0062, | 17 | [PERF_COUNT_HW_BUS_CYCLES] = 0x0062, /* BUS_DRDY_CLOCKS */ |
18 | [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00a2, /* RESOURCE_STALLS */ | ||
19 | |||
20 | }; | ||
21 | |||
22 | static __initconst u64 p6_hw_cache_event_ids | ||
23 | [PERF_COUNT_HW_CACHE_MAX] | ||
24 | [PERF_COUNT_HW_CACHE_OP_MAX] | ||
25 | [PERF_COUNT_HW_CACHE_RESULT_MAX] = | ||
26 | { | ||
27 | [ C(L1D) ] = { | ||
28 | [ C(OP_READ) ] = { | ||
29 | [ C(RESULT_ACCESS) ] = 0x0043, /* DATA_MEM_REFS */ | ||
30 | [ C(RESULT_MISS) ] = 0x0045, /* DCU_LINES_IN */ | ||
31 | }, | ||
32 | [ C(OP_WRITE) ] = { | ||
33 | [ C(RESULT_ACCESS) ] = 0, | ||
34 | [ C(RESULT_MISS) ] = 0x0f29, /* L2_LD:M:E:S:I */ | ||
35 | }, | ||
36 | [ C(OP_PREFETCH) ] = { | ||
37 | [ C(RESULT_ACCESS) ] = 0, | ||
38 | [ C(RESULT_MISS) ] = 0, | ||
39 | }, | ||
40 | }, | ||
41 | [ C(L1I ) ] = { | ||
42 | [ C(OP_READ) ] = { | ||
43 | [ C(RESULT_ACCESS) ] = 0x0080, /* IFU_IFETCH */ | ||
44 | [ C(RESULT_MISS) ] = 0x0f28, /* L2_IFETCH:M:E:S:I */ | ||
45 | }, | ||
46 | [ C(OP_WRITE) ] = { | ||
47 | [ C(RESULT_ACCESS) ] = -1, | ||
48 | [ C(RESULT_MISS) ] = -1, | ||
49 | }, | ||
50 | [ C(OP_PREFETCH) ] = { | ||
51 | [ C(RESULT_ACCESS) ] = 0, | ||
52 | [ C(RESULT_MISS) ] = 0, | ||
53 | }, | ||
54 | }, | ||
55 | [ C(LL ) ] = { | ||
56 | [ C(OP_READ) ] = { | ||
57 | [ C(RESULT_ACCESS) ] = 0, | ||
58 | [ C(RESULT_MISS) ] = 0, | ||
59 | }, | ||
60 | [ C(OP_WRITE) ] = { | ||
61 | [ C(RESULT_ACCESS) ] = 0, | ||
62 | [ C(RESULT_MISS) ] = 0x0025, /* L2_M_LINES_INM */ | ||
63 | }, | ||
64 | [ C(OP_PREFETCH) ] = { | ||
65 | [ C(RESULT_ACCESS) ] = 0, | ||
66 | [ C(RESULT_MISS) ] = 0, | ||
67 | }, | ||
68 | }, | ||
69 | [ C(DTLB) ] = { | ||
70 | [ C(OP_READ) ] = { | ||
71 | [ C(RESULT_ACCESS) ] = 0x0043, /* DATA_MEM_REFS */ | ||
72 | [ C(RESULT_MISS) ] = 0, | ||
73 | }, | ||
74 | [ C(OP_WRITE) ] = { | ||
75 | [ C(RESULT_ACCESS) ] = 0, | ||
76 | [ C(RESULT_MISS) ] = 0, | ||
77 | }, | ||
78 | [ C(OP_PREFETCH) ] = { | ||
79 | [ C(RESULT_ACCESS) ] = 0, | ||
80 | [ C(RESULT_MISS) ] = 0, | ||
81 | }, | ||
82 | }, | ||
83 | [ C(ITLB) ] = { | ||
84 | [ C(OP_READ) ] = { | ||
85 | [ C(RESULT_ACCESS) ] = 0x0080, /* IFU_IFETCH */ | ||
86 | [ C(RESULT_MISS) ] = 0x0085, /* ITLB_MISS */ | ||
87 | }, | ||
88 | [ C(OP_WRITE) ] = { | ||
89 | [ C(RESULT_ACCESS) ] = -1, | ||
90 | [ C(RESULT_MISS) ] = -1, | ||
91 | }, | ||
92 | [ C(OP_PREFETCH) ] = { | ||
93 | [ C(RESULT_ACCESS) ] = -1, | ||
94 | [ C(RESULT_MISS) ] = -1, | ||
95 | }, | ||
96 | }, | ||
97 | [ C(BPU ) ] = { | ||
98 | [ C(OP_READ) ] = { | ||
99 | [ C(RESULT_ACCESS) ] = 0x00c4, /* BR_INST_RETIRED */ | ||
100 | [ C(RESULT_MISS) ] = 0x00c5, /* BR_MISS_PRED_RETIRED */ | ||
101 | }, | ||
102 | [ C(OP_WRITE) ] = { | ||
103 | [ C(RESULT_ACCESS) ] = -1, | ||
104 | [ C(RESULT_MISS) ] = -1, | ||
105 | }, | ||
106 | [ C(OP_PREFETCH) ] = { | ||
107 | [ C(RESULT_ACCESS) ] = -1, | ||
108 | [ C(RESULT_MISS) ] = -1, | ||
109 | }, | ||
110 | }, | ||
18 | }; | 111 | }; |
19 | 112 | ||
20 | static u64 p6_pmu_event_map(int hw_event) | 113 | static u64 p6_pmu_event_map(int hw_event) |
@@ -34,7 +127,7 @@ static struct event_constraint p6_event_constraints[] = | |||
34 | { | 127 | { |
35 | INTEL_EVENT_CONSTRAINT(0xc1, 0x1), /* FLOPS */ | 128 | INTEL_EVENT_CONSTRAINT(0xc1, 0x1), /* FLOPS */ |
36 | INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */ | 129 | INTEL_EVENT_CONSTRAINT(0x10, 0x1), /* FP_COMP_OPS_EXE */ |
37 | INTEL_EVENT_CONSTRAINT(0x11, 0x1), /* FP_ASSIST */ | 130 | INTEL_EVENT_CONSTRAINT(0x11, 0x2), /* FP_ASSIST */ |
38 | INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */ | 131 | INTEL_EVENT_CONSTRAINT(0x12, 0x2), /* MUL */ |
39 | INTEL_EVENT_CONSTRAINT(0x13, 0x2), /* DIV */ | 132 | INTEL_EVENT_CONSTRAINT(0x13, 0x2), /* DIV */ |
40 | INTEL_EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */ | 133 | INTEL_EVENT_CONSTRAINT(0x14, 0x1), /* CYCLES_DIV_BUSY */ |
@@ -64,25 +157,25 @@ static void p6_pmu_enable_all(int added) | |||
64 | static inline void | 157 | static inline void |
65 | p6_pmu_disable_event(struct perf_event *event) | 158 | p6_pmu_disable_event(struct perf_event *event) |
66 | { | 159 | { |
67 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
68 | struct hw_perf_event *hwc = &event->hw; | 160 | struct hw_perf_event *hwc = &event->hw; |
69 | u64 val = P6_NOP_EVENT; | 161 | u64 val = P6_NOP_EVENT; |
70 | 162 | ||
71 | if (cpuc->enabled) | ||
72 | val |= ARCH_PERFMON_EVENTSEL_ENABLE; | ||
73 | |||
74 | (void)wrmsrl_safe(hwc->config_base, val); | 163 | (void)wrmsrl_safe(hwc->config_base, val); |
75 | } | 164 | } |
76 | 165 | ||
77 | static void p6_pmu_enable_event(struct perf_event *event) | 166 | static void p6_pmu_enable_event(struct perf_event *event) |
78 | { | 167 | { |
79 | struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); | ||
80 | struct hw_perf_event *hwc = &event->hw; | 168 | struct hw_perf_event *hwc = &event->hw; |
81 | u64 val; | 169 | u64 val; |
82 | 170 | ||
83 | val = hwc->config; | 171 | val = hwc->config; |
84 | if (cpuc->enabled) | 172 | |
85 | val |= ARCH_PERFMON_EVENTSEL_ENABLE; | 173 | /* |
174 | * p6 only has a global event enable, set on PerfEvtSel0 | ||
175 | * We "disable" events by programming P6_NOP_EVENT | ||
176 | * and we rely on p6_pmu_enable_all() being called | ||
177 | * to actually enable the events. | ||
178 | */ | ||
86 | 179 | ||
87 | (void)wrmsrl_safe(hwc->config_base, val); | 180 | (void)wrmsrl_safe(hwc->config_base, val); |
88 | } | 181 | } |
@@ -158,5 +251,9 @@ __init int p6_pmu_init(void) | |||
158 | 251 | ||
159 | x86_pmu = p6_pmu; | 252 | x86_pmu = p6_pmu; |
160 | 253 | ||
254 | memcpy(hw_cache_event_ids, p6_hw_cache_event_ids, | ||
255 | sizeof(hw_cache_event_ids)); | ||
256 | |||
257 | |||
161 | return 0; | 258 | return 0; |
162 | } | 259 | } |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index ed858e9e9a74..df06ade26bef 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -1077,6 +1077,9 @@ void __init memblock_x86_fill(void) | |||
1077 | memblock_add(ei->addr, ei->size); | 1077 | memblock_add(ei->addr, ei->size); |
1078 | } | 1078 | } |
1079 | 1079 | ||
1080 | /* throw away partial pages */ | ||
1081 | memblock_trim_memory(PAGE_SIZE); | ||
1082 | |||
1080 | memblock_dump_all(); | 1083 | memblock_dump_all(); |
1081 | } | 1084 | } |
1082 | 1085 | ||
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index a1193aef6d7d..88b725aa1d52 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1035,7 +1035,7 @@ ENTRY(xen_sysenter_target) | |||
1035 | 1035 | ||
1036 | ENTRY(xen_hypervisor_callback) | 1036 | ENTRY(xen_hypervisor_callback) |
1037 | CFI_STARTPROC | 1037 | CFI_STARTPROC |
1038 | pushl_cfi $0 | 1038 | pushl_cfi $-1 /* orig_ax = -1 => not a system call */ |
1039 | SAVE_ALL | 1039 | SAVE_ALL |
1040 | TRACE_IRQS_OFF | 1040 | TRACE_IRQS_OFF |
1041 | 1041 | ||
@@ -1077,14 +1077,16 @@ ENTRY(xen_failsafe_callback) | |||
1077 | 2: mov 8(%esp),%es | 1077 | 2: mov 8(%esp),%es |
1078 | 3: mov 12(%esp),%fs | 1078 | 3: mov 12(%esp),%fs |
1079 | 4: mov 16(%esp),%gs | 1079 | 4: mov 16(%esp),%gs |
1080 | /* EAX == 0 => Category 1 (Bad segment) | ||
1081 | EAX != 0 => Category 2 (Bad IRET) */ | ||
1080 | testl %eax,%eax | 1082 | testl %eax,%eax |
1081 | popl_cfi %eax | 1083 | popl_cfi %eax |
1082 | lea 16(%esp),%esp | 1084 | lea 16(%esp),%esp |
1083 | CFI_ADJUST_CFA_OFFSET -16 | 1085 | CFI_ADJUST_CFA_OFFSET -16 |
1084 | jz 5f | 1086 | jz 5f |
1085 | addl $16,%esp | 1087 | addl $16,%esp |
1086 | jmp iret_exc # EAX != 0 => Category 2 (Bad IRET) | 1088 | jmp iret_exc |
1087 | 5: pushl_cfi $0 # EAX == 0 => Category 1 (Bad segment) | 1089 | 5: pushl_cfi $-1 /* orig_ax = -1 => not a system call */ |
1088 | SAVE_ALL | 1090 | SAVE_ALL |
1089 | jmp ret_from_exception | 1091 | jmp ret_from_exception |
1090 | CFI_ENDPROC | 1092 | CFI_ENDPROC |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 0c58952d64e8..b51b2c7ee51f 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -1435,7 +1435,7 @@ ENTRY(xen_failsafe_callback) | |||
1435 | CFI_RESTORE r11 | 1435 | CFI_RESTORE r11 |
1436 | addq $0x30,%rsp | 1436 | addq $0x30,%rsp |
1437 | CFI_ADJUST_CFA_OFFSET -0x30 | 1437 | CFI_ADJUST_CFA_OFFSET -0x30 |
1438 | pushq_cfi $0 | 1438 | pushq_cfi $-1 /* orig_ax = -1 => not a system call */ |
1439 | SAVE_ALL | 1439 | SAVE_ALL |
1440 | jmp error_exit | 1440 | jmp error_exit |
1441 | CFI_ENDPROC | 1441 | CFI_ENDPROC |
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index b3e5e51bc907..4180a874c764 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c | |||
@@ -247,7 +247,10 @@ do_async_page_fault(struct pt_regs *regs, unsigned long error_code) | |||
247 | break; | 247 | break; |
248 | case KVM_PV_REASON_PAGE_NOT_PRESENT: | 248 | case KVM_PV_REASON_PAGE_NOT_PRESENT: |
249 | /* page is swapped out by the host. */ | 249 | /* page is swapped out by the host. */ |
250 | rcu_irq_enter(); | ||
251 | exit_idle(); | ||
250 | kvm_async_pf_task_wait((u32)read_cr2()); | 252 | kvm_async_pf_task_wait((u32)read_cr2()); |
253 | rcu_irq_exit(); | ||
251 | break; | 254 | break; |
252 | case KVM_PV_REASON_PAGE_READY: | 255 | case KVM_PV_REASON_PAGE_READY: |
253 | rcu_irq_enter(); | 256 | rcu_irq_enter(); |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 468e98dfd44e..ca45696f30fb 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -921,18 +921,19 @@ void __init setup_arch(char **cmdline_p) | |||
921 | #ifdef CONFIG_X86_64 | 921 | #ifdef CONFIG_X86_64 |
922 | if (max_pfn > max_low_pfn) { | 922 | if (max_pfn > max_low_pfn) { |
923 | int i; | 923 | int i; |
924 | for (i = 0; i < e820.nr_map; i++) { | 924 | unsigned long start, end; |
925 | struct e820entry *ei = &e820.map[i]; | 925 | unsigned long start_pfn, end_pfn; |
926 | 926 | ||
927 | if (ei->addr + ei->size <= 1UL << 32) | 927 | for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, |
928 | continue; | 928 | NULL) { |
929 | 929 | ||
930 | if (ei->type == E820_RESERVED) | 930 | end = PFN_PHYS(end_pfn); |
931 | if (end <= (1UL<<32)) | ||
931 | continue; | 932 | continue; |
932 | 933 | ||
934 | start = PFN_PHYS(start_pfn); | ||
933 | max_pfn_mapped = init_memory_mapping( | 935 | max_pfn_mapped = init_memory_mapping( |
934 | ei->addr < 1UL << 32 ? 1UL << 32 : ei->addr, | 936 | max((1UL<<32), start), end); |
935 | ei->addr + ei->size); | ||
936 | } | 937 | } |
937 | 938 | ||
938 | /* can we preseve max_low_pfn ?*/ | 939 | /* can we preseve max_low_pfn ?*/ |
@@ -1048,6 +1049,18 @@ void __init setup_arch(char **cmdline_p) | |||
1048 | arch_init_ideal_nops(); | 1049 | arch_init_ideal_nops(); |
1049 | 1050 | ||
1050 | register_refined_jiffies(CLOCK_TICK_RATE); | 1051 | register_refined_jiffies(CLOCK_TICK_RATE); |
1052 | |||
1053 | #ifdef CONFIG_EFI | ||
1054 | /* Once setup is done above, disable efi_enabled on mismatched | ||
1055 | * firmware/kernel archtectures since there is no support for | ||
1056 | * runtime services. | ||
1057 | */ | ||
1058 | if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) { | ||
1059 | pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); | ||
1060 | efi_unmap_memmap(); | ||
1061 | efi_enabled = 0; | ||
1062 | } | ||
1063 | #endif | ||
1051 | } | 1064 | } |
1052 | 1065 | ||
1053 | #ifdef CONFIG_X86_32 | 1066 | #ifdef CONFIG_X86_32 |
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 29ad351804e9..70b27ee6118e 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c | |||
@@ -824,10 +824,8 @@ do_notify_resume(struct pt_regs *regs, void *unused, __u32 thread_info_flags) | |||
824 | mce_notify_process(); | 824 | mce_notify_process(); |
825 | #endif /* CONFIG_X86_64 && CONFIG_X86_MCE */ | 825 | #endif /* CONFIG_X86_64 && CONFIG_X86_MCE */ |
826 | 826 | ||
827 | if (thread_info_flags & _TIF_UPROBE) { | 827 | if (thread_info_flags & _TIF_UPROBE) |
828 | clear_thread_flag(TIF_UPROBE); | ||
829 | uprobe_notify_resume(regs); | 828 | uprobe_notify_resume(regs); |
830 | } | ||
831 | 829 | ||
832 | /* deal with pending signal delivery */ | 830 | /* deal with pending signal delivery */ |
833 | if (thread_info_flags & _TIF_SIGPENDING) | 831 | if (thread_info_flags & _TIF_SIGPENDING) |
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 9538f00827a9..aafa5557b396 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c | |||
@@ -651,31 +651,19 @@ void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) | |||
651 | 651 | ||
652 | /* | 652 | /* |
653 | * Skip these instructions as per the currently known x86 ISA. | 653 | * Skip these instructions as per the currently known x86 ISA. |
654 | * 0x66* { 0x90 | 0x0f 0x1f | 0x0f 0x19 | 0x87 0xc0 } | 654 | * rep=0x66*; nop=0x90 |
655 | */ | 655 | */ |
656 | static bool __skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) | 656 | static bool __skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) |
657 | { | 657 | { |
658 | int i; | 658 | int i; |
659 | 659 | ||
660 | for (i = 0; i < MAX_UINSN_BYTES; i++) { | 660 | for (i = 0; i < MAX_UINSN_BYTES; i++) { |
661 | if ((auprobe->insn[i] == 0x66)) | 661 | if (auprobe->insn[i] == 0x66) |
662 | continue; | 662 | continue; |
663 | 663 | ||
664 | if (auprobe->insn[i] == 0x90) | 664 | if (auprobe->insn[i] == 0x90) |
665 | return true; | 665 | return true; |
666 | 666 | ||
667 | if (i == (MAX_UINSN_BYTES - 1)) | ||
668 | break; | ||
669 | |||
670 | if ((auprobe->insn[i] == 0x0f) && (auprobe->insn[i+1] == 0x1f)) | ||
671 | return true; | ||
672 | |||
673 | if ((auprobe->insn[i] == 0x0f) && (auprobe->insn[i+1] == 0x19)) | ||
674 | return true; | ||
675 | |||
676 | if ((auprobe->insn[i] == 0x87) && (auprobe->insn[i+1] == 0xc0)) | ||
677 | return true; | ||
678 | |||
679 | break; | 667 | break; |
680 | } | 668 | } |
681 | return false; | 669 | return false; |
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index c6e6b721b6ee..43e9fadca5d0 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c | |||
@@ -1311,7 +1311,7 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value) | |||
1311 | vcpu->arch.apic_base = value; | 1311 | vcpu->arch.apic_base = value; |
1312 | if (apic_x2apic_mode(apic)) { | 1312 | if (apic_x2apic_mode(apic)) { |
1313 | u32 id = kvm_apic_id(apic); | 1313 | u32 id = kvm_apic_id(apic); |
1314 | u32 ldr = ((id & ~0xf) << 16) | (1 << (id & 0xf)); | 1314 | u32 ldr = ((id >> 4) << 16) | (1 << (id & 0xf)); |
1315 | kvm_apic_set_ldr(apic, ldr); | 1315 | kvm_apic_set_ldr(apic, ldr); |
1316 | } | 1316 | } |
1317 | apic->base_address = apic->vcpu->arch.apic_base & | 1317 | apic->base_address = apic->vcpu->arch.apic_base & |
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d289fee1ffb8..6f85fe0bf958 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -2497,8 +2497,7 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *sptep, | |||
2497 | } | 2497 | } |
2498 | } | 2498 | } |
2499 | 2499 | ||
2500 | if (!is_error_pfn(pfn)) | 2500 | kvm_release_pfn_clean(pfn); |
2501 | kvm_release_pfn_clean(pfn); | ||
2502 | } | 2501 | } |
2503 | 2502 | ||
2504 | static void nonpaging_new_cr3(struct kvm_vcpu *vcpu) | 2503 | static void nonpaging_new_cr3(struct kvm_vcpu *vcpu) |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 1eefebe5d727..224a7e78cb6c 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -3779,7 +3779,7 @@ static int write_exit_mmio(struct kvm_vcpu *vcpu, gpa_t gpa, | |||
3779 | { | 3779 | { |
3780 | struct kvm_mmio_fragment *frag = &vcpu->mmio_fragments[0]; | 3780 | struct kvm_mmio_fragment *frag = &vcpu->mmio_fragments[0]; |
3781 | 3781 | ||
3782 | memcpy(vcpu->run->mmio.data, frag->data, frag->len); | 3782 | memcpy(vcpu->run->mmio.data, frag->data, min(8u, frag->len)); |
3783 | return X86EMUL_CONTINUE; | 3783 | return X86EMUL_CONTINUE; |
3784 | } | 3784 | } |
3785 | 3785 | ||
@@ -3832,18 +3832,11 @@ mmio: | |||
3832 | bytes -= handled; | 3832 | bytes -= handled; |
3833 | val += handled; | 3833 | val += handled; |
3834 | 3834 | ||
3835 | while (bytes) { | 3835 | WARN_ON(vcpu->mmio_nr_fragments >= KVM_MAX_MMIO_FRAGMENTS); |
3836 | unsigned now = min(bytes, 8U); | 3836 | frag = &vcpu->mmio_fragments[vcpu->mmio_nr_fragments++]; |
3837 | 3837 | frag->gpa = gpa; | |
3838 | frag = &vcpu->mmio_fragments[vcpu->mmio_nr_fragments++]; | 3838 | frag->data = val; |
3839 | frag->gpa = gpa; | 3839 | frag->len = bytes; |
3840 | frag->data = val; | ||
3841 | frag->len = now; | ||
3842 | |||
3843 | gpa += now; | ||
3844 | val += now; | ||
3845 | bytes -= now; | ||
3846 | } | ||
3847 | return X86EMUL_CONTINUE; | 3840 | return X86EMUL_CONTINUE; |
3848 | } | 3841 | } |
3849 | 3842 | ||
@@ -3890,7 +3883,7 @@ int emulator_read_write(struct x86_emulate_ctxt *ctxt, unsigned long addr, | |||
3890 | vcpu->mmio_needed = 1; | 3883 | vcpu->mmio_needed = 1; |
3891 | vcpu->mmio_cur_fragment = 0; | 3884 | vcpu->mmio_cur_fragment = 0; |
3892 | 3885 | ||
3893 | vcpu->run->mmio.len = vcpu->mmio_fragments[0].len; | 3886 | vcpu->run->mmio.len = min(8u, vcpu->mmio_fragments[0].len); |
3894 | vcpu->run->mmio.is_write = vcpu->mmio_is_write = ops->write; | 3887 | vcpu->run->mmio.is_write = vcpu->mmio_is_write = ops->write; |
3895 | vcpu->run->exit_reason = KVM_EXIT_MMIO; | 3888 | vcpu->run->exit_reason = KVM_EXIT_MMIO; |
3896 | vcpu->run->mmio.phys_addr = gpa; | 3889 | vcpu->run->mmio.phys_addr = gpa; |
@@ -5522,28 +5515,44 @@ static int complete_emulated_pio(struct kvm_vcpu *vcpu) | |||
5522 | * | 5515 | * |
5523 | * read: | 5516 | * read: |
5524 | * for each fragment | 5517 | * for each fragment |
5525 | * write gpa, len | 5518 | * for each mmio piece in the fragment |
5526 | * exit | 5519 | * write gpa, len |
5527 | * copy data | 5520 | * exit |
5521 | * copy data | ||
5528 | * execute insn | 5522 | * execute insn |
5529 | * | 5523 | * |
5530 | * write: | 5524 | * write: |
5531 | * for each fragment | 5525 | * for each fragment |
5532 | * write gpa, len | 5526 | * for each mmio piece in the fragment |
5533 | * copy data | 5527 | * write gpa, len |
5534 | * exit | 5528 | * copy data |
5529 | * exit | ||
5535 | */ | 5530 | */ |
5536 | static int complete_emulated_mmio(struct kvm_vcpu *vcpu) | 5531 | static int complete_emulated_mmio(struct kvm_vcpu *vcpu) |
5537 | { | 5532 | { |
5538 | struct kvm_run *run = vcpu->run; | 5533 | struct kvm_run *run = vcpu->run; |
5539 | struct kvm_mmio_fragment *frag; | 5534 | struct kvm_mmio_fragment *frag; |
5535 | unsigned len; | ||
5540 | 5536 | ||
5541 | BUG_ON(!vcpu->mmio_needed); | 5537 | BUG_ON(!vcpu->mmio_needed); |
5542 | 5538 | ||
5543 | /* Complete previous fragment */ | 5539 | /* Complete previous fragment */ |
5544 | frag = &vcpu->mmio_fragments[vcpu->mmio_cur_fragment++]; | 5540 | frag = &vcpu->mmio_fragments[vcpu->mmio_cur_fragment]; |
5541 | len = min(8u, frag->len); | ||
5545 | if (!vcpu->mmio_is_write) | 5542 | if (!vcpu->mmio_is_write) |
5546 | memcpy(frag->data, run->mmio.data, frag->len); | 5543 | memcpy(frag->data, run->mmio.data, len); |
5544 | |||
5545 | if (frag->len <= 8) { | ||
5546 | /* Switch to the next fragment. */ | ||
5547 | frag++; | ||
5548 | vcpu->mmio_cur_fragment++; | ||
5549 | } else { | ||
5550 | /* Go forward to the next mmio piece. */ | ||
5551 | frag->data += len; | ||
5552 | frag->gpa += len; | ||
5553 | frag->len -= len; | ||
5554 | } | ||
5555 | |||
5547 | if (vcpu->mmio_cur_fragment == vcpu->mmio_nr_fragments) { | 5556 | if (vcpu->mmio_cur_fragment == vcpu->mmio_nr_fragments) { |
5548 | vcpu->mmio_needed = 0; | 5557 | vcpu->mmio_needed = 0; |
5549 | if (vcpu->mmio_is_write) | 5558 | if (vcpu->mmio_is_write) |
@@ -5551,13 +5560,12 @@ static int complete_emulated_mmio(struct kvm_vcpu *vcpu) | |||
5551 | vcpu->mmio_read_completed = 1; | 5560 | vcpu->mmio_read_completed = 1; |
5552 | return complete_emulated_io(vcpu); | 5561 | return complete_emulated_io(vcpu); |
5553 | } | 5562 | } |
5554 | /* Initiate next fragment */ | 5563 | |
5555 | ++frag; | ||
5556 | run->exit_reason = KVM_EXIT_MMIO; | 5564 | run->exit_reason = KVM_EXIT_MMIO; |
5557 | run->mmio.phys_addr = frag->gpa; | 5565 | run->mmio.phys_addr = frag->gpa; |
5558 | if (vcpu->mmio_is_write) | 5566 | if (vcpu->mmio_is_write) |
5559 | memcpy(run->mmio.data, frag->data, frag->len); | 5567 | memcpy(run->mmio.data, frag->data, min(8u, frag->len)); |
5560 | run->mmio.len = frag->len; | 5568 | run->mmio.len = min(8u, frag->len); |
5561 | run->mmio.is_write = vcpu->mmio_is_write; | 5569 | run->mmio.is_write = vcpu->mmio_is_write; |
5562 | vcpu->arch.complete_userspace_io = complete_emulated_mmio; | 5570 | vcpu->arch.complete_userspace_io = complete_emulated_mmio; |
5563 | return 0; | 5571 | return 0; |
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c index ab1f6a93b527..d7aea41563b3 100644 --- a/arch/x86/mm/init.c +++ b/arch/x86/mm/init.c | |||
@@ -35,40 +35,44 @@ struct map_range { | |||
35 | unsigned page_size_mask; | 35 | unsigned page_size_mask; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | static void __init find_early_table_space(struct map_range *mr, unsigned long end, | 38 | /* |
39 | int use_pse, int use_gbpages) | 39 | * First calculate space needed for kernel direct mapping page tables to cover |
40 | * mr[0].start to mr[nr_range - 1].end, while accounting for possible 2M and 1GB | ||
41 | * pages. Then find enough contiguous space for those page tables. | ||
42 | */ | ||
43 | static void __init find_early_table_space(struct map_range *mr, int nr_range) | ||
40 | { | 44 | { |
41 | unsigned long puds, pmds, ptes, tables, start = 0, good_end = end; | 45 | int i; |
46 | unsigned long puds = 0, pmds = 0, ptes = 0, tables; | ||
47 | unsigned long start = 0, good_end; | ||
42 | phys_addr_t base; | 48 | phys_addr_t base; |
43 | 49 | ||
44 | puds = (end + PUD_SIZE - 1) >> PUD_SHIFT; | 50 | for (i = 0; i < nr_range; i++) { |
45 | tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); | 51 | unsigned long range, extra; |
46 | |||
47 | if (use_gbpages) { | ||
48 | unsigned long extra; | ||
49 | |||
50 | extra = end - ((end>>PUD_SHIFT) << PUD_SHIFT); | ||
51 | pmds = (extra + PMD_SIZE - 1) >> PMD_SHIFT; | ||
52 | } else | ||
53 | pmds = (end + PMD_SIZE - 1) >> PMD_SHIFT; | ||
54 | 52 | ||
55 | tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); | 53 | range = mr[i].end - mr[i].start; |
54 | puds += (range + PUD_SIZE - 1) >> PUD_SHIFT; | ||
56 | 55 | ||
57 | if (use_pse) { | 56 | if (mr[i].page_size_mask & (1 << PG_LEVEL_1G)) { |
58 | unsigned long extra; | 57 | extra = range - ((range >> PUD_SHIFT) << PUD_SHIFT); |
58 | pmds += (extra + PMD_SIZE - 1) >> PMD_SHIFT; | ||
59 | } else { | ||
60 | pmds += (range + PMD_SIZE - 1) >> PMD_SHIFT; | ||
61 | } | ||
59 | 62 | ||
60 | extra = end - ((end>>PMD_SHIFT) << PMD_SHIFT); | 63 | if (mr[i].page_size_mask & (1 << PG_LEVEL_2M)) { |
64 | extra = range - ((range >> PMD_SHIFT) << PMD_SHIFT); | ||
61 | #ifdef CONFIG_X86_32 | 65 | #ifdef CONFIG_X86_32 |
62 | extra += PMD_SIZE; | 66 | extra += PMD_SIZE; |
63 | #endif | 67 | #endif |
64 | /* The first 2/4M doesn't use large pages. */ | 68 | ptes += (extra + PAGE_SIZE - 1) >> PAGE_SHIFT; |
65 | if (mr->start < PMD_SIZE) | 69 | } else { |
66 | extra += mr->end - mr->start; | 70 | ptes += (range + PAGE_SIZE - 1) >> PAGE_SHIFT; |
67 | 71 | } | |
68 | ptes = (extra + PAGE_SIZE - 1) >> PAGE_SHIFT; | 72 | } |
69 | } else | ||
70 | ptes = (end + PAGE_SIZE - 1) >> PAGE_SHIFT; | ||
71 | 73 | ||
74 | tables = roundup(puds * sizeof(pud_t), PAGE_SIZE); | ||
75 | tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE); | ||
72 | tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE); | 76 | tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE); |
73 | 77 | ||
74 | #ifdef CONFIG_X86_32 | 78 | #ifdef CONFIG_X86_32 |
@@ -86,7 +90,7 @@ static void __init find_early_table_space(struct map_range *mr, unsigned long en | |||
86 | pgt_buf_top = pgt_buf_start + (tables >> PAGE_SHIFT); | 90 | pgt_buf_top = pgt_buf_start + (tables >> PAGE_SHIFT); |
87 | 91 | ||
88 | printk(KERN_DEBUG "kernel direct mapping tables up to %#lx @ [mem %#010lx-%#010lx]\n", | 92 | printk(KERN_DEBUG "kernel direct mapping tables up to %#lx @ [mem %#010lx-%#010lx]\n", |
89 | end - 1, pgt_buf_start << PAGE_SHIFT, | 93 | mr[nr_range - 1].end - 1, pgt_buf_start << PAGE_SHIFT, |
90 | (pgt_buf_top << PAGE_SHIFT) - 1); | 94 | (pgt_buf_top << PAGE_SHIFT) - 1); |
91 | } | 95 | } |
92 | 96 | ||
@@ -267,7 +271,7 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
267 | * nodes are discovered. | 271 | * nodes are discovered. |
268 | */ | 272 | */ |
269 | if (!after_bootmem) | 273 | if (!after_bootmem) |
270 | find_early_table_space(&mr[0], end, use_pse, use_gbpages); | 274 | find_early_table_space(mr, nr_range); |
271 | 275 | ||
272 | for (i = 0; i < nr_range; i++) | 276 | for (i = 0; i < nr_range; i++) |
273 | ret = kernel_physical_mapping_init(mr[i].start, mr[i].end, | 277 | ret = kernel_physical_mapping_init(mr[i].start, mr[i].end, |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 2b6b4a3c8beb..3baff255adac 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -386,7 +386,8 @@ phys_pte_init(pte_t *pte_page, unsigned long addr, unsigned long end, | |||
386 | * these mappings are more intelligent. | 386 | * these mappings are more intelligent. |
387 | */ | 387 | */ |
388 | if (pte_val(*pte)) { | 388 | if (pte_val(*pte)) { |
389 | pages++; | 389 | if (!after_bootmem) |
390 | pages++; | ||
390 | continue; | 391 | continue; |
391 | } | 392 | } |
392 | 393 | ||
@@ -451,6 +452,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end, | |||
451 | * attributes. | 452 | * attributes. |
452 | */ | 453 | */ |
453 | if (page_size_mask & (1 << PG_LEVEL_2M)) { | 454 | if (page_size_mask & (1 << PG_LEVEL_2M)) { |
455 | if (!after_bootmem) | ||
456 | pages++; | ||
454 | last_map_addr = next; | 457 | last_map_addr = next; |
455 | continue; | 458 | continue; |
456 | } | 459 | } |
@@ -526,6 +529,8 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end, | |||
526 | * attributes. | 529 | * attributes. |
527 | */ | 530 | */ |
528 | if (page_size_mask & (1 << PG_LEVEL_1G)) { | 531 | if (page_size_mask & (1 << PG_LEVEL_1G)) { |
532 | if (!after_bootmem) | ||
533 | pages++; | ||
529 | last_map_addr = next; | 534 | last_map_addr = next; |
530 | continue; | 535 | continue; |
531 | } | 536 | } |
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 26b8a8514ee5..48768df2471a 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -55,7 +55,7 @@ u64 op_x86_get_ctrl(struct op_x86_model_spec const *model, | |||
55 | val |= counter_config->extra; | 55 | val |= counter_config->extra; |
56 | event &= model->event_mask ? model->event_mask : 0xFF; | 56 | event &= model->event_mask ? model->event_mask : 0xFF; |
57 | val |= event & 0xFF; | 57 | val |= event & 0xFF; |
58 | val |= (event & 0x0F00) << 24; | 58 | val |= (u64)(event & 0x0F00) << 24; |
59 | 59 | ||
60 | return val; | 60 | return val; |
61 | } | 61 | } |
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index aded2a91162a..ad4439145f85 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c | |||
@@ -70,11 +70,15 @@ EXPORT_SYMBOL(efi); | |||
70 | struct efi_memory_map memmap; | 70 | struct efi_memory_map memmap; |
71 | 71 | ||
72 | bool efi_64bit; | 72 | bool efi_64bit; |
73 | static bool efi_native; | ||
74 | 73 | ||
75 | static struct efi efi_phys __initdata; | 74 | static struct efi efi_phys __initdata; |
76 | static efi_system_table_t efi_systab __initdata; | 75 | static efi_system_table_t efi_systab __initdata; |
77 | 76 | ||
77 | static inline bool efi_is_native(void) | ||
78 | { | ||
79 | return IS_ENABLED(CONFIG_X86_64) == efi_64bit; | ||
80 | } | ||
81 | |||
78 | static int __init setup_noefi(char *arg) | 82 | static int __init setup_noefi(char *arg) |
79 | { | 83 | { |
80 | efi_enabled = 0; | 84 | efi_enabled = 0; |
@@ -420,7 +424,7 @@ void __init efi_reserve_boot_services(void) | |||
420 | } | 424 | } |
421 | } | 425 | } |
422 | 426 | ||
423 | static void __init efi_unmap_memmap(void) | 427 | void __init efi_unmap_memmap(void) |
424 | { | 428 | { |
425 | if (memmap.map) { | 429 | if (memmap.map) { |
426 | early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); | 430 | early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size); |
@@ -432,7 +436,7 @@ void __init efi_free_boot_services(void) | |||
432 | { | 436 | { |
433 | void *p; | 437 | void *p; |
434 | 438 | ||
435 | if (!efi_native) | 439 | if (!efi_is_native()) |
436 | return; | 440 | return; |
437 | 441 | ||
438 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { | 442 | for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) { |
@@ -684,12 +688,10 @@ void __init efi_init(void) | |||
684 | return; | 688 | return; |
685 | } | 689 | } |
686 | efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab; | 690 | efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab; |
687 | efi_native = !efi_64bit; | ||
688 | #else | 691 | #else |
689 | efi_phys.systab = (efi_system_table_t *) | 692 | efi_phys.systab = (efi_system_table_t *) |
690 | (boot_params.efi_info.efi_systab | | 693 | (boot_params.efi_info.efi_systab | |
691 | ((__u64)boot_params.efi_info.efi_systab_hi<<32)); | 694 | ((__u64)boot_params.efi_info.efi_systab_hi<<32)); |
692 | efi_native = efi_64bit; | ||
693 | #endif | 695 | #endif |
694 | 696 | ||
695 | if (efi_systab_init(efi_phys.systab)) { | 697 | if (efi_systab_init(efi_phys.systab)) { |
@@ -723,7 +725,7 @@ void __init efi_init(void) | |||
723 | * that doesn't match the kernel 32/64-bit mode. | 725 | * that doesn't match the kernel 32/64-bit mode. |
724 | */ | 726 | */ |
725 | 727 | ||
726 | if (!efi_native) | 728 | if (!efi_is_native()) |
727 | pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); | 729 | pr_info("No EFI runtime due to 32/64-bit mismatch with kernel\n"); |
728 | else if (efi_runtime_init()) { | 730 | else if (efi_runtime_init()) { |
729 | efi_enabled = 0; | 731 | efi_enabled = 0; |
@@ -735,7 +737,7 @@ void __init efi_init(void) | |||
735 | return; | 737 | return; |
736 | } | 738 | } |
737 | #ifdef CONFIG_X86_32 | 739 | #ifdef CONFIG_X86_32 |
738 | if (efi_native) { | 740 | if (efi_is_native()) { |
739 | x86_platform.get_wallclock = efi_get_time; | 741 | x86_platform.get_wallclock = efi_get_time; |
740 | x86_platform.set_wallclock = efi_set_rtc_mmss; | 742 | x86_platform.set_wallclock = efi_set_rtc_mmss; |
741 | } | 743 | } |
@@ -810,6 +812,16 @@ void __iomem *efi_lookup_mapped_addr(u64 phys_addr) | |||
810 | return NULL; | 812 | return NULL; |
811 | } | 813 | } |
812 | 814 | ||
815 | void efi_memory_uc(u64 addr, unsigned long size) | ||
816 | { | ||
817 | unsigned long page_shift = 1UL << EFI_PAGE_SHIFT; | ||
818 | u64 npages; | ||
819 | |||
820 | npages = round_up(size, page_shift) / page_shift; | ||
821 | memrange_efi_to_native(&addr, &npages); | ||
822 | set_memory_uc(addr, npages); | ||
823 | } | ||
824 | |||
813 | /* | 825 | /* |
814 | * This function will switch the EFI runtime services to virtual mode. | 826 | * This function will switch the EFI runtime services to virtual mode. |
815 | * Essentially, look through the EFI memmap and map every region that | 827 | * Essentially, look through the EFI memmap and map every region that |
@@ -823,7 +835,7 @@ void __init efi_enter_virtual_mode(void) | |||
823 | efi_memory_desc_t *md, *prev_md = NULL; | 835 | efi_memory_desc_t *md, *prev_md = NULL; |
824 | efi_status_t status; | 836 | efi_status_t status; |
825 | unsigned long size; | 837 | unsigned long size; |
826 | u64 end, systab, addr, npages, end_pfn; | 838 | u64 end, systab, end_pfn; |
827 | void *p, *va, *new_memmap = NULL; | 839 | void *p, *va, *new_memmap = NULL; |
828 | int count = 0; | 840 | int count = 0; |
829 | 841 | ||
@@ -834,7 +846,7 @@ void __init efi_enter_virtual_mode(void) | |||
834 | * non-native EFI | 846 | * non-native EFI |
835 | */ | 847 | */ |
836 | 848 | ||
837 | if (!efi_native) { | 849 | if (!efi_is_native()) { |
838 | efi_unmap_memmap(); | 850 | efi_unmap_memmap(); |
839 | return; | 851 | return; |
840 | } | 852 | } |
@@ -879,10 +891,14 @@ void __init efi_enter_virtual_mode(void) | |||
879 | end_pfn = PFN_UP(end); | 891 | end_pfn = PFN_UP(end); |
880 | if (end_pfn <= max_low_pfn_mapped | 892 | if (end_pfn <= max_low_pfn_mapped |
881 | || (end_pfn > (1UL << (32 - PAGE_SHIFT)) | 893 | || (end_pfn > (1UL << (32 - PAGE_SHIFT)) |
882 | && end_pfn <= max_pfn_mapped)) | 894 | && end_pfn <= max_pfn_mapped)) { |
883 | va = __va(md->phys_addr); | 895 | va = __va(md->phys_addr); |
884 | else | 896 | |
885 | va = efi_ioremap(md->phys_addr, size, md->type); | 897 | if (!(md->attribute & EFI_MEMORY_WB)) |
898 | efi_memory_uc((u64)(unsigned long)va, size); | ||
899 | } else | ||
900 | va = efi_ioremap(md->phys_addr, size, | ||
901 | md->type, md->attribute); | ||
886 | 902 | ||
887 | md->virt_addr = (u64) (unsigned long) va; | 903 | md->virt_addr = (u64) (unsigned long) va; |
888 | 904 | ||
@@ -892,13 +908,6 @@ void __init efi_enter_virtual_mode(void) | |||
892 | continue; | 908 | continue; |
893 | } | 909 | } |
894 | 910 | ||
895 | if (!(md->attribute & EFI_MEMORY_WB)) { | ||
896 | addr = md->virt_addr; | ||
897 | npages = md->num_pages; | ||
898 | memrange_efi_to_native(&addr, &npages); | ||
899 | set_memory_uc(addr, npages); | ||
900 | } | ||
901 | |||
902 | systab = (u64) (unsigned long) efi_phys.systab; | 911 | systab = (u64) (unsigned long) efi_phys.systab; |
903 | if (md->phys_addr <= systab && systab < end) { | 912 | if (md->phys_addr <= systab && systab < end) { |
904 | systab += md->virt_addr - md->phys_addr; | 913 | systab += md->virt_addr - md->phys_addr; |
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c index ac3aa54e2654..95fd505dfeb6 100644 --- a/arch/x86/platform/efi/efi_64.c +++ b/arch/x86/platform/efi/efi_64.c | |||
@@ -82,7 +82,7 @@ void __init efi_call_phys_epilog(void) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, | 84 | void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, |
85 | u32 type) | 85 | u32 type, u64 attribute) |
86 | { | 86 | { |
87 | unsigned long last_map_pfn; | 87 | unsigned long last_map_pfn; |
88 | 88 | ||
@@ -92,8 +92,11 @@ void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, | |||
92 | last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); | 92 | last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); |
93 | if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) { | 93 | if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) { |
94 | unsigned long top = last_map_pfn << PAGE_SHIFT; | 94 | unsigned long top = last_map_pfn << PAGE_SHIFT; |
95 | efi_ioremap(top, size - (top - phys_addr), type); | 95 | efi_ioremap(top, size - (top - phys_addr), type, attribute); |
96 | } | 96 | } |
97 | 97 | ||
98 | if (!(attribute & EFI_MEMORY_WB)) | ||
99 | efi_memory_uc((u64)(unsigned long)__va(phys_addr), size); | ||
100 | |||
98 | return (void __iomem *)__va(phys_addr); | 101 | return (void __iomem *)__va(phys_addr); |
99 | } | 102 | } |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index e3497f240eab..586d83812b67 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -81,8 +81,6 @@ | |||
81 | #include "smp.h" | 81 | #include "smp.h" |
82 | #include "multicalls.h" | 82 | #include "multicalls.h" |
83 | 83 | ||
84 | #include <xen/events.h> | ||
85 | |||
86 | EXPORT_SYMBOL_GPL(hypercall_page); | 84 | EXPORT_SYMBOL_GPL(hypercall_page); |
87 | 85 | ||
88 | DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); | 86 | DEFINE_PER_CPU(struct vcpu_info *, xen_vcpu); |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index 6226c99729b9..dcf5f2dd91ec 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
@@ -1288,6 +1288,25 @@ unsigned long xen_read_cr2_direct(void) | |||
1288 | return this_cpu_read(xen_vcpu_info.arch.cr2); | 1288 | return this_cpu_read(xen_vcpu_info.arch.cr2); |
1289 | } | 1289 | } |
1290 | 1290 | ||
1291 | void xen_flush_tlb_all(void) | ||
1292 | { | ||
1293 | struct mmuext_op *op; | ||
1294 | struct multicall_space mcs; | ||
1295 | |||
1296 | trace_xen_mmu_flush_tlb_all(0); | ||
1297 | |||
1298 | preempt_disable(); | ||
1299 | |||
1300 | mcs = xen_mc_entry(sizeof(*op)); | ||
1301 | |||
1302 | op = mcs.args; | ||
1303 | op->cmd = MMUEXT_TLB_FLUSH_ALL; | ||
1304 | MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); | ||
1305 | |||
1306 | xen_mc_issue(PARAVIRT_LAZY_MMU); | ||
1307 | |||
1308 | preempt_enable(); | ||
1309 | } | ||
1291 | static void xen_flush_tlb(void) | 1310 | static void xen_flush_tlb(void) |
1292 | { | 1311 | { |
1293 | struct mmuext_op *op; | 1312 | struct mmuext_op *op; |
@@ -2518,7 +2537,7 @@ int xen_remap_domain_mfn_range(struct vm_area_struct *vma, | |||
2518 | err = 0; | 2537 | err = 0; |
2519 | out: | 2538 | out: |
2520 | 2539 | ||
2521 | flush_tlb_all(); | 2540 | xen_flush_tlb_all(); |
2522 | 2541 | ||
2523 | return err; | 2542 | return err; |
2524 | } | 2543 | } |
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index cdcb48adee4c..0d1f36a22c98 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -13,6 +13,8 @@ config XTENSA | |||
13 | select GENERIC_CPU_DEVICES | 13 | select GENERIC_CPU_DEVICES |
14 | select MODULES_USE_ELF_RELA | 14 | select MODULES_USE_ELF_RELA |
15 | select GENERIC_PCI_IOMAP | 15 | select GENERIC_PCI_IOMAP |
16 | select GENERIC_KERNEL_THREAD | ||
17 | select GENERIC_KERNEL_EXECVE | ||
16 | select ARCH_WANT_OPTIONAL_GPIOLIB | 18 | select ARCH_WANT_OPTIONAL_GPIOLIB |
17 | help | 19 | help |
18 | Xtensa processors are 32-bit RISC machines designed by Tensilica | 20 | Xtensa processors are 32-bit RISC machines designed by Tensilica |
diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/include/asm/io.h index e6be5b9091c2..700c2e6f2d25 100644 --- a/arch/xtensa/include/asm/io.h +++ b/arch/xtensa/include/asm/io.h | |||
@@ -62,6 +62,10 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size) | |||
62 | static inline void iounmap(volatile void __iomem *addr) | 62 | static inline void iounmap(volatile void __iomem *addr) |
63 | { | 63 | { |
64 | } | 64 | } |
65 | |||
66 | #define virt_to_bus virt_to_phys | ||
67 | #define bus_to_virt phys_to_virt | ||
68 | |||
65 | #endif /* CONFIG_MMU */ | 69 | #endif /* CONFIG_MMU */ |
66 | 70 | ||
67 | /* | 71 | /* |
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h index 5c371d8d4528..2d630e7399ca 100644 --- a/arch/xtensa/include/asm/processor.h +++ b/arch/xtensa/include/asm/processor.h | |||
@@ -152,6 +152,7 @@ struct thread_struct { | |||
152 | 152 | ||
153 | /* Clearing a0 terminates the backtrace. */ | 153 | /* Clearing a0 terminates the backtrace. */ |
154 | #define start_thread(regs, new_pc, new_sp) \ | 154 | #define start_thread(regs, new_pc, new_sp) \ |
155 | memset(regs, 0, sizeof(*regs)); \ | ||
155 | regs->pc = new_pc; \ | 156 | regs->pc = new_pc; \ |
156 | regs->ps = USER_PS_VALUE; \ | 157 | regs->ps = USER_PS_VALUE; \ |
157 | regs->areg[1] = new_sp; \ | 158 | regs->areg[1] = new_sp; \ |
@@ -168,9 +169,6 @@ struct mm_struct; | |||
168 | /* Free all resources held by a thread. */ | 169 | /* Free all resources held by a thread. */ |
169 | #define release_thread(thread) do { } while(0) | 170 | #define release_thread(thread) do { } while(0) |
170 | 171 | ||
171 | /* Create a kernel thread without removing it from tasklists */ | ||
172 | extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); | ||
173 | |||
174 | /* Copy and release all segment info associated with a VM */ | 172 | /* Copy and release all segment info associated with a VM */ |
175 | #define copy_segments(p, mm) do { } while(0) | 173 | #define copy_segments(p, mm) do { } while(0) |
176 | #define release_segments(mm) do { } while(0) | 174 | #define release_segments(mm) do { } while(0) |
diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/asm/syscall.h index c1dacca312f3..124aeee0d381 100644 --- a/arch/xtensa/include/asm/syscall.h +++ b/arch/xtensa/include/asm/syscall.h | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | struct pt_regs; | 11 | struct pt_regs; |
12 | struct sigaction; | 12 | struct sigaction; |
13 | asmlinkage long xtensa_execve(char*, char**, char**, struct pt_regs*); | 13 | asmlinkage long sys_execve(char*, char**, char**, struct pt_regs*); |
14 | asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*); | 14 | asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*); |
15 | asmlinkage long xtensa_ptrace(long, long, long, long); | 15 | asmlinkage long xtensa_ptrace(long, long, long, long); |
16 | asmlinkage long xtensa_sigreturn(struct pt_regs*); | 16 | asmlinkage long xtensa_sigreturn(struct pt_regs*); |
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h index 9ef1c31d2c83..f4e6eaa40d1c 100644 --- a/arch/xtensa/include/asm/unistd.h +++ b/arch/xtensa/include/asm/unistd.h | |||
@@ -1,16 +1,9 @@ | |||
1 | /* | 1 | #ifndef _XTENSA_UNISTD_H |
2 | * include/asm-xtensa/unistd.h | 2 | #define _XTENSA_UNISTD_H |
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2005 Tensilica Inc. | ||
9 | */ | ||
10 | 3 | ||
4 | #define __ARCH_WANT_SYS_EXECVE | ||
11 | #include <uapi/asm/unistd.h> | 5 | #include <uapi/asm/unistd.h> |
12 | 6 | ||
13 | |||
14 | /* | 7 | /* |
15 | * "Conditional" syscalls | 8 | * "Conditional" syscalls |
16 | * | 9 | * |
@@ -37,3 +30,5 @@ | |||
37 | #define __IGNORE_mmap /* use mmap2 */ | 30 | #define __IGNORE_mmap /* use mmap2 */ |
38 | #define __IGNORE_vfork /* use clone */ | 31 | #define __IGNORE_vfork /* use clone */ |
39 | #define __IGNORE_fadvise64 /* use fadvise64_64 */ | 32 | #define __IGNORE_fadvise64 /* use fadvise64_64 */ |
33 | |||
34 | #endif /* _XTENSA_UNISTD_H */ | ||
diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h index 479abaea5aae..9f36d0e3e0ac 100644 --- a/arch/xtensa/include/uapi/asm/unistd.h +++ b/arch/xtensa/include/uapi/asm/unistd.h | |||
@@ -1,14 +1,4 @@ | |||
1 | /* | 1 | #if !defined(_UAPI_XTENSA_UNISTD_H) || defined(__SYSCALL) |
2 | * include/asm-xtensa/unistd.h | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file "COPYING" in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright (C) 2001 - 2012 Tensilica Inc. | ||
9 | */ | ||
10 | |||
11 | #ifndef _UAPI_XTENSA_UNISTD_H | ||
12 | #define _UAPI_XTENSA_UNISTD_H | 2 | #define _UAPI_XTENSA_UNISTD_H |
13 | 3 | ||
14 | #ifndef __SYSCALL | 4 | #ifndef __SYSCALL |
@@ -272,7 +262,7 @@ __SYSCALL(115, sys_sendmmsg, 4) | |||
272 | #define __NR_clone 116 | 262 | #define __NR_clone 116 |
273 | __SYSCALL(116, xtensa_clone, 5) | 263 | __SYSCALL(116, xtensa_clone, 5) |
274 | #define __NR_execve 117 | 264 | #define __NR_execve 117 |
275 | __SYSCALL(117, xtensa_execve, 3) | 265 | __SYSCALL(117, sys_execve, 3) |
276 | #define __NR_exit 118 | 266 | #define __NR_exit 118 |
277 | __SYSCALL(118, sys_exit, 1) | 267 | __SYSCALL(118, sys_exit, 1) |
278 | #define __NR_exit_group 119 | 268 | #define __NR_exit_group 119 |
@@ -759,4 +749,6 @@ __SYSCALL(331, sys_kcmp, 5) | |||
759 | 749 | ||
760 | #define SYS_XTENSA_COUNT 5 /* count */ | 750 | #define SYS_XTENSA_COUNT 5 /* count */ |
761 | 751 | ||
752 | #undef __SYSCALL | ||
753 | |||
762 | #endif /* _UAPI_XTENSA_UNISTD_H */ | 754 | #endif /* _UAPI_XTENSA_UNISTD_H */ |
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 18453067c258..90bfc1dbc13d 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S | |||
@@ -1833,50 +1833,6 @@ ENTRY(system_call) | |||
1833 | 1833 | ||
1834 | 1834 | ||
1835 | /* | 1835 | /* |
1836 | * Create a kernel thread | ||
1837 | * | ||
1838 | * int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) | ||
1839 | * a2 a2 a3 a4 | ||
1840 | */ | ||
1841 | |||
1842 | ENTRY(kernel_thread) | ||
1843 | entry a1, 16 | ||
1844 | |||
1845 | mov a5, a2 # preserve fn over syscall | ||
1846 | mov a7, a3 # preserve args over syscall | ||
1847 | |||
1848 | movi a3, _CLONE_VM | _CLONE_UNTRACED | ||
1849 | movi a2, __NR_clone | ||
1850 | or a6, a4, a3 # arg0: flags | ||
1851 | mov a3, a1 # arg1: sp | ||
1852 | syscall | ||
1853 | |||
1854 | beq a3, a1, 1f # branch if parent | ||
1855 | mov a6, a7 # args | ||
1856 | callx4 a5 # fn(args) | ||
1857 | |||
1858 | movi a2, __NR_exit | ||
1859 | syscall # return value of fn(args) still in a6 | ||
1860 | |||
1861 | 1: retw | ||
1862 | |||
1863 | /* | ||
1864 | * Do a system call from kernel instead of calling sys_execve, so we end up | ||
1865 | * with proper pt_regs. | ||
1866 | * | ||
1867 | * int kernel_execve(const char *fname, char *const argv[], charg *const envp[]) | ||
1868 | * a2 a2 a3 a4 | ||
1869 | */ | ||
1870 | |||
1871 | ENTRY(kernel_execve) | ||
1872 | entry a1, 16 | ||
1873 | mov a6, a2 # arg0 is in a6 | ||
1874 | movi a2, __NR_execve | ||
1875 | syscall | ||
1876 | |||
1877 | retw | ||
1878 | |||
1879 | /* | ||
1880 | * Task switch. | 1836 | * Task switch. |
1881 | * | 1837 | * |
1882 | * struct task* _switch_to (struct task* prev, struct task* next) | 1838 | * struct task* _switch_to (struct task* prev, struct task* next) |
@@ -1958,3 +1914,16 @@ ENTRY(ret_from_fork) | |||
1958 | 1914 | ||
1959 | j common_exception_return | 1915 | j common_exception_return |
1960 | 1916 | ||
1917 | /* | ||
1918 | * Kernel thread creation helper | ||
1919 | * On entry, set up by copy_thread: a2 = thread_fn, a3 = thread_fn arg | ||
1920 | * left from _switch_to: a6 = prev | ||
1921 | */ | ||
1922 | ENTRY(ret_from_kernel_thread) | ||
1923 | |||
1924 | call4 schedule_tail | ||
1925 | mov a6, a3 | ||
1926 | callx4 a2 | ||
1927 | j common_exception_return | ||
1928 | |||
1929 | ENDPROC(ret_from_kernel_thread) | ||
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index 1908f6642d31..09ae7bfab9a7 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <asm/regs.h> | 45 | #include <asm/regs.h> |
46 | 46 | ||
47 | extern void ret_from_fork(void); | 47 | extern void ret_from_fork(void); |
48 | extern void ret_from_kernel_thread(void); | ||
48 | 49 | ||
49 | struct task_struct *current_set[NR_CPUS] = {&init_task, }; | 50 | struct task_struct *current_set[NR_CPUS] = {&init_task, }; |
50 | 51 | ||
@@ -158,18 +159,30 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
158 | /* | 159 | /* |
159 | * Copy thread. | 160 | * Copy thread. |
160 | * | 161 | * |
162 | * There are two modes in which this function is called: | ||
163 | * 1) Userspace thread creation, | ||
164 | * regs != NULL, usp_thread_fn is userspace stack pointer. | ||
165 | * It is expected to copy parent regs (in case CLONE_VM is not set | ||
166 | * in the clone_flags) and set up passed usp in the childregs. | ||
167 | * 2) Kernel thread creation, | ||
168 | * regs == NULL, usp_thread_fn is the function to run in the new thread | ||
169 | * and thread_fn_arg is its parameter. | ||
170 | * childregs are not used for the kernel threads. | ||
171 | * | ||
161 | * The stack layout for the new thread looks like this: | 172 | * The stack layout for the new thread looks like this: |
162 | * | 173 | * |
163 | * +------------------------+ <- sp in childregs (= tos) | 174 | * +------------------------+ |
164 | * | childregs | | 175 | * | childregs | |
165 | * +------------------------+ <- thread.sp = sp in dummy-frame | 176 | * +------------------------+ <- thread.sp = sp in dummy-frame |
166 | * | dummy-frame | (saved in dummy-frame spill-area) | 177 | * | dummy-frame | (saved in dummy-frame spill-area) |
167 | * +------------------------+ | 178 | * +------------------------+ |
168 | * | 179 | * |
169 | * We create a dummy frame to return to ret_from_fork: | 180 | * We create a dummy frame to return to either ret_from_fork or |
170 | * a0 points to ret_from_fork (simulating a call4) | 181 | * ret_from_kernel_thread: |
182 | * a0 points to ret_from_fork/ret_from_kernel_thread (simulating a call4) | ||
171 | * sp points to itself (thread.sp) | 183 | * sp points to itself (thread.sp) |
172 | * a2, a3 are unused. | 184 | * a2, a3 are unused for userspace threads, |
185 | * a2 points to thread_fn, a3 holds thread_fn arg for kernel threads. | ||
173 | * | 186 | * |
174 | * Note: This is a pristine frame, so we don't need any spill region on top of | 187 | * Note: This is a pristine frame, so we don't need any spill region on top of |
175 | * childregs. | 188 | * childregs. |
@@ -185,43 +198,63 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
185 | * involved. Much simpler to just not copy those live frames across. | 198 | * involved. Much simpler to just not copy those live frames across. |
186 | */ | 199 | */ |
187 | 200 | ||
188 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 201 | int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn, |
189 | unsigned long unused, | 202 | unsigned long thread_fn_arg, |
190 | struct task_struct * p, struct pt_regs * regs) | 203 | struct task_struct *p, struct pt_regs *unused) |
191 | { | 204 | { |
192 | struct pt_regs *childregs; | 205 | struct pt_regs *childregs = task_pt_regs(p); |
193 | unsigned long tos; | ||
194 | int user_mode = user_mode(regs); | ||
195 | 206 | ||
196 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) | 207 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) |
197 | struct thread_info *ti; | 208 | struct thread_info *ti; |
198 | #endif | 209 | #endif |
199 | 210 | ||
200 | /* Set up new TSS. */ | ||
201 | tos = (unsigned long)task_stack_page(p) + THREAD_SIZE; | ||
202 | if (user_mode) | ||
203 | childregs = (struct pt_regs*)(tos - PT_USER_SIZE); | ||
204 | else | ||
205 | childregs = (struct pt_regs*)tos - 1; | ||
206 | |||
207 | /* This does not copy all the regs. In a bout of brilliance or madness, | ||
208 | ARs beyond a0-a15 exist past the end of the struct. */ | ||
209 | *childregs = *regs; | ||
210 | |||
211 | /* Create a call4 dummy-frame: a0 = 0, a1 = childregs. */ | 211 | /* Create a call4 dummy-frame: a0 = 0, a1 = childregs. */ |
212 | *((int*)childregs - 3) = (unsigned long)childregs; | 212 | *((int*)childregs - 3) = (unsigned long)childregs; |
213 | *((int*)childregs - 4) = 0; | 213 | *((int*)childregs - 4) = 0; |
214 | 214 | ||
215 | childregs->areg[2] = 0; | ||
216 | p->set_child_tid = p->clear_child_tid = NULL; | ||
217 | p->thread.ra = MAKE_RA_FOR_CALL((unsigned long)ret_from_fork, 0x1); | ||
218 | p->thread.sp = (unsigned long)childregs; | 215 | p->thread.sp = (unsigned long)childregs; |
219 | 216 | ||
220 | if (user_mode(regs)) { | 217 | if (!(p->flags & PF_KTHREAD)) { |
218 | struct pt_regs *regs = current_pt_regs(); | ||
219 | unsigned long usp = usp_thread_fn ? | ||
220 | usp_thread_fn : regs->areg[1]; | ||
221 | 221 | ||
222 | p->thread.ra = MAKE_RA_FOR_CALL( | ||
223 | (unsigned long)ret_from_fork, 0x1); | ||
224 | |||
225 | /* This does not copy all the regs. | ||
226 | * In a bout of brilliance or madness, | ||
227 | * ARs beyond a0-a15 exist past the end of the struct. | ||
228 | */ | ||
229 | *childregs = *regs; | ||
222 | childregs->areg[1] = usp; | 230 | childregs->areg[1] = usp; |
231 | childregs->areg[2] = 0; | ||
232 | |||
233 | /* When sharing memory with the parent thread, the child | ||
234 | usually starts on a pristine stack, so we have to reset | ||
235 | windowbase, windowstart and wmask. | ||
236 | (Note that such a new thread is required to always create | ||
237 | an initial call4 frame) | ||
238 | The exception is vfork, where the new thread continues to | ||
239 | run on the parent's stack until it calls execve. This could | ||
240 | be a call8 or call12, which requires a legal stack frame | ||
241 | of the previous caller for the overflow handlers to work. | ||
242 | (Note that it's always legal to overflow live registers). | ||
243 | In this case, ensure to spill at least the stack pointer | ||
244 | of that frame. */ | ||
245 | |||
223 | if (clone_flags & CLONE_VM) { | 246 | if (clone_flags & CLONE_VM) { |
224 | childregs->wmask = 1; /* can't share live windows */ | 247 | /* check that caller window is live and same stack */ |
248 | int len = childregs->wmask & ~0xf; | ||
249 | if (regs->areg[1] == usp && len != 0) { | ||
250 | int callinc = (regs->areg[0] >> 30) & 3; | ||
251 | int caller_ars = XCHAL_NUM_AREGS - callinc * 4; | ||
252 | put_user(regs->areg[caller_ars+1], | ||
253 | (unsigned __user*)(usp - 12)); | ||
254 | } | ||
255 | childregs->wmask = 1; | ||
256 | childregs->windowstart = 1; | ||
257 | childregs->windowbase = 0; | ||
225 | } else { | 258 | } else { |
226 | int len = childregs->wmask & ~0xf; | 259 | int len = childregs->wmask & ~0xf; |
227 | memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4], | 260 | memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4], |
@@ -230,11 +263,19 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
230 | // FIXME: we need to set THREADPTR in thread_info... | 263 | // FIXME: we need to set THREADPTR in thread_info... |
231 | if (clone_flags & CLONE_SETTLS) | 264 | if (clone_flags & CLONE_SETTLS) |
232 | childregs->areg[2] = childregs->areg[6]; | 265 | childregs->areg[2] = childregs->areg[6]; |
233 | |||
234 | } else { | 266 | } else { |
235 | /* In kernel space, we start a new thread with a new stack. */ | 267 | p->thread.ra = MAKE_RA_FOR_CALL( |
236 | childregs->wmask = 1; | 268 | (unsigned long)ret_from_kernel_thread, 1); |
237 | childregs->areg[1] = tos; | 269 | |
270 | /* pass parameters to ret_from_kernel_thread: | ||
271 | * a2 = thread_fn, a3 = thread_fn arg | ||
272 | */ | ||
273 | *((int *)childregs - 1) = thread_fn_arg; | ||
274 | *((int *)childregs - 2) = usp_thread_fn; | ||
275 | |||
276 | /* Childregs are only used when we're going to userspace | ||
277 | * in which case start_thread will set them up. | ||
278 | */ | ||
238 | } | 279 | } |
239 | 280 | ||
240 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) | 281 | #if (XTENSA_HAVE_COPROCESSORS || XTENSA_HAVE_IO_PORTS) |
@@ -330,32 +371,5 @@ long xtensa_clone(unsigned long clone_flags, unsigned long newsp, | |||
330 | void __user *child_tid, long a5, | 371 | void __user *child_tid, long a5, |
331 | struct pt_regs *regs) | 372 | struct pt_regs *regs) |
332 | { | 373 | { |
333 | if (!newsp) | ||
334 | newsp = regs->areg[1]; | ||
335 | return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); | 374 | return do_fork(clone_flags, newsp, regs, 0, parent_tid, child_tid); |
336 | } | 375 | } |
337 | |||
338 | /* | ||
339 | * xtensa_execve() executes a new program. | ||
340 | */ | ||
341 | |||
342 | asmlinkage | ||
343 | long xtensa_execve(const char __user *name, | ||
344 | const char __user *const __user *argv, | ||
345 | const char __user *const __user *envp, | ||
346 | long a3, long a4, long a5, | ||
347 | struct pt_regs *regs) | ||
348 | { | ||
349 | long error; | ||
350 | struct filename *filename; | ||
351 | |||
352 | filename = getname(name); | ||
353 | error = PTR_ERR(filename); | ||
354 | if (IS_ERR(filename)) | ||
355 | goto out; | ||
356 | error = do_execve(filename->name, argv, envp, regs); | ||
357 | putname(filename); | ||
358 | out: | ||
359 | return error; | ||
360 | } | ||
361 | |||
diff --git a/arch/xtensa/kernel/syscall.c b/arch/xtensa/kernel/syscall.c index a5c01e74d5d5..5702065f472a 100644 --- a/arch/xtensa/kernel/syscall.c +++ b/arch/xtensa/kernel/syscall.c | |||
@@ -32,10 +32,8 @@ typedef void (*syscall_t)(void); | |||
32 | syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= { | 32 | syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= { |
33 | [0 ... __NR_syscall_count - 1] = (syscall_t)&sys_ni_syscall, | 33 | [0 ... __NR_syscall_count - 1] = (syscall_t)&sys_ni_syscall, |
34 | 34 | ||
35 | #undef __SYSCALL | ||
36 | #define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol, | 35 | #define __SYSCALL(nr,symbol,nargs) [ nr ] = (syscall_t)symbol, |
37 | #undef __KERNEL_SYSCALLS__ | 36 | #include <uapi/asm/unistd.h> |
38 | #include <asm/unistd.h> | ||
39 | }; | 37 | }; |
40 | 38 | ||
41 | asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg) | 39 | asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg) |
@@ -49,7 +47,8 @@ asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg) | |||
49 | return (long)ret; | 47 | return (long)ret; |
50 | } | 48 | } |
51 | 49 | ||
52 | asmlinkage long xtensa_fadvise64_64(int fd, int advice, unsigned long long offset, unsigned long long len) | 50 | asmlinkage long xtensa_fadvise64_64(int fd, int advice, |
51 | unsigned long long offset, unsigned long long len) | ||
53 | { | 52 | { |
54 | return sys_fadvise64_64(fd, offset, len, advice); | 53 | return sys_fadvise64_64(fd, offset, len, advice); |
55 | } | 54 | } |
diff --git a/arch/xtensa/kernel/xtensa_ksyms.c b/arch/xtensa/kernel/xtensa_ksyms.c index a8b9f1fd1e17..afe058b24e6e 100644 --- a/arch/xtensa/kernel/xtensa_ksyms.c +++ b/arch/xtensa/kernel/xtensa_ksyms.c | |||
@@ -43,7 +43,6 @@ EXPORT_SYMBOL(__strncpy_user); | |||
43 | EXPORT_SYMBOL(clear_page); | 43 | EXPORT_SYMBOL(clear_page); |
44 | EXPORT_SYMBOL(copy_page); | 44 | EXPORT_SYMBOL(copy_page); |
45 | 45 | ||
46 | EXPORT_SYMBOL(kernel_thread); | ||
47 | EXPORT_SYMBOL(empty_zero_page); | 46 | EXPORT_SYMBOL(empty_zero_page); |
48 | 47 | ||
49 | /* | 48 | /* |