[7/7] KVM: PPC: Ignore PIR writes

Submitted by Alexander Graf on June 30, 2013, 1:38 a.m.


Message ID 1372556328-18617-8-git-send-email-agraf@suse.de
State New
Headers show

Commit Message

Alexander Graf June 30, 2013, 1:38 a.m.
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>
 arch/powerpc/kvm/emulate.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 631a265..2c52ada 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -169,6 +169,9 @@  static int kvmppc_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
 		vcpu->arch.shared->sprg3 = spr_val;
+	/* PIR can legally be written, but we ignore it */
+	case SPRN_PIR: break;
 		emulated = kvmppc_core_emulate_mtspr(vcpu, sprn,