Re: [PATCH] KVM: VMX: Set VMENTER_L1D_FLUSH_NOT_REQUIRED if !X86_BUG_L1TF

From: Paolo Bonzini
Date: Fri Sep 27 2019 - 12:04:12 EST


On 27/09/19 17:55, Borislav Petkov wrote:
> I'd move that logic with the if (boot_cpu_has(X86_BUG_L1TF)) check inside
> vmx_setup_l1d_flush() so that I have this:
>
> if (!boot_cpu_has_bug(X86_BUG_L1TF)) {
> l1tf_vmx_mitigation = VMENTER_L1D_FLUSH_NOT_REQUIRED;
> return 0;
> }
>
> if (!enable_ept) {
> ...
>
> }
>
> inside the function and outside am left with:
>
> r = vmx_setup_l1d_flush(vmentry_l1d_flush_param);
> if (r) {
> vmx_exit();
> return r;
> }
>
> only. This way I'm concentrating the whole l1tf_vmx_mitigation picking
> apart in one place.

Right you are, I'm sending v2.

Paolo