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]
Date:   Mon, 25 Sep 2023 12:47:16 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Borislav Petkov <bp@...en8.de>
Cc:     LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
        "Chang S. Bae" <chang.seok.bae@...el.com>,
        Arjan van de Ven <arjan@...ux.intel.com>,
        Nikolay Borisov <nik.borisov@...e.com>
Subject: Re: [patch V3 12/30] x86/microcode/intel: Reuse
 intel_cpu_collect_info()

On Thu, Sep 21 2023 at 12:42, Borislav Petkov wrote:

> On Tue, Sep 12, 2023 at 09:58:02AM +0200, Thomas Gleixner wrote:
>>  static int collect_cpu_info(int cpu_num, struct cpu_signature *csig)
>
> You can get rid of that silly wrapper too and use
> intel_collect_cpu_info() in the function pointer assignment directly.
>
> Diff ontop:
>
> ---
>
> diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
> index 4066dd3734ba..581ecfbaf134 100644
> --- a/arch/x86/include/asm/cpu.h
> +++ b/arch/x86/include/asm/cpu.h
> @@ -75,7 +75,7 @@ extern __noendbr void cet_disable(void);
>  
>  struct cpu_signature;
>  
> -void intel_collect_cpu_info(struct cpu_signature *sig);
> +void intel_collect_cpu_info(int unused, struct cpu_signature *sig);

Eew. That's a function exposed to code outside of microcode and just
grows that unused argument for no value and you obviously forgot to
fixup the extern callsite :)
  
> diff --git a/arch/x86/kernel/cpu/microcode/internal.h b/arch/x86/kernel/cpu/microcode/internal.h
> index 051b7956d4fd..b3753025cd4a 100644
> --- a/arch/x86/kernel/cpu/microcode/internal.h
> +++ b/arch/x86/kernel/cpu/microcode/internal.h
> @@ -30,7 +30,7 @@ struct microcode_ops {
>  	 * See also the "Synchronization" section in microcode_core.c.
>  	 */
>  	enum ucode_state (*apply_microcode)(int cpu);
> -	int (*collect_cpu_info)(int cpu, struct cpu_signature *csig);
> +	void (*collect_cpu_info)(int cpu, struct cpu_signature *csig);
>  	void (*finalize_late_load)(int result);

Making this void makes sense, but that's a separate change.

Thanks,

        tglx


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ