[lkml]   [2020]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 5.4] KVM: x86: Fix pkru save/restore when guest CR4.PKE=0, move it to x86.c
On Fri, May 22, 2020 at 11:32:49AM -0500, Babu Moger wrote:
> [Backported upstream commit 37486135d3a7b03acc7755b63627a130437f066a]
> 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.
> While at it, move pkru state save/restore to common code and the
> host_pkru field to kvm_vcpu_arch. This will let SVM support protection keys.
> Cc:
> Reported-by: Jim Mattson <>
> Signed-off-by: Babu Moger <>
> Signed-off-by: Paolo Bonzini <>

Now applied, thanks.

greg k-h

 \ /
  Last update: 2020-05-23 09:49    [W:0.048 / U:1.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site