diff options
author | Michael Holzheu <holzheu@de.ibm.com> | 2007-07-10 05:24:15 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-07-10 05:24:48 -0400 |
commit | dc4123303b54657389c952049bf5738dd753d004 (patch) | |
tree | 46e6f092defc8a499e9696a1fa4490216d6479a2 /drivers/s390/cio | |
parent | 8a88367088a6b9964d99694b30d80720f019bea2 (diff) |
[S390] Program check in diag 210 under 31 bit
If a virtual address is passed to the diag210 function under 31 bit, we get a
programming exception, since diag 210 only works with physical addresses. To
fix this, the content of the diag210 data structure is copied to a local
structure and the physical address of that structure is passed to diagnose 210.
Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/device_id.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/s390/cio/device_id.c b/drivers/s390/cio/device_id.c index 997f46874537..60b9347f7c92 100644 --- a/drivers/s390/cio/device_id.c +++ b/drivers/s390/cio/device_id.c | |||
@@ -27,7 +27,6 @@ | |||
27 | /* | 27 | /* |
28 | * diag210 is used under VM to get information about a virtual device | 28 | * diag210 is used under VM to get information about a virtual device |
29 | */ | 29 | */ |
30 | #ifdef CONFIG_64BIT | ||
31 | int | 30 | int |
32 | diag210(struct diag210 * addr) | 31 | diag210(struct diag210 * addr) |
33 | { | 32 | { |
@@ -43,6 +42,7 @@ diag210(struct diag210 * addr) | |||
43 | spin_lock_irqsave(&diag210_lock, flags); | 42 | spin_lock_irqsave(&diag210_lock, flags); |
44 | diag210_tmp = *addr; | 43 | diag210_tmp = *addr; |
45 | 44 | ||
45 | #ifdef CONFIG_64BIT | ||
46 | asm volatile( | 46 | asm volatile( |
47 | " lhi %0,-1\n" | 47 | " lhi %0,-1\n" |
48 | " sam31\n" | 48 | " sam31\n" |
@@ -51,19 +51,8 @@ diag210(struct diag210 * addr) | |||
51 | " srl %0,28\n" | 51 | " srl %0,28\n" |
52 | "1: sam64\n" | 52 | "1: sam64\n" |
53 | EX_TABLE(0b,1b) | 53 | EX_TABLE(0b,1b) |
54 | : "=&d" (ccode) : "a" (__pa(&diag210_tmp)) : "cc", "memory"); | 54 | : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory"); |
55 | |||
56 | *addr = diag210_tmp; | ||
57 | spin_unlock_irqrestore(&diag210_lock, flags); | ||
58 | |||
59 | return ccode; | ||
60 | } | ||
61 | #else | 55 | #else |
62 | int | ||
63 | diag210(struct diag210 * addr) | ||
64 | { | ||
65 | int ccode; | ||
66 | |||
67 | asm volatile( | 56 | asm volatile( |
68 | " lhi %0,-1\n" | 57 | " lhi %0,-1\n" |
69 | " diag %1,0,0x210\n" | 58 | " diag %1,0,0x210\n" |
@@ -71,11 +60,14 @@ diag210(struct diag210 * addr) | |||
71 | " srl %0,28\n" | 60 | " srl %0,28\n" |
72 | "1:\n" | 61 | "1:\n" |
73 | EX_TABLE(0b,1b) | 62 | EX_TABLE(0b,1b) |
74 | : "=&d" (ccode) : "a" (__pa(addr)) : "cc", "memory"); | 63 | : "=&d" (ccode) : "a" (&diag210_tmp) : "cc", "memory"); |
64 | #endif | ||
65 | |||
66 | *addr = diag210_tmp; | ||
67 | spin_unlock_irqrestore(&diag210_lock, flags); | ||
75 | 68 | ||
76 | return ccode; | 69 | return ccode; |
77 | } | 70 | } |
78 | #endif | ||
79 | 71 | ||
80 | /* | 72 | /* |
81 | * Input : | 73 | * Input : |