aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/machvec_impl.h2
-rw-r--r--arch/arm/kernel/calls.S8
-rw-r--r--arch/arm/kernel/entry-armv.S49
-rw-r--r--arch/arm/kernel/entry-common.S20
-rw-r--r--arch/i386/mm/ioremap.c2
-rw-r--r--arch/i386/pci/mmconfig.c2
-rw-r--r--arch/ia64/configs/sn2_defconfig2
-rw-r--r--arch/ia64/kernel/time.c29
-rw-r--r--arch/ia64/kernel/uncached.c6
-rw-r--r--arch/ia64/kernel/vmlinux.lds.S3
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c2
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_reg.c48
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c12
-rw-r--r--arch/powerpc/kernel/syscalls.c2
-rw-r--r--arch/ppc/syslib/ppc4xx_dma.c1
-rw-r--r--arch/sparc/kernel/ebus.c24
-rw-r--r--arch/sparc/kernel/led.c2
-rw-r--r--arch/sparc/kernel/pcic.c2
-rw-r--r--arch/sparc/kernel/time.c4
-rw-r--r--arch/sparc/mm/sun4c.c2
-rw-r--r--arch/um/Kconfig2
-rw-r--r--arch/um/Makefile-x86_644
-rw-r--r--arch/um/include/sysdep-i386/stub.h29
-rw-r--r--arch/um/include/sysdep-x86_64/stub.h30
-rw-r--r--arch/um/kernel/skas/clone.c23
-rw-r--r--arch/um/scripts/Makefile.rules5
-rw-r--r--arch/x86_64/mm/ioremap.c2
-rw-r--r--arch/x86_64/pci/mmconfig.c14
28 files changed, 204 insertions, 127 deletions
diff --git a/arch/alpha/kernel/machvec_impl.h b/arch/alpha/kernel/machvec_impl.h
index 4959b7a3e1e..11f996f24fd 100644
--- a/arch/alpha/kernel/machvec_impl.h
+++ b/arch/alpha/kernel/machvec_impl.h
@@ -41,7 +41,7 @@
41#define CAT1(x,y) x##y 41#define CAT1(x,y) x##y
42#define CAT(x,y) CAT1(x,y) 42#define CAT(x,y) CAT1(x,y)
43 43
44#define DO_DEFAULT_RTC rtc_port: 0x70 44#define DO_DEFAULT_RTC .rtc_port = 0x70
45 45
46#define DO_EV4_MMU \ 46#define DO_EV4_MMU \
47 .max_asn = EV4_MAX_ASN, \ 47 .max_asn = EV4_MAX_ASN, \
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 2ad4aa2a153..55076a75e5b 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -131,7 +131,7 @@ __syscall_start:
131 .long sys_wait4 131 .long sys_wait4
132/* 115 */ .long sys_swapoff 132/* 115 */ .long sys_swapoff
133 .long sys_sysinfo 133 .long sys_sysinfo
134 .long sys_ipc_wrapper 134 .long sys_ipc
135 .long sys_fsync 135 .long sys_fsync
136 .long sys_sigreturn_wrapper 136 .long sys_sigreturn_wrapper
137/* 120 */ .long sys_clone_wrapper 137/* 120 */ .long sys_clone_wrapper
@@ -254,7 +254,7 @@ __syscall_start:
254 .long sys_fremovexattr 254 .long sys_fremovexattr
255 .long sys_tkill 255 .long sys_tkill
256 .long sys_sendfile64 256 .long sys_sendfile64
257/* 240 */ .long sys_futex_wrapper 257/* 240 */ .long sys_futex
258 .long sys_sched_setaffinity 258 .long sys_sched_setaffinity
259 .long sys_sched_getaffinity 259 .long sys_sched_getaffinity
260 .long sys_io_setup 260 .long sys_io_setup
@@ -284,7 +284,7 @@ __syscall_start:
284 .long sys_fstatfs64 284 .long sys_fstatfs64
285 .long sys_tgkill 285 .long sys_tgkill
286 .long sys_utimes 286 .long sys_utimes
287/* 270 */ .long sys_arm_fadvise64_64_wrapper 287/* 270 */ .long sys_arm_fadvise64_64
288 .long sys_pciconfig_iobase 288 .long sys_pciconfig_iobase
289 .long sys_pciconfig_read 289 .long sys_pciconfig_read
290 .long sys_pciconfig_write 290 .long sys_pciconfig_write
@@ -333,7 +333,7 @@ __syscall_start:
333 .long sys_inotify_init 333 .long sys_inotify_init
334 .long sys_inotify_add_watch 334 .long sys_inotify_add_watch
335 .long sys_inotify_rm_watch 335 .long sys_inotify_rm_watch
336 .long sys_mbind_wrapper 336 .long sys_mbind
337/* 320 */ .long sys_get_mempolicy 337/* 320 */ .long sys_get_mempolicy
338 .long sys_set_mempolicy 338 .long sys_set_mempolicy
339__syscall_end: 339__syscall_end:
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index d9fb819bf7c..2a8d27e18fa 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -614,6 +614,47 @@ __kuser_helper_start:
614/* 614/*
615 * Reference prototype: 615 * Reference prototype:
616 * 616 *
617 * void __kernel_memory_barrier(void)
618 *
619 * Input:
620 *
621 * lr = return address
622 *
623 * Output:
624 *
625 * none
626 *
627 * Clobbered:
628 *
629 * the Z flag might be lost
630 *
631 * Definition and user space usage example:
632 *
633 * typedef void (__kernel_dmb_t)(void);
634 * #define __kernel_dmb (*(__kernel_dmb_t *)0xffff0fa0)
635 *
636 * Apply any needed memory barrier to preserve consistency with data modified
637 * manually and __kuser_cmpxchg usage.
638 *
639 * This could be used as follows:
640 *
641 * #define __kernel_dmb() \
642 * asm volatile ( "mov r0, #0xffff0fff; mov lr, pc; sub pc, r0, #95" \
643 * : : : "lr","cc" )
644 */
645
646__kuser_memory_barrier: @ 0xffff0fa0
647
648#if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_SMP)
649 mcr p15, 0, r0, c7, c10, 5 @ dmb
650#endif
651 mov pc, lr
652
653 .align 5
654
655/*
656 * Reference prototype:
657 *
617 * int __kernel_cmpxchg(int oldval, int newval, int *ptr) 658 * int __kernel_cmpxchg(int oldval, int newval, int *ptr)
618 * 659 *
619 * Input: 660 * Input:
@@ -642,6 +683,8 @@ __kuser_helper_start:
642 * The C flag is also set if *ptr was changed to allow for assembly 683 * The C flag is also set if *ptr was changed to allow for assembly
643 * optimization in the calling code. 684 * optimization in the calling code.
644 * 685 *
686 * Note: this routine already includes memory barriers as needed.
687 *
645 * For example, a user space atomic_add implementation could look like this: 688 * For example, a user space atomic_add implementation could look like this:
646 * 689 *
647 * #define atomic_add(ptr, val) \ 690 * #define atomic_add(ptr, val) \
@@ -698,10 +741,16 @@ __kuser_cmpxchg: @ 0xffff0fc0
698 741
699#else 742#else
700 743
744#ifdef CONFIG_SMP
745 mcr p15, 0, r0, c7, c10, 5 @ dmb
746#endif
701 ldrex r3, [r2] 747 ldrex r3, [r2]
702 subs r3, r3, r0 748 subs r3, r3, r0
703 strexeq r3, r1, [r2] 749 strexeq r3, r1, [r2]
704 rsbs r0, r3, #0 750 rsbs r0, r3, #0
751#ifdef CONFIG_SMP
752 mcr p15, 0, r0, c7, c10, 5 @ dmb
753#endif
705 mov pc, lr 754 mov pc, lr
706 755
707#endif 756#endif
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index f7f18307523..e2b42997ad3 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -145,7 +145,7 @@ ENTRY(vector_swi)
145#endif 145#endif
146 enable_irq 146 enable_irq
147 147
148 str r4, [sp, #-S_OFF]! @ push fifth arg 148 stmdb sp!, {r4, r5} @ push fifth and sixth args
149 149
150 get_thread_info tsk 150 get_thread_info tsk
151 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing 151 ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing
@@ -204,7 +204,7 @@ ENTRY(sys_call_table)
204 * Special system call wrappers 204 * Special system call wrappers
205 */ 205 */
206@ r0 = syscall number 206@ r0 = syscall number
207@ r5 = syscall table 207@ r8 = syscall table
208 .type sys_syscall, #function 208 .type sys_syscall, #function
209sys_syscall: 209sys_syscall:
210 eor scno, r0, #__NR_SYSCALL_BASE 210 eor scno, r0, #__NR_SYSCALL_BASE
@@ -255,22 +255,6 @@ sys_sigaltstack_wrapper:
255 ldr r2, [sp, #S_OFF + S_SP] 255 ldr r2, [sp, #S_OFF + S_SP]
256 b do_sigaltstack 256 b do_sigaltstack
257 257
258sys_futex_wrapper:
259 str r5, [sp, #4] @ push sixth arg
260 b sys_futex
261
262sys_arm_fadvise64_64_wrapper:
263 str r5, [sp, #4] @ push r5 to stack
264 b sys_arm_fadvise64_64
265
266sys_mbind_wrapper:
267 str r5, [sp, #4]
268 b sys_mbind
269
270sys_ipc_wrapper:
271 str r5, [sp, #4] @ push sixth arg
272 b sys_ipc
273
274/* 258/*
275 * Note: off_4k (r5) is always units of 4K. If we can't do the requested 259 * Note: off_4k (r5) is always units of 4K. If we can't do the requested
276 * offset, we return EINVAL. 260 * offset, we return EINVAL.
diff --git a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c
index 8498b5ac395..247fde76aae 100644
--- a/arch/i386/mm/ioremap.c
+++ b/arch/i386/mm/ioremap.c
@@ -245,7 +245,7 @@ void iounmap(volatile void __iomem *addr)
245 addr < phys_to_virt(ISA_END_ADDRESS)) 245 addr < phys_to_virt(ISA_END_ADDRESS))
246 return; 246 return;
247 247
248 addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr); 248 addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr);
249 249
250 /* Use the vm area unlocked, assuming the caller 250 /* Use the vm area unlocked, assuming the caller
251 ensures there isn't another iounmap for the same address 251 ensures there isn't another iounmap for the same address
diff --git a/arch/i386/pci/mmconfig.c b/arch/i386/pci/mmconfig.c
index 08a08490121..4bb4d4b0f73 100644
--- a/arch/i386/pci/mmconfig.c
+++ b/arch/i386/pci/mmconfig.c
@@ -155,7 +155,7 @@ static __init void unreachable_devices(void)
155 addr = get_base_addr(0, 0, PCI_DEVFN(i, 0)); 155 addr = get_base_addr(0, 0, PCI_DEVFN(i, 0));
156 if (addr != 0) 156 if (addr != 0)
157 pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0)); 157 pci_exp_set_dev_base(addr, 0, PCI_DEVFN(i, 0));
158 if (addr == 0 || readl((u32 *)addr) != val1) 158 if (addr == 0 || readl((u32 __iomem *)mmcfg_virt_addr) != val1)
159 set_bit(i, fallback_slots); 159 set_bit(i, fallback_slots);
160 spin_unlock_irqrestore(&pci_config_lock, flags); 160 spin_unlock_irqrestore(&pci_config_lock, flags);
161 } 161 }
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig
index e1924cc9687..ff8bb3770c9 100644
--- a/arch/ia64/configs/sn2_defconfig
+++ b/arch/ia64/configs/sn2_defconfig
@@ -113,7 +113,7 @@ CONFIG_IOSAPIC=y
113CONFIG_IA64_SGI_SN_XP=m 113CONFIG_IA64_SGI_SN_XP=m
114CONFIG_FORCE_MAX_ZONEORDER=17 114CONFIG_FORCE_MAX_ZONEORDER=17
115CONFIG_SMP=y 115CONFIG_SMP=y
116CONFIG_NR_CPUS=512 116CONFIG_NR_CPUS=1024
117# CONFIG_HOTPLUG_CPU is not set 117# CONFIG_HOTPLUG_CPU is not set
118CONFIG_SCHED_SMT=y 118CONFIG_SCHED_SMT=y
119CONFIG_PREEMPT=y 119CONFIG_PREEMPT=y
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 5b7e736f3b4..028a2b95936 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -249,3 +249,32 @@ time_init (void)
249 */ 249 */
250 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec); 250 set_normalized_timespec(&wall_to_monotonic, -xtime.tv_sec, -xtime.tv_nsec);
251} 251}
252
253#define SMALLUSECS 100
254
255void
256udelay (unsigned long usecs)
257{
258 unsigned long start;
259 unsigned long cycles;
260 unsigned long smallusecs;
261
262 /*
263 * Execute the non-preemptible delay loop (because the ITC might
264 * not be synchronized between CPUS) in relatively short time
265 * chunks, allowing preemption between the chunks.
266 */
267 while (usecs > 0) {
268 smallusecs = (usecs > SMALLUSECS) ? SMALLUSECS : usecs;
269 preempt_disable();
270 cycles = smallusecs*local_cpu_data->cyc_per_usec;
271 start = ia64_get_itc();
272
273 while (ia64_get_itc() - start < cycles)
274 cpu_relax();
275
276 preempt_enable();
277 usecs -= smallusecs;
278 }
279}
280EXPORT_SYMBOL(udelay);
diff --git a/arch/ia64/kernel/uncached.c b/arch/ia64/kernel/uncached.c
index c6d40446c2c..b631cf86ed4 100644
--- a/arch/ia64/kernel/uncached.c
+++ b/arch/ia64/kernel/uncached.c
@@ -53,7 +53,7 @@ static void uncached_ipi_visibility(void *data)
53 if ((status != PAL_VISIBILITY_OK) && 53 if ((status != PAL_VISIBILITY_OK) &&
54 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED)) 54 (status != PAL_VISIBILITY_OK_REMOTE_NEEDED))
55 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on " 55 printk(KERN_DEBUG "pal_prefetch_visibility() returns %i on "
56 "CPU %i\n", status, get_cpu()); 56 "CPU %i\n", status, raw_smp_processor_id());
57} 57}
58 58
59 59
@@ -63,7 +63,7 @@ static void uncached_ipi_mc_drain(void *data)
63 status = ia64_pal_mc_drain(); 63 status = ia64_pal_mc_drain();
64 if (status) 64 if (status)
65 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on " 65 printk(KERN_WARNING "ia64_pal_mc_drain() failed with %i on "
66 "CPU %i\n", status, get_cpu()); 66 "CPU %i\n", status, raw_smp_processor_id());
67} 67}
68 68
69 69
@@ -105,7 +105,7 @@ uncached_get_new_chunk(struct gen_pool *poolp)
105 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL); 105 status = ia64_pal_prefetch_visibility(PAL_VISIBILITY_PHYSICAL);
106 106
107 dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n", 107 dprintk(KERN_INFO "pal_prefetch_visibility() returns %i on cpu %i\n",
108 status, get_cpu()); 108 status, raw_smp_processor_id());
109 109
110 if (!status) { 110 if (!status) {
111 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1); 111 status = smp_call_function(uncached_ipi_visibility, NULL, 0, 1);
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S
index 30d8564e960..73af6267d2e 100644
--- a/arch/ia64/kernel/vmlinux.lds.S
+++ b/arch/ia64/kernel/vmlinux.lds.S
@@ -177,6 +177,9 @@ SECTIONS
177 } 177 }
178 . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose kernel data */ 178 . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose kernel data */
179 179
180 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
181 { *(.data.read_mostly) }
182
180 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) 183 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET)
181 { *(.data.cacheline_aligned) } 184 { *(.data.cacheline_aligned) }
182 185
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index 5d54f5f4e92..471bbaa65d1 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -202,7 +202,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
202 unsigned long end, unsigned long nbits) 202 unsigned long end, unsigned long nbits)
203{ 203{
204 int i, opt, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0; 204 int i, opt, shub1, cnode, mynasid, cpu, lcpu = 0, nasid, flushed = 0;
205 int mymm = (mm == current->active_mm); 205 int mymm = (mm == current->active_mm && current->mm);
206 volatile unsigned long *ptc0, *ptc1; 206 volatile unsigned long *ptc0, *ptc1;
207 unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value; 207 unsigned long itc, itc2, flags, data0 = 0, data1 = 0, rr_value;
208 short nasids[MAX_NUMNODES], nix; 208 short nasids[MAX_NUMNODES], nix;
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_reg.c b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
index 5d534091262..79fdb91d725 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_reg.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_reg.c
@@ -25,7 +25,7 @@ union br_ptr {
25 */ 25 */
26void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) 26void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
27{ 27{
28 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 28 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
29 29
30 if (pcibus_info) { 30 if (pcibus_info) {
31 switch (pcibus_info->pbi_bridge_type) { 31 switch (pcibus_info->pbi_bridge_type) {
@@ -38,14 +38,14 @@ void pcireg_control_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
38 default: 38 default:
39 panic 39 panic
40 ("pcireg_control_bit_clr: unknown bridgetype bridge 0x%p", 40 ("pcireg_control_bit_clr: unknown bridgetype bridge 0x%p",
41 (void *)ptr); 41 ptr);
42 } 42 }
43 } 43 }
44} 44}
45 45
46void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) 46void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
47{ 47{
48 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 48 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
49 49
50 if (pcibus_info) { 50 if (pcibus_info) {
51 switch (pcibus_info->pbi_bridge_type) { 51 switch (pcibus_info->pbi_bridge_type) {
@@ -58,7 +58,7 @@ void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
58 default: 58 default:
59 panic 59 panic
60 ("pcireg_control_bit_set: unknown bridgetype bridge 0x%p", 60 ("pcireg_control_bit_set: unknown bridgetype bridge 0x%p",
61 (void *)ptr); 61 ptr);
62 } 62 }
63 } 63 }
64} 64}
@@ -68,7 +68,7 @@ void pcireg_control_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
68 */ 68 */
69uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info) 69uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info)
70{ 70{
71 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 71 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
72 uint64_t ret = 0; 72 uint64_t ret = 0;
73 73
74 if (pcibus_info) { 74 if (pcibus_info) {
@@ -82,7 +82,7 @@ uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info)
82 default: 82 default:
83 panic 83 panic
84 ("pcireg_tflush_get: unknown bridgetype bridge 0x%p", 84 ("pcireg_tflush_get: unknown bridgetype bridge 0x%p",
85 (void *)ptr); 85 ptr);
86 } 86 }
87 } 87 }
88 88
@@ -98,7 +98,7 @@ uint64_t pcireg_tflush_get(struct pcibus_info *pcibus_info)
98 */ 98 */
99uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info) 99uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info)
100{ 100{
101 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 101 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
102 uint64_t ret = 0; 102 uint64_t ret = 0;
103 103
104 if (pcibus_info) { 104 if (pcibus_info) {
@@ -112,7 +112,7 @@ uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info)
112 default: 112 default:
113 panic 113 panic
114 ("pcireg_intr_status_get: unknown bridgetype bridge 0x%p", 114 ("pcireg_intr_status_get: unknown bridgetype bridge 0x%p",
115 (void *)ptr); 115 ptr);
116 } 116 }
117 } 117 }
118 return ret; 118 return ret;
@@ -123,7 +123,7 @@ uint64_t pcireg_intr_status_get(struct pcibus_info * pcibus_info)
123 */ 123 */
124void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits) 124void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
125{ 125{
126 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 126 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
127 127
128 if (pcibus_info) { 128 if (pcibus_info) {
129 switch (pcibus_info->pbi_bridge_type) { 129 switch (pcibus_info->pbi_bridge_type) {
@@ -136,14 +136,14 @@ void pcireg_intr_enable_bit_clr(struct pcibus_info *pcibus_info, uint64_t bits)
136 default: 136 default:
137 panic 137 panic
138 ("pcireg_intr_enable_bit_clr: unknown bridgetype bridge 0x%p", 138 ("pcireg_intr_enable_bit_clr: unknown bridgetype bridge 0x%p",
139 (void *)ptr); 139 ptr);
140 } 140 }
141 } 141 }
142} 142}
143 143
144void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits) 144void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
145{ 145{
146 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 146 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
147 147
148 if (pcibus_info) { 148 if (pcibus_info) {
149 switch (pcibus_info->pbi_bridge_type) { 149 switch (pcibus_info->pbi_bridge_type) {
@@ -156,7 +156,7 @@ void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
156 default: 156 default:
157 panic 157 panic
158 ("pcireg_intr_enable_bit_set: unknown bridgetype bridge 0x%p", 158 ("pcireg_intr_enable_bit_set: unknown bridgetype bridge 0x%p",
159 (void *)ptr); 159 ptr);
160 } 160 }
161 } 161 }
162} 162}
@@ -167,7 +167,7 @@ void pcireg_intr_enable_bit_set(struct pcibus_info *pcibus_info, uint64_t bits)
167void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n, 167void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n,
168 uint64_t addr) 168 uint64_t addr)
169{ 169{
170 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 170 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
171 171
172 if (pcibus_info) { 172 if (pcibus_info) {
173 switch (pcibus_info->pbi_bridge_type) { 173 switch (pcibus_info->pbi_bridge_type) {
@@ -186,7 +186,7 @@ void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n,
186 default: 186 default:
187 panic 187 panic
188 ("pcireg_intr_addr_addr_get: unknown bridgetype bridge 0x%p", 188 ("pcireg_intr_addr_addr_get: unknown bridgetype bridge 0x%p",
189 (void *)ptr); 189 ptr);
190 } 190 }
191 } 191 }
192} 192}
@@ -196,7 +196,7 @@ void pcireg_intr_addr_addr_set(struct pcibus_info *pcibus_info, int int_n,
196 */ 196 */
197void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n) 197void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n)
198{ 198{
199 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 199 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
200 200
201 if (pcibus_info) { 201 if (pcibus_info) {
202 switch (pcibus_info->pbi_bridge_type) { 202 switch (pcibus_info->pbi_bridge_type) {
@@ -209,7 +209,7 @@ void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n)
209 default: 209 default:
210 panic 210 panic
211 ("pcireg_force_intr_set: unknown bridgetype bridge 0x%p", 211 ("pcireg_force_intr_set: unknown bridgetype bridge 0x%p",
212 (void *)ptr); 212 ptr);
213 } 213 }
214 } 214 }
215} 215}
@@ -219,7 +219,7 @@ void pcireg_force_intr_set(struct pcibus_info *pcibus_info, int int_n)
219 */ 219 */
220uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device) 220uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
221{ 221{
222 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 222 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
223 uint64_t ret = 0; 223 uint64_t ret = 0;
224 224
225 if (pcibus_info) { 225 if (pcibus_info) {
@@ -233,7 +233,7 @@ uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
233 __sn_readq_relaxed(&ptr->pic.p_wr_req_buf[device]); 233 __sn_readq_relaxed(&ptr->pic.p_wr_req_buf[device]);
234 break; 234 break;
235 default: 235 default:
236 panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", (void *)ptr); 236 panic("pcireg_wrb_flush_get: unknown bridgetype bridge 0x%p", ptr);
237 } 237 }
238 238
239 } 239 }
@@ -244,7 +244,7 @@ uint64_t pcireg_wrb_flush_get(struct pcibus_info *pcibus_info, int device)
244void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index, 244void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index,
245 uint64_t val) 245 uint64_t val)
246{ 246{
247 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 247 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
248 248
249 if (pcibus_info) { 249 if (pcibus_info) {
250 switch (pcibus_info->pbi_bridge_type) { 250 switch (pcibus_info->pbi_bridge_type) {
@@ -257,15 +257,15 @@ void pcireg_int_ate_set(struct pcibus_info *pcibus_info, int ate_index,
257 default: 257 default:
258 panic 258 panic
259 ("pcireg_int_ate_set: unknown bridgetype bridge 0x%p", 259 ("pcireg_int_ate_set: unknown bridgetype bridge 0x%p",
260 (void *)ptr); 260 ptr);
261 } 261 }
262 } 262 }
263} 263}
264 264
265uint64_t *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index) 265uint64_t __iomem *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index)
266{ 266{
267 union br_ptr *ptr = (union br_ptr *)pcibus_info->pbi_buscommon.bs_base; 267 union br_ptr __iomem *ptr = (union br_ptr __iomem *)pcibus_info->pbi_buscommon.bs_base;
268 uint64_t *ret = (uint64_t *) 0; 268 uint64_t __iomem *ret = NULL;
269 269
270 if (pcibus_info) { 270 if (pcibus_info) {
271 switch (pcibus_info->pbi_bridge_type) { 271 switch (pcibus_info->pbi_bridge_type) {
@@ -278,7 +278,7 @@ uint64_t *pcireg_int_ate_addr(struct pcibus_info *pcibus_info, int ate_index)
278 default: 278 default:
279 panic 279 panic
280 ("pcireg_int_ate_addr: unknown bridgetype bridge 0x%p", 280 ("pcireg_int_ate_addr: unknown bridgetype bridge 0x%p",
281 (void *)ptr); 281 ptr);
282 } 282 }
283 } 283 }
284 return ret; 284 return ret;
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 46b646a6d34..27aa1842dac 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -38,10 +38,10 @@ tioca_gart_init(struct tioca_kernel *tioca_kern)
38 uint64_t offset; 38 uint64_t offset;
39 struct page *tmp; 39 struct page *tmp;
40 struct tioca_common *tioca_common; 40 struct tioca_common *tioca_common;
41 struct tioca *ca_base; 41 struct tioca __iomem *ca_base;
42 42
43 tioca_common = tioca_kern->ca_common; 43 tioca_common = tioca_kern->ca_common;
44 ca_base = (struct tioca *)tioca_common->ca_common.bs_base; 44 ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base;
45 45
46 if (list_empty(tioca_kern->ca_devices)) 46 if (list_empty(tioca_kern->ca_devices))
47 return 0; 47 return 0;
@@ -215,7 +215,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
215{ 215{
216 int cap_ptr; 216 int cap_ptr;
217 uint32_t reg; 217 uint32_t reg;
218 struct tioca *tioca_base; 218 struct tioca __iomem *tioca_base;
219 struct pci_dev *pdev; 219 struct pci_dev *pdev;
220 struct tioca_common *common; 220 struct tioca_common *common;
221 221
@@ -257,7 +257,7 @@ tioca_fastwrite_enable(struct tioca_kernel *tioca_kern)
257 * Set ca's fw to match 257 * Set ca's fw to match
258 */ 258 */
259 259
260 tioca_base = (struct tioca *)common->ca_common.bs_base; 260 tioca_base = (struct tioca __iomem*)common->ca_common.bs_base;
261 __sn_setq_relaxed(&tioca_base->ca_control1, CA_AGP_FW_ENABLE); 261 __sn_setq_relaxed(&tioca_base->ca_control1, CA_AGP_FW_ENABLE);
262} 262}
263 263
@@ -322,7 +322,7 @@ static uint64_t
322tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr) 322tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr)
323{ 323{
324 struct tioca_common *tioca_common; 324 struct tioca_common *tioca_common;
325 struct tioca *ca_base; 325 struct tioca __iomem *ca_base;
326 uint64_t ct_addr; 326 uint64_t ct_addr;
327 dma_addr_t bus_addr; 327 dma_addr_t bus_addr;
328 uint32_t node_upper; 328 uint32_t node_upper;
@@ -330,7 +330,7 @@ tioca_dma_d48(struct pci_dev *pdev, uint64_t paddr)
330 struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev); 330 struct pcidev_info *pcidev_info = SN_PCIDEV_INFO(pdev);
331 331
332 tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info; 332 tioca_common = (struct tioca_common *)pcidev_info->pdi_pcibus_info;
333 ca_base = (struct tioca *)tioca_common->ca_common.bs_base; 333 ca_base = (struct tioca __iomem *)tioca_common->ca_common.bs_base;
334 334
335 ct_addr = PHYS_TO_TIODMA(paddr); 335 ct_addr = PHYS_TO_TIODMA(paddr);
336 if (!ct_addr) 336 if (!ct_addr)
diff --git a/arch/powerpc/kernel/syscalls.c b/arch/powerpc/kernel/syscalls.c
index f72ced11212..91b93d917b6 100644
--- a/arch/powerpc/kernel/syscalls.c
+++ b/arch/powerpc/kernel/syscalls.c
@@ -247,7 +247,7 @@ long ppc64_personality(unsigned long personality)
247#define OVERRIDE_MACHINE 0 247#define OVERRIDE_MACHINE 0
248#endif 248#endif
249 249
250static inline int override_machine(char *mach) 250static inline int override_machine(char __user *mach)
251{ 251{
252 if (OVERRIDE_MACHINE) { 252 if (OVERRIDE_MACHINE) {
253 /* change ppc64 to ppc */ 253 /* change ppc64 to ppc */
diff --git a/arch/ppc/syslib/ppc4xx_dma.c b/arch/ppc/syslib/ppc4xx_dma.c
index f15e64285f9..05ccd598dd4 100644
--- a/arch/ppc/syslib/ppc4xx_dma.c
+++ b/arch/ppc/syslib/ppc4xx_dma.c
@@ -30,6 +30,7 @@
30 30
31#include <asm/system.h> 31#include <asm/system.h>
32#include <asm/io.h> 32#include <asm/io.h>
33#include <asm/dma.h>
33#include <asm/ppc4xx_dma.h> 34#include <asm/ppc4xx_dma.h>
34 35
35ppc_dma_ch_t dma_channels[MAX_PPC4xx_DMA_CHANNELS]; 36ppc_dma_ch_t dma_channels[MAX_PPC4xx_DMA_CHANNELS];
diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c
index 1754192c69d..5c3529ceb5d 100644
--- a/arch/sparc/kernel/ebus.c
+++ b/arch/sparc/kernel/ebus.c
@@ -22,7 +22,7 @@
22#include <asm/oplib.h> 22#include <asm/oplib.h>
23#include <asm/bpp.h> 23#include <asm/bpp.h>
24 24
25struct linux_ebus *ebus_chain = 0; 25struct linux_ebus *ebus_chain = NULL;
26 26
27/* We are together with pcic.c under CONFIG_PCI. */ 27/* We are together with pcic.c under CONFIG_PCI. */
28extern unsigned int pcic_pin_to_irq(unsigned int, char *name); 28extern unsigned int pcic_pin_to_irq(unsigned int, char *name);
@@ -46,7 +46,7 @@ static struct ebus_device_irq je1_1[] = {
46 { "SUNW,CS4231", 0 }, 46 { "SUNW,CS4231", 0 },
47 { "parallel", 0 }, 47 { "parallel", 0 },
48 { "se", 2 }, 48 { "se", 2 },
49 { 0, 0 } 49 { NULL, 0 }
50}; 50};
51 51
52/* 52/*
@@ -55,7 +55,7 @@ static struct ebus_device_irq je1_1[] = {
55 */ 55 */
56static struct ebus_system_entry ebus_blacklist[] = { 56static struct ebus_system_entry ebus_blacklist[] = {
57 { "SUNW,JavaEngine1", je1_1 }, 57 { "SUNW,JavaEngine1", je1_1 },
58 { 0, 0 } 58 { NULL, NULL }
59}; 59};
60 60
61static struct ebus_device_irq *ebus_blackp = NULL; 61static struct ebus_device_irq *ebus_blackp = NULL;
@@ -233,7 +233,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev)
233 ebus_alloc(sizeof(struct linux_ebus_child)); 233 ebus_alloc(sizeof(struct linux_ebus_child));
234 234
235 child = dev->children; 235 child = dev->children;
236 child->next = 0; 236 child->next = NULL;
237 child->parent = dev; 237 child->parent = dev;
238 child->bus = dev->bus; 238 child->bus = dev->bus;
239 fill_ebus_child(node, &regs[0], child); 239 fill_ebus_child(node, &regs[0], child);
@@ -243,7 +243,7 @@ void __init fill_ebus_device(int node, struct linux_ebus_device *dev)
243 ebus_alloc(sizeof(struct linux_ebus_child)); 243 ebus_alloc(sizeof(struct linux_ebus_child));
244 244
245 child = child->next; 245 child = child->next;
246 child->next = 0; 246 child->next = NULL;
247 child->parent = dev; 247 child->parent = dev;
248 child->bus = dev->bus; 248 child->bus = dev->bus;
249 fill_ebus_child(node, &regs[0], child); 249 fill_ebus_child(node, &regs[0], child);
@@ -275,7 +275,7 @@ void __init ebus_init(void)
275 } 275 }
276 } 276 }
277 277
278 pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, 0); 278 pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_EBUS, NULL);
279 if (!pdev) { 279 if (!pdev) {
280 return; 280 return;
281 } 281 }
@@ -284,7 +284,7 @@ void __init ebus_init(void)
284 284
285 ebus_chain = ebus = (struct linux_ebus *) 285 ebus_chain = ebus = (struct linux_ebus *)
286 ebus_alloc(sizeof(struct linux_ebus)); 286 ebus_alloc(sizeof(struct linux_ebus));
287 ebus->next = 0; 287 ebus->next = NULL;
288 288
289 while (ebusnd) { 289 while (ebusnd) {
290 290
@@ -325,8 +325,8 @@ void __init ebus_init(void)
325 ebus_alloc(sizeof(struct linux_ebus_device)); 325 ebus_alloc(sizeof(struct linux_ebus_device));
326 326
327 dev = ebus->devices; 327 dev = ebus->devices;
328 dev->next = 0; 328 dev->next = NULL;
329 dev->children = 0; 329 dev->children = NULL;
330 dev->bus = ebus; 330 dev->bus = ebus;
331 fill_ebus_device(nd, dev); 331 fill_ebus_device(nd, dev);
332 332
@@ -335,8 +335,8 @@ void __init ebus_init(void)
335 ebus_alloc(sizeof(struct linux_ebus_device)); 335 ebus_alloc(sizeof(struct linux_ebus_device));
336 336
337 dev = dev->next; 337 dev = dev->next;
338 dev->next = 0; 338 dev->next = NULL;
339 dev->children = 0; 339 dev->children = NULL;
340 dev->bus = ebus; 340 dev->bus = ebus;
341 fill_ebus_device(nd, dev); 341 fill_ebus_device(nd, dev);
342 } 342 }
@@ -353,7 +353,7 @@ void __init ebus_init(void)
353 ebus->next = (struct linux_ebus *) 353 ebus->next = (struct linux_ebus *)
354 ebus_alloc(sizeof(struct linux_ebus)); 354 ebus_alloc(sizeof(struct linux_ebus));
355 ebus = ebus->next; 355 ebus = ebus->next;
356 ebus->next = 0; 356 ebus->next = NULL;
357 ++num_ebus; 357 ++num_ebus;
358 } 358 }
359 if (pdev) 359 if (pdev)
diff --git a/arch/sparc/kernel/led.c b/arch/sparc/kernel/led.c
index 2a3afca453c..313d1620ae8 100644
--- a/arch/sparc/kernel/led.c
+++ b/arch/sparc/kernel/led.c
@@ -55,7 +55,7 @@ static int led_read_proc(char *buf, char **start, off_t offset, int count,
55 return len; 55 return len;
56} 56}
57 57
58static int led_write_proc(struct file *file, const char *buffer, 58static int led_write_proc(struct file *file, const char __user *buffer,
59 unsigned long count, void *data) 59 unsigned long count, void *data)
60{ 60{
61 char *buf = NULL; 61 char *buf = NULL;
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index cccfc12802e..42002b742de 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -161,7 +161,7 @@ static struct pcic_sn2list pcic_known_sysnames[] = {
161static int pcic0_up; 161static int pcic0_up;
162static struct linux_pcic pcic0; 162static struct linux_pcic pcic0;
163 163
164void * __iomem pcic_regs; 164void __iomem *pcic_regs;
165volatile int pcic_speculative; 165volatile int pcic_speculative;
166volatile int pcic_trapped; 166volatile int pcic_trapped;
167 167
diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c
index 24814d58f9e..7dadcdb4ca4 100644
--- a/arch/sparc/kernel/time.c
+++ b/arch/sparc/kernel/time.c
@@ -49,7 +49,7 @@ DEFINE_SPINLOCK(rtc_lock);
49enum sparc_clock_type sp_clock_typ; 49enum sparc_clock_type sp_clock_typ;
50DEFINE_SPINLOCK(mostek_lock); 50DEFINE_SPINLOCK(mostek_lock);
51void __iomem *mstk48t02_regs = NULL; 51void __iomem *mstk48t02_regs = NULL;
52static struct mostek48t08 *mstk48t08_regs = NULL; 52static struct mostek48t08 __iomem *mstk48t08_regs = NULL;
53static int set_rtc_mmss(unsigned long); 53static int set_rtc_mmss(unsigned long);
54static int sbus_do_settimeofday(struct timespec *tv); 54static int sbus_do_settimeofday(struct timespec *tv);
55 55
@@ -342,7 +342,7 @@ static __inline__ void clock_probe(void)
342 /* XXX r/o attribute is somewhere in r.flags */ 342 /* XXX r/o attribute is somewhere in r.flags */
343 r.flags = clk_reg[0].which_io; 343 r.flags = clk_reg[0].which_io;
344 r.start = clk_reg[0].phys_addr; 344 r.start = clk_reg[0].phys_addr;
345 mstk48t08_regs = (struct mostek48t08 *) sbus_ioremap(&r, 0, 345 mstk48t08_regs = sbus_ioremap(&r, 0,
346 sizeof(struct mostek48t08), "mk48t08"); 346 sizeof(struct mostek48t08), "mk48t08");
347 347
348 mstk48t02_regs = &mstk48t08_regs->regs; 348 mstk48t02_regs = &mstk48t08_regs->regs;
diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c
index 1d560390e28..731f19603ca 100644
--- a/arch/sparc/mm/sun4c.c
+++ b/arch/sparc/mm/sun4c.c
@@ -497,7 +497,7 @@ static void __init sun4c_probe_mmu(void)
497 patch_kernel_fault_handler(); 497 patch_kernel_fault_handler();
498} 498}
499 499
500volatile unsigned long *sun4c_memerr_reg = NULL; 500volatile unsigned long __iomem *sun4c_memerr_reg = NULL;
501 501
502void __init sun4c_probe_memerr_reg(void) 502void __init sun4c_probe_memerr_reg(void)
503{ 503{
diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 563301fe5df..1eb21de9d1b 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -289,6 +289,8 @@ source "arch/um/Kconfig.net"
289 289
290source "drivers/net/Kconfig" 290source "drivers/net/Kconfig"
291 291
292source "drivers/connector/Kconfig"
293
292source "fs/Kconfig" 294source "fs/Kconfig"
293 295
294source "security/Kconfig" 296source "security/Kconfig"
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64
index 4f118d5cc2e..38df311e75d 100644
--- a/arch/um/Makefile-x86_64
+++ b/arch/um/Makefile-x86_64
@@ -12,3 +12,7 @@ CHECKFLAGS += -m64
12 12
13ELF_ARCH := i386:x86-64 13ELF_ARCH := i386:x86-64
14ELF_FORMAT := elf64-x86-64 14ELF_FORMAT := elf64-x86-64
15
16# Not on all 64-bit distros /lib is a symlink to /lib64. PLD is an example.
17
18LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64
diff --git a/arch/um/include/sysdep-i386/stub.h b/arch/um/include/sysdep-i386/stub.h
index 6ba8cbbe0d3..b492b12b4a1 100644
--- a/arch/um/include/sysdep-i386/stub.h
+++ b/arch/um/include/sysdep-i386/stub.h
@@ -6,8 +6,12 @@
6#ifndef __SYSDEP_STUB_H 6#ifndef __SYSDEP_STUB_H
7#define __SYSDEP_STUB_H 7#define __SYSDEP_STUB_H
8 8
9#include <sys/mman.h>
9#include <asm/ptrace.h> 10#include <asm/ptrace.h>
10#include <asm/unistd.h> 11#include <asm/unistd.h>
12#include "stub-data.h"
13#include "kern_constants.h"
14#include "uml-config.h"
11 15
12extern void stub_segv_handler(int sig); 16extern void stub_segv_handler(int sig);
13extern void stub_clone_handler(void); 17extern void stub_clone_handler(void);
@@ -76,23 +80,22 @@ static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3,
76 return ret; 80 return ret;
77} 81}
78 82
79static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, 83static inline void trap_myself(void)
80 long arg4, long arg5, long arg6)
81{ 84{
82 long ret; 85 __asm("int3");
83
84 __asm__ volatile ("push %%ebp ; movl %%eax,%%ebp ; movl %1,%%eax ; "
85 "int $0x80 ; pop %%ebp"
86 : "=a" (ret)
87 : "g" (syscall), "b" (arg1), "c" (arg2), "d" (arg3),
88 "S" (arg4), "D" (arg5), "0" (arg6));
89
90 return ret;
91} 86}
92 87
93static inline void trap_myself(void) 88static inline void remap_stack(int fd, unsigned long offset)
94{ 89{
95 __asm("int3"); 90 __asm__ volatile ("movl %%eax,%%ebp ; movl %0,%%eax ; int $0x80 ;"
91 "movl %7, %%ebx ; movl %%eax, (%%ebx)"
92 : : "g" (STUB_MMAP_NR), "b" (UML_CONFIG_STUB_DATA),
93 "c" (UM_KERN_PAGE_SIZE),
94 "d" (PROT_READ | PROT_WRITE),
95 "S" (MAP_FIXED | MAP_SHARED), "D" (fd),
96 "a" (offset),
97 "i" (&((struct stub_data *) UML_CONFIG_STUB_DATA)->err)
98 : "memory");
96} 99}
97 100
98#endif 101#endif
diff --git a/arch/um/include/sysdep-x86_64/stub.h b/arch/um/include/sysdep-x86_64/stub.h
index c41689c13dc..92e989f8176 100644
--- a/arch/um/include/sysdep-x86_64/stub.h
+++ b/arch/um/include/sysdep-x86_64/stub.h
@@ -6,8 +6,12 @@
6#ifndef __SYSDEP_STUB_H 6#ifndef __SYSDEP_STUB_H
7#define __SYSDEP_STUB_H 7#define __SYSDEP_STUB_H
8 8
9#include <sys/mman.h>
9#include <asm/unistd.h> 10#include <asm/unistd.h>
10#include <sysdep/ptrace_user.h> 11#include <sysdep/ptrace_user.h>
12#include "stub-data.h"
13#include "kern_constants.h"
14#include "uml-config.h"
11 15
12extern void stub_segv_handler(int sig); 16extern void stub_segv_handler(int sig);
13extern void stub_clone_handler(void); 17extern void stub_clone_handler(void);
@@ -81,23 +85,23 @@ static inline long stub_syscall5(long syscall, long arg1, long arg2, long arg3,
81 return ret; 85 return ret;
82} 86}
83 87
84static inline long stub_syscall6(long syscall, long arg1, long arg2, long arg3, 88static inline void trap_myself(void)
85 long arg4, long arg5, long arg6)
86{ 89{
87 long ret; 90 __asm("int3");
88
89 __asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; "
90 "movq %7, %%r9; " __syscall : "=a" (ret)
91 : "0" (syscall), "D" (arg1), "S" (arg2), "d" (arg3),
92 "g" (arg4), "g" (arg5), "g" (arg6)
93 : __syscall_clobber, "r10", "r8", "r9" );
94
95 return ret;
96} 91}
97 92
98static inline void trap_myself(void) 93static inline void remap_stack(long fd, unsigned long offset)
99{ 94{
100 __asm("int3"); 95 __asm__ volatile ("movq %4,%%r10 ; movq %5,%%r8 ; "
96 "movq %6, %%r9; " __syscall "; movq %7, %%rbx ; "
97 "movq %%rax, (%%rbx)":
98 : "a" (STUB_MMAP_NR), "D" (UML_CONFIG_STUB_DATA),
99 "S" (UM_KERN_PAGE_SIZE),
100 "d" (PROT_READ | PROT_WRITE),
101 "g" (MAP_FIXED | MAP_SHARED), "g" (fd),
102 "g" (offset),
103 "i" (&((struct stub_data *) UML_CONFIG_STUB_DATA)->err)
104 : __syscall_clobber, "r10", "r8", "r9" );
101} 105}
102 106
103#endif 107#endif
diff --git a/arch/um/kernel/skas/clone.c b/arch/um/kernel/skas/clone.c
index cb37ce9124a..47b812b3bca 100644
--- a/arch/um/kernel/skas/clone.c
+++ b/arch/um/kernel/skas/clone.c
@@ -18,11 +18,10 @@
18 * on some systems. 18 * on some systems.
19 */ 19 */
20 20
21#define STUB_DATA(field) (((struct stub_data *) UML_CONFIG_STUB_DATA)->field)
22
23void __attribute__ ((__section__ (".__syscall_stub"))) 21void __attribute__ ((__section__ (".__syscall_stub")))
24stub_clone_handler(void) 22stub_clone_handler(void)
25{ 23{
24 struct stub_data *data = (struct stub_data *) UML_CONFIG_STUB_DATA;
26 long err; 25 long err;
27 26
28 err = stub_syscall2(__NR_clone, CLONE_PARENT | CLONE_FILES | SIGCHLD, 27 err = stub_syscall2(__NR_clone, CLONE_PARENT | CLONE_FILES | SIGCHLD,
@@ -35,17 +34,21 @@ stub_clone_handler(void)
35 if(err) 34 if(err)
36 goto out; 35 goto out;
37 36
38 err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL, 37 err = stub_syscall3(__NR_setitimer, ITIMER_VIRTUAL,
39 (long) &STUB_DATA(timer), 0); 38 (long) &data->timer, 0);
40 if(err) 39 if(err)
41 goto out; 40 goto out;
42 41
43 err = stub_syscall6(STUB_MMAP_NR, UML_CONFIG_STUB_DATA, 42 remap_stack(data->fd, data->offset);
44 UM_KERN_PAGE_SIZE, PROT_READ | PROT_WRITE, 43 goto done;
45 MAP_FIXED | MAP_SHARED, STUB_DATA(fd), 44
46 STUB_DATA(offset));
47 out: 45 out:
48 /* save current result. Parent: pid; child: retcode of mmap */ 46 /* save current result.
49 STUB_DATA(err) = err; 47 * Parent: pid;
48 * child: retcode of mmap already saved and it jumps around this
49 * assignment
50 */
51 data->err = err;
52 done:
50 trap_myself(); 53 trap_myself();
51} 54}
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules
index b3fbf125709..2e41cabd3d9 100644
--- a/arch/um/scripts/Makefile.rules
+++ b/arch/um/scripts/Makefile.rules
@@ -21,11 +21,6 @@ define unprofile
21endef 21endef
22 22
23 23
24# The stubs and unmap.o can't try to call mcount or update basic block data
25define unprofile
26 $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
27endef
28
29# cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If 24# cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If
30# so, it's considered to be a path relative to $(srcdir) rather than 25# so, it's considered to be a path relative to $(srcdir) rather than
31# $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from 26# $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from
diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86_64/mm/ioremap.c
index 0d260e4492f..ae207064201 100644
--- a/arch/x86_64/mm/ioremap.c
+++ b/arch/x86_64/mm/ioremap.c
@@ -263,7 +263,7 @@ void iounmap(volatile void __iomem *addr)
263 addr < phys_to_virt(ISA_END_ADDRESS)) 263 addr < phys_to_virt(ISA_END_ADDRESS))
264 return; 264 return;
265 265
266 addr = (volatile void *)(PAGE_MASK & (unsigned long __force)addr); 266 addr = (volatile void __iomem *)(PAGE_MASK & (unsigned long __force)addr);
267 /* Use the vm area unlocked, assuming the caller 267 /* Use the vm area unlocked, assuming the caller
268 ensures there isn't another iounmap for the same address 268 ensures there isn't another iounmap for the same address
269 in parallel. Reuse of the virtual address is prevented by 269 in parallel. Reuse of the virtual address is prevented by
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index 9c4f907e301..f16c0d57c55 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -18,11 +18,11 @@ static DECLARE_BITMAP(fallback_slots, 32);
18/* Static virtual mapping of the MMCONFIG aperture */ 18/* Static virtual mapping of the MMCONFIG aperture */
19struct mmcfg_virt { 19struct mmcfg_virt {
20 struct acpi_table_mcfg_config *cfg; 20 struct acpi_table_mcfg_config *cfg;
21 char *virt; 21 char __iomem *virt;
22}; 22};
23static struct mmcfg_virt *pci_mmcfg_virt; 23static struct mmcfg_virt *pci_mmcfg_virt;
24 24
25static char *get_virt(unsigned int seg, unsigned bus) 25static char __iomem *get_virt(unsigned int seg, unsigned bus)
26{ 26{
27 int cfg_num = -1; 27 int cfg_num = -1;
28 struct acpi_table_mcfg_config *cfg; 28 struct acpi_table_mcfg_config *cfg;
@@ -43,9 +43,9 @@ static char *get_virt(unsigned int seg, unsigned bus)
43 } 43 }
44} 44}
45 45
46static char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) 46static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
47{ 47{
48 char *addr; 48 char __iomem *addr;
49 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots)) 49 if (seg == 0 && bus == 0 && test_bit(PCI_SLOT(devfn), &fallback_slots))
50 return NULL; 50 return NULL;
51 addr = get_virt(seg, bus); 51 addr = get_virt(seg, bus);
@@ -57,7 +57,7 @@ static char *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn
57static int pci_mmcfg_read(unsigned int seg, unsigned int bus, 57static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
58 unsigned int devfn, int reg, int len, u32 *value) 58 unsigned int devfn, int reg, int len, u32 *value)
59{ 59{
60 char *addr; 60 char __iomem *addr;
61 61
62 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ 62 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
63 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095))) 63 if (unlikely(!value || (bus > 255) || (devfn > 255) || (reg > 4095)))
@@ -85,7 +85,7 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus,
85static int pci_mmcfg_write(unsigned int seg, unsigned int bus, 85static int pci_mmcfg_write(unsigned int seg, unsigned int bus,
86 unsigned int devfn, int reg, int len, u32 value) 86 unsigned int devfn, int reg, int len, u32 value)
87{ 87{
88 char *addr; 88 char __iomem *addr;
89 89
90 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ 90 /* Why do we have this when nobody checks it. How about a BUG()!? -AK */
91 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) 91 if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095)))
@@ -127,7 +127,7 @@ static __init void unreachable_devices(void)
127 int i; 127 int i;
128 for (i = 0; i < 32; i++) { 128 for (i = 0; i < 32; i++) {
129 u32 val1; 129 u32 val1;
130 char *addr; 130 char __iomem *addr;
131 131
132 pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1); 132 pci_conf1_read(0, 0, PCI_DEVFN(i,0), 0, 4, &val1);
133 if (val1 == 0xffffffff) 133 if (val1 == 0xffffffff)