From: Yazen Ghannam <yazen.ghannam@amd.com>
To: <bp@alien8.de>, <linux-edac@vger.kernel.org>, <tony.luck@intel.com>
Cc: <linux-kernel@vger.kernel.org>, <avadhut.naik@amd.com>,
<john.allen@amd.com>, <william.roche@oracle.com>,
Yazen Ghannam <yazen.ghannam@amd.com>
Subject: [PATCH v2 0/2] AMD Address Translation Library
Date: Thu, 5 Oct 2023 12:35:24 -0500 [thread overview]
Message-ID: <20231005173526.42831-1-yazen.ghannam@amd.com> (raw)
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.
Since this code is very much implementation-specific, I thought it'd be
appropriate to have it as a "library module". 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.
I had planned to include example code stubs for MCA and CXL with this
second submission. But I got occupied with other things, and I don't
want to hold off on the current set. The MCA subsystem integration is
starting development, so working patches should be ready soon.
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 current
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.
Old patch set (before refactor):
https://lore.kernel.org/r/20220127204115.384161-1-yazen.ghannam@amd.com
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.
Link:
https://lore.kernel.org/r/20230802185504.606855-1-yazen.ghannam@amd.com
v1->v2:
1) Move code to drivers/ras.
2) Add "reachable" check to header file.
Thanks,
Yazen
Yazen Ghannam (2):
RAS: Introduce AMD Address Translation Library
EDAC/amd64: Use new AMD Address Translation Library
MAINTAINERS | 7 +
drivers/edac/Kconfig | 1 +
drivers/edac/amd64_edac.c | 278 +------------
drivers/ras/Kconfig | 1 +
drivers/ras/Makefile | 1 +
drivers/ras/amd/atl/Kconfig | 19 +
drivers/ras/amd/atl/Makefile | 18 +
drivers/ras/amd/atl/access.c | 107 +++++
drivers/ras/amd/atl/core.c | 212 ++++++++++
drivers/ras/amd/atl/dehash.c | 459 +++++++++++++++++++++
drivers/ras/amd/atl/denormalize.c | 644 +++++++++++++++++++++++++++++
drivers/ras/amd/atl/internal.h | 307 ++++++++++++++
drivers/ras/amd/atl/map.c | 659 ++++++++++++++++++++++++++++++
drivers/ras/amd/atl/reg_fields.h | 603 +++++++++++++++++++++++++++
drivers/ras/amd/atl/system.c | 282 +++++++++++++
drivers/ras/amd/atl/umc.c | 53 +++
include/linux/amd-atl.h | 28 ++
17 files changed, 3403 insertions(+), 276 deletions(-)
create mode 100644 drivers/ras/amd/atl/Kconfig
create mode 100644 drivers/ras/amd/atl/Makefile
create mode 100644 drivers/ras/amd/atl/access.c
create mode 100644 drivers/ras/amd/atl/core.c
create mode 100644 drivers/ras/amd/atl/dehash.c
create mode 100644 drivers/ras/amd/atl/denormalize.c
create mode 100644 drivers/ras/amd/atl/internal.h
create mode 100644 drivers/ras/amd/atl/map.c
create mode 100644 drivers/ras/amd/atl/reg_fields.h
create mode 100644 drivers/ras/amd/atl/system.c
create mode 100644 drivers/ras/amd/atl/umc.c
create mode 100644 include/linux/amd-atl.h
--
2.34.1
next reply other threads:[~2023-10-05 17:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-05 17:35 Yazen Ghannam [this message]
2023-10-05 17:35 ` [PATCH v2 1/2] RAS: Introduce " Yazen Ghannam
2023-10-11 17:35 ` Borislav Petkov
2023-10-16 13:47 ` Yazen Ghannam
2023-10-25 10:53 ` Borislav Petkov
2023-10-16 12:28 ` kernel test robot
2023-10-24 15:30 ` Yazen Ghannam
2023-11-07 12:02 ` Borislav Petkov
2023-10-05 17:35 ` [PATCH v2 2/2] EDAC/amd64: Use new " Yazen Ghannam
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=20231005173526.42831-1-yazen.ghannam@amd.com \
--to=yazen.ghannam@amd.com \
--cc=avadhut.naik@amd.com \
--cc=bp@alien8.de \
--cc=john.allen@amd.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--cc=william.roche@oracle.com \
/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®