Skip to content
  • David Gibson's avatar
    pseries: Don't test for MSR_PR for hypercalls under KVM · efcb9383
    David Gibson authored
    
    
    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: default avatarDavid Gibson <david@gibson.dropbear.id.au>
    CC: qemu-stable@nongnu.org
    Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
    efcb9383