[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f9cd603d-8a3f-43fc-a670-75b4d9a6c729@intel.com>
Date: Thu, 31 Oct 2024 11:26:27 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: Borislav Petkov <bp@...en8.de>
CC: Yazen Ghannam <yazen.ghannam@....com>, "Luck, Tony" <tony.luck@...el.com>,
Andy Whitcroft <apw@...onical.com>, Joe Perches <joe@...ches.com>,
"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>, "avadhut.naik@....com"
<avadhut.naik@....com>, "john.allen@....com" <john.allen@....com>,
"mario.limonciello@....com" <mario.limonciello@....com>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>, "Shyam-sundar.S-k@....com"
<Shyam-sundar.S-k@....com>, "richard.gong@....com" <richard.gong@....com>,
"jdelvare@...e.com" <jdelvare@...e.com>, "linux@...ck-us.net"
<linux@...ck-us.net>, "clemens@...isch.de" <clemens@...isch.de>,
"hdegoede@...hat.com" <hdegoede@...hat.com>, "ilpo.jarvinen@...ux.intel.com"
<ilpo.jarvinen@...ux.intel.com>, "linux-pci@...r.kernel.org"
<linux-pci@...r.kernel.org>, "linux-hwmon@...r.kernel.org"
<linux-hwmon@...r.kernel.org>, "platform-driver-x86@...r.kernel.org"
<platform-driver-x86@...r.kernel.org>, "naveenkrishna.chatradhi@....com"
<naveenkrishna.chatradhi@....com>, "carlos.bilbao.osdev@...il.com"
<carlos.bilbao.osdev@...il.com>
Subject: Re: [PATCH] x86/cpufeature: Document cpu_feature_enabled() as the
default to use
On 10/31/2024 3:34 AM, Borislav Petkov wrote:
> From: "Borislav Petkov (AMD)" <bp@...en8.de>
>
> cpu_feature_enabled() should be used in most cases when CPU feature
> support needs to be tested in code. Document that.
>
> Reported-by: Sohil Mehta <sohil.mehta@...el.com>
> Signed-off-by: Borislav Petkov (AMD) <bp@...en8.de>
> ---
> arch/x86/include/asm/cpufeature.h | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
>
Looks good (a minor nit below),
Reviewed-by: Sohil Mehta <sohil.mehta@...el.com>
> diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h
> index 0b9611da6c53..de1ad09fe8d7 100644
> --- a/arch/x86/include/asm/cpufeature.h
> +++ b/arch/x86/include/asm/cpufeature.h
> @@ -132,11 +132,12 @@ extern const char * const x86_bug_flags[NBUGINTS*32];
> x86_this_cpu_test_bit(bit, cpu_info.x86_capability))
>
> /*
> - * This macro is for detection of features which need kernel
> - * infrastructure to be used. It may *not* directly test the CPU
> - * itself. Use the cpu_has() family if you want true runtime
> - * testing of CPU features, like in hypervisor code where you are
> - * supporting a possible guest feature where host support for it
> + * This is the default CPU features testing macro to use in code.
> + *
Does "default CPU feature testing macro" roll better than "default CPU
features testing macro"?
> + * It is for detection of features which need kernel infrastructure to be
> + * used. It may *not* directly test the CPU itself. Use the cpu_has() family
> + * if you want true runtime testing of CPU features, like in hypervisor code
> + * where you are supporting a possible guest feature where host support for it
> * is not relevant.
> */
Powered by blists - more mailing lists