aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/diag.c4
-rw-r--r--arch/s390/kvm/intercept.c18
-rw-r--r--arch/s390/kvm/interrupt.c12
-rw-r--r--arch/s390/kvm/kvm-s390.c23
-rw-r--r--arch/s390/kvm/priv.c2
-rw-r--r--arch/s390/kvm/sigp.c4
6 files changed, 32 insertions, 31 deletions
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index 8300309698fa..9e4c84187cf5 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -39,7 +39,7 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
39 vcpu->run->s390_reset_flags = 0; 39 vcpu->run->s390_reset_flags = 0;
40 break; 40 break;
41 default: 41 default:
42 return -ENOTSUPP; 42 return -EOPNOTSUPP;
43 } 43 }
44 44
45 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags); 45 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags);
@@ -62,6 +62,6 @@ int kvm_s390_handle_diag(struct kvm_vcpu *vcpu)
62 case 0x308: 62 case 0x308:
63 return __diag_ipl_functions(vcpu); 63 return __diag_ipl_functions(vcpu);
64 default: 64 default:
65 return -ENOTSUPP; 65 return -EOPNOTSUPP;
66 } 66 }
67} 67}
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index b40096494e46..3ddc30895e31 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -32,7 +32,7 @@ static int handle_lctlg(struct kvm_vcpu *vcpu)
32 32
33 vcpu->stat.instruction_lctlg++; 33 vcpu->stat.instruction_lctlg++;
34 if ((vcpu->arch.sie_block->ipb & 0xff) != 0x2f) 34 if ((vcpu->arch.sie_block->ipb & 0xff) != 0x2f)
35 return -ENOTSUPP; 35 return -EOPNOTSUPP;
36 36
37 useraddr = disp2; 37 useraddr = disp2;
38 if (base2) 38 if (base2)
@@ -138,7 +138,7 @@ static int handle_stop(struct kvm_vcpu *vcpu)
138 rc = __kvm_s390_vcpu_store_status(vcpu, 138 rc = __kvm_s390_vcpu_store_status(vcpu,
139 KVM_S390_STORE_STATUS_NOADDR); 139 KVM_S390_STORE_STATUS_NOADDR);
140 if (rc >= 0) 140 if (rc >= 0)
141 rc = -ENOTSUPP; 141 rc = -EOPNOTSUPP;
142 } 142 }
143 143
144 if (vcpu->arch.local_int.action_bits & ACTION_RELOADVCPU_ON_STOP) { 144 if (vcpu->arch.local_int.action_bits & ACTION_RELOADVCPU_ON_STOP) {
@@ -150,7 +150,7 @@ static int handle_stop(struct kvm_vcpu *vcpu)
150 if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) { 150 if (vcpu->arch.local_int.action_bits & ACTION_STOP_ON_STOP) {
151 vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP; 151 vcpu->arch.local_int.action_bits &= ~ACTION_STOP_ON_STOP;
152 VCPU_EVENT(vcpu, 3, "%s", "cpu stopped"); 152 VCPU_EVENT(vcpu, 3, "%s", "cpu stopped");
153 rc = -ENOTSUPP; 153 rc = -EOPNOTSUPP;
154 } 154 }
155 155
156 spin_unlock_bh(&vcpu->arch.local_int.lock); 156 spin_unlock_bh(&vcpu->arch.local_int.lock);
@@ -171,9 +171,9 @@ static int handle_validity(struct kvm_vcpu *vcpu)
171 2*PAGE_SIZE); 171 2*PAGE_SIZE);
172 if (rc) 172 if (rc)
173 /* user will receive sigsegv, exit to user */ 173 /* user will receive sigsegv, exit to user */
174 rc = -ENOTSUPP; 174 rc = -EOPNOTSUPP;
175 } else 175 } else
176 rc = -ENOTSUPP; 176 rc = -EOPNOTSUPP;
177 177
178 if (rc) 178 if (rc)
179 VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d", 179 VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d",
@@ -189,7 +189,7 @@ static int handle_instruction(struct kvm_vcpu *vcpu)
189 handler = instruction_handlers[vcpu->arch.sie_block->ipa >> 8]; 189 handler = instruction_handlers[vcpu->arch.sie_block->ipa >> 8];
190 if (handler) 190 if (handler)
191 return handler(vcpu); 191 return handler(vcpu);
192 return -ENOTSUPP; 192 return -EOPNOTSUPP;
193} 193}
194 194
195static int handle_prog(struct kvm_vcpu *vcpu) 195static int handle_prog(struct kvm_vcpu *vcpu)
@@ -206,7 +206,7 @@ static int handle_instruction_and_prog(struct kvm_vcpu *vcpu)
206 rc = handle_instruction(vcpu); 206 rc = handle_instruction(vcpu);
207 rc2 = handle_prog(vcpu); 207 rc2 = handle_prog(vcpu);
208 208
209 if (rc == -ENOTSUPP) 209 if (rc == -EOPNOTSUPP)
210 vcpu->arch.sie_block->icptcode = 0x04; 210 vcpu->arch.sie_block->icptcode = 0x04;
211 if (rc) 211 if (rc)
212 return rc; 212 return rc;
@@ -231,9 +231,9 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu)
231 u8 code = vcpu->arch.sie_block->icptcode; 231 u8 code = vcpu->arch.sie_block->icptcode;
232 232
233 if (code & 3 || (code >> 2) >= ARRAY_SIZE(intercept_funcs)) 233 if (code & 3 || (code >> 2) >= ARRAY_SIZE(intercept_funcs))
234 return -ENOTSUPP; 234 return -EOPNOTSUPP;
235 func = intercept_funcs[code >> 2]; 235 func = intercept_funcs[code >> 2];
236 if (func) 236 if (func)
237 return func(vcpu); 237 return func(vcpu);
238 return -ENOTSUPP; 238 return -EOPNOTSUPP;
239} 239}
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 43486c2408e1..834774d8d5f3 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -10,12 +10,12 @@
10 * Author(s): Carsten Otte <cotte@de.ibm.com> 10 * Author(s): Carsten Otte <cotte@de.ibm.com>
11 */ 11 */
12 12
13#include <asm/lowcore.h>
14#include <asm/uaccess.h>
15#include <linux/hrtimer.h>
16#include <linux/interrupt.h> 13#include <linux/interrupt.h>
17#include <linux/kvm_host.h> 14#include <linux/kvm_host.h>
15#include <linux/hrtimer.h>
18#include <linux/signal.h> 16#include <linux/signal.h>
17#include <asm/asm-offsets.h>
18#include <asm/uaccess.h>
19#include "kvm-s390.h" 19#include "kvm-s390.h"
20#include "gaccess.h" 20#include "gaccess.h"
21 21
@@ -187,8 +187,8 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
187 if (rc == -EFAULT) 187 if (rc == -EFAULT)
188 exception = 1; 188 exception = 1;
189 189
190 rc = put_guest_u64(vcpu, __LC_PFAULT_INTPARM, 190 rc = put_guest_u64(vcpu, __LC_EXT_PARAMS2,
191 inti->ext.ext_params2); 191 inti->ext.ext_params2);
192 if (rc == -EFAULT) 192 if (rc == -EFAULT)
193 exception = 1; 193 exception = 1;
194 break; 194 break;
@@ -342,7 +342,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
342 if (psw_interrupts_disabled(vcpu)) { 342 if (psw_interrupts_disabled(vcpu)) {
343 VCPU_EVENT(vcpu, 3, "%s", "disabled wait"); 343 VCPU_EVENT(vcpu, 3, "%s", "disabled wait");
344 __unset_cpu_idle(vcpu); 344 __unset_cpu_idle(vcpu);
345 return -ENOTSUPP; /* disabled wait */ 345 return -EOPNOTSUPP; /* disabled wait */
346 } 346 }
347 347
348 if (psw_extint_disabled(vcpu) || 348 if (psw_extint_disabled(vcpu) ||
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index f8bcaefd7d34..3fa0a10e4668 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -23,6 +23,7 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/timer.h> 25#include <linux/timer.h>
26#include <asm/asm-offsets.h>
26#include <asm/lowcore.h> 27#include <asm/lowcore.h>
27#include <asm/pgtable.h> 28#include <asm/pgtable.h>
28#include <asm/nmi.h> 29#include <asm/nmi.h>
@@ -543,7 +544,7 @@ rerun_vcpu:
543 rc = -EINTR; 544 rc = -EINTR;
544 } 545 }
545 546
546 if (rc == -ENOTSUPP) { 547 if (rc == -EOPNOTSUPP) {
547 /* intercept cannot be handled in-kernel, prepare kvm-run */ 548 /* intercept cannot be handled in-kernel, prepare kvm-run */
548 kvm_run->exit_reason = KVM_EXIT_S390_SIEIC; 549 kvm_run->exit_reason = KVM_EXIT_S390_SIEIC;
549 kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode; 550 kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode;
@@ -603,45 +604,45 @@ int __kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
603 } else 604 } else
604 prefix = 0; 605 prefix = 0;
605 606
606 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, fp_regs), 607 if (__guestcopy(vcpu, addr + offsetof(struct save_area, fp_regs),
607 vcpu->arch.guest_fpregs.fprs, 128, prefix)) 608 vcpu->arch.guest_fpregs.fprs, 128, prefix))
608 return -EFAULT; 609 return -EFAULT;
609 610
610 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, gp_regs), 611 if (__guestcopy(vcpu, addr + offsetof(struct save_area, gp_regs),
611 vcpu->arch.guest_gprs, 128, prefix)) 612 vcpu->arch.guest_gprs, 128, prefix))
612 return -EFAULT; 613 return -EFAULT;
613 614
614 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, psw), 615 if (__guestcopy(vcpu, addr + offsetof(struct save_area, psw),
615 &vcpu->arch.sie_block->gpsw, 16, prefix)) 616 &vcpu->arch.sie_block->gpsw, 16, prefix))
616 return -EFAULT; 617 return -EFAULT;
617 618
618 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, pref_reg), 619 if (__guestcopy(vcpu, addr + offsetof(struct save_area, pref_reg),
619 &vcpu->arch.sie_block->prefix, 4, prefix)) 620 &vcpu->arch.sie_block->prefix, 4, prefix))
620 return -EFAULT; 621 return -EFAULT;
621 622
622 if (__guestcopy(vcpu, 623 if (__guestcopy(vcpu,
623 addr + offsetof(struct save_area_s390x, fp_ctrl_reg), 624 addr + offsetof(struct save_area, fp_ctrl_reg),
624 &vcpu->arch.guest_fpregs.fpc, 4, prefix)) 625 &vcpu->arch.guest_fpregs.fpc, 4, prefix))
625 return -EFAULT; 626 return -EFAULT;
626 627
627 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, tod_reg), 628 if (__guestcopy(vcpu, addr + offsetof(struct save_area, tod_reg),
628 &vcpu->arch.sie_block->todpr, 4, prefix)) 629 &vcpu->arch.sie_block->todpr, 4, prefix))
629 return -EFAULT; 630 return -EFAULT;
630 631
631 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, timer), 632 if (__guestcopy(vcpu, addr + offsetof(struct save_area, timer),
632 &vcpu->arch.sie_block->cputm, 8, prefix)) 633 &vcpu->arch.sie_block->cputm, 8, prefix))
633 return -EFAULT; 634 return -EFAULT;
634 635
635 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, clk_cmp), 636 if (__guestcopy(vcpu, addr + offsetof(struct save_area, clk_cmp),
636 &vcpu->arch.sie_block->ckc, 8, prefix)) 637 &vcpu->arch.sie_block->ckc, 8, prefix))
637 return -EFAULT; 638 return -EFAULT;
638 639
639 if (__guestcopy(vcpu, addr + offsetof(struct save_area_s390x, acc_regs), 640 if (__guestcopy(vcpu, addr + offsetof(struct save_area, acc_regs),
640 &vcpu->arch.guest_acrs, 64, prefix)) 641 &vcpu->arch.guest_acrs, 64, prefix))
641 return -EFAULT; 642 return -EFAULT;
642 643
643 if (__guestcopy(vcpu, 644 if (__guestcopy(vcpu,
644 addr + offsetof(struct save_area_s390x, ctrl_regs), 645 addr + offsetof(struct save_area, ctrl_regs),
645 &vcpu->arch.sie_block->gcr, 128, prefix)) 646 &vcpu->arch.sie_block->gcr, 128, prefix))
646 return -EFAULT; 647 return -EFAULT;
647 return 0; 648 return 0;
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index d426aac8095d..28c55677eb39 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -323,5 +323,5 @@ int kvm_s390_handle_b2(struct kvm_vcpu *vcpu)
323 else 323 else
324 return handler(vcpu); 324 return handler(vcpu);
325 } 325 }
326 return -ENOTSUPP; 326 return -EOPNOTSUPP;
327} 327}
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 15ee1111de58..241a48459b66 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -172,7 +172,7 @@ static int __sigp_set_arch(struct kvm_vcpu *vcpu, u32 parameter)
172 rc = 0; /* order accepted */ 172 rc = 0; /* order accepted */
173 break; 173 break;
174 default: 174 default:
175 rc = -ENOTSUPP; 175 rc = -EOPNOTSUPP;
176 } 176 }
177 return rc; 177 return rc;
178} 178}
@@ -293,7 +293,7 @@ int kvm_s390_handle_sigp(struct kvm_vcpu *vcpu)
293 vcpu->stat.instruction_sigp_restart++; 293 vcpu->stat.instruction_sigp_restart++;
294 /* user space must know about restart */ 294 /* user space must know about restart */
295 default: 295 default:
296 return -ENOTSUPP; 296 return -EOPNOTSUPP;
297 } 297 }
298 298
299 if (rc < 0) 299 if (rc < 0)