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: <YNyaXr9yfi/paLt/@zn.tnic>
Date:   Wed, 30 Jun 2021 18:22:54 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Yazen Ghannam <yazen.ghannam@....com>
Cc:     linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
        mchehab@...nel.org, tony.luck@...el.com,
        Smita.KoralahalliChannabasappa@....com
Subject: Re: [PATCH v2 04/31] EDAC/amd64: Allow for DF Indirect Broadcast
 reads

On Wed, Jun 23, 2021 at 07:19:35PM +0000, Yazen Ghannam wrote:
> The DF Indirect Access method allows for "Broadcast" accesses in which
> case no specific instance is targeted. Add support using a reserved
> instance ID of 0xFF to indicate a broadcast access. Set the FICAA
> register appropriately.
> 
> Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
> ---
> Link:
> https://lkml.kernel.org/r/20210507190140.18854-1-Yazen.Ghannam@amd.com
> 
> v1->v2:
> * New in v2.
> 
>  drivers/edac/amd64_edac.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
> index b94067e3952b..d67cd8f57b94 100644
> --- a/drivers/edac/amd64_edac.c
> +++ b/drivers/edac/amd64_edac.c
> @@ -1010,7 +1010,11 @@ struct df_reg {
>   *
>   * Fabric Indirect Configuration Access Data (FICAD): There are FICAD LO
>   * and FICAD HI registers but so far we only need the LO register.
> + *
> + * Use Instance Id 0xFF to indicate a broadcast read.
>   */
> +
> +#define DF_BROADCAST	0xFF
>  static int amd_df_indirect_read(u16 node, struct df_reg reg, u8 instance_id, u32 *lo)
>  {
>  	struct pci_dev *F4;
> @@ -1024,7 +1028,7 @@ static int amd_df_indirect_read(u16 node, struct df_reg reg, u8 instance_id, u32
>  	if (!F4)
>  		goto out;
>  
> -	ficaa  = 1;
> +	ficaa  = (instance_id == DF_BROADCAST) ? 0 : 1;

Or, you can define two functions:

df_indirect_read_broadcast()
df_indirect_read_umc()

(no need for the "amd_" prefix either - this is a static function now)

which both call a low-level helper:

static int __df_indirect_read(u16 node, struct df_reg reg, u8 instance_id, u32 *lo)

and there you either pass the instance_id or 0xff depending on which
outer function is calling it...

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ