Message ID | 20250429202412.380637-2-tony.luck@intel.com |
---|---|
State | New |
Headers | show |
Series | Add interfaces for ACPI MRRM table | expand |
On Tue, Apr 29, 2025 at 10:24 PM Tony Luck <tony.luck@intel.com> wrote: > > Patch for reference, this has already been applied to > https://github.com/acpica/acpica and will in due course make its way > into Linux when the next ACPICA release is ported over. > > Signed-off-by: Tony Luck <tony.luck@intel.com> > --- > include/acpi/actbl1.h | 7 +++++++ > include/acpi/actbl2.h | 42 ++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 49 insertions(+) > > diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h > index 387fc821703a..4cb36392e9e9 100644 > --- a/include/acpi/actbl1.h > +++ b/include/acpi/actbl1.h > @@ -110,6 +110,13 @@ struct acpi_whea_header { > u64 mask; /* Bitmask required for this register instruction */ > }; > > +/* Larger subtable header (when Length can exceed 255) */ > + > +struct acpi_subtbl_hdr_16 { > + u16 type; > + u16 length; > +}; > + > /* https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/acpitabl/ns-acpitabl-aspt_table */ > #define ASPT_REVISION_ID 0x01 > struct acpi_table_aspt { > diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h > index 2e917a8f8bca..e7423db6e24b 100644 > --- a/include/acpi/actbl2.h > +++ b/include/acpi/actbl2.h > @@ -37,6 +37,7 @@ > #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ > #define ACPI_SIG_MPAM "MPAM" /* Memory System Resource Partitioning and Monitoring Table */ > #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */ > +#define ACPI_SIG_MRRM "MRRM" /* Memory Range and Region Mapping table */ > #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ > #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */ > #define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */ > @@ -1736,6 +1737,47 @@ struct acpi_msct_proximity { > u64 memory_capacity; /* In bytes */ > }; > > +/******************************************************************************* > + * > + * MRRM - Memory Range and Region Mapping (MRRM) table > + * Conforms to "Intel Resource Director Technology Architecture Specification" > + * Version 1.1, January 2025 > + * > + ******************************************************************************/ > + > +struct acpi_table_mrrm { > + struct acpi_table_header header; /* Common ACPI table header */ > + u8 max_mem_region; /* Max Memory Regions supported */ > + u8 flags; /* Region assignment type */ > + u8 reserved[26]; > + u8 memory_range_entry[]; > +}; > + > +/* Flags */ > +#define ACPI_MRRM_FLAGS_REGION_ASSIGNMENT_OS (1<<0) > + > +/******************************************************************************* > + * > + * Memory Range entry - Memory Range entry in MRRM table > + * > + ******************************************************************************/ > + > +struct acpi_mrrm_mem_range_entry { > + struct acpi_subtbl_hdr_16 header; > + u32 reserved0; /* Reserved */ > + u64 addr_base; /* Base addr of the mem range */ > + u64 addr_len; /* Length of the mem range */ > + u16 region_id_flags; /* Valid local or remote Region-ID */ > + u8 local_region_id; /* Platform-assigned static local Region-ID */ > + u8 remote_region_id; /* Platform-assigned static remote Region-ID */ > + u32 reserved1; /* Reserved */ > + /* Region-ID Programming Registers[] */ > +}; > + > +/* Values for region_id_flags above */ > +#define ACPI_MRRM_VALID_REGION_ID_FLAGS_LOCAL (1<<0) > +#define ACPI_MRRM_VALID_REGION_ID_FLAGS_REMOTE (1<<1) > + > /******************************************************************************* > * > * MSDM - Microsoft Data Management table > -- All of the above definitions should be there in linux-next now. Can you please check if they are there and they are correct? Alternatively, please check https://web.git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/log/?h=testing
> > +/* Values for region_id_flags above */ > > +#define ACPI_MRRM_VALID_REGION_ID_FLAGS_LOCAL (1<<0) > > +#define ACPI_MRRM_VALID_REGION_ID_FLAGS_REMOTE (1<<1) > > + > > /******************************************************************************* > > * > > * MSDM - Microsoft Data Management table > > -- > > All of the above definitions should be there in linux-next now. > > Can you please check if they are there and they are correct? > Alternatively, please check > > https://web.git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/log/?h=testing Rafael, I checked the "testing" branch. The MRRM bits there look good. Do you want me to post a V5 of this series that drops patch1? Fenghua had some comments ... the one about a spurious blank line in mrrm_init() is real. I'm less sure about documenting the meaning of "X" in the ABI documentation patch. -Tony
On Mon, May 5, 2025 at 7:12 PM Luck, Tony <tony.luck@intel.com> wrote: > > > > +/* Values for region_id_flags above */ > > > +#define ACPI_MRRM_VALID_REGION_ID_FLAGS_LOCAL (1<<0) > > > +#define ACPI_MRRM_VALID_REGION_ID_FLAGS_REMOTE (1<<1) > > > + > > > /******************************************************************************* > > > * > > > * MSDM - Microsoft Data Management table > > > -- > > > > All of the above definitions should be there in linux-next now. > > > > Can you please check if they are there and they are correct? > > Alternatively, please check > > > > https://web.git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/log/?h=testing > > Rafael, > > I checked the "testing" branch. The MRRM bits there look good. > > Do you want me to post a V5 of this series that drops patch1? > > Fenghua had some comments ... the one about a spurious blank > line in mrrm_init() is real. I'm less sure about documenting the > meaning of "X" in the ABI documentation patch. If you want to update any of the 3 last patches, please send an update. Otherwise, let me know and I can pick them up from the current series. Thanks!
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 387fc821703a..4cb36392e9e9 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -110,6 +110,13 @@ struct acpi_whea_header { u64 mask; /* Bitmask required for this register instruction */ }; +/* Larger subtable header (when Length can exceed 255) */ + +struct acpi_subtbl_hdr_16 { + u16 type; + u16 length; +}; + /* https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/acpitabl/ns-acpitabl-aspt_table */ #define ASPT_REVISION_ID 0x01 struct acpi_table_aspt { diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 2e917a8f8bca..e7423db6e24b 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h @@ -37,6 +37,7 @@ #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ #define ACPI_SIG_MPAM "MPAM" /* Memory System Resource Partitioning and Monitoring Table */ #define ACPI_SIG_MPST "MPST" /* Memory Power State Table */ +#define ACPI_SIG_MRRM "MRRM" /* Memory Range and Region Mapping table */ #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ #define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */ #define ACPI_SIG_NHLT "NHLT" /* Non HD Audio Link Table */ @@ -1736,6 +1737,47 @@ struct acpi_msct_proximity { u64 memory_capacity; /* In bytes */ }; +/******************************************************************************* + * + * MRRM - Memory Range and Region Mapping (MRRM) table + * Conforms to "Intel Resource Director Technology Architecture Specification" + * Version 1.1, January 2025 + * + ******************************************************************************/ + +struct acpi_table_mrrm { + struct acpi_table_header header; /* Common ACPI table header */ + u8 max_mem_region; /* Max Memory Regions supported */ + u8 flags; /* Region assignment type */ + u8 reserved[26]; + u8 memory_range_entry[]; +}; + +/* Flags */ +#define ACPI_MRRM_FLAGS_REGION_ASSIGNMENT_OS (1<<0) + +/******************************************************************************* + * + * Memory Range entry - Memory Range entry in MRRM table + * + ******************************************************************************/ + +struct acpi_mrrm_mem_range_entry { + struct acpi_subtbl_hdr_16 header; + u32 reserved0; /* Reserved */ + u64 addr_base; /* Base addr of the mem range */ + u64 addr_len; /* Length of the mem range */ + u16 region_id_flags; /* Valid local or remote Region-ID */ + u8 local_region_id; /* Platform-assigned static local Region-ID */ + u8 remote_region_id; /* Platform-assigned static remote Region-ID */ + u32 reserved1; /* Reserved */ + /* Region-ID Programming Registers[] */ +}; + +/* Values for region_id_flags above */ +#define ACPI_MRRM_VALID_REGION_ID_FLAGS_LOCAL (1<<0) +#define ACPI_MRRM_VALID_REGION_ID_FLAGS_REMOTE (1<<1) + /******************************************************************************* * * MSDM - Microsoft Data Management table
Patch for reference, this has already been applied to https://github.com/acpica/acpica and will in due course make its way into Linux when the next ACPICA release is ported over. Signed-off-by: Tony Luck <tony.luck@intel.com> --- include/acpi/actbl1.h | 7 +++++++ include/acpi/actbl2.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+)