mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yazen Ghannam <yazen.ghannam@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	Avadhut Naik <avanaik92@gmail.com>
Subject: Re: [PATCH v7 3/3] EDAC/amd64: Include DRAM address in output
Date: Tue, 7 Jul 2026 10:02:08 -0400	[thread overview]
Message-ID: <20260707140208.GB1382082@yaz-khff2.amd.com> (raw)
In-Reply-To: <20260707003735.GBakxKT4r7efMzoszz@fat_crate.local>

On Mon, Jul 06, 2026 at 05:37:35PM -0700, Borislav Petkov wrote:
> On Tue, Jun 30, 2026 at 05:06:40PM -0400, Yazen Ghannam wrote:
> > From: Avadhut Naik <avadhut.naik@amd.com>
> > 
> > The DRAM address of an error is used by tooling to find failure
> > patterns. This information can be used for general analysis off system.
> > And it can be used on system to take action like offline a page affected
> > by a bad row.
> > 
> > Other EDAC modules (GHES and SKX) provide this information in their
> > output. The AMD64 EDAC module was not able to provide this information,
> > because system-specific translation is needed.
> > 
> > Recent AMD systems provide a PRM handler for DRAM address translation.
> > 
> > Use this PRM handler to get the DRAM address of an error. Include this
> > in the EDAC "other_detail" field.
> > 
> > Also include the Socket and IPID in the EDAC "other_detail" field. These
> > are needed by tooling to translate a DRAM address to a System Physical
> > Address.
> 
>     "Use the DRAM address translated by the PRM handler on AMD systems when
>     reporting an error and add it to the error information that is being
>     logged by EDAC. Also include the Socket and IPID which tooling needs to
>     translate the DRAM address into a SPA (System Physical Address)."
> 
> Plain and simple.
> 

Okay.

> > 
> > [Yazen: Reformat other_detail string]
> > 
> > Signed-off-by: Avadhut Naik <avadhut.naik@amd.com>
> > Co-developed-by: Yazen Ghannam <yazen.ghannam@amd.com>
> > Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
> > ---
> >  drivers/edac/amd64_edac.c | 32 +++++++++++++++++++++++++++++++-
> >  drivers/edac/amd64_edac.h |  3 +++
> >  2 files changed, 34 insertions(+), 1 deletion(-)
> 
> ...
> 
> > @@ -2853,6 +2880,9 @@ static void decode_umc_error(int node_id, struct mce *m)
> >  		goto log_error;
> >  	}
> >  
> > +	if (!amd_convert_umc_addr_to_dram_addr(&a_err, &dram_addr))
> > +		err.dram_addr = &dram_addr;
> 
> I really hate the fact that we have to call PRM twice per error. Is there
> a PRM that can give us both addresses in one go?
> 

There is a one handler per operation. But we can wrap them however we
want. I'll add an AMD_ATL helper to do both translations in one call.

> >  	error_address_to_page_and_offset(sys_addr, &err);
> >  
> >  log_error:
> > diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h
> > index 1757c1b99fc8..39c1b6471909 100644
> > --- a/drivers/edac/amd64_edac.h
> > +++ b/drivers/edac/amd64_edac.h
> > @@ -400,6 +400,9 @@ struct err_info {
> >  	u16 syndrome;
> >  	u32 page;
> >  	u32 offset;
> > +	struct atl_dram_addr *dram_addr;
> 
> If you embed it into the enclosing struct:
> 
> 	struct atl_dram_addr dram_addr;
> 
> you'll save yourself a bunch of lines in this patch of noodling through the
> error struct.
> 

Okay.

Thanks,
Yazen

  reply	other threads:[~2026-07-07 14:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 21:06 [PATCH v7 0/3] Incorporate DRAM address in EDAC messages Yazen Ghannam
2026-06-30 21:06 ` [PATCH v7 1/3] RAS/AMD/ATL: Directly export address translation helper Yazen Ghannam
2026-06-30 21:06 ` [PATCH v7 2/3] RAS/AMD/ATL: Translate UMC normalized address to DRAM address using PRM Yazen Ghannam
2026-07-07  0:32   ` Borislav Petkov
2026-07-07 13:57     ` Yazen Ghannam
2026-07-08  1:58       ` Borislav Petkov
2026-06-30 21:06 ` [PATCH v7 3/3] EDAC/amd64: Include DRAM address in output Yazen Ghannam
2026-07-07  0:37   ` Borislav Petkov
2026-07-07 14:02     ` Yazen Ghannam [this message]
2026-07-08  2:00       ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260707140208.GB1382082@yaz-khff2.amd.com \
    --to=yazen.ghannam@amd.com \
    --cc=avanaik92@gmail.com \
    --cc=bp@alien8.de \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®