From nobody Sun May 19 01:26:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=1589310727; cv=none; d=zohomail.com; s=zohoarc; b=RLuaIU72u/WlBqzRLXuRQFbu72r8s+KNgKXw41LHsCFF/A3gCbtS0lmOF0Kmh+oJvGNBNhd9V52XKaLnFoJXuyThNiWBgyu37rsG4QxVAAJQevRs97JvGW2BH57WEucwWRHHFly6epNP29WVdxBg6GxCoOjEEanaX+GL4cqFv/k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589310727; 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=NCZIXY6Set9YkNBhgIQ2GdzMP90y5BYOZDNW8QLhbx0=; b=RwuCZgyMopXit6t83f6XmIjMqcZJ7Wp5PEIHzBSIYVUxxOItN2ZfaD5uJvCxEDxxKczlRPbvEEeI7rNTh0/AZZejkKDzPDujk70qBZe0RvXHy28lrsbWtcZqS3ddavFYvqztNcSBzzQ/Hmeh2xjQqIzdzpP7we1X2Cm3Vg7RSPE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 1589310727746968.0758933971964; Tue, 12 May 2020 12:12:07 -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 1jYaJi-0002Qw-Dc; Tue, 12 May 2020 19:11:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jYaJi-0002Qq-0x for xen-devel@lists.xenproject.org; Tue, 12 May 2020 19:11:50 +0000 Received: from esa1.hc3370-68.iphmx.com (unknown [216.71.145.142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6dae7a82-9484-11ea-ae69-bc764e2007e4; Tue, 12 May 2020 19:11:49 +0000 (UTC) X-Inumbo-ID: 6dae7a82-9484-11ea-ae69-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1589310709; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oMCdGSDqIXHcN3yrHbB182v6Q6Qj/Ianz2JO6oKJY2I=; b=IX6PR4MFFU/bz0O8a5EdaZZhfcUZ5iIOJXQWMMOcycD/60yfqHylwgju lf3hSuEqiqWHWprWJCPeccx/xKWzzuyGvozVy7ifd5hRop9jP5vnTAIgY iJruB7MYZAbMupvQ0kVbfOL0lew45mS8tDx4GDa4yO1joJFkLQqHAjFP8 8=; 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; 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 ip4:168.245.78.127 ~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 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; dmarc=pass (p=none dis=none) d=citrix.com IronPort-SDR: PBwiuavzafFtcce7TY/uOXgN1tTXnJ+s1m+WMDEnJTkyadmsH7TPFfUwRDQDuQmV67huSJee6e /G4x1e/Igmwppwy/Nt1vKUIE90uZP+K59wXFR32m/yrPVyrKP3RcfuTLgRATacAcWvRqJdWmdC f447dNQL5Gw2m32E1Tq3re8yrcrqM6pG4w32pbHR+UbRRuMLz2ZzJBCk6h7AFtp55pN1ONzEU6 VK/Q/586PvfBzNP+bDcTCI7QwoujHHGXhH3DKEviXZPl7hM0doEuxxqciXYC1xike67kCeT0UD zNM= X-SBRS: 2.7 X-MesageID: 17620682 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,384,1583211600"; d="scan'208";a="17620682" From: Andrew Cooper To: Xen-devel Subject: [PATCH] x86/build: Unilaterally disable -fcf-protection Date: Tue, 12 May 2020 20:11:16 +0100 Message-ID: <20200512191116.6851-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.11.0 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: Wei Liu , Jason Andryuk , Andrew Cooper , Stefan Bader , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) See comment for details. Works around a GCC-9 bug which breaks the build on Ubuntu. Reported-by: Jason Andryuk Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich Reviewed-by: Jason Andryuk Tested-by: Jason Andryuk --- CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monn=C3=A9 CC: Jason Andryuk CC: Stefan Bader Sorry for messing you around with how to fix this. I'd neglected to consid= er the CONFIG_LIVEPATCH interaction. With that extra observation, there is no point having the extra complexity given that the result with CET-IBT and Retpoline still isn't usable. --- xen/arch/x86/arch.mk | 9 +++++++++ xen/arch/x86/boot/build32.mk | 1 + 2 files changed, 10 insertions(+) diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk index 2a51553edb..93e30e4bea 100644 --- a/xen/arch/x86/arch.mk +++ b/xen/arch/x86/arch.mk @@ -67,6 +67,15 @@ CFLAGS-$(CONFIG_INDIRECT_THUNK) +=3D -mindirect-branch= =3Dthunk-extern CFLAGS-$(CONFIG_INDIRECT_THUNK) +=3D -mindirect-branch-register CFLAGS-$(CONFIG_INDIRECT_THUNK) +=3D -fno-jump-tables =20 +# Xen doesn't support CET-IBT yet. At a minimum, logic is required to +# enable it for supervisor use, but the Livepatch functionality needs +# to learn not to overwrite ENDBR64 instructions. +# +# Furthermore, Ubuntu enables -fcf-protection by default, along with a +# buggy version of GCC-9 which objects to it in combination with +# -mindirect-branch=3Dthunk-extern (Fixed in GCC 10, 9.4). +$(call cc-option-add,CFLAGS,CC,-fcf-protection=3Dnone) + # If supported by the compiler, reduce stack alignment to 8 bytes. But all= ow # this to be overridden elsewhere. $(call cc-option-add,CFLAGS-stack-boundary,CC,-mpreferred-stack-boundary= =3D3) diff --git a/xen/arch/x86/boot/build32.mk b/xen/arch/x86/boot/build32.mk index 48c7407c00..5a00755512 100644 --- a/xen/arch/x86/boot/build32.mk +++ b/xen/arch/x86/boot/build32.mk @@ -3,6 +3,7 @@ CFLAGS =3D include $(XEN_ROOT)/Config.mk =20 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) +$(call cc-option-add,CFLAGS,CC,-fcf-protection=3Dnone) =20 CFLAGS +=3D -Werror -fno-asynchronous-unwind-tables -fno-builtin -g0 -msof= t-float CFLAGS +=3D -I$(XEN_ROOT)/xen/include --=20 2.11.0