linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] AMD Address Translation Library
@ 2023-08-02 18:55 Yazen Ghannam
  2023-08-02 18:55 ` [PATCH 1/2] platform/x86/amd: Introduce " Yazen Ghannam
  2023-08-02 18:55 ` [PATCH 2/2] EDAC/amd64: Use new " Yazen Ghannam
  0 siblings, 2 replies; 15+ messages in thread
From: Yazen Ghannam @ 2023-08-02 18:55 UTC (permalink / raw)
  To: bp, linux-edac, hdegoede, markgross, platform-driver-x86
  Cc: linux-kernel, avadhut.naik, mario.limonciello, Yazen Ghannam

Hi all,

This set adds a new library to do AMD-specific address translation. The
first use case is for translating a Unified Memory Controller (UMC)
"Normalized" address to a system physical address. Another use case will
be to do a similar translation for certain CXL configurations. The only
user is EDAC at the moment. But this can be used in MCA and CXL
subsystems too. Patches coming soon...

Since this code is very much implementation-specific, I thought it'd be
appropriate to have it as a "platform driver". Having the option to
build as a module helps with development, but this will likely be
'built-in' to use for MCA and CXL in production.

Patch 1 adds the new code. This includes support for all current AMD
Zen-based systems with a couple of exceptions noted in the commit
message.

The code is based on AMD reference code. Much of this is arbitrary bit
arithmetic. But I tried my best to make clarifying comments and to
restructure the code to be easier to follow.

Also, I purposefully avoided "over-optimizing" for the same reason, and
also to leverage compile-time checks for bitfields, etc. For example,
there are many uses of FIELD_GET(), and this requires a constant
expression as input.

The reference code underwent a major refactor. Therefore, this latest
set is fresh start. I figure it's best to match the latest reference
rather than submit another revision based on old code that will need to
be refactored anyway.

There are many code paths that are reused between various interleaving
modes and Data Fabric revisions. And these aren't easily decoupled. So
run time checks are used for code flow rather than function pointers,
etc.

All the code is added within a single patch. Mostly, this was done to
get the "whole picture" of how things fit together. But I can break this
up into separate patches for each Data Fabric revision, if needed. I
also want to avoid taking the old code and incrementally refactoring.
Since the old code no longer matches the reference, I think it's simpler
to just add the new and delete the old.

Patch 2 removes the old code and switches the AMD64 EDAC module to use
the new code.

Previous set:
https://lore.kernel.org/r/20220127204115.384161-1-yazen.ghannam@amd.com

Notable changes from previous set:
1) Move code out of EDAC.
2) Another major refactor based on refactored reference code.
3) Addition of DF4 and DF4.5 support.

Thanks,
Yazen

Yazen Ghannam (2):
  platform/x86/amd: Introduce AMD Address Translation Library
  EDAC/amd64: Use new AMD Address Translation Library

 MAINTAINERS                                |   7 +
 drivers/edac/Kconfig                       |   1 +
 drivers/edac/amd64_edac.c                  | 282 +--------
 drivers/platform/x86/amd/Kconfig           |   1 +
 drivers/platform/x86/amd/Makefile          |   1 +
 drivers/platform/x86/amd/atl/Kconfig       |  20 +
 drivers/platform/x86/amd/atl/Makefile      |  18 +
 drivers/platform/x86/amd/atl/access.c      | 107 ++++
 drivers/platform/x86/amd/atl/core.c        | 212 +++++++
 drivers/platform/x86/amd/atl/dehash.c      | 459 ++++++++++++++
 drivers/platform/x86/amd/atl/denormalize.c | 644 ++++++++++++++++++++
 drivers/platform/x86/amd/atl/internal.h    | 307 ++++++++++
 drivers/platform/x86/amd/atl/map.c         | 659 +++++++++++++++++++++
 drivers/platform/x86/amd/atl/reg_fields.h  | 603 +++++++++++++++++++
 drivers/platform/x86/amd/atl/system.c      | 282 +++++++++
 drivers/platform/x86/amd/atl/umc.c         |  53 ++
 include/linux/amd-atl.h                    |  18 +
 17 files changed, 3398 insertions(+), 276 deletions(-)
 create mode 100644 drivers/platform/x86/amd/atl/Kconfig
 create mode 100644 drivers/platform/x86/amd/atl/Makefile
 create mode 100644 drivers/platform/x86/amd/atl/access.c
 create mode 100644 drivers/platform/x86/amd/atl/core.c
 create mode 100644 drivers/platform/x86/amd/atl/dehash.c
 create mode 100644 drivers/platform/x86/amd/atl/denormalize.c
 create mode 100644 drivers/platform/x86/amd/atl/internal.h
 create mode 100644 drivers/platform/x86/amd/atl/map.c
 create mode 100644 drivers/platform/x86/amd/atl/reg_fields.h
 create mode 100644 drivers/platform/x86/amd/atl/system.c
 create mode 100644 drivers/platform/x86/amd/atl/umc.c
 create mode 100644 include/linux/amd-atl.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-08-09 15:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-02 18:55 [PATCH 0/2] AMD Address Translation Library Yazen Ghannam
2023-08-02 18:55 ` [PATCH 1/2] platform/x86/amd: Introduce " Yazen Ghannam
2023-08-07 20:44   ` Yazen Ghannam
2023-08-08  3:17     ` Limonciello, Mario
2023-08-08 12:10       ` Borislav Petkov
2023-08-08 14:07         ` Yazen Ghannam
2023-08-08 14:20           ` Borislav Petkov
2023-08-08 14:28             ` Yazen Ghannam
2023-08-08 14:37               ` Borislav Petkov
2023-08-08 15:18                 ` Yazen Ghannam
2023-08-08 15:58                   ` Borislav Petkov
2023-08-08 16:24                     ` Yazen Ghannam
2023-08-09 14:38           ` Hans de Goede
2023-08-09 15:05             ` Yazen Ghannam
2023-08-02 18:55 ` [PATCH 2/2] EDAC/amd64: Use new " Yazen Ghannam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).