Re: [RFC PATCH 4/4] KVM: vmx: add support for emulating UMIP

From: Paolo Bonzini
Date: Thu Jul 14 2016 - 08:54:40 EST




On 14/07/2016 14:36, Radim KrÄmÃÅ wrote:
>>> And we could then return true in vmx_umip_emulated() when
>>> boot_cpu_has(X86_FEATURE_UMIP).
>>> (Just for self-documentation, because occurrence of X86_FEATURE_UMIP is
>>> most likely a subset of SECONDARY_EXEC_DESC.)
>>
>> This is not necessary because this is how KVM computes
>> CPUID[EAX=7,EBX=0].ECX:
>>
>> unsigned f_umip = kvm_x86_ops->umip_emulated() ? F(UMIP) : 0;
>> ...
>> const u32 kvm_cpuid_7_0_ecx_x86_features = F(PKU) | F(UMIP);
>
> and that too, I'm really sorry for the review.

At least in the latter case, that says something about the code quality too.

Paolo