On Mon, 3 Feb 2020 08:19:55 -0500 Christian Borntraeger <borntraeger@xxxxxxxxxx> wrote: > From: Janosch Frank <frankja@xxxxxxxxxxxxx> > > We're not allowed to inject interrupts on those intercept codes. As our Spell out what these codes actually are? > PSW is just a copy of the real one that will be replaced on the next > exit, we can mask out the interrupt bits in the PSW to make sure that we > do not inject anything. > > Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx> > --- > arch/s390/kvm/kvm-s390.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c > index d4dc156e2c3e..137ae5dc9101 100644 > --- a/arch/s390/kvm/kvm-s390.c > +++ b/arch/s390/kvm/kvm-s390.c > @@ -4050,6 +4050,7 @@ static int vcpu_post_run(struct kvm_vcpu *vcpu, int exit_reason) > return vcpu_post_run_fault_in_sie(vcpu); > } > > +#define PSW_INT_MASK (PSW_MASK_EXT | PSW_MASK_IO | PSW_MASK_MCHECK) > static int __vcpu_run(struct kvm_vcpu *vcpu) > { > int rc, exit_reason; > @@ -4082,10 +4083,15 @@ static int __vcpu_run(struct kvm_vcpu *vcpu) > } > exit_reason = sie64a(vcpu->arch.sie_block, > vcpu->run->s.regs.gprs); > + /* This will likely be moved into a new function. */ Hm? > if (kvm_s390_pv_is_protected(vcpu->kvm)) { > memcpy(vcpu->run->s.regs.gprs, > sie_page->pv_grregs, > sizeof(sie_page->pv_grregs)); > + if (vcpu->arch.sie_block->icptcode == ICPT_PV_INSTR || > + vcpu->arch.sie_block->icptcode == ICPT_PV_PREF) { > + vcpu->arch.sie_block->gpsw.mask &= ~PSW_INT_MASK; > + } > } > local_irq_disable(); > __enable_cpu_timer_accounting(vcpu);