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

[PATCH] coverage: filter out lib{fdt,elf}-temp.o


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 18 Jan 2024 13:06:41 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=V+kg6+IJHxqILiPqgSli5P1UDg1reVgTH5m++TngXLs=; b=ZF54wH2w5vy1kkzD0Ww88HLYajMWd2TAZXRdktA6GFdqUnnSLNlfqQPo2U4PldrUq9zNt0P2vfOZ0SkdAfKMsNfRMQBTKlDtzxW9Xx3eWKai5BK2HOWM0nxashHSk/KSopPcpYpF+/cTf4to20KBJR6jXTXzUVDO1RPPgXiXxpNdc+IFyMBSaXFItbbqy0LiqkGszAhI2JM5Lucyf6YlIb5vHUDGmDY8an1zA2/H/J/R83Zs32ExkyosMRGoH/5ReWpYK1Q+9vkzhAlUJUj0c3v7Y+nHe1RT0/I6gZX/+qDOVxQa8OY0WPZCtOE6QJiethVgPqvs2GNcu4+vJe5bQQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RpWNW6QVqTuud5b1jU3EeLBffx5X44O/JVXcqglWVKNEyAUrH+cmgY96X8WoFarMrKQ1l0m4OGu9oneuBZI4J9ISGy3BBz1pij0Ir/OfcQN6ikQnRddgXHBy8NEBlBJDG8MF+ZcFU7gEn8GEQBnxc9yHT0EaTmUxP8+2wcCCenA8FIm1F5gPswYbg+S5mUKkZdyHQtI4TiuheTeKXQXpyZywEGJbeDUDQZOqoIuqST00GRDFERDKXidJZAniH2B580MNWswcn+UFtdOfrVXUkUWLGX5Rebt0nRe4Cbxs5jwtwkO8vLtK9rU0GseXMlPbGdiA0T1uRZv86WZiu/WoYQ==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Javi Merino <javi.merino@xxxxxxxxx>
  • Delivery-date: Thu, 18 Jan 2024 12:07:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

At the moment, trying to run xencov read/reset (calling SYSCTL_coverage_op
under the hood) results in a crash. This is due to an attempt to
access code in the .init.* sections (libfdt for Arm and libelf for x86)
that are stripped after boot. Normally, the build system compiles any
*.init.o file without COV_FLAGS. However, these two libraries are
handled differently as sections will be renamed to init after linking.

This worked until e321576f4047 ("xen/build: start using if_changed")
that added lib{fdt,elf}-temp.o to extra-y. Any file listed there without
*.init.o suffix will be part of non-init-objects for which COV_FLAGS
will be appended. In such case, the solution is to add a file to nocov-y.

Also, for libfdt, append to nocov-y only if CONFIG_OVERLAY_DTB is not
set. Otherwise, there is no section renaming and we should be able to
run the coverage.

Fixes: e321576f4047 ("xen/build: start using if_changed")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/common/libelf/Makefile | 2 +-
 xen/common/libfdt/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/libelf/Makefile b/xen/common/libelf/Makefile
index 8a4522e4e141..f618f70d5c8e 100644
--- a/xen/common/libelf/Makefile
+++ b/xen/common/libelf/Makefile
@@ -1,5 +1,5 @@
 obj-bin-y := libelf.o
-nocov-y += libelf.o
+nocov-y += libelf.o libelf-temp.o
 libelf-objs := libelf-tools.o libelf-loader.o libelf-dominfo.o
 
 SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
diff --git a/xen/common/libfdt/Makefile b/xen/common/libfdt/Makefile
index d50487aa6e32..fb0d8a48eee2 100644
--- a/xen/common/libfdt/Makefile
+++ b/xen/common/libfdt/Makefile
@@ -5,10 +5,10 @@ SECTIONS := text data $(SPECIAL_DATA_SECTIONS)
 # For CONFIG_OVERLAY_DTB, libfdt functionalities will be needed during runtime.
 ifneq ($(CONFIG_OVERLAY_DTB),y)
 OBJCOPYFLAGS := $(foreach s,$(SECTIONS),--rename-section .$(s)=.init.$(s))
+nocov-y += libfdt.o libfdt-temp.o
 endif
 
 obj-y += libfdt.o
-nocov-y += libfdt.o
 
 CFLAGS-y += -I$(srctree)/include/xen/libfdt/
 
-- 
2.25.1




 


Rackspace

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