[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <85v7tq5d47.fsf@amd.com>
Date: Tue, 4 Feb 2025 08:27:04 +0000
From: Nikunj A Dadhania <nikunj@....com>
To: Sean Christopherson <seanjc@...gle.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>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>, Juergen Gross
<jgross@...e.com>, "K. Y. Srinivasan" <kys@...rosoft.com>, Haiyang Zhang
<haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>, Dexuan Cui
<decui@...rosoft.com>, Ajay Kaher <ajay.kaher@...adcom.com>, "Alexey
Makhalov" <alexey.amakhalov@...adcom.com>, Jan Kiszka
<jan.kiszka@...mens.com>, Paolo Bonzini <pbonzini@...hat.com>, "Andy
Lutomirski" <luto@...nel.org>, Peter Zijlstra <peterz@...radead.org>
CC: <linux-kernel@...r.kernel.org>, <linux-coco@...ts.linux.dev>,
<virtualization@...ts.linux.dev>, <linux-hyperv@...r.kernel.org>,
<jailhouse-dev@...glegroups.com>, <kvm@...r.kernel.org>,
<xen-devel@...ts.xenproject.org>, Sean Christopherson <seanjc@...gle.com>,
Tom Lendacky <thomas.lendacky@....com>
Subject: Re: [PATCH 05/16] x86/sev: Move check for SNP Secure TSC support to
tsc_early_init()
Sean Christopherson <seanjc@...gle.com> writes:
> Move the check on having a Secure TSC to the common tsc_early_init() so
> that it's obvious that having a Secure TSC is conditional, and to prepare
> for adding TDX to the mix (blindly initializing *both* SNP and TDX TSC
> logic looks especially weird).
Agree.
>
> No functional change intended.
>
> Cc: Nikunj A Dadhania <nikunj@....com>
> Cc: Tom Lendacky <thomas.lendacky@....com>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
Reviewed-by: Nikunj A Dadhania <nikunj@....com>
> ---
> arch/x86/coco/sev/core.c | 3 ---
> arch/x86/kernel/tsc.c | 3 ++-
> 2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index e6ce4ca72465..dab386f782ce 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -3284,9 +3284,6 @@ void __init snp_secure_tsc_init(void)
> {
> unsigned long long tsc_freq_mhz;
>
> - if (!cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
> - return;
> -
> setup_force_cpu_cap(X86_FEATURE_TSC_KNOWN_FREQ);
> setup_force_cpu_cap(X86_FEATURE_TSC_RELIABLE);
>
> diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
> index 5a16271b7a5c..09ca0cbd4f31 100644
> --- a/arch/x86/kernel/tsc.c
> +++ b/arch/x86/kernel/tsc.c
> @@ -1514,7 +1514,8 @@ void __init tsc_early_init(void)
> if (is_early_uv_system())
> return;
>
> - snp_secure_tsc_init();
> + if (cc_platform_has(CC_ATTR_GUEST_SNP_SECURE_TSC))
> + snp_secure_tsc_init();
>
> if (!determine_cpu_tsc_frequencies(true))
> return;
> --
> 2.48.1.362.g079036d154-goog
Powered by blists - more mailing lists