Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2021-02-01 Thread Paolo Bonzini
On 01/02/21 10:53, Chenyi Qiang wrote: Is the guest expected to do a lot of reads/writes to the MSR (e.g. at every context switch)? Even if this is the case, the MSR intercepts and the entry/exit controls should only be done if CR4.PKS=1.  If the guest does not use PKS, KVM should behave

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2021-02-01 Thread Chenyi Qiang
On 1/27/2021 2:01 AM, Paolo Bonzini wrote: On 07/08/20 10:48, Chenyi Qiang wrote: +{ +    struct vcpu_vmx *vmx = to_vmx(vcpu); +    unsigned long *msr_bitmap = vmx->vmcs01.msr_bitmap; +    bool pks_supported = guest_cpuid_has(vcpu, X86_FEATURE_PKS); + +    /* + * set intercept for PKRS

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2021-01-27 Thread Chenyi Qiang
On 1/27/2021 2:01 AM, Paolo Bonzini wrote: On 07/08/20 10:48, Chenyi Qiang wrote: +{ +    struct vcpu_vmx *vmx = to_vmx(vcpu); +    unsigned long *msr_bitmap = vmx->vmcs01.msr_bitmap; +    bool pks_supported = guest_cpuid_has(vcpu, X86_FEATURE_PKS); + +    /* + * set intercept for PKRS

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2021-01-26 Thread Paolo Bonzini
On 07/08/20 10:48, Chenyi Qiang wrote: +{ + struct vcpu_vmx *vmx = to_vmx(vcpu); + unsigned long *msr_bitmap = vmx->vmcs01.msr_bitmap; + bool pks_supported = guest_cpuid_has(vcpu, X86_FEATURE_PKS); + + /* +* set intercept for PKRS when the guest doesn't support

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2020-08-21 Thread Sean Christopherson
On Tue, Aug 18, 2020 at 11:23:47AM -0700, Jim Mattson wrote: > On Tue, Aug 18, 2020 at 12:28 AM Chenyi Qiang wrote: > > > > > > > > On 8/14/2020 1:31 AM, Jim Mattson wrote: > > > On Wed, Aug 12, 2020 at 10:42 PM Chenyi Qiang > > > wrote: > > >> > > >> > > >> > > >> On 8/13/2020 5:21 AM, Jim

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2020-08-18 Thread Jim Mattson
On Tue, Aug 18, 2020 at 12:28 AM Chenyi Qiang wrote: > > > > On 8/14/2020 1:31 AM, Jim Mattson wrote: > > On Wed, Aug 12, 2020 at 10:42 PM Chenyi Qiang > > wrote: > >> > >> > >> > >> On 8/13/2020 5:21 AM, Jim Mattson wrote: > >>> On Fri, Aug 7, 2020 at 1:46 AM Chenyi Qiang > >>> wrote: >

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2020-08-18 Thread Chenyi Qiang
On 8/14/2020 1:31 AM, Jim Mattson wrote: On Wed, Aug 12, 2020 at 10:42 PM Chenyi Qiang wrote: On 8/13/2020 5:21 AM, Jim Mattson wrote: On Fri, Aug 7, 2020 at 1:46 AM Chenyi Qiang wrote: Protection Keys for Supervisor Pages (PKS) uses IA32_PKRS MSR (PKRS) at index 0x6E1 to allow

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2020-08-13 Thread Jim Mattson
On Wed, Aug 12, 2020 at 10:42 PM Chenyi Qiang wrote: > > > > On 8/13/2020 5:21 AM, Jim Mattson wrote: > > On Fri, Aug 7, 2020 at 1:46 AM Chenyi Qiang wrote: > >> > >> Protection Keys for Supervisor Pages (PKS) uses IA32_PKRS MSR (PKRS) at > >> index 0x6E1 to allow software to manage supervisor

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2020-08-12 Thread Chenyi Qiang
On 8/13/2020 5:21 AM, Jim Mattson wrote: On Fri, Aug 7, 2020 at 1:46 AM Chenyi Qiang wrote: Protection Keys for Supervisor Pages (PKS) uses IA32_PKRS MSR (PKRS) at index 0x6E1 to allow software to manage supervisor protection key rights. For performance consideration, PKRS intercept will

Re: [RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2020-08-12 Thread Jim Mattson
On Fri, Aug 7, 2020 at 1:46 AM Chenyi Qiang wrote: > > Protection Keys for Supervisor Pages (PKS) uses IA32_PKRS MSR (PKRS) at > index 0x6E1 to allow software to manage supervisor protection key > rights. For performance consideration, PKRS intercept will be disabled > so that the guest can

[RFC 2/7] KVM: VMX: Expose IA32_PKRS MSR

2020-08-07 Thread Chenyi Qiang
Protection Keys for Supervisor Pages (PKS) uses IA32_PKRS MSR (PKRS) at index 0x6E1 to allow software to manage supervisor protection key rights. For performance consideration, PKRS intercept will be disabled so that the guest can access the PKRS without VM exits. PKS introduces dedicated control