Commit 353cbc6a authored by Janosch Frank's avatar Janosch Frank Committed by Christian Borntraeger

KVM: s390: protvirt: STSI handling

Save response to sidad and disable address checking for protected
guests.
Signed-off-by: default avatarJanosch Frank <frankja@linux.ibm.com>
Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
[borntraeger@de.ibm.com: patch merging, splitting, fixing]
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 22d768c3
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* /*
* handling privileged instructions * handling privileged instructions
* *
* Copyright IBM Corp. 2008, 2018 * Copyright IBM Corp. 2008, 2020
* *
* Author(s): Carsten Otte <cotte@de.ibm.com> * Author(s): Carsten Otte <cotte@de.ibm.com>
* Christian Borntraeger <borntraeger@de.ibm.com> * Christian Borntraeger <borntraeger@de.ibm.com>
...@@ -872,7 +872,7 @@ static int handle_stsi(struct kvm_vcpu *vcpu) ...@@ -872,7 +872,7 @@ static int handle_stsi(struct kvm_vcpu *vcpu)
operand2 = kvm_s390_get_base_disp_s(vcpu, &ar); operand2 = kvm_s390_get_base_disp_s(vcpu, &ar);
if (operand2 & 0xfff) if (!kvm_s390_pv_cpu_is_protected(vcpu) && (operand2 & 0xfff))
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
switch (fc) { switch (fc) {
...@@ -893,8 +893,13 @@ static int handle_stsi(struct kvm_vcpu *vcpu) ...@@ -893,8 +893,13 @@ static int handle_stsi(struct kvm_vcpu *vcpu)
handle_stsi_3_2_2(vcpu, (void *) mem); handle_stsi_3_2_2(vcpu, (void *) mem);
break; break;
} }
if (kvm_s390_pv_cpu_is_protected(vcpu)) {
rc = write_guest(vcpu, operand2, ar, (void *)mem, PAGE_SIZE); memcpy((void *)sida_origin(vcpu->arch.sie_block), (void *)mem,
PAGE_SIZE);
rc = 0;
} else {
rc = write_guest(vcpu, operand2, ar, (void *)mem, PAGE_SIZE);
}
if (rc) { if (rc) {
rc = kvm_s390_inject_prog_cond(vcpu, rc); rc = kvm_s390_inject_prog_cond(vcpu, rc);
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment