Re: [PATCH v7 3/3] EDAC/amd64: Include DRAM address in output
Yazen Ghannam <[email protected]> Tue, 7 Jul 2026 10:02:08 -0400
| Newsgroups | org.kernel.vger.linux-edac,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> > > > > 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 <[email protected]> > > Co-developed-by: Yazen Ghannam <[email protected]> > > Signed-off-by: Yazen Ghannam <[email protected]> > > --- > > 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