lkml.org 
[lkml]   [2020]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH v3 2/3] KVM: x86: Move pkru save/restore to x86.c
    On Mon, May 11, 2020 at 4:33 PM Babu Moger <babu.moger@amd.com> wrote:
    >
    > MPK feature is supported by both VMX and SVM. So we can
    > safely move pkru state save/restore to common code. Also
    > move all the pkru data structure to kvm_vcpu_arch.
    >
    > Also fixes the problem Jim Mattson pointed and suggested below.
    >
    > "Though rdpkru and wrpkru are contingent upon CR4.PKE, the PKRU
    > resource isn't. It can be read with XSAVE and written with XRSTOR.
    > So, if we don't set the guest PKRU value here(kvm_load_guest_xsave_state),
    > the guest can read the host value.
    >
    > In case of kvm_load_host_xsave_state, guest with CR4.PKE clear could
    > potentially use XRSTOR to change the host PKRU value"
    >
    > Signed-off-by: Babu Moger <babu.moger@amd.com>

    I would do the bugfix as a separate commit, to ease backporting it to
    the stable branches.

    \
     
     \ /
      Last update: 2020-05-12 18:41    [W:3.776 / U:0.128 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site