Skip to content

Commit

Permalink
KVM: PPC: Ignore PIR writes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Graf committed Jun 30, 2013
1 parent 681562c commit a3ff5fb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/powerpc/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ static int kvmppc_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
vcpu->arch.shared->sprg3 = spr_val;
break;

/* PIR can legally be written, but we ignore it */
case SPRN_PIR: break;

default:
emulated = kvmppc_core_emulate_mtspr(vcpu, sprn,
spr_val);
Expand Down

0 comments on commit a3ff5fb

Please sign in to comment.