From nobody Thu Mar 28 13:51:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1565697732; cv=none; d=zoho.com; s=zohoarc; b=oVbIAsd8AeT+T6IAf0Hhp/Tu/YbYvOqMruk4/+DBofLC4ZFQ1x9xvVyEhwDPsbbNEHWbW+9QY2hV+aRIYsGp13iMgDWSImJu8TpsM+BMcJS9g+R6yYMfzv62mgPrU/6vXnOI7dksavbCRC8etAdECs8y71tFxvYMOu1YTIWdElU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565697732; 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=Fd106VHWTiktDgw6c0MSwoV0x8ks18xHY++lOnQwxWw=; b=cw7KFJ9HvmqCLdBVSI2S9JLTtaP5CxW6vnsAtrQ8swZsZ/87n2kow49mX3FwS8jM2symt3zB4lkiPYYdAS5I5UXTDsCmiHuXjPlrDN0PxDMTuojyM1AvXsS14XP0SQbzgrWbbcTOg/j+MYhk6F3+ODu76eC/uoQx3k0Al965xBE= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; 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 1565697732360714.9189491696214; Tue, 13 Aug 2019 05:02:12 -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 1hxVUT-00045G-B8; Tue, 13 Aug 2019 12:01:25 +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 1hxVUR-00044y-W2 for xen-devel@lists.xenproject.org; Tue, 13 Aug 2019 12:01:24 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 106c956e-bdc2-11e9-a7ad-afdb04ed2b71; Tue, 13 Aug 2019 12:01:21 +0000 (UTC) X-Inumbo-ID: 106c956e-bdc2-11e9-a7ad-afdb04ed2b71 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1565697682; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=qr0bRkGN+EgzDwVian4any+2EppgtZJDXAK9TJtaaao=; b=XwFtMqT1hSMSuJQoqXhjqyf6XO6fkH6/btl6qhVVQiZgslmzGcTmoAmW 9oEn/drf5cc+5KHLsX5/f/ONF2AP8AqZjfiLShXJqfgIieTqM/C4vC8W2 3PrTo2ga32JhMdyy8o16mDGiR6g/xHtqdVDGMcPYTf+yaPnXQryn2vyJk Y=; Authentication-Results: esa1.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 (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; Received-SPF: None (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="andrew.cooper3@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa1.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=esa1.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 ~all" Received-SPF: None (esa1.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=esa1.hc3370-68.iphmx.com; envelope-from="Andrew.Cooper3@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: gOb0rFYKmhRBpSEoqGn2adWlb31A1DplCt76fLpKxAvSnkVgilz8tfKTukNymegDENiG8p7DnF KTmT5jSp1KOQueIc0N1KHbbFD0G0OYx8Vn7qEZMvDyxzfAuf/QrhTXgnwLmxTSeq+n8LY2ejWx C9OGFFtb0YDrbFGAh+wiF2joOke3kMf5RAprkbPj497rVRRcMloMt7GIexFa46Wom8Wwwu63Gt MXh4LJmtrbdkVMF8RJS1ZazsZgZXDvgI6qA0kEdQc5eljItO5rUFrWQ6wRWqqDp0uEkFlb90OH PaU= X-SBRS: 2.7 X-MesageID: 4242438 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.64,381,1559534400"; d="scan'208";a="4242438" From: Andrew Cooper To: Xen-devel Date: Tue, 13 Aug 2019 13:01:17 +0100 Message-ID: <20190813120117.22528-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] x86/tss: Fix clang build following c/s 7888440625 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 , Wei Liu , Jan Beulich , =?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" X-ZohoMail-DKIM: fail (Header signature does not verify) Clang-3.5 from Debian Jessie fails with: smpboot.c:829:29: error: statement expression not allowed at file scope BUILD_BUG_ON(sizeof(this_cpu(tss_page)) !=3D PAGE_SIZE); ^ /local/xen.git/xen/include/asm/percpu.h:14:7: note: expanded from macro 'this_cpu' (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset)) ^ /local/xen.git/xen/include/xen/compiler.h:98:3: note: expanded from macro 'RELOC_HIDE' ({ unsigned long __ptr; \ ^ /local/xen.git/xen/include/xen/lib.h:26:53: note: expanded from macro 'BUILD_BUG_ON' #define BUILD_BUG_ON(cond) ((void)BUILD_BUG_ON_ZERO(cond)) ^ /local/xen.git/xen/include/xen/lib.h:25:57: note: expanded from macro 'BUILD_BUG_ON_ZERO' #define BUILD_BUG_ON_ZERO(cond) sizeof(struct { int:-!!(cond); }) ^ 1 error generated. /local/xen.git/xen/Rules.mk:202: recipe for target 'smpboot.o' failed This is obviously a compiler bug because the BUILD_BUG_ON() is not at file scope. However, it can be worked around by using a local variable. Spotted by Gitlab CI. Signed-off-by: Andrew Cooper Reviewed-by: Wei Liu --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 --- xen/arch/x86/smpboot.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 5057109a77..85c81c247e 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -826,9 +826,11 @@ static int setup_cpu_root_pgt(unsigned int cpu) rc =3D clone_mapping(idt_tables[cpu], rpt); if ( !rc ) { - BUILD_BUG_ON(sizeof(this_cpu(tss_page)) !=3D PAGE_SIZE); + struct tss_page *this_tss =3D &per_cpu(tss_page, cpu); =20 - rc =3D clone_mapping(&per_cpu(tss_page, cpu).tss, rpt); + BUILD_BUG_ON(sizeof(*this_tss) !=3D PAGE_SIZE); + + rc =3D clone_mapping(&this_tss->tss, rpt); } if ( !rc ) rc =3D clone_mapping((void *)per_cpu(stubs.addr, cpu), rpt); --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel