From: Greg KH <greg@kroah.com>
To: Babu Moger <babu.moger@amd.com>
Cc: corbet@lwn.net, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, hpa@zytor.com, pbonzini@redhat.com,
sean.j.christopherson@intel.com, stable@vger.kernel.org,
x86@kernel.org, vkuznets@redhat.com, wanpengli@tencent.com,
jmattson@google.com, joro@8bytes.org,
dave.hansen@linux.intel.com, luto@kernel.org,
peterz@infradead.org, mchehab+samsung@kernel.org,
changbin.du@intel.com, namit@vmware.com, bigeasy@linutronix.de,
yang.shi@linux.alibaba.com, asteinhauser@google.com,
anshuman.khandual@arm.com, jan.kiszka@siemens.com,
akpm@linux-foundation.org, steven.price@arm.com,
rppt@linux.vnet.ibm.com, peterx@redhat.com,
dan.j.williams@intel.com, arjunroy@google.com,
logang@deltatee.com, thellstrom@vmware.com, aarcange@redhat.com,
justin.he@arm.com, robin.murphy@arm.com, ira.weiny@intel.com,
keescook@chromium.org, jgross@suse.com,
andrew.cooper3@citrix.com, pawan.kumar.gupta@linux.intel.com,
fenghua.yu@intel.com, vineela.tummalapalli@intel.com,
yamada.masahiro@socionext.com, sam@ravnborg.org, acme@redhat.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Subject: Re: [PATCH 5.4] KVM: x86: Fix pkru save/restore when guest CR4.PKE=0, move it to x86.c
Date: Sat, 23 May 2020 09:49:08 +0200 [thread overview]
Message-ID: <20200523074908.GA3285051@kroah.com> (raw)
In-Reply-To: <159016509437.3131.17229420966309596602.stgit@naples-babu.amd.com>
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: stable@vger.kernel.org
> Reported-by: Jim Mattson <jmattson@google.com>
> Signed-off-by: Babu Moger <babu.moger@amd.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Now applied, thanks.
greg k-h
prev parent reply other threads:[~2020-05-23 7:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-22 16:32 [PATCH 5.4] KVM: x86: Fix pkru save/restore when guest CR4.PKE=0, move it to x86.c Babu Moger
2020-05-22 18:33 ` Paolo Bonzini
2020-05-23 7:49 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200523074908.GA3285051@kroah.com \
--to=greg@kroah.com \
--cc=aarcange@redhat.com \
--cc=acme@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=andrew.cooper3@citrix.com \
--cc=anshuman.khandual@arm.com \
--cc=arjunroy@google.com \
--cc=asteinhauser@google.com \
--cc=babu.moger@amd.com \
--cc=bigeasy@linutronix.de \
--cc=bp@alien8.de \
--cc=changbin.du@intel.com \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=ira.weiny@intel.com \
--cc=jan.kiszka@siemens.com \
--cc=jgross@suse.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=justin.he@arm.com \
--cc=keescook@chromium.org \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=luto@kernel.org \
--cc=mchehab+samsung@kernel.org \
--cc=mingo@redhat.com \
--cc=namit@vmware.com \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=peterz@infradead.org \
--cc=robin.murphy@arm.com \
--cc=rppt@linux.vnet.ibm.com \
--cc=sam@ravnborg.org \
--cc=sean.j.christopherson@intel.com \
--cc=stable@vger.kernel.org \
--cc=steven.price@arm.com \
--cc=tglx@linutronix.de \
--cc=thellstrom@vmware.com \
--cc=vineela.tummalapalli@intel.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
--cc=yamada.masahiro@socionext.com \
--cc=yang.shi@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).