From nobody Fri Apr 19 11:20:27 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1560233045; cv=none; d=zoho.com; s=zohoarc; b=fN9NluJLEQAajnxndz87kwzSpA0stU5kO11u8OPlDiq34n1SQzxj+By9B5RuJMj/JYXS7xWJGNp0kDowafM/UHSGhij+qQsYtgQm8XA/FxcbyeGozc/klwZM/sL775bKOcZd5Ft/1uyKFjItP9V86O1qrbpwggTa+iDPVWZXWTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560233045; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=8TtQJDS2NNHoLtncqMR7rDvKbX1HjlTfnC3oxC5vzEs=; b=nAmTHhBVxdpgNd63DaHpKCEntbB8KpLBklH9MCDuaSiRpMuHdyfSlmlKJAk6sUbJ3Divl8m/hkhusetGa/gUUuATc5PgOplAtYONoVb3NA3ah+vtuhTL4qrl6hOTBsOyYMuuRwZLmRenGsRZGSlQT83ZeOv/9BNYgsDqoQeYhYE= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1560233045817445.70692647552073; Mon, 10 Jun 2019 23:04:05 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1haZrk-0000DY-Gl; Tue, 11 Jun 2019 06:02:40 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1haZrj-0000DT-Lk for xen-devel@lists.xenproject.org; Tue, 11 Jun 2019 06:02:39 +0000 Received: from mxnavi-mail.mxnavi.com (unknown [116.90.87.199]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 82ad88bb-8c0e-11e9-8980-bc764e045a96; Tue, 11 Jun 2019 06:02:37 +0000 (UTC) Received: from localhost.localdomain (61.161.186.150) by mxnavi-mail.mxnavi.com (116.90.87.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Tue, 11 Jun 2019 13:59:26 +0800 X-Inumbo-ID: 82ad88bb-8c0e-11e9-8980-bc764e045a96 From: Baodong Chen To: Date: Tue, 11 Jun 2019 14:02:29 +0800 Message-ID: <1560232949-10673-1-git-send-email-chenbaodong@mxnavi.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [61.161.186.150] X-ClientProxiedBy: mxnavi-mail.mxnavi.com (116.90.87.199) To mxnavi-mail.mxnavi.com (116.90.87.199) Subject: [Xen-devel] [PATCH] xen/coverage: wrap coverage related things under 'CONFIG_COVERAGE' X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Julien Grall , Jan Beulich , Baodong Chen , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Constructors between '__ctors_start' and '__ctors_end' only used for code-coverage, not by xen itself, so use 'CONFIG_COVERAGE' wrap them. Signed-off-by: Baodong Chen --- xen/arch/arm/xen.lds.S | 2 ++ xen/arch/x86/xen.lds.S | 2 ++ xen/common/lib.c | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S index 1e72906..320ff68 100644 --- a/xen/arch/arm/xen.lds.S +++ b/xen/arch/arm/xen.lds.S @@ -172,12 +172,14 @@ SECTIONS *(.init.data.rel) *(.init.data.rel.*) =20 +#if defined(CONFIG_COVERAGE) . =3D ALIGN(8); __ctors_start =3D .; *(.ctors) *(.init_array) *(SORT(.init_array.*)) __ctors_end =3D .; +#endif =20 #if defined(CONFIG_HAS_VPCI) && !defined(CONFIG_LATE_HWDOM) . =3D ALIGN(POINTER_ALIGN); diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S index cb42dc8..604353f 100644 --- a/xen/arch/x86/xen.lds.S +++ b/xen/arch/x86/xen.lds.S @@ -240,12 +240,14 @@ SECTIONS *(.altinstructions) __alt_instructions_end =3D .; =20 +#if defined(CONFIG_COVERAGE) . =3D ALIGN(8); __ctors_start =3D .; *(.ctors) *(.init_array) *(SORT(.init_array.*)) __ctors_end =3D .; +#endif =20 #if defined(CONFIG_HAS_VPCI) && !defined(CONFIG_LATE_HWDOM) . =3D ALIGN(POINTER_ALIGN); diff --git a/xen/common/lib.c b/xen/common/lib.c index 8ebec81..b8fc165 100644 --- a/xen/common/lib.c +++ b/xen/common/lib.c @@ -491,15 +491,20 @@ unsigned long long parse_size_and_unit(const char *s,= const char **ps) return ret; } =20 +#if defined(CONFIG_COVERAGE) typedef void (*ctor_func_t)(void); extern const ctor_func_t __ctors_start[], __ctors_end[]; +#endif =20 +/* see 'docs/hypervisor-guide/code-coverage.rst' */ void __init init_constructors(void) { +#if defined(CONFIG_COVERAGE) const ctor_func_t *f; for ( f =3D __ctors_start; f < __ctors_end; ++f ) (*f)(); =20 +#endif /* Putting this here seems as good (or bad) as any other place. */ BUILD_BUG_ON(sizeof(size_t) !=3D sizeof(ssize_t)); } --=20 2.7.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel