aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kvm/gaccess.h153
-rw-r--r--arch/s390/kvm/intercept.c6
-rw-r--r--arch/s390/kvm/interrupt.c52
-rw-r--r--arch/s390/kvm/priv.c22
4 files changed, 81 insertions, 152 deletions
diff --git a/arch/s390/kvm/gaccess.h b/arch/s390/kvm/gaccess.h
index 84d01dd7a8e4..82f450ecb585 100644
--- a/arch/s390/kvm/gaccess.h
+++ b/arch/s390/kvm/gaccess.h
@@ -18,122 +18,47 @@
18#include <asm/uaccess.h> 18#include <asm/uaccess.h>
19#include "kvm-s390.h" 19#include "kvm-s390.h"
20 20
21static inline void __user *__guestaddr_to_user(struct kvm_vcpu *vcpu, 21static inline void *__gptr_to_uptr(struct kvm_vcpu *vcpu, void *gptr)
22 unsigned long guestaddr)
23{ 22{
24 unsigned long prefix = vcpu->arch.sie_block->prefix; 23 unsigned long prefix = vcpu->arch.sie_block->prefix;
25 unsigned long uaddress; 24 unsigned long gaddr = (unsigned long) gptr;
26 25 unsigned long uaddr;
27 if (guestaddr < 2 * PAGE_SIZE) 26
28 guestaddr += prefix; 27 if (gaddr < 2 * PAGE_SIZE)
29 else if ((guestaddr >= prefix) && (guestaddr < prefix + 2 * PAGE_SIZE)) 28 gaddr += prefix;
30 guestaddr -= prefix; 29 else if ((gaddr >= prefix) && (gaddr < prefix + 2 * PAGE_SIZE))
31 uaddress = gmap_fault(guestaddr, vcpu->arch.gmap); 30 gaddr -= prefix;
32 if (IS_ERR_VALUE(uaddress)) 31 uaddr = gmap_fault(gaddr, vcpu->arch.gmap);
33 uaddress = -EFAULT; 32 if (IS_ERR_VALUE(uaddr))
34 return (void __user *)uaddress; 33 uaddr = -EFAULT;
35} 34 return (void *)uaddr;
36
37static inline int get_guest_u64(struct kvm_vcpu *vcpu, unsigned long guestaddr,
38 u64 *result)
39{
40 void __user *uptr = __guestaddr_to_user(vcpu, guestaddr);
41
42 BUG_ON(guestaddr & 7);
43
44 if (IS_ERR((void __force *) uptr))
45 return PTR_ERR((void __force *) uptr);
46
47 return get_user(*result, (unsigned long __user *) uptr);
48}
49
50static inline int get_guest_u32(struct kvm_vcpu *vcpu, unsigned long guestaddr,
51 u32 *result)
52{
53 void __user *uptr = __guestaddr_to_user(vcpu, guestaddr);
54
55 BUG_ON(guestaddr & 3);
56
57 if (IS_ERR((void __force *) uptr))
58 return PTR_ERR((void __force *) uptr);
59
60 return get_user(*result, (u32 __user *) uptr);
61}
62
63static inline int get_guest_u16(struct kvm_vcpu *vcpu, unsigned long guestaddr,
64 u16 *result)
65{
66 void __user *uptr = __guestaddr_to_user(vcpu, guestaddr);
67
68 BUG_ON(guestaddr & 1);
69
70 if (IS_ERR(uptr))
71 return PTR_ERR(uptr);
72
73 return get_user(*result, (u16 __user *) uptr);
74}
75
76static inline int get_guest_u8(struct kvm_vcpu *vcpu, unsigned long guestaddr,
77 u8 *result)
78{
79 void __user *uptr = __guestaddr_to_user(vcpu, guestaddr);
80
81 if (IS_ERR((void __force *) uptr))
82 return PTR_ERR((void __force *) uptr);
83
84 return get_user(*result, (u8 __user *) uptr);
85}
86
87static inline int put_guest_u64(struct kvm_vcpu *vcpu, unsigned long guestaddr,
88 u64 value)
89{
90 void __user *uptr = __guestaddr_to_user(vcpu, guestaddr);
91
92 BUG_ON(guestaddr & 7);
93
94 if (IS_ERR((void __force *) uptr))
95 return PTR_ERR((void __force *) uptr);
96
97 return put_user(value, (u64 __user *) uptr);
98}
99
100static inline int put_guest_u32(struct kvm_vcpu *vcpu, unsigned long guestaddr,
101 u32 value)
102{
103 void __user *uptr = __guestaddr_to_user(vcpu, guestaddr);
104
105 BUG_ON(guestaddr & 3);
106
107 if (IS_ERR((void __force *) uptr))
108 return PTR_ERR((void __force *) uptr);
109
110 return put_user(value, (u32 __user *) uptr);
111}
112
113static inline int put_guest_u16(struct kvm_vcpu *vcpu, unsigned long guestaddr,
114 u16 value)
115{
116 void __user *uptr = __guestaddr_to_user(vcpu, guestaddr);
117
118 BUG_ON(guestaddr & 1);
119
120 if (IS_ERR((void __force *) uptr))
121 return PTR_ERR((void __force *) uptr);
122
123 return put_user(value, (u16 __user *) uptr);
124}
125
126static inline int put_guest_u8(struct kvm_vcpu *vcpu, unsigned long guestaddr,
127 u8 value)
128{
129 void __user *uptr = __guestaddr_to_user(vcpu, guestaddr);
130
131 if (IS_ERR((void __force *) uptr))
132 return PTR_ERR((void __force *) uptr);
133
134 return put_user(value, (u8 __user *) uptr);
135} 35}
136 36
37#define get_guest(vcpu, x, gptr) \
38({ \
39 __typeof__(gptr) __uptr = __gptr_to_uptr(vcpu, gptr); \
40 int __mask = sizeof(__typeof__(*(gptr))) - 1; \
41 int __ret = PTR_RET(__uptr); \
42 \
43 if (!__ret) { \
44 BUG_ON((unsigned long)__uptr & __mask); \
45 __ret = get_user(x, __uptr); \
46 } \
47 __ret; \
48})
49
50#define put_guest(vcpu, x, gptr) \
51({ \
52 __typeof__(gptr) __uptr = __gptr_to_uptr(vcpu, gptr); \
53 int __mask = sizeof(__typeof__(*(gptr))) - 1; \
54 int __ret = PTR_RET(__uptr); \
55 \
56 if (!__ret) { \
57 BUG_ON((unsigned long)__uptr & __mask); \
58 __ret = put_user(x, __uptr); \
59 } \
60 __ret; \
61})
137 62
138static inline int __copy_to_guest_slow(struct kvm_vcpu *vcpu, 63static inline int __copy_to_guest_slow(struct kvm_vcpu *vcpu,
139 unsigned long guestdest, 64 unsigned long guestdest,
@@ -144,7 +69,7 @@ static inline int __copy_to_guest_slow(struct kvm_vcpu *vcpu,
144 u8 *data = from; 69 u8 *data = from;
145 70
146 for (i = 0; i < n; i++) { 71 for (i = 0; i < n; i++) {
147 rc = put_guest_u8(vcpu, guestdest++, *(data++)); 72 rc = put_guest(vcpu, *(data++), (u8 *)guestdest++);
148 if (rc < 0) 73 if (rc < 0)
149 return rc; 74 return rc;
150 } 75 }
@@ -270,7 +195,7 @@ static inline int __copy_from_guest_slow(struct kvm_vcpu *vcpu, void *to,
270 u8 *data = to; 195 u8 *data = to;
271 196
272 for (i = 0; i < n; i++) { 197 for (i = 0; i < n; i++) {
273 rc = get_guest_u8(vcpu, guestsrc++, data++); 198 rc = get_guest(vcpu, *(data++), (u8 *)guestsrc++);
274 if (rc < 0) 199 if (rc < 0)
275 return rc; 200 return rc;
276 } 201 }
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index 9b2204759445..64744003a66e 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -43,8 +43,8 @@ static int handle_lctlg(struct kvm_vcpu *vcpu)
43 trace_kvm_s390_handle_lctl(vcpu, 1, reg1, reg3, useraddr); 43 trace_kvm_s390_handle_lctl(vcpu, 1, reg1, reg3, useraddr);
44 44
45 do { 45 do {
46 rc = get_guest_u64(vcpu, useraddr, 46 rc = get_guest(vcpu, vcpu->arch.sie_block->gcr[reg],
47 &vcpu->arch.sie_block->gcr[reg]); 47 (u64 *) useraddr);
48 if (rc) { 48 if (rc) {
49 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 49 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
50 break; 50 break;
@@ -78,7 +78,7 @@ static int handle_lctl(struct kvm_vcpu *vcpu)
78 78
79 reg = reg1; 79 reg = reg1;
80 do { 80 do {
81 rc = get_guest_u32(vcpu, useraddr, &val); 81 rc = get_guest(vcpu, val, (u32 *) useraddr);
82 if (rc) { 82 if (rc) {
83 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 83 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
84 break; 84 break;
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 5afa931aed11..d78824b18e9d 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -188,8 +188,9 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
188 vcpu->stat.deliver_emergency_signal++; 188 vcpu->stat.deliver_emergency_signal++;
189 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 189 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
190 inti->emerg.code, 0); 190 inti->emerg.code, 0);
191 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1201); 191 rc = put_guest(vcpu, 0x1201, (u16 *)__LC_EXT_INT_CODE);
192 rc |= put_guest_u16(vcpu, __LC_EXT_CPU_ADDR, inti->emerg.code); 192 rc |= put_guest(vcpu, inti->emerg.code,
193 (u16 *)__LC_EXT_CPU_ADDR);
193 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 194 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
194 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 195 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
195 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 196 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -200,8 +201,9 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
200 vcpu->stat.deliver_external_call++; 201 vcpu->stat.deliver_external_call++;
201 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 202 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
202 inti->extcall.code, 0); 203 inti->extcall.code, 0);
203 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1202); 204 rc = put_guest(vcpu, 0x1202, (u16 *)__LC_EXT_INT_CODE);
204 rc |= put_guest_u16(vcpu, __LC_EXT_CPU_ADDR, inti->extcall.code); 205 rc |= put_guest(vcpu, inti->extcall.code,
206 (u16 *)__LC_EXT_CPU_ADDR);
205 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 207 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
206 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 208 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
207 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 209 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -213,12 +215,13 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
213 vcpu->stat.deliver_service_signal++; 215 vcpu->stat.deliver_service_signal++;
214 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 216 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
215 inti->ext.ext_params, 0); 217 inti->ext.ext_params, 0);
216 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2401); 218 rc = put_guest(vcpu, 0x2401, (u16 *)__LC_EXT_INT_CODE);
217 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 219 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
218 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 220 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
219 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 221 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
220 __LC_EXT_NEW_PSW, sizeof(psw_t)); 222 __LC_EXT_NEW_PSW, sizeof(psw_t));
221 rc |= put_guest_u32(vcpu, __LC_EXT_PARAMS, inti->ext.ext_params); 223 rc |= put_guest(vcpu, inti->ext.ext_params,
224 (u32 *)__LC_EXT_PARAMS);
222 break; 225 break;
223 case KVM_S390_INT_VIRTIO: 226 case KVM_S390_INT_VIRTIO:
224 VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx", 227 VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx",
@@ -227,15 +230,16 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
227 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 230 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
228 inti->ext.ext_params, 231 inti->ext.ext_params,
229 inti->ext.ext_params2); 232 inti->ext.ext_params2);
230 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2603); 233 rc = put_guest(vcpu, 0x2603, (u16 *)__LC_EXT_INT_CODE);
231 rc |= put_guest_u16(vcpu, __LC_EXT_CPU_ADDR, 0x0d00); 234 rc |= put_guest(vcpu, 0x0d00, (u16 *)__LC_EXT_CPU_ADDR);
232 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 235 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
233 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 236 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
234 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 237 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
235 __LC_EXT_NEW_PSW, sizeof(psw_t)); 238 __LC_EXT_NEW_PSW, sizeof(psw_t));
236 rc |= put_guest_u32(vcpu, __LC_EXT_PARAMS, inti->ext.ext_params); 239 rc |= put_guest(vcpu, inti->ext.ext_params,
237 rc |= put_guest_u64(vcpu, __LC_EXT_PARAMS2, 240 (u32 *)__LC_EXT_PARAMS);
238 inti->ext.ext_params2); 241 rc |= put_guest(vcpu, inti->ext.ext_params2,
242 (u64 *)__LC_EXT_PARAMS2);
239 break; 243 break;
240 case KVM_S390_SIGP_STOP: 244 case KVM_S390_SIGP_STOP:
241 VCPU_EVENT(vcpu, 4, "%s", "interrupt: cpu stop"); 245 VCPU_EVENT(vcpu, 4, "%s", "interrupt: cpu stop");
@@ -274,9 +278,9 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
274 vcpu->stat.deliver_program_int++; 278 vcpu->stat.deliver_program_int++;
275 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 279 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
276 inti->pgm.code, 0); 280 inti->pgm.code, 0);
277 rc = put_guest_u16(vcpu, __LC_PGM_INT_CODE, inti->pgm.code); 281 rc = put_guest(vcpu, inti->pgm.code, (u16 *)__LC_PGM_INT_CODE);
278 rc |= put_guest_u16(vcpu, __LC_PGM_ILC, 282 rc |= put_guest(vcpu, table[vcpu->arch.sie_block->ipa >> 14],
279 table[vcpu->arch.sie_block->ipa >> 14]); 283 (u16 *)__LC_PGM_ILC);
280 rc |= copy_to_guest(vcpu, __LC_PGM_OLD_PSW, 284 rc |= copy_to_guest(vcpu, __LC_PGM_OLD_PSW,
281 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 285 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
282 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 286 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -291,7 +295,7 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
291 inti->mchk.mcic); 295 inti->mchk.mcic);
292 rc = kvm_s390_vcpu_store_status(vcpu, 296 rc = kvm_s390_vcpu_store_status(vcpu,
293 KVM_S390_STORE_STATUS_PREFIXED); 297 KVM_S390_STORE_STATUS_PREFIXED);
294 rc |= put_guest_u64(vcpu, __LC_MCCK_CODE, inti->mchk.mcic); 298 rc |= put_guest(vcpu, inti->mchk.mcic, (u64 *) __LC_MCCK_CODE);
295 rc |= copy_to_guest(vcpu, __LC_MCK_OLD_PSW, 299 rc |= copy_to_guest(vcpu, __LC_MCK_OLD_PSW,
296 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 300 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
297 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 301 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -308,14 +312,14 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
308 vcpu->stat.deliver_io_int++; 312 vcpu->stat.deliver_io_int++;
309 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type, 313 trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, inti->type,
310 param0, param1); 314 param0, param1);
311 rc = put_guest_u16(vcpu, __LC_SUBCHANNEL_ID, 315 rc = put_guest(vcpu, inti->io.subchannel_id,
312 inti->io.subchannel_id); 316 (u16 *) __LC_SUBCHANNEL_ID);
313 rc |= put_guest_u16(vcpu, __LC_SUBCHANNEL_NR, 317 rc |= put_guest(vcpu, inti->io.subchannel_nr,
314 inti->io.subchannel_nr); 318 (u16 *) __LC_SUBCHANNEL_NR);
315 rc |= put_guest_u32(vcpu, __LC_IO_INT_PARM, 319 rc |= put_guest(vcpu, inti->io.io_int_parm,
316 inti->io.io_int_parm); 320 (u32 *) __LC_IO_INT_PARM);
317 rc |= put_guest_u32(vcpu, __LC_IO_INT_WORD, 321 rc |= put_guest(vcpu, inti->io.io_int_word,
318 inti->io.io_int_word); 322 (u32 *) __LC_IO_INT_WORD);
319 rc |= copy_to_guest(vcpu, __LC_IO_OLD_PSW, 323 rc |= copy_to_guest(vcpu, __LC_IO_OLD_PSW,
320 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 324 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
321 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 325 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
@@ -340,7 +344,7 @@ static int __try_deliver_ckc_interrupt(struct kvm_vcpu *vcpu)
340 return 0; 344 return 0;
341 if (!(vcpu->arch.sie_block->gcr[0] & 0x800ul)) 345 if (!(vcpu->arch.sie_block->gcr[0] & 0x800ul))
342 return 0; 346 return 0;
343 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x1004); 347 rc = put_guest(vcpu, 0x1004, (u16 *)__LC_EXT_INT_CODE);
344 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW, 348 rc |= copy_to_guest(vcpu, __LC_EXT_OLD_PSW,
345 &vcpu->arch.sie_block->gpsw, sizeof(psw_t)); 349 &vcpu->arch.sie_block->gpsw, sizeof(psw_t));
346 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw, 350 rc |= copy_from_guest(vcpu, &vcpu->arch.sie_block->gpsw,
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 34b42dc285ee..cb07147cda73 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -41,7 +41,7 @@ static int handle_set_prefix(struct kvm_vcpu *vcpu)
41 } 41 }
42 42
43 /* get the value */ 43 /* get the value */
44 if (get_guest_u32(vcpu, operand2, &address)) { 44 if (get_guest(vcpu, address, (u32 *) operand2)) {
45 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 45 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
46 goto out; 46 goto out;
47 } 47 }
@@ -82,7 +82,7 @@ static int handle_store_prefix(struct kvm_vcpu *vcpu)
82 address = address & 0x7fffe000u; 82 address = address & 0x7fffe000u;
83 83
84 /* get the value */ 84 /* get the value */
85 if (put_guest_u32(vcpu, operand2, address)) { 85 if (put_guest(vcpu, address, (u32 *)operand2)) {
86 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 86 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
87 goto out; 87 goto out;
88 } 88 }
@@ -107,7 +107,7 @@ static int handle_store_cpu_address(struct kvm_vcpu *vcpu)
107 goto out; 107 goto out;
108 } 108 }
109 109
110 rc = put_guest_u16(vcpu, useraddr, vcpu->vcpu_id); 110 rc = put_guest(vcpu, vcpu->vcpu_id, (u16 *)useraddr);
111 if (rc) { 111 if (rc) {
112 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 112 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
113 goto out; 113 goto out;
@@ -142,18 +142,18 @@ static int handle_tpi(struct kvm_vcpu *vcpu)
142 * Store the two-word I/O interruption code into the 142 * Store the two-word I/O interruption code into the
143 * provided area. 143 * provided area.
144 */ 144 */
145 put_guest_u16(vcpu, addr, inti->io.subchannel_id); 145 put_guest(vcpu, inti->io.subchannel_id, (u16 *) addr);
146 put_guest_u16(vcpu, addr + 2, inti->io.subchannel_nr); 146 put_guest(vcpu, inti->io.subchannel_nr, (u16 *) (addr + 2));
147 put_guest_u32(vcpu, addr + 4, inti->io.io_int_parm); 147 put_guest(vcpu, inti->io.io_int_parm, (u32 *) (addr + 4));
148 } else { 148 } else {
149 /* 149 /*
150 * Store the three-word I/O interruption code into 150 * Store the three-word I/O interruption code into
151 * the appropriate lowcore area. 151 * the appropriate lowcore area.
152 */ 152 */
153 put_guest_u16(vcpu, 184, inti->io.subchannel_id); 153 put_guest(vcpu, inti->io.subchannel_id, (u16 *) 184);
154 put_guest_u16(vcpu, 186, inti->io.subchannel_nr); 154 put_guest(vcpu, inti->io.subchannel_nr, (u16 *) 186);
155 put_guest_u32(vcpu, 188, inti->io.io_int_parm); 155 put_guest(vcpu, inti->io.io_int_parm, (u32 *) 188);
156 put_guest_u32(vcpu, 192, inti->io.io_int_word); 156 put_guest(vcpu, inti->io.io_int_word, (u32 *) 192);
157 } 157 }
158 cc = 1; 158 cc = 1;
159 } else 159 } else
@@ -347,7 +347,7 @@ static int handle_stidp(struct kvm_vcpu *vcpu)
347 goto out; 347 goto out;
348 } 348 }
349 349
350 rc = put_guest_u64(vcpu, operand2, vcpu->arch.stidp_data); 350 rc = put_guest(vcpu, vcpu->arch.stidp_data, (u64 *)operand2);
351 if (rc) { 351 if (rc) {
352 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 352 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
353 goto out; 353 goto out;