Program irq injection during program irq intercepts is the last candidates that injects nullifying irqs and relies on delivery to do the right thing. As we should not rely on the icptcode during any delivery (because that value will not be migrated), let's add a flag, telling prog IRQ delivery to not rewind the PSW in case of nullifying prog IRQs.
Unified · Split
| @@ -140,6 +140,8 @@ static int inject_prog_on_prog_intercept(struct kvm_vcpu *vcpu) · 139 unmodified lines | ||
| 140 | 140 | { |
| 141 | 141 | struct kvm_s390_pgm_info pgm_info = { |
| 142 | 142 | .code = vcpu->arch.sie_block->iprcc, |
| 143 | + /* the PSW has already been rewound */ | |
| 144 | + .flags = KVM_S390_PGM_FLAGS_NO_REWIND, | |
| 143 | 145 | }; |
| 144 | 146 | |
| 145 | 147 | switch (vcpu->arch.sie_block->iprcc & ~PGM_PER) { |
| @@ -665,7 +665,7 @@ static int __must_check __deliver_prog(struct kvm_vcpu *vcpu) · 664 unmodified lines | ||
| 665 | 665 | (u8 *) __LC_PER_ACCESS_ID); |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | − if (nullifying && vcpu->arch.sie_block->icptcode == ICPT_INST) | |
| 668 | + if (nullifying && !(pgm_info.flags & KVM_S390_PGM_FLAGS_NO_REWIND)) | |
| 669 | 669 | kvm_s390_rewind_psw(vcpu, ilen); |
| 670 | 670 | |
| 671 | 671 | /* bit 1+2 of the target are the ilc, so we can directly use ilen */ |
| @@ -545,6 +545,7 @@ struct kvm_s390_pgm_info { · 544 unmodified lines | ||
| 545 | 545 | #define KVM_S390_PGM_FLAGS_ILC_0 0x02 |
| 546 | 546 | #define KVM_S390_PGM_FLAGS_ILC_1 0x04 |
| 547 | 547 | #define KVM_S390_PGM_FLAGS_ILC_MASK 0x06 |
| 548 | +#define KVM_S390_PGM_FLAGS_NO_REWIND 0x08 | |
| 548 | 549 | __u8 flags; |
| 549 | 550 | __u8 pad[2]; |
| 550 | 551 | }; |