diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2012-09-25 17:12:20 +0000 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-10-05 02:35:11 +0200 |
commit | efcb9383b974114e5f682e531346006f8f2466c0 (patch) | |
tree | be3beb684a5a9d2d6e1e20b36a56ff3cd925e319 /hw/spapr_hcall.c | |
parent | 7e7ec2d290ca5b1bdd555da9852dc5ee60232fe5 (diff) |
pseries: Don't test for MSR_PR for hypercalls under KVM
PAPR hypercalls should only be invoked from the guest kernel, not guest
user programs, that is, with MSR[PR]=0. Currently we check this in
spapr_hypercall, returning H_PRIVILEGE if MSR[PR]=1.
However, under KVM the state of MSR[PR] is already checked by the host
kernel before passing the hypercall to qemu, making this check redundant.
Worse, however, we don't generally synchronize KVM and qemu state on the
hypercall path, meaning that qemu could incorrectly reject a hypercall
because it has a stale MSR value.
This patch fixes the problem by moving the privilege test exclusively to
the TCG hypercall path.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
CC: qemu-stable@nongnu.org
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/spapr_hcall.c')
-rw-r--r-- | hw/spapr_hcall.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c index 826ca673fc..194d9c24b5 100644 --- a/hw/spapr_hcall.c +++ b/hw/spapr_hcall.c @@ -681,11 +681,6 @@ void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn) target_ulong spapr_hypercall(CPUPPCState *env, target_ulong opcode, target_ulong *args) { - if (msr_pr) { - hcall_dprintf("Hypercall made with MSR[PR]=1\n"); - return H_PRIVILEGE; - } - if ((opcode <= MAX_HCALL_OPCODE) && ((opcode & 0x3) == 0)) { spapr_hcall_fn fn = papr_hypercall_table[opcode / 4]; |