On 05.02.20 10:51, Thomas Huth wrote: > On 03/02/2020 14.19, Christian Borntraeger wrote: >> From: Michael Mueller <mimu@xxxxxxxxxxxxx> >> >> The patch implements interruption injection for the following >> list of interruption types: >> >> - I/O >> __deliver_io (III) >> >> - External >> __deliver_cpu_timer (IEI) >> __deliver_ckc (IEI) >> __deliver_emergency_signal (IEI) >> __deliver_external_call (IEI) >> >> - cpu restart >> __deliver_restart (IRI) >> >> The service interrupt is handled in a followup patch. >> >> Signed-off-by: Michael Mueller <mimu@xxxxxxxxxxxxx> >> Signed-off-by: Christian Borntraeger <borntraeger@xxxxxxxxxx> >> [fixes] >> --- >> arch/s390/include/asm/kvm_host.h | 8 +++ >> arch/s390/kvm/interrupt.c | 93 ++++++++++++++++++++++---------- >> 2 files changed, 74 insertions(+), 27 deletions(-) >> >> diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h >> index a45d10d87a8a..989cea7a5591 100644 >> --- a/arch/s390/include/asm/kvm_host.h >> +++ b/arch/s390/include/asm/kvm_host.h >> @@ -563,6 +563,14 @@ enum irq_types { >> #define IRQ_PEND_MCHK_MASK ((1UL << IRQ_PEND_MCHK_REP) | \ >> (1UL << IRQ_PEND_MCHK_EX)) >> >> +#define IRQ_PEND_MCHK_REP_MASK (1UL << IRQ_PEND_MCHK_REP) >> + >> +#define IRQ_PEND_EXT_II_MASK ((1UL << IRQ_PEND_EXT_CPU_TIMER) | \ >> + (1UL << IRQ_PEND_EXT_CLOCK_COMP) | \ >> + (1UL << IRQ_PEND_EXT_EMERGENCY) | \ >> + (1UL << IRQ_PEND_EXT_EXTERNAL) | \ >> + (1UL << IRQ_PEND_EXT_SERVICE)) >> + >> struct kvm_s390_interrupt_info { >> struct list_head list; >> u64 type; >> diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c >> index c06c89d370a7..ecdec6960a60 100644 >> --- a/arch/s390/kvm/interrupt.c >> +++ b/arch/s390/kvm/interrupt.c >> @@ -387,6 +387,12 @@ static unsigned long deliverable_irqs(struct kvm_vcpu *vcpu) >> __clear_bit(IRQ_PEND_EXT_SERVICE, &active_mask); >> if (psw_mchk_disabled(vcpu)) >> active_mask &= ~IRQ_PEND_MCHK_MASK; >> + /* PV guest cpus can have a single interruption injected at a time. */ >> + if (kvm_s390_pv_is_protected(vcpu->kvm) && >> + vcpu->arch.sie_block->iictl != IICTL_CODE_NONE) >> + active_mask &= ~(IRQ_PEND_EXT_II_MASK | >> + IRQ_PEND_IO_MASK | >> + IRQ_PEND_MCHK_REP_MASK); > > I don't quite understand why there is a difference between > IRQ_PEND_MCHK_REP and IRQ_PEND_MCHK_EX here? Why not simply use > IRQ_PEND_MCHK_MASK here? Could you elaborate? (and maybe add a sentence > to the patch description) I changed to IRQ_PEND_MCHK_MASK by just considering the existing interrupt as delivered. > >> @@ -533,7 +547,6 @@ static int __must_check __deliver_pfault_init(struct kvm_vcpu *vcpu) >> trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id, >> KVM_S390_INT_PFAULT_INIT, >> 0, ext.ext_params2); >> - > > Nit: Unnecessary white space change. ack