diff mbox series

[5/5] cxl/acpi: Enable address translation for Zen4 platforms

Message ID 20240627224615.854162-6-rrichter@amd.com
State New
Headers show
Series cxl: Address translation for HDM decoding | expand

Commit Message

Robert Richter June 27, 2024, 10:46 p.m. UTC
Enable address translation for Zen4 platforms.

Link: https://lore.kernel.org/all/65c68969903b1_afa429460@dwillia2-xfh.jf.intel.com.notmuch/
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Robert Richter <rrichter@amd.com>
---
 drivers/cxl/acpi.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Comments

kernel test robot June 29, 2024, 8:22 a.m. UTC | #1
Hi Robert,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0]

url:    https://github.com/intel-lab-lkp/linux/commits/Robert-Richter/cxl-hdm-Moving-HDM-specific-code-to-core-hdm-c/20240629-045739
base:   1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
patch link:    https://lore.kernel.org/r/20240627224615.854162-6-rrichter%40amd.com
patch subject: [PATCH 5/5] cxl/acpi: Enable address translation for Zen4 platforms
config: loongarch-allmodconfig
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build):

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406291547.ZClwWxgs-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   drivers/cxl/acpi.c: In function 'is_amd_zen4':
>> drivers/cxl/acpi.c:545:43: error: implicit declaration of function 'boot_cpu_has'; did you mean 'boot_cpu_data'? [-Werror=implicit-function-declaration]
     545 |         return (IS_ENABLED(CONFIG_X86) && boot_cpu_has(X86_FEATURE_ZEN4));
         |                                           ^~~~~~~~~~~~
         |                                           boot_cpu_data
>> drivers/cxl/acpi.c:545:56: error: 'X86_FEATURE_ZEN4' undeclared (first use in this function); did you mean 'X86_FEATURE_ANY'?
     545 |         return (IS_ENABLED(CONFIG_X86) && boot_cpu_has(X86_FEATURE_ZEN4));
         |                                                        ^~~~~~~~~~~~~~~~
         |                                                        X86_FEATURE_ANY
   drivers/cxl/acpi.c:545:56: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/cxl/acpi.c:546:1: warning: control reaches end of non-void function [-Wreturn-type]
     546 | }
         | ^
   cc1: some warnings being treated as errors


vim +545 drivers/cxl/acpi.c

   542	
   543	static bool is_amd_zen4(void)
   544	{
 > 545		return (IS_ENABLED(CONFIG_X86) && boot_cpu_has(X86_FEATURE_ZEN4));
 > 546	}
   547
kernel test robot June 29, 2024, 11:29 a.m. UTC | #2
Hi Robert,

kernel test robot noticed the following build errors:

[auto build test ERROR on 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0]

url:    https://github.com/intel-lab-lkp/linux/commits/Robert-Richter/cxl-hdm-Moving-HDM-specific-code-to-core-hdm-c/20240629-045739
base:   1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0
patch link:    https://lore.kernel.org/r/20240627224615.854162-6-rrichter%40amd.com
patch subject: [PATCH 5/5] cxl/acpi: Enable address translation for Zen4 platforms
config: arm64-allmodconfig
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 326ba38a991250a8587a399a260b0f7af2c9166a)
reproduce (this is a W=1 build):

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202406291923.sWR3UO7M-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from drivers/cxl/acpi.c:7:
   In file included from include/linux/acpi.h:39:
   In file included from include/acpi/acpi_io.h:7:
   In file included from arch/arm64/include/asm/acpi.h:14:
   In file included from include/linux/memblock.h:12:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     500 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     501 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     507 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     508 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     519 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     520 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     528 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     529 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/cxl/acpi.c:545:36: error: call to undeclared function 'boot_cpu_has'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     545 |         return (IS_ENABLED(CONFIG_X86) && boot_cpu_has(X86_FEATURE_ZEN4));
         |                                           ^
>> drivers/cxl/acpi.c:545:49: error: use of undeclared identifier 'X86_FEATURE_ZEN4'
     545 |         return (IS_ENABLED(CONFIG_X86) && boot_cpu_has(X86_FEATURE_ZEN4));
         |                                                        ^
   5 warnings and 2 errors generated.


vim +/boot_cpu_has +545 drivers/cxl/acpi.c

   542	
   543	static bool is_amd_zen4(void)
   544	{
 > 545		return (IS_ENABLED(CONFIG_X86) && boot_cpu_has(X86_FEATURE_ZEN4));
   546	}
   547
diff mbox series

Patch

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)