From: Tony Luck <tony.luck@intel.com>
To: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@lists.linux.dev, Tony Luck <tony.luck@intel.com>
Subject: [PATCH v2 4/4] acpi_mrrm: fake for testing, do not apply!
Date: Thu, 27 Feb 2025 14:48:28 -0800 [thread overview]
Message-ID: <20250227224828.306537-5-tony.luck@intel.com> (raw)
In-Reply-To: <20250227224828.306537-1-tony.luck@intel.com>
Dummy MRRM table for a 2 socket system with memory map:
LocalAccess RemoteAccess
0-3.5G DDR on socket 0 0 1
2G-512G More DDR on socket 0 0 1
512G-1T DDR on socket 1 0 1
1T-2T Reserved for CXL on socket 0 2 3
2T-3T Reserved for CXL on socket 1 2 3
This tags all local DDR access in region 0, remote DDR in region 1,
local CXL in region 2, and remote CXL in region 3.
Presented to user like this:
$ cd /sys/firmware/acpi
$ grep ^ memory_ranges/*/*
memory_ranges/range0/base:0x0
memory_ranges/range0/length:0xe0000000
memory_ranges/range0/local_region_id:0x0
memory_ranges/range0/remote_region_id:0x1
memory_ranges/range1/base:0x100000000
memory_ranges/range1/length:0x7f00000000
memory_ranges/range1/local_region_id:0x0
memory_ranges/range1/remote_region_id:0x1
memory_ranges/range2/base:0x8000000000
memory_ranges/range2/length:0x8000000000
memory_ranges/range2/local_region_id:0x0
memory_ranges/range2/remote_region_id:0x1
memory_ranges/range3/base:0x10000000000
memory_ranges/range3/length:0x100000000000
memory_ranges/range3/local_region_id:0x2
memory_ranges/range3/remote_region_id:0x3
memory_ranges/range4/base:0x200000000000
memory_ranges/range4/length:0x100000000000
memory_ranges/range4/local_region_id:0x2
memory_ranges/range4/remote_region_id:0x3
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
drivers/acpi/acpi_mrrm.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/acpi/acpi_mrrm.c b/drivers/acpi/acpi_mrrm.c
index 1f7d0381a628..16f0ca7072e0 100644
--- a/drivers/acpi/acpi_mrrm.c
+++ b/drivers/acpi/acpi_mrrm.c
@@ -147,11 +147,35 @@ static __init int add_boot_memory_ranges(void)
return ret;
}
+#define FAKE 1
+#ifdef FAKE
+static const u8 fake_mrrm[] = {
+ 0x4D,0x52,0x52,0x4D,0xE0,0x00,0x00,0x00,0x01,0x3A,0x49,0x4E,0x54,0x45,0x4C,0x00,
+ 0x49,0x4E,0x54,0x45,0x4C,0x20,0x49,0x44,0x02,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,
+ 0x12,0x12,0x24,0x20,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xE0,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x7F,0x00,0x00,0x00,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x03,0x00,0x00,0x01,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x03,0x00,0x02,0x03,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x03,0x00,0x02,0x03,0x00,0x00,0x00,0x00
+};
+#endif
+
static __init int mrrm_init(void)
{
int ret;
+#ifdef FAKE
+ ret = acpi_parse_mrrm((struct acpi_table_header *)fake_mrrm);
+#else
ret = acpi_table_parse(ACPI_SIG_MRRM, acpi_parse_mrrm);
+#endif
if (ret < 0)
return ret;
--
2.48.1
prev parent reply other threads:[~2025-02-27 22:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 22:48 [PATCH v2 0/4] Add interfaces for ACPI MRRM table Tony Luck
2025-02-27 22:48 ` [PATCH v2 1/4] ACPICA: Define MRRM ACPI table Tony Luck
2025-02-27 22:48 ` [PATCH v2 2/4] ACPI/MRRM: Create /sys/firmware/acpi/memory_ranges/rangeX ABI Tony Luck
2025-02-27 22:48 ` [PATCH v2 3/4] ACPI: Add documentation for exposing MRRM data Tony Luck
2025-02-27 22:48 ` Tony Luck [this message]
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=20250227224828.306537-5-tony.luck@intel.com \
--to=tony.luck@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@lists.linux.dev \
--cc=rafael.j.wysocki@intel.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