History

KVM: s390: irq delivery should not rely on icptcode

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.

David Hildenbrand committed 11 years ago

Commit eaa4f411 parent f6af84e3 files · +4 −1Browse files

Unified · Split

3 files
  1. arch/s390/kvm/intercept.c +2 −0
  2. arch/s390/kvm/interrupt.c +1 −1
  3. include/uapi/linux/kvm.h +1 −0
arch/s390/kvm/intercept.c+2−0
@@ -140,6 +140,8 @@ static int inject_prog_on_prog_intercept(struct kvm_vcpu *vcpu) · 139 unmodified lines
140140 {
141141 struct kvm_s390_pgm_info pgm_info = {
142142 .code = vcpu->arch.sie_block->iprcc,
143+ /* the PSW has already been rewound */
144+ .flags = KVM_S390_PGM_FLAGS_NO_REWIND,
143145 };
144146
145147 switch (vcpu->arch.sie_block->iprcc & ~PGM_PER) {
arch/s390/kvm/interrupt.c+1−1
@@ -665,7 +665,7 @@ static int __must_check __deliver_prog(struct kvm_vcpu *vcpu) · 664 unmodified lines
665665 (u8 *) __LC_PER_ACCESS_ID);
666666 }
667667
668− if (nullifying && vcpu->arch.sie_block->icptcode == ICPT_INST)
668+ if (nullifying && !(pgm_info.flags & KVM_S390_PGM_FLAGS_NO_REWIND))
669669 kvm_s390_rewind_psw(vcpu, ilen);
670670
671671 /* bit 1+2 of the target are the ilc, so we can directly use ilen */
include/uapi/linux/kvm.h+1−0
@@ -545,6 +545,7 @@ struct kvm_s390_pgm_info { · 544 unmodified lines
545545 #define KVM_S390_PGM_FLAGS_ILC_0 0x02
546546 #define KVM_S390_PGM_FLAGS_ILC_1 0x04
547547 #define KVM_S390_PGM_FLAGS_ILC_MASK 0x06
548+#define KVM_S390_PGM_FLAGS_NO_REWIND 0x08
548549 __u8 flags;
549550 __u8 pad[2];
550551 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t