Skip to content

Commit a3ff5fb

Browse files
committed
KVM: PPC: Ignore PIR writes
While technically it's legal to write to PIR and have the identifier changed, we don't implement logic to do so because we simply expose vcpu_id to the guest. So instead, let's ignore writes to PIR. This ensures that we don't inject faults into the guest for something the guest is allowed to do. While at it, we cross our fingers hoping that it also doesn't mind that we broke its PIR read values. Signed-off-by: Alexander Graf <agraf@suse.de>
1 parent 681562c commit a3ff5fb

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎arch/powerpc/kvm/emulate.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ static int kvmppc_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
169169
vcpu->arch.shared->sprg3 = spr_val;
170170
break;
171171

172+
/* PIR can legally be written, but we ignore it */
173+
case SPRN_PIR: break;
174+
172175
default:
173176
emulated = kvmppc_core_emulate_mtspr(vcpu, sprn,
174177
spr_val);

0 commit comments

Comments
 (0)