From nobody Sat May 4 07:24:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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=1591019698; cv=none; d=zohomail.com; s=zohoarc; b=iO4rkawMLGP/0uezfEJ4Z2FAc0AsG4ekn0Lgh5mnz5nPoSrAIm6gu6909I30Br+HQ6dYZXGr7WG2fs/2P7ru3M07kI+kZgGb1PmGWLByTB1Xt+8VkN1B/qevLTe2DrxWZg1+2QTa3mO1LtfjSEEDwprXORu29xlbq4kQmPOZzMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591019698; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=FvbQAqUp6pZLGOexNPNVSwp/BkiNml6omaX95SU5XaU=; b=DyPvS7bwuEqf70SqflqZBgNS+kS9Ig+KiMkxHGohDfLG3ji2HqS6S86+tv3S1tYhFZdkPh119wRDzcJqew3xq2g3v2VfgZ1FjrO71dU3qFJYerCyzt8AfN7bLVhOHWzttHic9DbdPCWa9M2XNR0nVF47ELdmR1n7z/mEYngmfcg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1591019698061398.24879190445347; Mon, 1 Jun 2020 06:54:58 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jfktY-0002Gh-LR; Mon, 01 Jun 2020 13:54:28 +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.92) (envelope-from ) id 1jfktX-0002GY-D6 for xen-devel@lists.xenproject.org; Mon, 01 Jun 2020 13:54:27 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 67c38028-a40f-11ea-ab1d-12813bfff9fa; Mon, 01 Jun 2020 13:54:26 +0000 (UTC) X-Inumbo-ID: 67c38028-a40f-11ea-ab1d-12813bfff9fa Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 4qt90VmACEPxtLEgjd+wGQwkhHFgATKLovXG0ynly1zRDj7WrmW/W0blK63cKyHDinM669+Ubb FrfZMH+NTlS8oriz16y3K5dciQ/MBzZ+u58ZQw5J0RxIHnB8QD+S8TQghNeedCabEV1wUtu2uK FGpVh1l+MCYedB2sqm5iBL/IcpzmAF2xiJGROuN3Ix8gMMGQfoNDT8iIt6eHvgDa2SE2clruoV 9xkn27QDFx+zpcB3v572iwdVAImHcD5KCZwf17uO001kYr9qd8L4ixhBqa6kKzMKS4EzFLb0si 2Hc= X-SBRS: 2.7 X-MesageID: 19215687 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,461,1583211600"; d="scan'208";a="19215687" From: Roger Pau Monne To: Subject: [PATCH v3 1/2] x86/mm: do not attempt to convert _PAGE_GNTTAB to a boolean Date: Mon, 1 Jun 2020 15:53:24 +0200 Message-ID: <20200601135325.34156-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601135325.34156-1-roger.pau@citrix.com> References: <20200601135325.34156-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Roger Pau Monne , Wei Liu , Jan Beulich , paul@xen.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Clang 10 complains with: mm.c:1239:10: error: converting the result of '<<' to a boolean always eval= uates to true [-Werror,-Wtautological-constant-compare] if ( _PAGE_GNTTAB && (l1e_get_flags(l1e) & _PAGE_GNTTAB) && ^ xen/include/asm/x86_64/page.h:161:25: note: expanded from macro '_PAGE_GNTT= AB' #define _PAGE_GNTTAB (1U<<22) ^ Remove the conversion of _PAGE_GNTTAB to a boolean and instead use a preprocessor conditional to check if _PAGE_GNTTAB is defined. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Jan Beulich --- Changes since v2: - Add comment. Changes since v1: - Use a preprocessor conditional. --- xen/arch/x86/mm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 53e3dcb2d4..e376fc7e8f 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1235,8 +1235,14 @@ void put_page_from_l1e(l1_pgentry_t l1e, struct doma= in *l1e_owner) * * (Note that the undestroyable active grants are not a security hole = in * Xen. All active grants can safely be cleaned up when the domain die= s.) + * + * NB: the preprocessor conditional is required in order to prevent cl= ang's + * -Wtautological-constant-compare complaining about converting the re= sult + * of a << into a bool is always true if it's evaluated directly in th= e if + * condition. */ - if ( _PAGE_GNTTAB && (l1e_get_flags(l1e) & _PAGE_GNTTAB) && +#if _PAGE_GNTTAB + if ( (l1e_get_flags(l1e) & _PAGE_GNTTAB) && !l1e_owner->is_shutting_down && !l1e_owner->is_dying ) { gdprintk(XENLOG_WARNING, @@ -1244,6 +1250,7 @@ void put_page_from_l1e(l1_pgentry_t l1e, struct domai= n *l1e_owner) l1e_get_intpte(l1e)); domain_crash(l1e_owner); } +#endif =20 /* * Remember we didn't take a type-count of foreign writable mappings --=20 2.26.2 From nobody Sat May 4 07:24:27 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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=1591019700; cv=none; d=zohomail.com; s=zohoarc; b=lqhQF8SOQNsGKVSwPFPO6Tx4TCikUs5iX8kTu8EoNe/yCrYj8E/MPK/79Ka0vcEjWNW07XmoG6fvTuFo1SxTMAlifOiU2yHfghbLloZvqsOI0V3FbGaamPxo+e2rj0xV0thyqAPVt9wHo9yxE4qXRXU7G4LGRpGgxQs2pkQod+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591019700; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=o8EX8kLJ/SxXx9SZw4g7553FxFT4cE9UNw1D7RXnmNE=; b=P+aVcNc4wqRxlDLz88TNrwsFQS+xo+Ds1xSGm8k/rs3HxVf40FmHKhDpfQrdM5qZiQ+Onm7kMJKo4mMLCFROXRePIuwTqhinSnL+6S0XMYuZf4Q3ju8ArEhdYqU99gFeqNoHCRUJhPUeANTZKi+lxzt+CWNFJSlVyAHsNp60cOg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 1591019700928988.9013611246997; Mon, 1 Jun 2020 06:55:00 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jfktd-0002HF-Tz; Mon, 01 Jun 2020 13:54:33 +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.92) (envelope-from ) id 1jfktc-0002Gy-BA for xen-devel@lists.xenproject.org; Mon, 01 Jun 2020 13:54:32 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 69163ce0-a40f-11ea-ab1d-12813bfff9fa; Mon, 01 Jun 2020 13:54:28 +0000 (UTC) X-Inumbo-ID: 69163ce0-a40f-11ea-ab1d-12813bfff9fa Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: sVIGuYT6wuHcAonyZ38W2nycDKp7UJw344QeU+pC4GVEpCF6iMHC2c3+fzesUdvrOvHW5waw1l 14tRczf9UcUAdiWTz1aTwvKden+IEVCntbDPMu75Nze0dXDG5A/OEDiA03NwboGx3+tgWSmyw4 452MGiLWj33XCMnplr+gb6bscf65+W1G1VP0aoNyI3svWOpnNIDKuGW/NZl4//YFsFyfiABiE1 c6SpcODi54eY3TV8+oKP1fq5vI/MrJzun9gooG+7qyb9Olyjh4Zo79WScNBr6Uj1/AD3cq6Zyq jpw= X-SBRS: 2.7 X-MesageID: 19215690 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.73,461,1583211600"; d="scan'208";a="19215690" From: Roger Pau Monne To: Subject: [PATCH v3 2/2] build32: don't discard .shstrtab in linker script Date: Mon, 1 Jun 2020 15:53:25 +0200 Message-ID: <20200601135325.34156-3-roger.pau@citrix.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601135325.34156-1-roger.pau@citrix.com> References: <20200601135325.34156-1-roger.pau@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Andrew Cooper , Roger Pau Monne , Wei Liu , Jan Beulich , paul@xen.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" LLVM linker doesn't support discarding .shstrtab, and complains with: ld -melf_i386_fbsd -N -T build32.lds -o reloc.lnk reloc.o ld: error: discarding .shstrtab section is not allowed Add an explicit .shstrtab, .strtab and .symtab sections to the linker script after the text section in order to make LLVM LD happy and match the behavior of GNU LD. Signed-off-by: Roger Pau Monn=C3=A9 Acked-by: Jan Beulich --- Changes since v2: - Also add .strtab and .symtab sections to match GNU behavior. --- xen/arch/x86/boot/build32.lds | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/xen/arch/x86/boot/build32.lds b/xen/arch/x86/boot/build32.lds index 97454b40ff..1ab9418793 100644 --- a/xen/arch/x86/boot/build32.lds +++ b/xen/arch/x86/boot/build32.lds @@ -50,6 +50,20 @@ SECTIONS *(.got.plt) } =20 + /* + * Discarding .shstrtab is not supported by LLD (LLVM LD) and will trigg= er an + * error. Also keep the rest of the control sections to match GNU LD beh= avior. + */ + .shstrtab : { + *(.shstrtab) + } + .strtab : { + *(.strtab) + } + .symtab : { + *(.symtab) + } + /DISCARD/ : { /* * Discard everything else, to prevent linkers from putting --=20 2.26.2