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:   Wed, 30 Jun 2021 19:27:07 +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 07/31] EDAC/amd64: Define functions for DramOffset

On Wed, Jun 23, 2021 at 07:19:38PM +0000, Yazen Ghannam wrote:
> Add helper functions to read the DramOffset register and to remove the
> offset from the calculated address.
> 
> The helper functions will be expanded in future DF versions.
> 
> Rename the "base" variable to "map_num" to indicate that this is the
> address map number. An address map is defined with a base and limit
> value. The map_num variable is used to select the proper base and limit
> registers to use for the address translation.
> 
> Signed-off-by: Yazen Ghannam <yazen.ghannam@....com>
> ---
> Link:
> https://lkml.kernel.org/r/20210507190140.18854-4-Yazen.Ghannam@amd.com
> 
> v1->v2:
> * Moved from arch/x86 to EDAC.
> * Add function to data_fabric_ops.
> 
>  drivers/edac/amd64_edac.c | 57 +++++++++++++++++++++++++++++----------
>  1 file changed, 43 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
> index f769353ef7e4..389f0621e885 100644
> --- a/drivers/edac/amd64_edac.c
> +++ b/drivers/edac/amd64_edac.c
> @@ -1079,16 +1079,26 @@ static struct df_reg df_regs[] = {
>  	[SYS_FAB_ID_MASK]	=	{1, 0x208},
>  };
>  
> +/* Use "reg_" prefix for raw register values. */
>  struct addr_ctx {
>  	u64 ret_addr;
> +	u32 reg_dram_offset;
>  	u16 nid;
>  	u8 inst_id;
> +	u8 map_num;
>  };
>  
>  struct data_fabric_ops {
> +	u64 (*get_hi_addr_offset)(struct addr_ctx *ctx);
>  };
>  
> +static u64 get_hi_addr_offset_df2(struct addr_ctx *ctx)
> +{
> +	return (ctx->reg_dram_offset & GENMASK_ULL(31, 20)) << 8;
> +}
> +
>  struct data_fabric_ops df2_ops = {

Those "df2" ops are for UMC v2? 

> +	.get_hi_addr_offset		=	&get_hi_addr_offset_df2,
						^

No need for the "&".

Also, if you define a member ->get_hi_addr_offset in df2_ops, then you
need to define that member in *every* df_ops structure you have so that
there's no NULL pointers.

I guess that's coming...

-- 
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