[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <59a6157f-973d-8568-7b3f-bb9290cece99@amd.com>
Date: Tue, 6 Aug 2024 09:12:18 -0500
From: Tom Lendacky <thomas.lendacky@....com>
To: Ravi Bangoria <ravi.bangoria@....com>, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
seanjc@...gle.com, pbonzini@...hat.com, jmattson@...gle.com
Cc: hpa@...or.com, rmk+kernel@...linux.org.uk, peterz@...radead.org,
james.morse@....com, lukas.bulwahn@...il.com, arjan@...ux.intel.com,
j.granados@...sung.com, sibs@...natelecom.cn, nik.borisov@...e.com,
michael.roth@....com, nikunj.dadhania@....com, babu.moger@....com,
x86@...nel.org, kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
santosh.shukla@....com, ananth.narayan@....com, sandipan.das@....com,
manali.shukla@....com
Subject: Re: [PATCH v3 3/4] KVM: SVM: Don't advertise Bus Lock Detect to guest
if SVM support is missing
On 8/6/24 07:54, Ravi Bangoria wrote:
> If host supports Bus Lock Detect, KVM advertises it to guests even if
> SVM support is absent. Additionally, guest wouldn't be able to use it
> despite guest CPUID bit being set. Fix it by unconditionally clearing
> the feature bit in KVM cpu capability.
>
> Reported-by: Jim Mattson <jmattson@...gle.com>
> Closes: https://lore.kernel.org/r/CALMp9eRet6+v8Y1Q-i6mqPm4hUow_kJNhmVHfOV8tMfuSS=tVg@mail.gmail.com
> Fixes: 76ea438b4afc ("KVM: X86: Expose bus lock debug exception to guest")
> Cc: stable@...r.kernel.org
> Signed-off-by: Ravi Bangoria <ravi.bangoria@....com>
> Reviewed-by: Jim Mattson <jmattson@...gle.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@....com>
> ---
> arch/x86/kvm/svm/svm.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index c115d26844f7..85631112c872 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -5223,6 +5223,9 @@ static __init void svm_set_cpu_caps(void)
>
> /* CPUID 0x8000001F (SME/SEV features) */
> sev_set_cpu_caps();
> +
> + /* Don't advertise Bus Lock Detect to guest if SVM support is absent */
> + kvm_cpu_cap_clear(X86_FEATURE_BUS_LOCK_DETECT);
> }
>
> static __init int svm_hardware_setup(void)
Powered by blists - more mailing lists