Skip to contentSkip to conversation

cxl_test: require 64-bit

PATCH In review Luis Chamberlain 2 participants 2 messages Dec 19, 2022 – Dec 20, 2022 CXL

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl_test: require 64-bit

size_t is limited to 32-bits and so the gen_pool_alloc() using the size of SZ_64G would map to 0, triggering a low allocation which is not expected. Force the dependency on 64-bit for cxl_test as that is what it was designed for.

This issue was found by build test reports when converting this driver as a proper upstream driver.

---
 tools/testing/cxl/config_check.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/cxl/config_check.c +1 -0
index c4c457e59841..99b56b5f6edf 100644
@@ -7,6 +7,7 @@ void check(void)
 	 * These kconfig symbols must be set to "m" for cxl_test to load
 	 * and operate.
 	 */
+	BUILD_BUG_ON(!IS_ENABLED(CONFIG_64BIT));
 	BUILD_BUG_ON(!IS_MODULE(CONFIG_CXL_BUS));
 	BUILD_BUG_ON(!IS_MODULE(CONFIG_CXL_ACPI));
 	BUILD_BUG_ON(!IS_MODULE(CONFIG_CXL_PMEM));
Signature · 1 line
2.35.1
#1 lore raw
Quoted 7 lines · Luis Chamberlain

size_t is limited to 32-bits and so the gen_pool_alloc() using the size of SZ_64G would map to 0, triggering a low allocation which is not expected. Force the dependency on 64-bit for cxl_test as that is what it was designed for.

This issue was found by build test reports when converting this driver as a proper upstream driver.

Looks good to me, changed the subject to tools/testing/cxl/ and applied for 6.3.