From nobody Fri Apr 19 14:01:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1578504297; cv=none; d=zohomail.com; s=zohoarc; b=SbqsMjtXcjERHREpoOJOTWx7KFYPz5u3Z0z39Q5v++FzNPZ1yqFsJh9G5MH9x89nm2ppljsGjBP3Lz5j+3KnDTsAL5nnEjDPyTqfzDzhTqGyUvte8R8mEmzOlAPU7Nqf1KRX+rjFWknA9wDsTnkvl3dmp98PrAPkgXchNgUJHWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1578504297; 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; bh=wBlVh3mLSG/5EGaleICzx+joQ+6DlDVL3UhE6MCTNUY=; b=RsiCv2UqtCXtBa+o5vWHVEzmO70oCYyfI/gtouy8H6EbDD5JjB3HrPtGDYH2AJhsIDWN4qLLe4xcPjuTIEf6FMp67R93qXQQNFuUrbv72FSayn7YUle6GnodWfihbwUPgtJWmwxUp0S0byq5r/08PBuC34D+QV+TxGn3gut/IXY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1578504297935693.4584954551286; Wed, 8 Jan 2020 09:24:57 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipF4M-0003HP-8O; Wed, 08 Jan 2020 17:24:34 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipF4K-0003HG-T3 for xen-devel@lists.xenproject.org; Wed, 08 Jan 2020 17:24:32 +0000 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id bb5387d8-323b-11ea-b861-12813bfff9fa; Wed, 08 Jan 2020 17:24:32 +0000 (UTC) X-Inumbo-ID: bb5387d8-323b-11ea-b861-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1578504271; h=from:to:cc:subject:date:message-id:mime-version; bh=HODhukAblgEi0KXLUXq3HGsv6ZoaQdq52eo34hySp9w=; b=PwwkJDvzsvvKUxMpRnZXaqo6Y5UVH8ET+ZrLdckD0moa65tX3VVBjOmg 4l3P37Fm53bwQiZU3p0ZR8ScQthzA5WJ4AD9M0QEub1n2QaKJ/bl+YkaU l0iXhjqjPzzT4cNL5DjFfNRdYqGSNhwg8DHlqSNZXhmkjLHhvhAlV+Bwl U=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=andrew.cooper3@citrix.com; spf=Pass smtp.mailfrom=Andrew.Cooper3@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zohomail.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; Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of andrew.cooper3@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of Andrew.Cooper3@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="Andrew.Cooper3@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: ysDd3iCRJ/zspTRASs9biTVVpV+E0ZxAMGIG7HZvr/Lk58GSXcjZJxZEnP7Q9945zK4gXwbeRi EJp+hNV5Wpq66eKft0040D3VyJJkgPGOKaCRZYXaj448MyQZLucsvkfkIgZWWUCNjrXeBAIpyV Jm4q5nuVrigRQQN5V9iiVMtP0dLciyHQ7l8UiXZImOYz0J3qAACKLSAyvB+EhuvPJMFLvWoLPC o7omIXwLXT2rXTYLHl9GwVYjlJ2A0f+O4klz/bJyVGinIZrAACVwGSzvS+qaQAW45YJkbWU0aK /KU= X-SBRS: 2.7 X-MesageID: 11012568 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.69,410,1571716800"; d="scan'208";a="11012568" From: Andrew Cooper To: Xen-devel Date: Wed, 8 Jan 2020 17:24:28 +0000 Message-ID: <20200108172428.28672-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v2] x86/mem_sharing: Fix RANDCONFIG build 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: Andrew Cooper , Tamas K Lengyel Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Travis reports: https://travis-ci.org/andyhhp/xen/jobs/633751811 mem_sharing.c:361:13: error: 'rmap_has_entries' defined but not used [-We= rror=3Dunused-function] static bool rmap_has_entries(const struct page_info *page) ^ cc1: all warnings being treated as errors This happens in a release build (disables MEM_SHARING_AUDIT) when CONFIG_MEM_SHARING is enabled. Expand both trivial helpers into their single callsite. Signed-off-by: Andrew Cooper Acked-by: Tamas K Lengyel --- CC: Tamas K Lengyel v2: * Expand, rather than mark as __maybe_unused --- xen/arch/x86/mm/mem_sharing.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index ddf1f0f9f9..64dd3689df 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -351,18 +351,6 @@ static gfn_info_t *rmap_retrieve(uint16_t domain_id, u= nsigned long gfn, return NULL; } =20 -/* Returns true if the rmap has only one entry. O(1) complexity. */ -static bool rmap_has_one_entry(const struct page_info *page) -{ - return rmap_count(page) =3D=3D 1; -} - -/* Returns true if the rmap has any entries. O(1) complexity. */ -static bool rmap_has_entries(const struct page_info *page) -{ - return rmap_count(page) !=3D 0; -} - /* * The iterator hides the details of how the rmap is implemented. This * involves splitting the list_for_each_safe macro into two steps. @@ -531,7 +519,7 @@ static int audit(void) } =20 /* Check we have a list */ - if ( (!pg->sharing) || !rmap_has_entries(pg) ) + if ( (!pg->sharing) || rmap_count(pg) =3D=3D 0 ) { MEM_SHARING_DEBUG("mfn %lx shared, but empty gfn list!\n", mfn_x(mfn)); @@ -1220,7 +1208,7 @@ int __mem_sharing_unshare_page(struct domain *d, * Do the accounting first. If anything fails below, we have bigger * bigger fish to fry. First, remove the gfn from the list. */ - last_gfn =3D rmap_has_one_entry(page); + last_gfn =3D rmap_count(page) =3D=3D 1; if ( last_gfn ) { /* --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel