From 3cbcd796a3f74bbca0c6ebca4afaff993ff2bf63 Mon Sep 17 00:00:00 2001 From: Xiaocheng Dong Date: Thu, 9 May 2024 01:22:13 -0400 Subject: [PATCH] tools: fix build version error and rtmr parameter error Signed-off-by: Xiaocheng Dong --- tools/build/build.sh | 9 +++++++-- ...dx-rtmr-extend-TDX-RTMR-interface-for-kernel-IM.patch | 2 +- tools/build/kernel/ubuntu/changelog | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/build/build.sh b/tools/build/build.sh index bcebd18..a0db4bf 100755 --- a/tools/build/build.sh +++ b/tools/build/build.sh @@ -45,8 +45,13 @@ build_ubuntu_kernel() { else CHANGELOG="debian.master/changelog" fi - LATEST_VERSION=$(sed -n '1 s/linux.*(\(.*\)) noble.*$/\1/p' ${CHANGELOG}) - CCNP_VERSION=${LATEST_VERSION}${CCNP_VERSION_SUFFIX} + + # For generic kernel, the default version in changelog is linux (6.8.0-31.31), + # we want to change to ccnp version linux (6.8.0-31.31+ccnp1) + # For intel kernel, the default version in changelog is linux-intel (6.8.0-1001.7) + # we want to change it to linux-intel (6.8.0-1001.7+ccnp1) + LATEST_VERSION=$(sed -n '1 s/\(linux.*(.*\)) noble.*$/\1/p' ${CHANGELOG}) + CCNP_VERSION="${LATEST_VERSION}${CCNP_VERSION_SUFFIX})" sed "s/CCNP_VERSION/${CCNP_VERSION}/" \ "${KERNEL_DIR}/ubuntu/changelog" > "${KERNEL_DIR}/ubuntu/changelog.tmp" sed -i "0 r ${KERNEL_DIR}/ubuntu/changelog.tmp" debian/changelog ${CHANGELOG} diff --git a/tools/build/kernel/patches/0006-x86-tdx-rtmr-extend-TDX-RTMR-interface-for-kernel-IM.patch b/tools/build/kernel/patches/0006-x86-tdx-rtmr-extend-TDX-RTMR-interface-for-kernel-IM.patch index 7bd5072..ee4d90c 100644 --- a/tools/build/kernel/patches/0006-x86-tdx-rtmr-extend-TDX-RTMR-interface-for-kernel-IM.patch +++ b/tools/build/kernel/patches/0006-x86-tdx-rtmr-extend-TDX-RTMR-interface-for-kernel-IM.patch @@ -116,7 +116,7 @@ index 000000000000..3ed78ad754dd + memcpy(data, digests[DEFAULT_SHA384_IDX].digest, sizeof(digests[DEFAULT_SHA384_IDX].digest)); + + /* Extend RTMR registers using "TDG.MR.RTMR.EXTEND" TDCALL */ -+ rc = tdx_mcall_rtmr_extend(data, (u8)rtmr_idx); ++ rc = tdx_mcall_rtmr_extend((u8)rtmr_idx, data); + kfree(data); + + return rc; diff --git a/tools/build/kernel/ubuntu/changelog b/tools/build/kernel/ubuntu/changelog index f1a4a7e..989382a 100644 --- a/tools/build/kernel/ubuntu/changelog +++ b/tools/build/kernel/ubuntu/changelog @@ -1,4 +1,4 @@ -linux (CCNP_VERSION) noble; urgency=medium +CCNP_VERSION noble; urgency=medium * [CCNP] Add CCNP kernel patches