From patchwork Wed Oct 23 16:48:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony PERARD X-Patchwork-Id: 11207257 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 09646112C for ; Wed, 23 Oct 2019 17:11:48 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9AF92086D for ; Wed, 23 Oct 2019 17:11:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="Aiwjc/L3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D9AF92086D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=citrix.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNK9d-0002Yg-UC; Wed, 23 Oct 2019 17:10:37 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iNK9c-0002Xv-Ih for xen-devel@lists.xenproject.org; Wed, 23 Oct 2019 17:10:36 +0000 X-Inumbo-ID: 070b0d24-f5b8-11e9-bbab-bc764e2007e4 Received: from esa5.hc3370-68.iphmx.com (unknown [216.71.155.168]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 070b0d24-f5b8-11e9-bbab-bc764e2007e4; Wed, 23 Oct 2019 17:10:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1571850635; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CmM17caS9BcmxVqilv9CV864hCkmygyaAx1dtmUJsKE=; b=Aiwjc/L3U591+5AREaFLWNsdA1FoMHTIDNL0t2+q/WytaogoN+4/6FAI Nb2bLeSR9EVRhi2S3ReHa7Qj7jT+yWUSDbFEnYaua64GGycWU8GXtPI/X OQ8wwOq65GL9Acjo5HKNxSQAJdCqLu306Jq5hp5vc5nfQaDJ+eg9MBq0H g=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@citrix.com; spf=Pass smtp.mailfrom=anthony.perard@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of anthony.perard@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="anthony.perard@citrix.com"; x-sender="anthony.perard@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="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 96h22YvGU1Hv80EMQPFhAJtz51BiZ2aQCqOdCC1wc36zTwRVO/CuWLE4B8Y/zkiJxhRaEO/MCl 6JZHwGy+pyX4uu8LSGNlCG/u2tv61WQ0QK2/MQUxJIe+4Hi6pDZgyL4yq0QpbpQzKAILl8qt8Z 79/z+fzx7Fc3dhI0UXAOXhs4HTJScrsrVmQhJpCYKvHkUmvBu0H0nI9SadSMmyGe95GXbStgJD 6j14BN5WeuR3Q6F8kZeBf29NIbvfycwBLj94kTDUS3TZsI4surHie5HOdrXaC168VEoCjELkQW FfI= X-SBRS: 2.7 X-MesageID: 7642017 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.68,221,1569297600"; d="scan'208";a="7642017" From: Anthony PERARD To: Date: Wed, 23 Oct 2019 17:48:33 +0100 Message-ID: <20191023164837.2700240-20-anthony.perard@citrix.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191023164837.2700240-1-anthony.perard@citrix.com> References: <20191023164837.2700240-1-anthony.perard@citrix.com> MIME-Version: 1.0 Subject: [Xen-devel] [RFC XEN PATCH 19/23] update *FLAGS for arch/x86/Makefile 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: Anthony PERARD Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" --- xen/arch/x86/Makefile | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 49b7eb9fd116..41486c512f10 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -1,3 +1,68 @@ +# select defconfig based on actual architecture +KBUILD_DEFCONFIG := $(ARCH)_defconfig + +export XEN_IMG_OFFSET := 0x200000 + +KBUILD_CFLAGS += -I$(srctree)/include +KBUILD_CFLAGS += -I$(srctree)/include/asm-x86/mach-generic +KBUILD_CFLAGS += -I$(srctree)/include/asm-x86/mach-default +KBUILD_CFLAGS += -DXEN_IMG_OFFSET=$(XEN_IMG_OFFSET) + +# Prevent floating-point variables from creeping into Xen. +KBUILD_CFLAGS += -msoft-float + +KBUILD_CFLAGS += $(foreach o,$(EMBEDDED_EXTRA_CFLAGS),$(call cc-option,$(o))) +KBUILD_CFLAGS += $(call cc-option,-Wnested-externs) +KBUILD_CFLAGS += $(call as-instr,vmcall,-DHAVE_AS_VMX) +KBUILD_CFLAGS += $(call as-instr,crc32 %eax$(comma)%eax,-DHAVE_AS_SSE4_2) +KBUILD_CFLAGS += $(call as-instr,invept (%rax)$(comma)%rax,-DHAVE_AS_EPT) +KBUILD_CFLAGS += $(call as-instr,rdrand %eax,-DHAVE_AS_RDRAND) +KBUILD_CFLAGS += $(call as-instr,rdfsbase %rax,-DHAVE_AS_FSGSBASE) +KBUILD_CFLAGS += $(call as-instr,xsaveopt (%rax),-DHAVE_AS_XSAVEOPT) +KBUILD_CFLAGS += $(call as-instr,rdseed %eax,-DHAVE_AS_RDSEED) +KBUILD_CFLAGS += $(call as-instr,clwb (%rax),-DHAVE_AS_CLWB) +KBUILD_CFLAGS += $(call as-instr,.equ \"x\"$(comma)1,-DHAVE_AS_QUOTED_SYM) +KBUILD_CFLAGS += $(call as-instr,invpcid (%rax)$(comma)%rax,-DHAVE_AS_INVPCID) + +# GAS's idea of true is -1. Clang's idea is 1 +KBUILD_CFLAGS += $(call as-instr,\ + .if ((1 > 0) < 0); .error "";.endif,,-DHAVE_AS_NEGATIVE_TRUE) + +# Check to see whether the assmbler supports the .nop directive. +KBUILD_CFLAGS += $(call as-instr,\ + .L1: .L2: .nops (.L2 - .L1)$(comma)9,-DHAVE_AS_NOPS_DIRECTIVE) + +KBUILD_CFLAGS += -mno-red-zone -fpic -fno-asynchronous-unwind-tables + +# Xen doesn't use SSE interally. If the compiler supports it, also skip the +# SSE setup for variadic function calls. +KBUILD_CFLAGS += -mno-sse $(call cc-option,-mskip-rax-setup) + +# -fvisibility=hidden reduces -fpic cost, if it's available +ifeq ($(call cc-option-yn,-fvisibility=hidden),y) +KBUILD_CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE +endif + +# Compile with thunk-extern, indirect-branch-register if avaiable. +ifeq ($(call cc-option-yn,-mindirect-branch-register),y) +KBUILD_CFLAGS += -mindirect-branch=thunk-extern -mindirect-branch-register +KBUILD_CFLAGS += -DCONFIG_INDIRECT_THUNK +KBUILD_CFLAGS += -fno-jump-tables +export CONFIG_INDIRECT_THUNK=y +endif + +# If supported by the compiler, reduce stack alignment to 8 bytes. But allow +# this to be overridden elsewhere. +# XXX adding to cflags instead of CFLAGS-stack-boundary +KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=3) + +# Set up the assembler include path properly for older toolchains. +KBUILD_CFLAGS += -Wa,-I$(srctree)/include + +# XXX from xen.git/config/x86_64.mk +LDFLAGS_emulation_OpenBSD := _obsd +LDFLAGS_emulation_FreeBSD := _fbsd +KBUILD_LDFLAGS += -melf_x86_64$(LDFLAGS_emulation_$(XEN_OS)) efi-y := $(shell if [ ! -r $(BASEDIR)/include/xen/compile.h -o \ -O $(BASEDIR)/include/xen/compile.h ]; then \