Re: [RFC 6/7] KVM: X86: Expose PKS to guest and userspace

2021-01-26 Thread Paolo Bonzini
On 26/01/21 20:56, Sean Christopherson wrote: It does belong in the mmu_role_bits though;-) Does it? We don't support PKU/PKS for shadow paging, and it's always zero for EPT. We only support enough PKU/PKS for emulation. As proposed, yes. The PKU/PKS mask is tracked on a per-mmu basis,

Re: [RFC 6/7] KVM: X86: Expose PKS to guest and userspace

2021-01-26 Thread Sean Christopherson
On Tue, Jan 26, 2021, Paolo Bonzini wrote: > On 30/09/20 06:36, Sean Christopherson wrote: > > > CR4.PKS is not in the list of CR4 bits that result in a PDPTE load. > > > Since it has no effect on PAE paging, I would be surprised if it did > > > result in a PDPTE load. > > It does belong in the

Re: [RFC 6/7] KVM: X86: Expose PKS to guest and userspace

2021-01-26 Thread Paolo Bonzini
On 30/09/20 06:36, Sean Christopherson wrote: CR4.PKS is not in the list of CR4 bits that result in a PDPTE load. Since it has no effect on PAE paging, I would be surprised if it did result in a PDPTE load. It does belong in the mmu_role_bits though;-) Does it? We don't support PKU/PKS for

Re: [RFC 6/7] KVM: X86: Expose PKS to guest and userspace

2020-09-29 Thread Sean Christopherson
On Thu, Aug 13, 2020 at 12:04:54PM -0700, Jim Mattson wrote: > On Fri, Aug 7, 2020 at 1:47 AM Chenyi Qiang wrote: > > > > Existence of PKS is enumerated via CPUID.(EAX=7H,ECX=0):ECX[31]. It is > > enabled by setting CR4.PKS when long mode is active. PKS is only > > implemented when EPT is enabled

Re: [RFC 6/7] KVM: X86: Expose PKS to guest and userspace

2020-08-13 Thread Chenyi Qiang
On 8/14/2020 3:04 AM, Jim Mattson wrote: On Fri, Aug 7, 2020 at 1:47 AM Chenyi Qiang wrote: Existence of PKS is enumerated via CPUID.(EAX=7H,ECX=0):ECX[31]. It is enabled by setting CR4.PKS when long mode is active. PKS is only implemented when EPT is enabled and requires the support of

Re: [RFC 6/7] KVM: X86: Expose PKS to guest and userspace

2020-08-13 Thread Jim Mattson
On Fri, Aug 7, 2020 at 1:47 AM Chenyi Qiang wrote: > > Existence of PKS is enumerated via CPUID.(EAX=7H,ECX=0):ECX[31]. It is > enabled by setting CR4.PKS when long mode is active. PKS is only > implemented when EPT is enabled and requires the support of VM_{ENTRY, > EXIT}_LOAD_IA32_PKRS

[RFC 6/7] KVM: X86: Expose PKS to guest and userspace

2020-08-07 Thread Chenyi Qiang
Existence of PKS is enumerated via CPUID.(EAX=7H,ECX=0):ECX[31]. It is enabled by setting CR4.PKS when long mode is active. PKS is only implemented when EPT is enabled and requires the support of VM_{ENTRY, EXIT}_LOAD_IA32_PKRS currently. Signed-off-by: Chenyi Qiang ---