[PATCH 5/5] cxl/acpi: Enable address translation for Zen4 platforms
From: Robert Richter
Date: Thu Jun 27 2024 - 18:48:17 EST
Enable address translation for Zen4 platforms.
Link: https://lore.kernel.org/all/65c68969903b1_afa429460@xxxxxxxxxxxxxxxxxxxxxxxxx.notmuch/
Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
Signed-off-by: Robert Richter <rrichter@xxxxxxx>
---
drivers/cxl/acpi.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/cxl/acpi.c b/drivers/cxl/acpi.c
index 67f73a831bd3..9e7b9629b98d 100644
--- a/drivers/cxl/acpi.c
+++ b/drivers/cxl/acpi.c
@@ -11,6 +11,10 @@
#include "cxlpci.h"
#include "cxl.h"
+#ifdef CONFIG_X86
+#include <asm/cpu.h>
+#endif
+
#define CXL_RCRB_SIZE SZ_8K
struct cxl_cxims_data {
@@ -536,9 +540,14 @@ static int cxl_get_chbs(struct device *dev, struct acpi_device *hb,
return 0;
}
+static bool is_amd_zen4(void)
+{
+ return (IS_ENABLED(CONFIG_X86) && boot_cpu_has(X86_FEATURE_ZEN4));
+}
+
static void setup_platform_quirks(struct cxl_root *root)
{
- root->hpa_xlat_enable = 0;
+ root->hpa_xlat_enable = is_amd_zen4();
}
static int get_genport_coordinates(struct device *dev, struct cxl_dport *dport)
--
2.39.2