Re: [PATCH v6 6/7] KVM: VMX: Expose PKS to guest
From: Sean Christopherson
Date: Wed Mar 30 2022 - 17:30:17 EST
On Mon, Feb 21, 2022, Chenyi Qiang wrote:
> @@ -7454,6 +7455,13 @@ static __init void vmx_set_cpu_caps(void)
>
> if (cpu_has_vmx_waitpkg())
> kvm_cpu_cap_check_and_set(X86_FEATURE_WAITPKG);
> +
> + /*
> + * If not support VM_{ENTRY, EXIT}_LOAD_IA32_PKRS,
> + * don't expose the PKS as well.
> + */
I wouldn't bother with the comment, this pattern is common and the behavior is
self-explanatory.
> + if (cpu_has_load_ia32_pkrs())
> + kvm_cpu_cap_check_and_set(X86_FEATURE_PKS);
> }