lkml.org 
[lkml]   [2022]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v7 7/8] KVM: VMX: Expose PKS to guest
From
On 5/25/2022 7:34 AM, Sean Christopherson wrote:
> On Sun, Apr 24, 2022, Lei Wang wrote:
>> diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c
>> index 9d0588e85410..cbcb0d7b47a4 100644
>> --- a/arch/x86/kvm/vmx/vmx.c
>> +++ b/arch/x86/kvm/vmx/vmx.c
>> @@ -3250,7 +3250,7 @@ void vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
>> }
>>
>> /*
>> - * SMEP/SMAP/PKU is disabled if CPU is in non-paging mode in
>> + * SMEP/SMAP/PKU/PKS is disabled if CPU is in non-paging mode in
>> * hardware. To emulate this behavior, SMEP/SMAP/PKU needs
> Heh, missed one ;-) Let's reduce future pain and reword this whole comment:
>
> /*
> * SMEP/SMAP/PKU/PKS are effectively disabled if the CPU is in
> * non-paging mode in hardware. To emulate this behavior,
> * clear them in the hardware CR4 when the guest switches to
> * non-paging mode and unrestricted guest is disabled, as KVM
> * must run the guest with hardware CR0.PG=1.
> */
>
Nice catch, will fix it ;-)

\
 
 \ /
  Last update: 2022-05-27 11:43    [W:0.546 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site