[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241018130618.GBZxJdSmQXOOgBRDLK@fat_crate.local>
Date: Fri, 18 Oct 2024 15:06:18 +0200
From: Borislav Petkov <bp@...en8.de>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: Dave Hansen <dave.hansen@...el.com>, linux-kernel@...r.kernel.org,
x86@...nel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Michael Roth <michael.roth@....com>,
Ashish Kalra <ashish.kalra@....com>
Subject: Re: [PATCH v3 3/8] x86/sev: Require the RMPREAD instruction after
Fam19h
On Mon, Sep 30, 2024 at 01:59:54PM -0500, Tom Lendacky wrote:
> The one issue we run into is that family 0x19 contains both Milan (zen3)
> and Genoa (zen4), so I'm not sure what to use as a good #define name. We
> have the same problem with family 0x17 which contains zen1 and zen2.
>
> I might be able to change the if statement to something like:
>
> if (!cpu_has(c, X86_FEATURE_HYPERVISOR) &&
> (cpu_feature_enabled(X86_FEATURE_ZEN3) ||
> cpu_feature_enabled(X86_FEATURE_ZEN4) ||
> cpu_feature_enabled(X86_FEATURE_RMPREAD)) &&
> snp_probe_rmptable_info()) {
>
> which might make the intent clearer.
>
> But, yes, I get your point about making grepping much easier, along with
> code readability. Maybe Boris and I can put our heads together to figure
> something out.
Right, that's why I'm adding the synthetic feature flags - for things like
that.
I think it is very readable this way and if this check needs to be repeated,
we can carve it out into a separate helper or so...
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists