diff options
| author | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-09 12:34:20 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.osdl.org> | 2007-01-09 12:34:20 -0500 |
| commit | 599c853195f43dfbcbf28b362e6ae80ffa33fec7 (patch) | |
| tree | 0a4730bd6cb2289bc3b81fdac1d42888d9de8e5f | |
| parent | 2f5c33b3180169f3eafb698b66686962d637fb0e (diff) | |
| parent | bf3dbdcd0bfca74c16ad0b2b5a978907c864ed4c (diff) | |
Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
[S390] locking problem with __cpcmd.
[S390] don't call handle_mm_fault() if in an atomic context.
[S390] Fix vmalloc area size calculation.
[S390] Fix cpu hotplug (missing 'online' attribute).
[S390] cio: use barrier() in stsch_reset.
[S390] memory detection misses 128k.
| -rw-r--r-- | arch/s390/kernel/head31.S | 12 | ||||
| -rw-r--r-- | arch/s390/kernel/head64.S | 12 | ||||
| -rw-r--r-- | arch/s390/kernel/setup.c | 2 | ||||
| -rw-r--r-- | arch/s390/kernel/smp.c | 5 | ||||
| -rw-r--r-- | arch/s390/lib/uaccess_pt.c | 3 | ||||
| -rw-r--r-- | arch/s390/lib/uaccess_std.c | 3 | ||||
| -rw-r--r-- | drivers/s390/char/vmcp.c | 2 | ||||
| -rw-r--r-- | drivers/s390/cio/cio.c | 12 | ||||
| -rw-r--r-- | include/asm-s390/futex.h | 4 |
9 files changed, 38 insertions, 17 deletions
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S index 4388b3309e0c..eca507050e47 100644 --- a/arch/s390/kernel/head31.S +++ b/arch/s390/kernel/head31.S | |||
| @@ -164,11 +164,14 @@ startup_continue: | |||
| 164 | srl %r7,28 | 164 | srl %r7,28 |
| 165 | clr %r6,%r7 # compare cc with last access code | 165 | clr %r6,%r7 # compare cc with last access code |
| 166 | be .Lsame-.LPG1(%r13) | 166 | be .Lsame-.LPG1(%r13) |
| 167 | b .Lchkmem-.LPG1(%r13) | 167 | lhi %r8,0 # no program checks |
| 168 | b .Lsavchk-.LPG1(%r13) | ||
| 168 | .Lsame: | 169 | .Lsame: |
| 169 | ar %r5,%r1 # add 128KB to end of chunk | 170 | ar %r5,%r1 # add 128KB to end of chunk |
| 170 | bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop | 171 | bno .Lloop-.LPG1(%r13) # r1 < 0x80000000 -> loop |
| 171 | .Lchkmem: # > 2GB or tprot got a program check | 172 | .Lchkmem: # > 2GB or tprot got a program check |
| 173 | lhi %r8,1 # set program check flag | ||
| 174 | .Lsavchk: | ||
| 172 | clr %r4,%r5 # chunk size > 0? | 175 | clr %r4,%r5 # chunk size > 0? |
| 173 | be .Lchkloop-.LPG1(%r13) | 176 | be .Lchkloop-.LPG1(%r13) |
| 174 | st %r4,0(%r3) # store start address of chunk | 177 | st %r4,0(%r3) # store start address of chunk |
| @@ -190,8 +193,15 @@ startup_continue: | |||
| 190 | je .Ldonemem # if not, leave | 193 | je .Ldonemem # if not, leave |
| 191 | chi %r10,0 # do we have chunks left? | 194 | chi %r10,0 # do we have chunks left? |
| 192 | je .Ldonemem | 195 | je .Ldonemem |
| 196 | chi %r8,1 # program check ? | ||
| 197 | je .Lpgmchk | ||
| 198 | lr %r4,%r5 # potential new chunk | ||
| 199 | alr %r5,%r1 # add 128KB to end of chunk | ||
| 200 | j .Llpcnt | ||
| 201 | .Lpgmchk: | ||
| 193 | alr %r5,%r1 # add 128KB to end of chunk | 202 | alr %r5,%r1 # add 128KB to end of chunk |
| 194 | lr %r4,%r5 # potential new chunk | 203 | lr %r4,%r5 # potential new chunk |
| 204 | .Llpcnt: | ||
| 195 | clr %r5,%r9 # should we go on? | 205 | clr %r5,%r9 # should we go on? |
| 196 | jl .Lloop | 206 | jl .Lloop |
| 197 | .Ldonemem: | 207 | .Ldonemem: |
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S index c526279e1123..6ba3f4512dd1 100644 --- a/arch/s390/kernel/head64.S +++ b/arch/s390/kernel/head64.S | |||
| @@ -172,12 +172,15 @@ startup_continue: | |||
| 172 | srl %r7,28 | 172 | srl %r7,28 |
| 173 | clr %r6,%r7 # compare cc with last access code | 173 | clr %r6,%r7 # compare cc with last access code |
| 174 | je .Lsame | 174 | je .Lsame |
| 175 | j .Lchkmem | 175 | lghi %r8,0 # no program checks |
| 176 | j .Lsavchk | ||
| 176 | .Lsame: | 177 | .Lsame: |
| 177 | algr %r5,%r1 # add 128KB to end of chunk | 178 | algr %r5,%r1 # add 128KB to end of chunk |
| 178 | # no need to check here, | 179 | # no need to check here, |
| 179 | brc 12,.Lloop # this is the same chunk | 180 | brc 12,.Lloop # this is the same chunk |
| 180 | .Lchkmem: # > 16EB or tprot got a program check | 181 | .Lchkmem: # > 16EB or tprot got a program check |
| 182 | lghi %r8,1 # set program check flag | ||
| 183 | .Lsavchk: | ||
| 181 | clgr %r4,%r5 # chunk size > 0? | 184 | clgr %r4,%r5 # chunk size > 0? |
| 182 | je .Lchkloop | 185 | je .Lchkloop |
| 183 | stg %r4,0(%r3) # store start address of chunk | 186 | stg %r4,0(%r3) # store start address of chunk |
| @@ -204,8 +207,15 @@ startup_continue: | |||
| 204 | chi %r10, 0 # do we have chunks left? | 207 | chi %r10, 0 # do we have chunks left? |
| 205 | je .Ldonemem | 208 | je .Ldonemem |
| 206 | .Lhsaskip: | 209 | .Lhsaskip: |
| 210 | chi %r8,1 # program check ? | ||
| 211 | je .Lpgmchk | ||
| 212 | lgr %r4,%r5 # potential new chunk | ||
| 213 | algr %r5,%r1 # add 128KB to end of chunk | ||
| 214 | j .Llpcnt | ||
| 215 | .Lpgmchk: | ||
| 207 | algr %r5,%r1 # add 128KB to end of chunk | 216 | algr %r5,%r1 # add 128KB to end of chunk |
| 208 | lgr %r4,%r5 # potential new chunk | 217 | lgr %r4,%r5 # potential new chunk |
| 218 | .Llpcnt: | ||
| 209 | clgr %r5,%r9 # should we go on? | 219 | clgr %r5,%r9 # should we go on? |
| 210 | jl .Lloop | 220 | jl .Lloop |
| 211 | .Ldonemem: | 221 | .Ldonemem: |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 49ef206ec880..5d8ee3baac14 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
| @@ -476,7 +476,7 @@ static void __init setup_memory_end(void) | |||
| 476 | int i; | 476 | int i; |
| 477 | 477 | ||
| 478 | memory_size = real_size = 0; | 478 | memory_size = real_size = 0; |
| 479 | max_phys = VMALLOC_END - VMALLOC_MIN_SIZE; | 479 | max_phys = VMALLOC_END_INIT - VMALLOC_MIN_SIZE; |
| 480 | memory_end &= PAGE_MASK; | 480 | memory_end &= PAGE_MASK; |
| 481 | 481 | ||
| 482 | max_mem = memory_end ? min(max_phys, memory_end) : max_phys; | 482 | max_mem = memory_end ? min(max_phys, memory_end) : max_phys; |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 19090f7d4f51..c0cd255fddbd 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
| @@ -794,7 +794,10 @@ static int __init topology_init(void) | |||
| 794 | int ret; | 794 | int ret; |
| 795 | 795 | ||
| 796 | for_each_possible_cpu(cpu) { | 796 | for_each_possible_cpu(cpu) { |
| 797 | ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu); | 797 | struct cpu *c = &per_cpu(cpu_devices, cpu); |
| 798 | |||
| 799 | c->hotpluggable = 1; | ||
| 800 | ret = register_cpu(c, cpu); | ||
| 798 | if (ret) | 801 | if (ret) |
| 799 | printk(KERN_WARNING "topology_init: register_cpu %d " | 802 | printk(KERN_WARNING "topology_init: register_cpu %d " |
| 800 | "failed (%d)\n", cpu, ret); | 803 | "failed (%d)\n", cpu, ret); |
diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c index 633249c3ba91..49c3e46b4065 100644 --- a/arch/s390/lib/uaccess_pt.c +++ b/arch/s390/lib/uaccess_pt.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
| 11 | #include <linux/hardirq.h> | ||
| 11 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
| 12 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
| 13 | #include <asm/futex.h> | 14 | #include <asm/futex.h> |
| @@ -18,6 +19,8 @@ static inline int __handle_fault(struct mm_struct *mm, unsigned long address, | |||
| 18 | struct vm_area_struct *vma; | 19 | struct vm_area_struct *vma; |
| 19 | int ret = -EFAULT; | 20 | int ret = -EFAULT; |
| 20 | 21 | ||
| 22 | if (in_atomic()) | ||
| 23 | return ret; | ||
| 21 | down_read(&mm->mmap_sem); | 24 | down_read(&mm->mmap_sem); |
| 22 | vma = find_vma(mm, address); | 25 | vma = find_vma(mm, address); |
| 23 | if (unlikely(!vma)) | 26 | if (unlikely(!vma)) |
diff --git a/arch/s390/lib/uaccess_std.c b/arch/s390/lib/uaccess_std.c index bbaca66fa293..56a0214e9928 100644 --- a/arch/s390/lib/uaccess_std.c +++ b/arch/s390/lib/uaccess_std.c | |||
| @@ -258,8 +258,6 @@ int futex_atomic_op(int op, int __user *uaddr, int oparg, int *old) | |||
| 258 | { | 258 | { |
| 259 | int oldval = 0, newval, ret; | 259 | int oldval = 0, newval, ret; |
| 260 | 260 | ||
| 261 | pagefault_disable(); | ||
| 262 | |||
| 263 | switch (op) { | 261 | switch (op) { |
| 264 | case FUTEX_OP_SET: | 262 | case FUTEX_OP_SET: |
| 265 | __futex_atomic_op("lr %2,%5\n", | 263 | __futex_atomic_op("lr %2,%5\n", |
| @@ -284,7 +282,6 @@ int futex_atomic_op(int op, int __user *uaddr, int oparg, int *old) | |||
| 284 | default: | 282 | default: |
| 285 | ret = -ENOSYS; | 283 | ret = -ENOSYS; |
| 286 | } | 284 | } |
| 287 | pagefault_enable(); | ||
| 288 | *old = oldval; | 285 | *old = oldval; |
| 289 | return ret; | 286 | return ret; |
| 290 | } | 287 | } |
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c index 1678b6c757ec..a420cd099041 100644 --- a/drivers/s390/char/vmcp.c +++ b/drivers/s390/char/vmcp.c | |||
| @@ -117,7 +117,7 @@ vmcp_write(struct file *file, const char __user * buff, size_t count, | |||
| 117 | return -ENOMEM; | 117 | return -ENOMEM; |
| 118 | } | 118 | } |
| 119 | debug_text_event(vmcp_debug, 1, cmd); | 119 | debug_text_event(vmcp_debug, 1, cmd); |
| 120 | session->resp_size = __cpcmd(cmd, session->response, | 120 | session->resp_size = cpcmd(cmd, session->response, |
| 121 | session->bufsize, | 121 | session->bufsize, |
| 122 | &session->resp_code); | 122 | &session->resp_code); |
| 123 | up(&session->mutex); | 123 | up(&session->mutex); |
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index b471ac4a1bf6..ae1bf231d089 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
| @@ -880,19 +880,15 @@ static void cio_reset_pgm_check_handler(void) | |||
| 880 | static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr) | 880 | static int stsch_reset(struct subchannel_id schid, volatile struct schib *addr) |
| 881 | { | 881 | { |
| 882 | int rc; | 882 | int rc; |
| 883 | register struct subchannel_id reg1 asm ("1") = schid; | ||
| 884 | 883 | ||
| 885 | pgm_check_occured = 0; | 884 | pgm_check_occured = 0; |
| 886 | s390_reset_pgm_handler = cio_reset_pgm_check_handler; | 885 | s390_reset_pgm_handler = cio_reset_pgm_check_handler; |
| 886 | rc = stsch(schid, addr); | ||
| 887 | s390_reset_pgm_handler = NULL; | ||
| 887 | 888 | ||
| 888 | asm volatile( | 889 | /* The program check handler could have changed pgm_check_occured */ |
| 889 | " stsch 0(%2)\n" | 890 | barrier(); |
| 890 | " ipm %0\n" | ||
| 891 | " srl %0,28" | ||
| 892 | : "=d" (rc) | ||
| 893 | : "d" (reg1), "a" (addr), "m" (*addr) : "memory", "cc"); | ||
| 894 | 891 | ||
| 895 | s390_reset_pgm_handler = NULL; | ||
| 896 | if (pgm_check_occured) | 892 | if (pgm_check_occured) |
| 897 | return -EIO; | 893 | return -EIO; |
| 898 | else | 894 | else |
diff --git a/include/asm-s390/futex.h b/include/asm-s390/futex.h index 5e261e1de671..5c5d02de49e9 100644 --- a/include/asm-s390/futex.h +++ b/include/asm-s390/futex.h | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
| 5 | 5 | ||
| 6 | #include <linux/futex.h> | 6 | #include <linux/futex.h> |
| 7 | #include <linux/uaccess.h> | ||
| 7 | #include <asm/errno.h> | 8 | #include <asm/errno.h> |
| 8 | #include <asm/uaccess.h> | ||
| 9 | 9 | ||
| 10 | static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | 10 | static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) |
| 11 | { | 11 | { |
| @@ -21,7 +21,9 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr) | |||
| 21 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) | 21 | if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) |
| 22 | return -EFAULT; | 22 | return -EFAULT; |
| 23 | 23 | ||
| 24 | pagefault_disable(); | ||
| 24 | ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval); | 25 | ret = uaccess.futex_atomic_op(op, uaddr, oparg, &oldval); |
| 26 | pagefault_enable(); | ||
| 25 | 27 | ||
| 26 | if (!ret) { | 28 | if (!ret) { |
| 27 | switch (cmp) { | 29 | switch (cmp) { |
