From a99cf9939655644095f1d3d781d0fc3402bfb9d9 Mon Sep 17 00:00:00 2001 From: Masamichi Takagi Date: Tue, 12 Jan 2021 16:34:21 +0900 Subject: [PATCH] cmake: add switch to turn on/off krm workaround Change-Id: I2dfd3d7f3373cce714247f9fc36bf5040a2a8fad --- CMakeLists.txt | 19 ++++++++++++++++++- ihk | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b87f6da..ea2a20c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.11) if (NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type: Debug Release..." FORCE) @@ -78,6 +78,22 @@ if(ENABLE_FUGAKU_HACKS) set(KBUILD_C_FLAGS "${KBUILD_C_FLAGS} -DENABLE_FUGAKU_HACKS") endif() +# krm that mandates reserved memory amount >= available at boot time? +execute_process(COMMAND bash -c "rpm -qi FJSVpxkrm-plugin-mckernel | awk '$1 == \"Version\" && $2 == \":\" { print $3 }'" + OUTPUT_VARIABLE KRM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) +message("KRM_VERSION: ${KRM_VERSION}") + +if(NOT "${KRM_VERSION}" STREQUAL "" AND "${KRM_VERSION}" VERSION_LESS_EQUAL 4.0.1) + option(ENABLE_KRM_WORKAROUND "krm workaround" ON) +else() + option(ENABLE_KRM_WORKAROUND "krm workaround" OFF) +endif() + +if(ENABLE_KRM_WORKAROUND) + add_definitions(-DENABLE_KRM_WORKAROUND) + set(KBUILD_C_FLAGS "${KBUILD_C_FLAGS} -DENABLE_KRM_WORKAROUND") +endif() + # SIGSTOP instead of SIGSEGV, additional IHK Linux kmsg option(ENABLE_FUGAKU_DEBUG "Fugaku debug instrumentation" OFF) @@ -297,6 +313,7 @@ message("ENABLE_PERF: ${ENABLE_PERF}") message("ENABLE_TOFU: ${ENABLE_TOFU}") message("ENABLE_FUGAKU_HACKS: ${ENABLE_FUGAKU_HACKS}") message("ENABLE_FUGAKU_DEBUG: ${ENABLE_FUGAKU_DEBUG}") +message("ENABLE_KRM_WORKAROUND: ${ENABLE_KRM_WORKAROUND}") message("PROFILE_ENABLE: ${PROFILE_ENABLE}") message("ENABLE_RUSAGE: ${ENABLE_RUSAGE}") message("ENABLE_QLMPI: ${ENABLE_QLMPI}") diff --git a/ihk b/ihk index 6e051eed..0f99b65b 160000 --- a/ihk +++ b/ihk @@ -1 +1 @@ -Subproject commit 6e051eed9c104fd9da5e9707a5b3ce5e228cddb2 +Subproject commit 0f99b65b562500487f35dc4a120e99def0ac682f