[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2] Eclair: scan the last xen-syms linking pass on Arm


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Wed, 7 Oct 2026 17:12:18 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A8YOGnWnUtt3vkVfHxoh7qJ2JSo9ob0CIBbEG6hibYY=; b=oJFtDuCXX/7xPu9KtXdxBoSMTgw0HZ88ojAPjgPl/wjnFkRumMHJihAlui/hpA8AlZykbsL+Ng6mYEEPbwcJaVxgWaf/nto2z8jd9tAciXiXdiA5S9ssuNYRr7z96QgtPhNVtC5DrmiF7VUyZpytNjzMUqLwSXnCBvGws6veonGJMWVwzWgSmqO8rpJeuqsoWYMvcjuo8hsgKeuxNU4fSnzQef9GJpkosI5IjzUAytbjPipaetDY9sSU5J40ALgxiEYUmdng/UxRcN/KjtutprVS0aMqGXOoSaWC/DY/4GFuQm801BmNYOxHL89+FZjAiWtJsiDLBprVhdQCIpsz9Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LbAkSKT1WFQi6uHDWaeq5nksjrAdWsctsQ93y2LucF8J0P7izu/K8Mwkv5egRZo2pnLBnPbSAQy7OKVgEhDKxVijsgOqKpYq8/ykXmS4aEO+xbEFnOUg1ONQmHM3Hhaf5ZmE1wJlOc08FQguxEY4Uf8yUQX7CyRcl2+s5zP4vhnsuYtrb0G6BCvoU/qdccIrsz3/6QtasXMCSoCk8VHTNYFN26JQQRRxxuxNepLADjorsC5Yte3Nn/Y+xGWugxcq0LVU5Cx2yAziNgFldxvi6SjNBHciRkiYZsMkoel3wehJiD/mxVB+huxbbeDFjXOWNvEjVR5bvldgJnlblyiy9Q==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:x-ms-exchange-senderadcheck"
  • Authentication-results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 07 Oct 2026 17:12:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHdVn8C9qte4lKYxEOXexEb5NUBWg==
  • Thread-topic: [PATCH v2] Eclair: scan the last xen-syms linking pass on Arm

The hide pattern .xen-syms.[013] leaves pass 2 visible. On x86
LAST_LINKING_PASS is 2, so that is the final link. On Arm
LAST_LINKING_PASS is 3 and the final image is .xen-syms.3. Pass 2 is
usually only a symlink, so Eclair saw no program link and reported every
translation unit as unreachable.

Before the analysis build, read LAST_LINKING_PASS from the architecture
makefile and the pass numbers from the foreach list in
xen/scripts/Makefile.link. Hide every pass except that one. An earlier
pass that is a real link stays hidden.

Fixes: a401b5c9dc35 ("Eclair: re-enable scanning of the (almost) final linking 
step")
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx>
---
Current patch isn't tested, sent just for review (if this accepted, I'll run 
pipeline).

Changes in v2:
- update commit message
- generate hide pattern before analysis
- read LAST_LINKING_PASS from the arch Makefile and pass numbers from the 
Makefile.link

Link to v1:
https://patchew.org/Xen/2f67ef7c4593d3ab94b75b5b819e7e046e055796.1791293680.git.dmytro._5Fprokopchuk1@xxxxxxxx/
---
 .../eclair_analysis/ECLAIR/analysis.ecl       |  2 +-
 automation/eclair_analysis/ECLAIR/analyze.sh  |  3 +++
 .../ECLAIR/generate-xen-syms-passes.sh        | 20 +++++++++++++++++++
 3 files changed, 24 insertions(+), 1 deletion(-)
 create mode 100755 
automation/eclair_analysis/ECLAIR/generate-xen-syms-passes.sh

diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl 
b/automation/eclair_analysis/ECLAIR/analysis.ecl
index c6e1a7a95d..df1006bcaa 100644
--- a/automation/eclair_analysis/ECLAIR/analysis.ecl
+++ b/automation/eclair_analysis/ECLAIR/analysis.ecl
@@ -37,7 +37,7 @@ their Standard Library equivalents."
 -doc_begin="Do not analyze intermediate linking artifacts, as they do not 
differ from their final
 counterparts for the purposes of MISRA C static analysis."
 -file_tag+={xen_efi_tmp, "^xen/\\.xen\\.efi\\.([01]|alt\\..*)$"}
--file_tag+={xen_syms_tmp, "^xen/\\.xen-syms\\.[013]$"}
+-eval_file=xen_syms_passes.ecl
 -frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"}
 -doc_end
 
diff --git a/automation/eclair_analysis/ECLAIR/analyze.sh 
b/automation/eclair_analysis/ECLAIR/analyze.sh
index 2356fc4007..ef59e87212 100755
--- a/automation/eclair_analysis/ECLAIR/analyze.sh
+++ b/automation/eclair_analysis/ECLAIR/analyze.sh
@@ -78,6 +78,9 @@ export ECLAIR_PROJECT_NAME="XEN_${VARIANT}-${SET}"
 rm -rf "${ECLAIR_OUTPUT_DIR:?}/*"
 mkdir -p "${ECLAIR_DATA_DIR}"
 
+# Generate hide pattern.
+"${SCRIPT_DIR}/generate-xen-syms-passes.sh"
+
 # Perform the build (from scratch) in an ECLAIR environment.
 "${ECLAIR_BIN_DIR}eclair_env" \
     "-config_file='${SCRIPT_DIR}/analysis.ecl'" \
diff --git a/automation/eclair_analysis/ECLAIR/generate-xen-syms-passes.sh 
b/automation/eclair_analysis/ECLAIR/generate-xen-syms-passes.sh
new file mode 100755
index 0000000000..e3795e8234
--- /dev/null
+++ b/automation/eclair_analysis/ECLAIR/generate-xen-syms-passes.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# Hide every xen-syms linking pass except LAST_LINKING_PASS.
+# The pass list is the foreach in xen/scripts/Makefile.link.
+
+set -e
+
+cd "$(dirname "$0")"
+arch=$(echo "${XEN_TARGET_ARCH}" | sed -e 's/x86.*/x86/' -e 's/arm.*/arm/')
+last=$(sed -n 's/^LAST_LINKING_PASS *:= *\([0-9]\).*/\1/p' \
+    "../../../xen/arch/${arch}/Makefile" | head -n 1)
+passes=$(sed -n 's/.*foreach n,\([0-9 ]*\).*/\1/p' \
+    ../../../xen/scripts/Makefile.link | head -n 1)
+test -n "${last}"
+test -n "${passes}"
+hidden=$(printf '%s' "${passes}" | tr -d " ${last}")
+
+printf '%s\n' \
+    "-file_tag+={xen_syms_tmp, \"^xen/\\\\.xen-syms\\\\.[${hidden}]\$\"}" \
+    >xen_syms_passes.ecl
-- 
2.43.0

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.