[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y1lmASxiV0r2Ldfs@google.com>
Date: Wed, 26 Oct 2022 16:53:21 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Emanuele Giuseppe Esposito <eesposit@...hat.com>
Cc: kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, Bandan Das <bsd@...hat.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v3] KVM: nVMX: Advertise ENCLS_EXITING to L1 iff SGX is
fully supported
On Wed, Oct 26, 2022, Emanuele Giuseppe Esposito wrote:
> Clear enable_sgx if ENCLS-exiting is not supported, i.e. if SGX cannot be
> virtualized. This fixes a bug where KVM would advertise ENCLS-exiting to
> L1 and propagate the control from vmcs12 to vmcs02 even if ENCLS-exiting
> isn't supported in secondary execution controls, e.g. because SGX isn't
> fully enabled, and thus induce an unexpected VM-Fail in L1.
>
> Not updating enable_sgx is responsible for a second bug:
> vmx_set_cpu_caps() doesn't clear the SGX bits when hardware support is
> unavailable. This is a much less problematic bug as it only pops up
> if SGX is soft-disabled (the case being handled by cpu_has_sgx()) or if
> SGX is supported for bare metal but not in the VMCS (will never happen
> when running on bare metal, but can theoertically happen when running in
> a VM).
>
> Last but not least, KVM should ideally have module params reflect KVM's
> actual configuration.
>
> RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2127128
>
> Fixes: 72add915fbd5 ("KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC")
> Cc: stable@...r.kernel.org
>
> Suggested-by: Sean Christopherson <seanjc@...gle.com>
> Suggested-by: Bandan Das <bsd@...hat.com>
> Signed-off-by: Emanuele Giuseppe Esposito <eesposit@...hat.com>
> ---
Reviewed-by: Sean Christopherson <seanjc@...gle.com>
Powered by blists - more mailing lists