[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e84b15c2-ec9d-8063-4cf4-42106116fdd9@amd.com>
Date: Tue, 12 May 2020 12:17:59 -0500
From: Babu Moger <babu.moger@....com>
To: Jim Mattson <jmattson@...gle.com>
Cc: Jonathan Corbet <corbet@....net>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"H . Peter Anvin" <hpa@...or.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
the arch/x86 maintainers <x86@...nel.org>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Joerg Roedel <joro@...tes.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
mchehab+samsung@...nel.org, changbin.du@...el.com,
Nadav Amit <namit@...are.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
yang.shi@...ux.alibaba.com,
Anthony Steinhauser <asteinhauser@...gle.com>,
anshuman.khandual@....com, Jan Kiszka <jan.kiszka@...mens.com>,
Andrew Morton <akpm@...ux-foundation.org>,
steven.price@....com, rppt@...ux.vnet.ibm.com, peterx@...hat.com,
Dan Williams <dan.j.williams@...el.com>,
Arjun Roy <arjunroy@...gle.com>, logang@...tatee.com,
Thomas Hellstrom <thellstrom@...are.com>,
Andrea Arcangeli <aarcange@...hat.com>, justin.he@....com,
robin.murphy@....com, ira.weiny@...el.com,
Kees Cook <keescook@...omium.org>,
Juergen Gross <jgross@...e.com>,
Andrew Cooper <andrew.cooper3@...rix.com>,
pawan.kumar.gupta@...ux.intel.com,
"Yu, Fenghua" <fenghua.yu@...el.com>,
vineela.tummalapalli@...el.com, yamada.masahiro@...ionext.com,
sam@...nborg.org, acme@...hat.com, linux-doc@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
kvm list <kvm@...r.kernel.org>
Subject: Re: [PATCH v3 2/3] KVM: x86: Move pkru save/restore to x86.c
On 5/12/20 11:39 AM, Jim Mattson wrote:
> On Mon, May 11, 2020 at 4:33 PM Babu Moger <babu.moger@....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@....com>
>
> I would do the bugfix as a separate commit, to ease backporting it to
> the stable branches.
Ok. Sure.
Powered by blists - more mailing lists