lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251009175852.bpqdfqbrun4kkclh@desk>
Date: Thu, 9 Oct 2025 10:58:52 -0700
From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
To: Petr Tesarik <ptesarik@...e.com>
Cc: "H. Peter Anvin" <hpa@...or.com>, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
	"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/2] x86/tsx: Make tsx_ctrl_state static

On Fri, Sep 26, 2025 at 08:01:01PM +0200, Petr Tesarik wrote:
> Move all definitions related to tsx_ctrl_state to tsx.c. They are
> never referenced outside this file.
> 
> No functional change.
> 
> Signed-off-by: Petr Tesarik <ptesarik@...e.com>
> ---
>  arch/x86/kernel/cpu/cpu.h |  9 ---------
>  arch/x86/kernel/cpu/tsx.c | 10 +++++++++-
>  2 files changed, 9 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h
> index bc38b2d56f26a..5c7a3a71191a1 100644
> --- a/arch/x86/kernel/cpu/cpu.h
> +++ b/arch/x86/kernel/cpu/cpu.h
> @@ -42,15 +42,6 @@ extern const struct cpu_dev *const __x86_cpu_dev_start[],
>  			    *const __x86_cpu_dev_end[];
>  
>  #ifdef CONFIG_CPU_SUP_INTEL
> -enum tsx_ctrl_states {
> -	TSX_CTRL_ENABLE,
> -	TSX_CTRL_DISABLE,
> -	TSX_CTRL_RTM_ALWAYS_ABORT,
> -	TSX_CTRL_NOT_SUPPORTED,
> -};
> -
> -extern __ro_after_init enum tsx_ctrl_states tsx_ctrl_state;
> -
>  extern void __init tsx_init(void);
>  void tsx_ap_init(void);
>  void intel_unlock_cpuid_leafs(struct cpuinfo_x86 *c);
> diff --git a/arch/x86/kernel/cpu/tsx.c b/arch/x86/kernel/cpu/tsx.c
> index 49782724a9430..167dfd38b87a2 100644
> --- a/arch/x86/kernel/cpu/tsx.c
> +++ b/arch/x86/kernel/cpu/tsx.c
> @@ -19,7 +19,15 @@
>  #undef pr_fmt
>  #define pr_fmt(fmt) "tsx: " fmt
>  
> -enum tsx_ctrl_states tsx_ctrl_state __ro_after_init = TSX_CTRL_NOT_SUPPORTED;
> +enum tsx_ctrl_states {
> +	TSX_CTRL_ENABLE,
> +	TSX_CTRL_DISABLE,
> +	TSX_CTRL_RTM_ALWAYS_ABORT,
> +	TSX_CTRL_NOT_SUPPORTED,
> +};
> +
> +static enum tsx_ctrl_states tsx_ctrl_state __ro_after_init =
> +	TSX_CTRL_NOT_SUPPORTED;

Nit, this can be on the same line:

static enum tsx_ctrl_states tsx_ctrl_state __ro_after_init = TSX_CTRL_NOT_SUPPORTED;

It is still under the 100 character limit.

Reviewed-by: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ