lkml.org 
[lkml]   [2017]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 2/2] KVM: VMX: Fix VPID capability detection
From
Date
On 17/10/2017 19:43, Jim Mattson wrote:
>> + &vmx_capability.ept, &vmx_capability.vpid);
>> +
>> if (_cpu_based_2nd_exec_control & SECONDARY_EXEC_ENABLE_EPT) {
>> /* CR3 accesses and invlpg don't need to cause VM Exits when EPT
>> enabled */
>> _cpu_based_exec_control &= ~(CPU_BASED_CR3_LOAD_EXITING |
>> CPU_BASED_CR3_STORE_EXITING |
>> CPU_BASED_INVLPG_EXITING);
>> - rdmsr(MSR_IA32_VMX_EPT_VPID_CAP,
>> - vmx_capability.ept, vmx_capability.vpid);
>> - }
>> + } else
>> + vmx_capability.ept = 0;
> I would expect vmx_capability.ept to already be 0 here. Otherwise, L0
> is reporting inconsistent VMX capabilities.
>
>> + if (!(_cpu_based_2nd_exec_control & SECONDARY_EXEC_ENABLE_VPID))
>> + vmx_capability.vpid = 0;
> I would expect vmx_capability.vpid to already be 0 here. Otherwise, L0
> is reporting inconsistent VMX capabilities.
>

That's true, but I think it's better to be safe. Maybe add a pr_warn if
it is not zero?

Paolo

\
 
 \ /
  Last update: 2017-10-17 19:48    [W:0.047 / U:7.100 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site