Re: [PATCH v4 2/5] KVM: X86: Expose PKS to guest

2021-02-05 Thread Paolo Bonzini
On 05/02/21 12:29, Thomas Gleixner wrote: On Fri, Feb 05 2021 at 11:10, Paolo Bonzini wrote: On 05/02/21 10:56, Borislav Petkov wrote: This would need an ack from the x86 people. Andy, Boris? This looks like the PKS baremetal pile needs to be upstream first. Yes, it does. I would like to

Re: [PATCH v4 2/5] KVM: X86: Expose PKS to guest

2021-02-05 Thread Thomas Gleixner
On Fri, Feb 05 2021 at 11:10, Paolo Bonzini wrote: > On 05/02/21 10:56, Borislav Petkov wrote: >>> This would need an ack from the x86 people. Andy, Boris? >> >> This looks like the PKS baremetal pile needs to be upstream first. > > Yes, it does. I would like to have an ack for including the

Re: [PATCH v4 2/5] KVM: X86: Expose PKS to guest

2021-02-05 Thread Paolo Bonzini
On 05/02/21 10:56, Borislav Petkov wrote: On Fri, Feb 05, 2021 at 10:25:48AM +0100, Paolo Bonzini wrote: On 05/02/21 09:37, Chenyi Qiang wrote: diff --git a/arch/x86/mm/pkeys.c b/arch/x86/mm/pkeys.c index 57718716cc70..8027f854c600 100644 --- a/arch/x86/mm/pkeys.c +++ b/arch/x86/mm/pkeys.c @@

Re: [PATCH v4 2/5] KVM: X86: Expose PKS to guest

2021-02-05 Thread Borislav Petkov
On Fri, Feb 05, 2021 at 10:25:48AM +0100, Paolo Bonzini wrote: > On 05/02/21 09:37, Chenyi Qiang wrote: > > > > diff --git a/arch/x86/mm/pkeys.c b/arch/x86/mm/pkeys.c > > index 57718716cc70..8027f854c600 100644 > > --- a/arch/x86/mm/pkeys.c > > +++ b/arch/x86/mm/pkeys.c > > @@ -390,3 +390,9 @@

Re: [PATCH v4 2/5] KVM: X86: Expose PKS to guest

2021-02-05 Thread Paolo Bonzini
On 05/02/21 09:37, Chenyi Qiang wrote: diff --git a/arch/x86/mm/pkeys.c b/arch/x86/mm/pkeys.c index 57718716cc70..8027f854c600 100644 --- a/arch/x86/mm/pkeys.c +++ b/arch/x86/mm/pkeys.c @@ -390,3 +390,9 @@ void pks_key_free(int pkey) __clear_bit(pkey, _key_allocation_map); }

Re: [PATCH v4 2/5] KVM: X86: Expose PKS to guest

2021-02-05 Thread Paolo Bonzini
On 05/02/21 09:37, Chenyi Qiang wrote: + /* +* PKS is not yet implemented for shadow paging. +* If not support VM_{ENTRY, EXIT}_LOAD_IA32_PKRS, +* don't expose the PKS as well. +*/ + if (enable_ept && cpu_has_load_ia32_pkrs()) +

[PATCH v4 2/5] KVM: X86: Expose PKS to guest

2021-02-05 Thread Chenyi Qiang
Protection Keys for Supervisor Pages (PKS) is a feature that extends the Protection Keys architecture to support thread-specific permission restrictions on supervisor pages, which extends an existing feature named PKU (for user-mode pages). PKS uses IA32_PKRS MSR (PKRS) at index 0x6E1 to allow