From patchwork Wed Nov 6 09:19:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 11229733 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 B22051599 for ; Wed, 6 Nov 2019 09:21:04 +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 8C6E92173E for ; Wed, 6 Nov 2019 09:21:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="imZLBWBS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C6E92173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 1iSHTK-0006rW-Te; Wed, 06 Nov 2019 09:19:26 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTI-0006rO-TV for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:24 +0000 X-Inumbo-ID: 8388bb1c-0076-11ea-adbe-bc764e2007e4 Received: from mail-lj1-x241.google.com (unknown [2a00:1450:4864:20::241]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8388bb1c-0076-11ea-adbe-bc764e2007e4; Wed, 06 Nov 2019 09:19:20 +0000 (UTC) Received: by mail-lj1-x241.google.com with SMTP id t5so25236023ljk.0 for ; Wed, 06 Nov 2019 01:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Y60o9fNUcHZsrorXcWFX4zvC9XULhWVpmJqmThUGBvs=; b=imZLBWBS0BJ7Slb1xEMmz7uUDllOi1B5SPzOa4E59Fx/u6gcbMWxkuWXAaJZGCWt1e mSb/Nal1B8A7d4GjoAaWx9DQ3r3CZbRt0PPwrrDOHyHnOYMtahcx25Ay+Mtcq4Ui2UjO FG/xbXglpY0Y4zAzBswfAC6Tb9jFpNA3vq6Co6nMz3qSV1iSDzOd4eEqC6QyfOsBDNOR n3bbnCSdIrjnBD44KowCtgYooSTQdNQz1s4gjmY18rg3YyaJo8vjvoe/nd8f3NTNP+5H tsSUO6J0/V/GIvDDg/f6Fa1ZsEfbzUIFxe5onipgRsHnwPS5BR+1qaMfowQkdH8AYM6m hDaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Y60o9fNUcHZsrorXcWFX4zvC9XULhWVpmJqmThUGBvs=; b=S9NCUjy3nL+7FBplMrGR49s//YSs54TVZPAqmqczjABYyL8nBAYPCSv5JscDytTVcQ 4IptwPKmGIceD6oB8wjp5VDG898r4P+Vdf9S81FzkHDw1/Dr3EFg9LHTxL08ytkPw77U MKeT1RxZD+ZhFBUia1t9OdpgyYMwLxLfdsdey4dL22Ml09fWPBsi6rmyqFllQKBW8xWd ibSnXS/bGC2OHG1S4jUco1BCH1TzWLLEqIE0PKaBaQIoCjVzvv8K7iaqDCe6h0s/Hs0G OHBJF7YkjrOs3JeKURxqDB+jhFUCtJyVXruzAn1+zdwMusOYvY0Vj5x1ro3VnAQkQsZ2 6IEQ== X-Gm-Message-State: APjAAAVeo4je9dxcUuq59ACSjh+1UzdX3wGxtIeLjMxMywI/rKfUZpCZ 2O28to0SioRpn3DyhO4es6lpog3D1ds= X-Google-Smtp-Source: APXvYqxq2jsEIltaX02AKa3Gqbw+LafXe5XEfUcR2SOIqbK/Lwd8ii4AhvQDQodcR1Q0x3lGOX3GzQ== X-Received: by 2002:a2e:890e:: with SMTP id d14mr1098025lji.6.1573031958811; Wed, 06 Nov 2019 01:19:18 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:18 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:07 +0200 Message-Id: <1573031953-12894-2-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 1/7] xen: clang: Support correctly cross-compile 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: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Julien Grall , Jan Beulich MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Julien Grall Clang uses "-target" option for cross-compilation. Signed-off-by: Julien Grall --- config/StdGNU.mk | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/StdGNU.mk b/config/StdGNU.mk index 039274e..48c50b5 100644 --- a/config/StdGNU.mk +++ b/config/StdGNU.mk @@ -1,8 +1,13 @@ AS = $(CROSS_COMPILE)as LD = $(CROSS_COMPILE)ld ifeq ($(clang),y) -CC = $(CROSS_COMPILE)clang -CXX = $(CROSS_COMPILE)clang++ +ifneq ($(CROSS_COMPILE),) +CC = clang -target $(CROSS_COMPILE:-=) +CXX = clang++ -target $(CROSS_COMPILE:-=) +else +CC = clang +CXX = clang++ +endif LD_LTO = $(CROSS_COMPILE)llvm-ld else CC = $(CROSS_COMPILE)gcc From patchwork Wed Nov 6 09:19:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 11229739 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 28E2D1599 for ; Wed, 6 Nov 2019 09:21:14 +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 04BE72173E for ; Wed, 6 Nov 2019 09:21:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kbJrq3Yp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 04BE72173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 1iSHTP-0006rm-5n; Wed, 06 Nov 2019 09:19:31 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTN-0006rh-Tq for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:29 +0000 X-Inumbo-ID: 8480e92c-0076-11ea-b678-bc764e2007e4 Received: from mail-lj1-x243.google.com (unknown [2a00:1450:4864:20::243]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 8480e92c-0076-11ea-b678-bc764e2007e4; Wed, 06 Nov 2019 09:19:22 +0000 (UTC) Received: by mail-lj1-x243.google.com with SMTP id g3so19076403ljl.11 for ; Wed, 06 Nov 2019 01:19:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xSOyQrMQPlr6EgdgcQhAe9WMzTPb2+P+YjpAc1iWnc4=; b=kbJrq3Ypw1o1ZJd+JXKd3/jehKqIBqbh82g+mN1z5kF5A8EaqUOzIzCA+ln4QmZffD TTNumjMB4wzEfoxZ7D7KMyfZYcJ8vtGqERkLcyGH0smDyHDCILUSAT+y43Vf6eNrkhaI YqWh/nTnWr93Ta9uuTcX8K65E0JUHAKmJRvxZ/1ZhynbzVYMioS9vxluzO3vGdLDoKWi q5tuJbnmo5n3dewSwFrt1PG6i6rdCq0FmFDhkOnTwO+sK6l00InVdaTYQSAcKpvT14L9 rBgW6Hxf+f8NyH0CVbEiOUs/S/jpzEqi6r4gDHifPnupHIb3Ltkan+CTdOHMk6KJj4Xw ox0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xSOyQrMQPlr6EgdgcQhAe9WMzTPb2+P+YjpAc1iWnc4=; b=MwODDpXAPvUOSa/2rWk1gcMGZb7zaJzwt6dqjExjDS4RvwLdwPvHUldKjFVGG22Olv kuYQoJbis5u3YCUGRvB2spHWkqdSEey3qv1qYifK+2MBq8XRzjShkxGJhMTwDL1IV+t7 rgvDQbdQzhGs80P6xH0EQzNCQy48YCFias/mZUngkSbdCQnk10kr6HW71IBDk/ED/1p/ a/QTjFe0mCEvhe8x2hjEdczpFvUO+H0G7L8sswpt/IHaaCWJdybpJXdsXWyYdhAFOMem BqI211BFyl2f3bmWzcQYsxiwqn0cB/yblENergac5FJnj2bdYgKK2pdnO2Me/z/46FNZ BRkQ== X-Gm-Message-State: APjAAAXwr/1iH3KlVma7DVRsCOPBO4C8MXSEyzBNx/7GAUsJEI3LEUeC OUH3M8S5mxuiiAT98ymRVbj4JsEguq8= X-Google-Smtp-Source: APXvYqx7iL707qKuIl3weG5T+IEQ2E+k/2TEcWWhq2BCmWw8A5vK2c1dn7JuiBZU/Fxyv5gQDGKupw== X-Received: by 2002:a2e:5d1:: with SMTP id 200mr1167546ljf.50.1573031960696; Wed, 06 Nov 2019 01:19:20 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:20 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:08 +0200 Message-Id: <1573031953-12894-3-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 2/7] WIP: Compilation with ARM DS-6 compiler 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: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , Volodymyr Babchuk , Artem Mygaiev MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Artem Mygaiev Still have linker issues --- Config.mk | 8 +++++++- config/StdGNU.mk | 11 ++++++++++- config/arm32.mk | 10 ++++++---- config/arm64.mk | 6 +++++- xen/Rules.mk | 2 ++ xen/arch/arm/Rules.mk | 8 ++++++++ 6 files changed, 38 insertions(+), 7 deletions(-) diff --git a/Config.mk b/Config.mk index d8f90d7..01487a7 100644 --- a/Config.mk +++ b/Config.mk @@ -221,7 +221,9 @@ CFLAGS += -Wall -Wstrict-prototypes $(call cc-option-add,HOSTCFLAGS,HOSTCC,-Wdeclaration-after-statement) $(call cc-option-add,CFLAGS,CC,-Wdeclaration-after-statement) +ifneq ($(armds),y) $(call cc-option-add,CFLAGS,CC,-Wno-unused-but-set-variable) +endif $(call cc-option-add,CFLAGS,CC,-Wno-unused-local-typedefs) LDFLAGS += $(foreach i, $(EXTRA_LIB), -L$(i)) @@ -234,9 +236,13 @@ endif APPEND_LDFLAGS += $(foreach i, $(APPEND_LIB), -L$(i)) APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i)) -EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all +EMBEDDED_EXTRA_CFLAGS := -fno-stack-protector -fno-stack-protector-all EMBEDDED_EXTRA_CFLAGS += -fno-exceptions +ifneq ($(armds),y) +EMBEDDED_EXTRA_CFLAGS += -nopie +endif + XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles # All the files at that location were downloaded from elsewhere on # the internet. The original download URL is preserved as a comment diff --git a/config/StdGNU.mk b/config/StdGNU.mk index 48c50b5..3bf3462 100644 --- a/config/StdGNU.mk +++ b/config/StdGNU.mk @@ -1,6 +1,15 @@ AS = $(CROSS_COMPILE)as +AR = $(CROSS_COMPILE)ar LD = $(CROSS_COMPILE)ld ifeq ($(clang),y) +ifeq ($(armds),y) +CC = armclang +CXX = armclang +LD_LTO = armlink --verbose --no_scanlib +LD = armlink --verbose --no_scanlib +AS = armasm +AR = armar +else ifneq ($(CROSS_COMPILE),) CC = clang -target $(CROSS_COMPILE:-=) CXX = clang++ -target $(CROSS_COMPILE:-=) @@ -9,13 +18,13 @@ CC = clang CXX = clang++ endif LD_LTO = $(CROSS_COMPILE)llvm-ld +endif else CC = $(CROSS_COMPILE)gcc CXX = $(CROSS_COMPILE)g++ LD_LTO = $(CROSS_COMPILE)ld endif CPP = $(CC) -E -AR = $(CROSS_COMPILE)ar RANLIB = $(CROSS_COMPILE)ranlib NM = $(CROSS_COMPILE)nm STRIP = $(CROSS_COMPILE)strip diff --git a/config/arm32.mk b/config/arm32.mk index f95228e..5afed07 100644 --- a/config/arm32.mk +++ b/config/arm32.mk @@ -4,12 +4,14 @@ CONFIG_ARM_$(XEN_OS) := y CONFIG_XEN_INSTALL_SUFFIX := -# -march= -mcpu= - # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb: -CFLAGS += -marm - +ifeq ($(armds),y) +# VE needed +CFLAGS += --target=arm-arm-none-eabi -march=armv7-a +else +CFLAGS += -marm # -march= -mcpu= # Use only if calling $(LD) directly. LDFLAGS_DIRECT += -EL +endif IOEMU_CPU_ARCH ?= arm diff --git a/config/arm64.mk b/config/arm64.mk index aa45772..46b203d 100644 --- a/config/arm64.mk +++ b/config/arm64.mk @@ -4,10 +4,14 @@ CONFIG_ARM_$(XEN_OS) := y CONFIG_XEN_INSTALL_SUFFIX := +ifeq ($(armds),y) +# VE needed +CFLAGS += --target=aarch64-arm-none-eabi -march=armv8.1-a+nofp+nosimd +else CFLAGS += #-marm -march= -mcpu= etc - # Use only if calling $(LD) directly. LDFLAGS_DIRECT += -EL +endif IOEMU_CPU_ARCH ?= aarch64 diff --git a/xen/Rules.mk b/xen/Rules.mk index 3090ea7..41a1c26 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -79,9 +79,11 @@ AFLAGS-y += -D__ASSEMBLY__ # Older clang's built-in assembler doesn't understand .skip with labels: # https://bugs.llvm.org/show_bug.cgi?id=27369 ifeq ($(clang),y) +ifneq ($(armds),y) $(call as-option-add,CFLAGS,CC,".L0:\n.L1:\n.skip (.L1 - .L0)",,\ -no-integrated-as) endif +endif ALL_OBJS := $(ALL_OBJS-y) diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk index 3d9a0ed..6f2b239 100644 --- a/xen/arch/arm/Rules.mk +++ b/xen/arch/arm/Rules.mk @@ -11,12 +11,20 @@ CFLAGS += -I$(BASEDIR)/include $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS)) $(call cc-option-add,CFLAGS,CC,-Wnested-externs) +ifneq ($(armds),y) # Prevent floating-point variables from creeping into Xen. CFLAGS-$(CONFIG_ARM_32) += -msoft-float CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15 CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc +else +CFLAGS-$(CONFIG_ARM_32) += -msoft-float +CFLAGS-$(CONFIG_ARM_32) += -mcpu=cortex-a15 + +CFLAGS-$(CONFIG_ARM_64) += -mcpu=generic +CFLAGS-$(CONFIG_ARM_64) += -mgeneral-regs-only # No fp registers etc +endif ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n) CFLAGS += -DGCC_HAS_VISIBILITY_ATTRIBUTE From patchwork Wed Nov 6 09:19:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 11229737 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 348A01575 for ; Wed, 6 Nov 2019 09:21:09 +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 0FD7A2173E for ; Wed, 6 Nov 2019 09:21:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lAiQv+0r" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0FD7A2173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 1iSHTU-0006sf-Hf; Wed, 06 Nov 2019 09:19:36 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTS-0006sL-Tj for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:34 +0000 X-Inumbo-ID: 857ca636-0076-11ea-adbe-bc764e2007e4 Received: from mail-lf1-x12d.google.com (unknown [2a00:1450:4864:20::12d]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 857ca636-0076-11ea-adbe-bc764e2007e4; Wed, 06 Nov 2019 09:19:24 +0000 (UTC) Received: by mail-lf1-x12d.google.com with SMTP id 19so12298635lft.13 for ; Wed, 06 Nov 2019 01:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SXK5YEv4q6DJPzsP6kXAnuhOPCSu4Bh2n9ZaicjoeUQ=; b=lAiQv+0rs6T6V1amjZ0jOha39FB89Uuqi8AZrzLhPtZPuiO4S+l8i8LjCxFWYHQkMW aAD6glC0Op+uRSv3mM1mil//xEjPUhOZSLHd+wqysfp8Ax7I1agrejE7uTp4Bg6yf8Oy KUhfjGzIudazYhJ9v358F6sJq/c1ssXnuzFJfFyIAQV7JfOvTUVJfUOPwKgMCoKhEskX P137Bb6PvLqLxzk+nrzxC+ziF1iAvuSb3EFX9Qx15d9X1aUIEMZi8YRZLo5hgzi03V85 Gba5RJ2/5q9GTKag4lCMhLU4qRSD7AHAA9REe4iRdDGjjbpJXKrTgbM+0NpGdNX7xzML xDHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SXK5YEv4q6DJPzsP6kXAnuhOPCSu4Bh2n9ZaicjoeUQ=; b=nauym5Od/0x3LDqO/jW/CpbdT7/JcuqGJV6Xa1ZKwXNtzqYT9NIzK1dVLQGYsA7lc3 wKTAZxkKks5HryhTxszyondA86vPRXuZzlx23X8HP7ShVCobJbUZTCDM561rI7fSJWMn BW0n48WhKNTaEXA7GfB3MONFWVO65VScYxlEBekK19INFjvKU/TJEP9iE7ehIHHI9uUk voSkvNs220hNyEnyu/1xMeWx9dyhKzapXbwGlYQ5Min3PCGh2XVO1N2GKoCYG5wr2mFf pPE+VCbxOqsGPxz+ejaIoItA7CaOue94YoJ8BEXq1lf9DDYlEtXp5z2UxSJCYjlOT3VP QdpQ== X-Gm-Message-State: APjAAAWAoN12joVZkZ8z0+myRa60pj9W4gt30l5wN5/XAQdJyV+OC7D1 2EWszza3bl8Z5cDuUhMIKHxOoRADRC8= X-Google-Smtp-Source: APXvYqytGFUnS3AaDk+EYDG4ohpaaCGpRV5nYy5/h5mgmsZr/FJB3IyhcAXCiENdOYvmymxOH/zDZQ== X-Received: by 2002:ac2:43d5:: with SMTP id u21mr2485948lfl.22.1573031962385; Wed, 06 Nov 2019 01:19:22 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:21 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:09 +0200 Message-Id: <1573031953-12894-4-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 3/7] arm64:armds: ARM Compiler 6.6 does not accept `rx` registers naming for AArch64 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: Julien Grall , Stefano Stabellini , Andrii Anisov , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Andrii Anisov So get the code duplication with `x`-es. Signed-off-by: Andrii Anisov --- xen/include/asm-arm/smccc.h | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/xen/include/asm-arm/smccc.h b/xen/include/asm-arm/smccc.h index 126399d..3fa1144 100644 --- a/xen/include/asm-arm/smccc.h +++ b/xen/include/asm-arm/smccc.h @@ -120,6 +120,8 @@ struct arm_smccc_res { #define __constraint_read_6 __constraint_read_5, "r" (r6) #define __constraint_read_7 __constraint_read_6, "r" (r7) +#ifdef CONFIG_ARM_32 + #define __declare_arg_0(a0, res) \ struct arm_smccc_res *___res = res; \ register unsigned long r0 asm("r0") = (uint32_t)a0;\ @@ -174,6 +176,64 @@ struct arm_smccc_res { __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res); \ register typeof(a7) r7 asm("r7") = __a7 +#else /* ARM_64 */ + +#define __declare_arg_0(a0, res) \ + struct arm_smccc_res *___res = res; \ + register unsigned long r0 asm("x0") = (uint32_t)a0;\ + register unsigned long r1 asm("x1"); \ + register unsigned long r2 asm("x2"); \ + register unsigned long r3 asm("x3") + +#define __declare_arg_1(a0, a1, res) \ + typeof(a1) __a1 = a1; \ + struct arm_smccc_res *___res = res; \ + register unsigned long r0 asm("x0") = (uint32_t)a0;\ + register unsigned long r1 asm("x1") = __a1; \ + register unsigned long r2 asm("x2"); \ + register unsigned long r3 asm("x3") + +#define __declare_arg_2(a0, a1, a2, res) \ + typeof(a1) __a1 = a1; \ + typeof(a2) __a2 = a2; \ + struct arm_smccc_res *___res = res; \ + register unsigned long r0 asm("x0") = (uint32_t)a0;\ + register unsigned long r1 asm("x1") = __a1; \ + register unsigned long r2 asm("x2") = __a2; \ + register unsigned long r3 asm("x3") + +#define __declare_arg_3(a0, a1, a2, a3, res) \ + typeof(a1) __a1 = a1; \ + typeof(a2) __a2 = a2; \ + typeof(a3) __a3 = a3; \ + struct arm_smccc_res *___res = res; \ + register unsigned long r0 asm("x0") = (uint32_t)a0;\ + register unsigned long r1 asm("x1") = __a1; \ + register unsigned long r2 asm("x2") = __a2; \ + register unsigned long r3 asm("x3") = __a3 + +#define __declare_arg_4(a0, a1, a2, a3, a4, res) \ + typeof(a4) __a4 = a4; \ + __declare_arg_3(a0, a1, a2, a3, res); \ + register unsigned long r4 asm("x4") = __a4 + +#define __declare_arg_5(a0, a1, a2, a3, a4, a5, res) \ + typeof(a5) __a5 = a5; \ + __declare_arg_4(a0, a1, a2, a3, a4, res); \ + register typeof(a5) r5 asm("x5") = __a5 + +#define __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res) \ + typeof(a6) __a6 = a6; \ + __declare_arg_5(a0, a1, a2, a3, a4, a5, res); \ + register typeof(a6) r6 asm("x6") = __a6 + +#define __declare_arg_7(a0, a1, a2, a3, a4, a5, a6, a7, res) \ + typeof(a7) __a7 = a7; \ + __declare_arg_6(a0, a1, a2, a3, a4, a5, a6, res); \ + register typeof(a7) r7 asm("x7") = __a7 + +#endif + #define ___declare_args(count, ...) __declare_arg_ ## count(__VA_ARGS__) #define __declare_args(count, ...) ___declare_args(count, __VA_ARGS__) From patchwork Wed Nov 6 09:19:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 11229735 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 75CA716B1 for ; Wed, 6 Nov 2019 09:21:05 +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 518342173E for ; Wed, 6 Nov 2019 09:21:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c5p9lkfk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 518342173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 1iSHTZ-0006tk-Qp; Wed, 06 Nov 2019 09:19:41 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTX-0006tH-Tu for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:39 +0000 X-Inumbo-ID: 86901026-0076-11ea-984a-bc764e2007e4 Received: from mail-lj1-x242.google.com (unknown [2a00:1450:4864:20::242]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 86901026-0076-11ea-984a-bc764e2007e4; Wed, 06 Nov 2019 09:19:25 +0000 (UTC) Received: by mail-lj1-x242.google.com with SMTP id g3so19076591ljl.11 for ; Wed, 06 Nov 2019 01:19:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=coiWn1foYoNL5/AHwQss8xRczmLkid+ReOf0kjJjIa4=; b=c5p9lkfkPe1akEiHY6SyoTNGB06FZdfk2JT3oZmB0h/1/HgrOtKYPPp7+/Z7S2kDXs DwWw0Li/JdvHxVzqL/gzj+HG1qZ1Qvfytnh8/Ma0yOmZr+/TjWRtP8u/BBeRXKO05sCy LKI38lXWDn2tSotce8QCXD0pZAxr4YDOiMhudt+TK/NpVMqAsbfnVyY4KyTdFYtTzJjx yFFnx5LZPB4GtN/KrrfJ/Kzo0P+5S0GpkZ0//1qWBPJVK/Nlh2XhUM4jPaSbTSM7TPsq 26Y0x0zztQSsAdhon+mMKYM5MWpwIuV4T6SULhEO3qa/iuUx7Pc89ThL983fpdxV9D4+ hJOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=coiWn1foYoNL5/AHwQss8xRczmLkid+ReOf0kjJjIa4=; b=gam/llvvIp4trmRDtMeQ/D/C1GkRJHSOZfDf+elRnoaErCGnhH/OuKbihbxV55yxP8 3+G7Wt08qcT3LpK90aKTLszrUyEsXzds6kp7xEtrbzF2jE1uhmZCV/jm2hTkGdqrVj0V f2YPGVLLragbwFZPg20aj1IRP/IGBhScsmKNcc42S3WivRH7jwB7BXes/45RWlKXppcs KeaaY1zyBMwLLwpGvSpoV6/S7lfOiLDjYlHlbl8c3+/7K8HO1EDfk4XvF3+qMnneLx3D 6oMVGWYnb2MFpgEH5uI3tDtKSR954QJQ21bZAlq60xpPwwT2xpiAQdl6zzUUZHXv9s0V ngUg== X-Gm-Message-State: APjAAAU36OeB7QDMrw6AxS/TMfeM6FGagnMmvWlWriZHrwSNdPPSZqP0 vDIe0fIv2bZJVU44Gv4/CWLjVD2FpbM= X-Google-Smtp-Source: APXvYqygdjzLjOvj1bpIRCpLaoDOXVgFUJvWRiA3Gkn04WMGh7ovdTcNuDOEBxyaYwy494eRkolrHg== X-Received: by 2002:a2e:b163:: with SMTP id a3mr1073177ljm.72.1573031964209; Wed, 06 Nov 2019 01:19:24 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:22 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:10 +0200 Message-Id: <1573031953-12894-5-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 4/7] arm/gic: Drop pointless assertions 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: Julien Grall , Stefano Stabellini , Andrii Anisov , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Andrii Anisov Also armclang complains about the condition always true, because `sgi` is of type enum with all its values under 16. Signed-off-by: Andrii Anisov --- xen/arch/arm/gic.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c index 113655a..58c6141 100644 --- a/xen/arch/arm/gic.c +++ b/xen/arch/arm/gic.c @@ -294,8 +294,6 @@ void __init gic_init(void) void send_SGI_mask(const cpumask_t *cpumask, enum gic_sgi sgi) { - ASSERT(sgi < 16); /* There are only 16 SGIs */ - gic_hw_ops->send_SGI(sgi, SGI_TARGET_LIST, cpumask); } @@ -306,15 +304,11 @@ void send_SGI_one(unsigned int cpu, enum gic_sgi sgi) void send_SGI_self(enum gic_sgi sgi) { - ASSERT(sgi < 16); /* There are only 16 SGIs */ - gic_hw_ops->send_SGI(sgi, SGI_TARGET_SELF, NULL); } void send_SGI_allbutself(enum gic_sgi sgi) { - ASSERT(sgi < 16); /* There are only 16 SGIs */ - gic_hw_ops->send_SGI(sgi, SGI_TARGET_OTHERS, NULL); } From patchwork Wed Nov 6 09:19:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 11229745 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 B81761575 for ; Wed, 6 Nov 2019 09:21:17 +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 87DAB2173E for ; Wed, 6 Nov 2019 09:21:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U+Wwm06/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87DAB2173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 1iSHTf-0006vy-3d; Wed, 06 Nov 2019 09:19:47 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTc-0006vA-UI for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:44 +0000 X-Inumbo-ID: 87b6f2ee-0076-11ea-984a-bc764e2007e4 Received: from mail-lf1-x141.google.com (unknown [2a00:1450:4864:20::141]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 87b6f2ee-0076-11ea-984a-bc764e2007e4; Wed, 06 Nov 2019 09:19:27 +0000 (UTC) Received: by mail-lf1-x141.google.com with SMTP id f5so17478592lfp.1 for ; Wed, 06 Nov 2019 01:19:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=A2D8arGicganAwObtfIOuesVLUdvzsL7dF/vnzlO4jo=; b=U+Wwm06/M0kTDmAXPRnYzmco5VzHF8v+P2P1jDYQ+v/BS7mr1j5J7XNGVJ9Ngnx2et 5+uXvquTRsbRZz7Zq4y792EfrCZc0kOeugaqB0fomSZ8SptD+2Fgj95mVpPQMvQWcJPE IFyHZDJZ6xkRUE73ilqFlC0bom/uuE1C2+Ua7NoAwugd7vSi8nhDgvMWBO2tULTLqpj3 /rllViUaRoo9RxT/mYqU8bh/cAGwuLOqX5S3uBAtJrY/OI1ZUrAaYCC0ErhSXwnG1WUM 4FaqhezwK7VtGfQ/JlQf3Hqamju465WFfoddjXmsL8XcFICzC4E4jzL3AZdWON2xbK47 SB/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=A2D8arGicganAwObtfIOuesVLUdvzsL7dF/vnzlO4jo=; b=B41pLqi1BnsClCO9NZRZL2MIc9bHLo2AEAvkIzwa7ZXKoy4xOuvKYzU/gPv0dtj4/b K+tRvociqMtQjC+t2Kd0DWRZKGucX9pB9LaZAWSW/N/Ubq5PsV2m9pBGq5LDA7+ziDzu 0cG+lBKCrh7AhA0fadjAx2YNKT6fYcDJ7dhGK/olC6bw8G5ZXd1rLXXJLvH4c3ZVLxOZ iq3zajQfsdrEKzTNG8sosdeE7f4kuM/8wOUq2BEphhdcpeSK1XoueUF3FDp+yKp6lHbQ n/6inVKGOmabsMddg3jDz9cA4G/BA6fjrDePNywJi/xEulBbMG0xO3/ERaB1P9JuOxKl 0QwA== X-Gm-Message-State: APjAAAXVpRTZWZy/EEGAF5SSWsTKVqzsByLBG2zjpsgSg61nUUbBvSWq wh28XlxcPyf5YJQvfi5AKvqQVX9CrJA= X-Google-Smtp-Source: APXvYqzdIh37IxjMeTnuoOZdQf65qHt64ugtMHGizdXo7XT8896WnWGzL/ex3vQCGjQcBtkDff9NfA== X-Received: by 2002:ac2:48b5:: with SMTP id u21mr24147723lfg.75.1573031966032; Wed, 06 Nov 2019 01:19:26 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:25 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:11 +0200 Message-Id: <1573031953-12894-6-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 5/7] WIP:arm64:armds: Build XEN with ARM Compiler 6.6 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: Stefano Stabellini , Andrii Anisov , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Jan Beulich , Julien Grall , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Andrii Anisov Here several ARM Compiler 6.6 issues are solved or provided a work-around: - Scatter file is pretty primitive, it has no feature to define symbols - ARM linker defined symbols are not counted as referred if only mentioned in a steering file for rename or resolve, so a header file is used to redefine GNU linker script symbols into armlink defined symbols. - _srodata type clashes by type with __start_bug_frames so can not be both redefined as Load$$_rodata_bug_frames_0$$Base. Use resolve feature of armlink steering file. - C style shift operators are missed among supported scatter file expressions, so some needed values are hardcoded in scatter file. - Rename correspondent ARM Linker defined symbols to those needed by `symbols` tool using steering file feature. - ARM Compiler 6.6 tools are not able to rename sections, so we still need GNU toolchain's objcopy for this. Signed-off-by: Andrii Anisov --- xen/Rules.mk | 6 + xen/arch/arm/Makefile | 24 ++++ xen/arch/arm/xen.scat.S | 266 ++++++++++++++++++++++++++++++++++++++++++++ xen/arch/arm/xen.steer | 5 + xen/include/asm-arm/armds.h | 91 +++++++++++++++ 5 files changed, 392 insertions(+) create mode 100644 xen/arch/arm/xen.scat.S create mode 100644 xen/arch/arm/xen.steer create mode 100644 xen/include/asm-arm/armds.h diff --git a/xen/Rules.mk b/xen/Rules.mk index 41a1c26..67bedce 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -60,6 +60,12 @@ CFLAGS += -nostdinc -fno-builtin -fno-common CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith $(call cc-option-add,CFLAGS,CC,-Wvla) CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h + +ifeq ($(armds),y) +CFLAGS += -nostdlibinc -nostdlib -Wno-unused-command-line-argument +CFLAGS += -include $(BASEDIR)/include/asm/armds.h +endif + CFLAGS-$(CONFIG_DEBUG_INFO) += -g CFLAGS += '-D__OBJECT_FILE__="$@"' diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 70f532e..a5a3479 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -83,11 +83,16 @@ else all_symbols = endif +ifeq ($(armds),y) +$(TARGET): $(TARGET)-syms + fromelf --bin $< --output $@ +else $(TARGET): $(TARGET)-syms $(OBJCOPY) -O binary -S $< $@ ifeq ($(CONFIG_ARM_64),y) ln -sf $(notdir $@) ../../$(notdir $@).efi endif +endif ifeq ($(CONFIG_LTO),y) # Gather all LTO objects together @@ -102,6 +107,19 @@ prelink.o: $(ALL_OBJS) $(LD) $(LDFLAGS) -r -o $@ $^ endif +ifeq ($(armds),y) +$(TARGET)-syms: prelink.o xen.scat + armlink --scatter="xen.scat" --edit="xen.steer" --no_scanlib $(LDFLAGS) prelink.o $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0 + $(NM) -pa --format=sysv $(@D)/.$(@F).0 \ + | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort >$(@D)/.$(@F).0.S + $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o + armlink --scatter="xen.scat" --edit="xen.steer" --no_scanlib $(LDFLAGS) prelink.o $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1 + $(NM) -pa --format=sysv $(@D)/.$(@F).1 \ + | $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort >$(@D)/.$(@F).1.S + $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o + armlink --scatter="xen.scat" --edit="xen.steer" --no_scanlib --symdefs="$(@D)/$(@F).map" $(LDFLAGS) prelink.o $(build_id_linker) $(@D)/.$(@F).1.o -o $@ + rm -f $(@D)/.$(@F).[0-9]* +else $(TARGET)-syms: prelink.o xen.lds $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \ $(BASEDIR)/common/symbols-dummy.o -o $(@D)/.$(@F).0 @@ -119,14 +137,20 @@ $(TARGET)-syms: prelink.o xen.lds | $(BASEDIR)/tools/symbols --xensyms --sysv --sort \ >$(@D)/$(@F).map rm -f $(@D)/.$(@F).[0-9]* +endif asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $< +ifeq ($(armds),y) +xen.scat: xen.scat.S + $(CC) -P -E --target=aarch64-arm-none-eabi -o $@ $< +else xen.lds: xen.lds.S $(CC) -P -E -Ui386 $(AFLAGS) -o $@ $< sed -e 's/xen\.lds\.o:/xen\.lds:/g' <.xen.lds.d >.xen.lds.d.new mv -f .xen.lds.d.new .xen.lds.d +endif dtb.o: $(CONFIG_DTB_FILE) diff --git a/xen/arch/arm/xen.scat.S b/xen/arch/arm/xen.scat.S new file mode 100644 index 0000000..3bb405f --- /dev/null +++ b/xen/arch/arm/xen.scat.S @@ -0,0 +1,266 @@ +#if 0 +/* + * armlink does not understand shifts in scat file expressions + * so hardcode needed values + */ +#include +#include +#include +#undef ENTRY +#undef ALIGN +#else + #define PAGE_SIZE 4096 + #define POINTER_ALIGN 8 + #define SMP_CACHE_BYTES 128 + #define STACK_SIZE 32768 + #define XEN_VIRT_START 0x00200000 +#endif + +LOAD XEN_VIRT_START +{ +;_start +;_stext + _text AlignExpr(+0, PAGE_SIZE) PADVALUE 0x9090 + { + *(.text*) + *(.text.cold) + *(.text.unlikely) + *(.fixup) + *(.gnu.warning) + } +;_etext + +;_srodata +;__start_bug_frames + _rodata_bug_frames_0 AlignExpr(+0, PAGE_SIZE) FIXED ZEROPAD + { + *(.bug_frames.0) + } +;__stop_bug_frames_0 + + _rodata_bug_frames_1 +0 FIXED ZEROPAD + { + *(.bug_frames.1) + } +;__stop_bug_frames_1 + + _rodata_bug_frames_2 +0 FIXED ZEROPAD + { + *(.bug_frames.2) + } +;__stop_bug_frames_2 + + _rodata_data +0 + { + *(.rodata) + *(.rodata.*) + *(.data.rel.ro) + *(.data.rel.ro.*) + } + +#ifdef CONFIG_LOCK_PROFILE +;__lock_profile_start + _rodata_lockprofile_data AlignExpr(+0, POINTER_ALIGN) FIXED ZEROPAD + { + *(.lockprofile.data) + } +;__lock_profile_end +#endif + +;__param_start + _rodata_data_param AlignExpr(+0, POINTER_ALIGN) FIXED ZEROPAD + { + *(.data.param) + } +;__param_end + +;__proc_info_start + _rodata_proc_info +0 FIXED ZEROPAD + { + *(.proc.info) + } +;__proc_info_end + +#if defined(CONFIG_HAS_VPCI) && defined(CONFIG_LATE_HWDOM) +;__start_vpci_array + _rodata_data_vpci AlignExpr(+0, POINTER_ALIGN) SORTTYPE Lexical FIXED ZEROPAD + { + *(SORT(.data.vpci.*)) + } +;__end_vpci_array +#endif + +#if defined(BUILD_ID) +;__note_gnu_build_id_start + _note_gnu_build_id +0 FIXED ZEROPAD + { + *(.note.gnu.build-id) + } +;__note_gnu_build_id_end +#endif + +;_erodata + + _data AlignExpr(+0, PAGE_SIZE) FIXED ZEROPAD + { + *(.data.page_aligned.*) + *(.data.*) + } + +;__start_schedulers_array + _data_schedulers AlignExpr(+0, 8) FIXED ZEROPAD + { + *(.data.schedulers) + } +;__end_schedulers_array + + _data_rel +0 FIXED ZEROPAD + { + *(.data.rel) + *(.data.rel.*) +;#CONSTRUCTORS ???? + } + +;__start___ex_table + _data_ex_table AlignExpr(+0, SMP_CACHE_BYTES) FIXED ZEROPAD + { + *(.ex_table) + } +;__stop___ex_table + +;__start___pre_ex_table + _data_ex_table_pre +0 FIXED ZEROPAD + { + *(.ex_table.pre) + } +;__stop___pre_ex_table + + _data_read_mostly +0 FIXED ZEROPAD + { + *(.data.read_mostly) + } + +;_splatform + _arch_info AlignExpr(+0, 8) FIXED ZEROPAD + { + *(.arch.info) + } +;_eplatform + +;_sdevice + _dev_info AlignExpr(+0, 8) FIXED ZEROPAD + { + *(.dev.info) + } +;_edevice + +;_asdevice + _adev_info AlignExpr(+0, 8) FIXED ZEROPAD + { + *(.adev.info) + } +;_aedevice + +;__init_begin +;_sinittext + _init_text AlignExpr(+0, PAGE_SIZE) FIXED ZEROPAD + { + *(.init.text) + } +;_einittext + + _init_rodata AlignExpr(+0, PAGE_SIZE) FIXED ZEROPAD + { + *(.init.rodata) + *(.init.rodata.rel) + *(.init.rodata.str*) + } + +;__setup_start + _init_setup AlignExpr(+0, POINTER_ALIGN) FIXED ZEROPAD + { + *(.init.setup) + } +;__setup_end + +;__initcall_start + _initcallpresmp_init +0 FIXED ZEROPAD + { + *(.initcallpresmp.init) + } +;__presmp_initcall_end + + _initcall1_init +0 FIXED ZEROPAD + { + *(.initcall1.init) + } +;__initcall_end + +;__alt_instructions + _altinstructions AlignExpr(+0, 4) FIXED ZEROPAD + { + *(.altinstructions) + } +;__alt_instructions_end + + _altinstr_replacement AlignExpr(+0, 4) FIXED ZEROPAD + { + *(.altinstr_replacement) + } + + _init_data +0 FIXED ZEROPAD + { + *(.init.data) + *(.init.data.rel) + *(.init.data.rel.*) + } + +;__ctors_start + _ctors AlignExpr(+0, 8) FIXED ZEROPAD + { + *(.ctors) + *(.init_array) + } + + _init_array_sorted AlignExpr(+0, 8) SORTTYPE Lexical FIXED ZEROPAD + { + *(.init_array.*) + } +;__ctors_end + +#if defined(CONFIG_HAS_VPCI) && !defined(CONFIG_LATE_HWDOM) + _data_vpci AlignExpr(+0, POINTER_ALIGN) SORTTYPE Lexical FIXED ZEROPAD + { + *(.data.vpci.*) + } +#endif +;__init_end_efi + +;__init_end +;__bss_start + _bss AlignExpr(+0, STACK_SIZE) FIXED ZEROPAD + { + *(.bss.stack_aligned*) + *(.bss.page_aligned*, OVERALIGN PAGE_SIZE) + *(.bss*) + } + +;__per_cpu_start + _bss_percpu AlignExpr(+0, SMP_CACHE_BYTES) FIXED ZEROPAD + { + *(.bss.percpu) + *(.bss.percpu.read_mostly, OVERALIGN SMP_CACHE_BYTES) + } +;__per_cpu_data_end +;__bss_end +;_end + +#ifdef CONFIG_DTB_FILE +;_sdtb + _dtb FIXED ZEROPAD + { + *(.dtb) + } +#endif + +} diff --git a/xen/arch/arm/xen.steer b/xen/arch/arm/xen.steer new file mode 100644 index 0000000..646e912 --- /dev/null +++ b/xen/arch/arm/xen.steer @@ -0,0 +1,5 @@ +RESOLVE _srodata AS Load$$_rodata_bug_frames_0$$Base +RENAME Load$$_text$$Base AS _stext +RENAME Load$$_text$$Limit AS _etext +RENAME Load$$_init_text$$Base AS _sinittext +RENAME Load$$_init_text$$Limit AS _einittext diff --git a/xen/include/asm-arm/armds.h b/xen/include/asm-arm/armds.h new file mode 100644 index 0000000..5ee2e5d --- /dev/null +++ b/xen/include/asm-arm/armds.h @@ -0,0 +1,91 @@ +#define _start Load$$_text$$Base +#define _stext Load$$_text$$Base + +#define _etext Load$$_text$$Limit + +//#define _srodata Load$$_rodata_bug_frames_0$$Base +#define __start_bug_frames Load$$_rodata_bug_frames_0$$Base + +#define __stop_bug_frames_0 Load$$_rodata_bug_frames_0$$Limit +#define __stop_bug_frames_1 Load$$_rodata_bug_frames_1$$Limit +#define __stop_bug_frames_2 Load$$_rodata_bug_frames_2$$Limit + +#ifdef CONFIG_LOCK_PROFILE +#define __lock_profile_start Load$$_rodata_lockprofile_data$$Base +#define __lock_profile_end Load$$_rodata_lockprofile_data$$Limit +#endif + +#define __param_start Load$$_rodata_data_param$$Base +#define __param_end Load$$_rodata_data_param$$Limit + +#define __proc_info_start Load$$_rodata_proc_info$$Base +#define __proc_info_end Load$$_rodata_proc_info$$Limit + +#define _erodata Load$$_rodata_proc_info$$Limit + +#if defined(CONFIG_HAS_VPCI) && defined(CONFIG_LATE_HWDOM) +#define __start_vpci_array Load$$_rodata_data_vpci$$Base +#define __end_vpci_array Load$$_rodata_data_vpci$$Limit + +#undef _erodata +#define _erodata Load$$_rodata_data_vpci$$Limit +#endif + +#if defined(BUILD_ID) +#define __note_gnu_build_id_start Load$$_note_gnu_build_id$$Base +#define __note_gnu_build_id_end Load$$_note_gnu_build_id$$Limit + +#undef _erodata +#define _erodata Load$$_note_gnu_build_id$$Limit +#endif + +#define __start_schedulers_array Load$$_data_schedulers$$Base +#define __end_schedulers_array Load$$_data_schedulers$$Limit + +/* Does not exist for ARM +#define __start___ex_table Load$$_data_ex_table$$Base +#define __stop___ex_table Load$$_data_ex_table$$Limit +*/ + +#define __start___pre_ex_table Load$$_data_ex_table_pre$$Base +#define __stop___pre_ex_table Load$$_data_ex_table_pre$$Limit + +#define _splatform Load$$_arch_info$$Base +#define _eplatform Load$$_arch_info$$Limit + +#define _sdevice Load$$_dev_info$$Base +#define _edevice Load$$_dev_info$$Limit + +#define _asdevice Load$$_adev_info$$Base +#define _aedevice Load$$_adev_info$$Limit + +#define __init_begin Load$$_init_text$$Base +#define _sinittext Load$$_init_text$$Base +#define _einittext Load$$_init_text$$Limit + +#define __setup_start Load$$_init_setup$$Base +#define __setup_end Load$$_init_setup$$Limit + +#define __initcall_start Load$$_initcallpresmp_init$$Base +#define __presmp_initcall_end Load$$_initcallpresmp_init$$Limit +#define __initcall_end Load$$_initcall1_init$$Limit + +#define __alt_instructions Load$$_altinstructions$$Base +#define __alt_instructions_end Load$$_altinstructions$$Limit + +#define __ctors_start Load$$_ctors$$Base +#define __ctors_end Load$$_init_array_sorted$$Limit +#define __init_end_efi Load$$_init_array_sorted$$Limit + +#if defined(CONFIG_HAS_VPCI) && !defined(CONFIG_LATE_HWDOM) +#undef __init_end_efi +#define __init_end_efi Load$$_data_vpci$$Limit +#endif + +#define __init_end Load$$_bss$$Base +#define __bss_start Load$$_bss$$Base + +#define __per_cpu_start Load$$_bss_percpu$$Base +#define __per_cpu_data_end Load$$_bss_percpu$$Limit +#define __bss_end Load$$_bss_percpu$$Limit +#define _end Load$$_bss_percpu$$Limit From patchwork Wed Nov 6 09:19:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 11229743 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 898E41575 for ; Wed, 6 Nov 2019 09:21:15 +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 653882173E for ; Wed, 6 Nov 2019 09:21:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kBg2hJnV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 653882173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 1iSHTi-0006xR-Cu; Wed, 06 Nov 2019 09:19:50 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTh-0006xD-UI for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:49 +0000 X-Inumbo-ID: 888272fc-0076-11ea-b678-bc764e2007e4 Received: from mail-lf1-x142.google.com (unknown [2a00:1450:4864:20::142]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 888272fc-0076-11ea-b678-bc764e2007e4; Wed, 06 Nov 2019 09:19:29 +0000 (UTC) Received: by mail-lf1-x142.google.com with SMTP id y6so17476485lfj.2 for ; Wed, 06 Nov 2019 01:19:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=051XW9OjPeed0xS97OPOpuHNYizMGvM3NpFZuAOd2bA=; b=kBg2hJnVWs2KeV57ITQd3crZeispZqLWt4aQXSraZwtFX2E3KGsbSY0fznvsPdUzTT Rax/RkbTm1JY8gEGG1VKOEteQROXbQHHIKXfj7XFukVlrMPLVbd7WZKsKb84T7Vhuucv prGGZG3uGpCW9hRXIfDzfgLyV9pT9W2EV0CmdCnSz4Zq2jivLdyvc9HEsgCO4dwjRmnY CkxEg/g/NQQ228dhbRB8olNnRRSjt26Uevqs8HcUmrsqug7n8q7nESjLnNDS3AxoGMHv DRxAopinuSRaMhSVhDcSGpP/J2q1p2krc0m2Oo370dAsZgwwQA3ew7CD/ikK5HxmUWfi Mg5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=051XW9OjPeed0xS97OPOpuHNYizMGvM3NpFZuAOd2bA=; b=Ru3orZYMqae/ZqqsyIBYbawvjCUjmy5Hx7/dueHq+sF5wDjcNxKYo2N3ex7MFBrUMt yRy9joydMRwN8BdVZUla4/rzrNPIGcEmbgZLsONCPz7BGgmsAQ7gNdxUSmMOe9mFkxW2 yeJg+y1iK6XVwYM9tefupkBKLvfQSBM1fs0DvKmHc03fXDIjv2+eqTJa+6hGZeGzqFpe jM7vOg45hZjFX8UED3rBVnjLqDgyuQgyIv/cPw0GOtTH9c/cu9rwJoLyXGSkeisURzbF KAAH+WHzy5GpYHpZJ38bGtmacmHe+NhoOsyLjbDY725rVz7KN1eJlRMx+aJTF8Cwkfcj yjTQ== X-Gm-Message-State: APjAAAWmh/tmDOMIMEutEALCULH4+b5Q41EQ/Xw1KCPfnIkydU1Xdt8v yz7iFiVqoKp2ZIrtqAF5Mrtaz1Nj5MA= X-Google-Smtp-Source: APXvYqwxFCF7juC5qHSk6BA6fIRYtyr8ZnHUhWcCEH/vHIBdwAGaFoEtSg3sdgWeyyLotHscDttnKA== X-Received: by 2002:a19:cc07:: with SMTP id c7mr24094186lfg.107.1573031967381; Wed, 06 Nov 2019 01:19:27 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:26 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:12 +0200 Message-Id: <1573031953-12894-7-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 6/7] arm: Introduce dummy empty functions for data only C files 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: Julien Grall , Daniel De Graaf , Stefano Stabellini , Andrii Anisov , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Andrii Anisov ARM Compiler 6 has a proven bug: it compiles data only C files with SoftVFP attributes. This leads to a failed linkage afterwards with an error: Error: L6242E: Cannot link object built_in.o as its attributes are incompatible with the image attributes. ... A64 clashes with SoftVFP. The known workaround is introducing some code into the affected file, e.g. an empty (non-static) function is enough. Signed-off-by: Andrii Anisov Signed-off-by: Andrii Anisov --- xen/arch/arm/platforms/brcm-raspberry-pi.c | 2 ++ xen/arch/arm/platforms/thunderx.c | 2 ++ xen/xsm/flask/gen-policy.py | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/xen/arch/arm/platforms/brcm-raspberry-pi.c b/xen/arch/arm/platforms/brcm-raspberry-pi.c index b697fa2..7ab1810 100644 --- a/xen/arch/arm/platforms/brcm-raspberry-pi.c +++ b/xen/arch/arm/platforms/brcm-raspberry-pi.c @@ -40,6 +40,8 @@ static const struct dt_device_match rpi4_blacklist_dev[] __initconst = { /* sentinel */ }, }; +void brcm_raspberry_pi_dummy_func(void) {} + PLATFORM_START(rpi4, "Raspberry Pi 4") .compatible = rpi4_dt_compat, .blacklist_dev = rpi4_blacklist_dev, diff --git a/xen/arch/arm/platforms/thunderx.c b/xen/arch/arm/platforms/thunderx.c index 9b32a29..8015323 100644 --- a/xen/arch/arm/platforms/thunderx.c +++ b/xen/arch/arm/platforms/thunderx.c @@ -33,6 +33,8 @@ static const struct dt_device_match thunderx_blacklist_dev[] __initconst = { /* sentinel */ }, }; +void thunderx_dummy_func(void) {} + PLATFORM_START(thunderx, "THUNDERX") .compatible = thunderx_dt_compat, .blacklist_dev = thunderx_blacklist_dev, diff --git a/xen/xsm/flask/gen-policy.py b/xen/xsm/flask/gen-policy.py index c7501e4..73bf7d2 100644 --- a/xen/xsm/flask/gen-policy.py +++ b/xen/xsm/flask/gen-policy.py @@ -21,3 +21,7 @@ sys.stdout.write(""" }; const unsigned int __initconst xsm_flask_init_policy_size = %d; """ % policy_size) + +sys.stdout.write(""" +void policy_dummy_func(void) {} +""") From patchwork Wed Nov 6 09:19:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Anisov X-Patchwork-Id: 11229747 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 728B916B1 for ; Wed, 6 Nov 2019 09:21:18 +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 424D62173E for ; Wed, 6 Nov 2019 09:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SqVGA3Hc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 424D62173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 1iSHTn-00070X-RC; Wed, 06 Nov 2019 09:19:55 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iSHTm-000707-UT for xen-devel@lists.xenproject.org; Wed, 06 Nov 2019 09:19:54 +0000 X-Inumbo-ID: 896fa1a8-0076-11ea-984a-bc764e2007e4 Received: from mail-lf1-x144.google.com (unknown [2a00:1450:4864:20::144]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 896fa1a8-0076-11ea-984a-bc764e2007e4; Wed, 06 Nov 2019 09:19:30 +0000 (UTC) Received: by mail-lf1-x144.google.com with SMTP id v4so17458437lfd.11 for ; Wed, 06 Nov 2019 01:19:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=a/yqnQeFJjOCdFr+6UQnrZBzrb36Gxv30QFZEk+hOfM=; b=SqVGA3HcPy64SPdiz6I+fO41zRqVsvTsNLsctkROyvYfjJ+Ab4bMxR76BB4bkBgDWn fIrHy41eguVb/io3Cdi0EmLii0PHxC3AoVaBlIpRH0HdraSUeqJ2Ant02PzGLsEE9dmg +wO/Jr7JPc+Fmg5qaoRLAEEXFygNtdr9bvOacpPCvKS+n2rg+zKmEPaAUESSOTtbF+aH VnNxndZ4rpcFvsuvuI+4/uaV+d8XJ0n08GMhiOo7L+OWz0G2IWA0ivoGT4w27huh71zH Dktn+qKtFDHqglgdsmAdUV7kkp997zhETSX0nJEEL/+P6xHBHrXMKOm5nYI9qQfVSmww 4JYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=a/yqnQeFJjOCdFr+6UQnrZBzrb36Gxv30QFZEk+hOfM=; b=LfRwkkI6MrsnWIQbR8WaoQLeNRiqf6mjO0pZ9c1ktHmaIgma4WEYxSfB1ZLi5gfgy1 G41ce/RpVT+o4hLZDp7pURyq7Jos9M04Z/uDg35uKthjjBAO00FjDJ/d7wdE9EVZjLmt g2Xy3E5OdmTbSuX2JwXXmkEvb15iqzRyp26YA0MV+Lb3UKpJGGtgjvPdqXuJ3uAgjcNf Xn2eaUJD3mJNauKnYh50jLgV8mXUIq+T2CtMo63YNZkvm8E7NsuPDsm8Thykpbsl14Dw ldEWr2beslOYV5c0AO4qRjSeCfsHhyXGCvhyv1ES/MU+AqivXgOfkI6jmoO1WNWUyPcH iJwg== X-Gm-Message-State: APjAAAUfOfJYLM8p9+UfWxgzSoEjLib8Pn22+z8Ovo6mArzpKN5xogMy QoMHW7k3lmTCYHRxl6loT6vCMR9k1hc= X-Google-Smtp-Source: APXvYqxUWE0/HQgGgtxE8ZQtp/uCj4yolTP0Dd1CJQ21BgI5yC4VaeSr/QMuNlpCy9SrCTxVWBZlhQ== X-Received: by 2002:a19:ad43:: with SMTP id s3mr1822047lfd.34.1573031968927; Wed, 06 Nov 2019 01:19:28 -0800 (PST) Received: from aanisov-work.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id g23sm3945937lja.104.2019.11.06.01.19.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Nov 2019 01:19:27 -0800 (PST) From: Andrii Anisov To: xen-devel@lists.xenproject.org Date: Wed, 6 Nov 2019 11:19:13 +0200 Message-Id: <1573031953-12894-8-git-send-email-andrii.anisov@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> References: <1573031953-12894-1-git-send-email-andrii.anisov@gmail.com> Subject: [Xen-devel] [RFC 7/7] arm/gic-v3: add GIC version suffix to iomem range variables 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: Julien Grall , Stefano Stabellini , Andrii Anisov , Volodymyr Babchuk MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" From: Andrii Anisov ARM Compiler 6.6 has a proven bug: static data symbols, moved to an init section, becomes global. Thus these symbols clash with ones defined in gic-v2.c. The straight forward way to resolve the issue is to add the GIC version suffix, at least for one of the conflicting side. Signed-off-by: Andrii Anisov --- xen/arch/arm/gic-v3.c | 68 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index 0f6cbf6..f57597a 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -1328,14 +1328,14 @@ static const hw_irq_controller gicv3_guest_irq_type = { .set_affinity = gicv3_irq_set_affinity, }; -static paddr_t __initdata dbase = INVALID_PADDR; -static paddr_t __initdata vbase = INVALID_PADDR, vsize = 0; -static paddr_t __initdata cbase = INVALID_PADDR, csize = 0; +static paddr_t __initdata dbase_v3 = INVALID_PADDR; +static paddr_t __initdata vbase_v3 = INVALID_PADDR, vsize_v3 = 0; +static paddr_t __initdata cbase_v3 = INVALID_PADDR, csize_v3 = 0; /* If the GICv3 supports GICv2, initialize it */ static void __init gicv3_init_v2(void) { - if ( cbase == INVALID_PADDR || vbase == INVALID_PADDR ) + if ( cbase_v3 == INVALID_PADDR || vbase_v3 == INVALID_PADDR ) return; /* @@ -1343,26 +1343,26 @@ static void __init gicv3_init_v2(void) * So only support GICv2 on GICv3 when the virtual CPU interface is * at least GUEST_GICC_SIZE. */ - if ( vsize < GUEST_GICC_SIZE ) + if ( vsize_v3 < GUEST_GICC_SIZE ) { printk(XENLOG_WARNING "GICv3: WARNING: Not enabling support for GICv2 compat mode.\n" "Size of GICV (%#"PRIpaddr") must at least be %#llx.\n", - vsize, GUEST_GICC_SIZE); + vsize_v3, GUEST_GICC_SIZE); return; } printk("GICv3 compatible with GICv2 cbase %#"PRIpaddr" vbase %#"PRIpaddr"\n", - cbase, vbase); + cbase_v3, vbase_v3); - vgic_v2_setup_hw(dbase, cbase, csize, vbase, 0); + vgic_v2_setup_hw(dbase_v3, cbase_v3, csize_v3, vbase_v3, 0); } static void __init gicv3_ioremap_distributor(paddr_t dist_paddr) { if ( dist_paddr & ~PAGE_MASK ) panic("GICv3: Found unaligned distributor address %"PRIpaddr"\n", - dbase); + dbase_v3); gicv3.map_dbase = ioremap_nocache(dist_paddr, SZ_64K); if ( !gicv3.map_dbase ) @@ -1375,11 +1375,11 @@ static void __init gicv3_dt_init(void) int res, i; const struct dt_device_node *node = gicv3_info.node; - res = dt_device_get_address(node, 0, &dbase, NULL); + res = dt_device_get_address(node, 0, &dbase_v3, NULL); if ( res ) panic("GICv3: Cannot find a valid distributor address\n"); - gicv3_ioremap_distributor(dbase); + gicv3_ioremap_distributor(dbase_v3); if ( !dt_property_read_u32(node, "#redistributor-regions", &gicv3.rdist_count) ) @@ -1416,10 +1416,10 @@ static void __init gicv3_dt_init(void) * provided. */ res = dt_device_get_address(node, 1 + gicv3.rdist_count, - &cbase, &csize); + &cbase_v3, &csize_v3); if ( !res ) dt_device_get_address(node, 1 + gicv3.rdist_count + 2, - &vbase, &vsize); + &vbase_v3, &vsize_v3); } static int gicv3_iomem_deny_access(const struct domain *d) @@ -1427,7 +1427,7 @@ static int gicv3_iomem_deny_access(const struct domain *d) int rc, i; unsigned long mfn, nr; - mfn = dbase >> PAGE_SHIFT; + mfn = dbase_v3 >> PAGE_SHIFT; nr = PFN_UP(SZ_64K); rc = iomem_deny_access(d, mfn, mfn + nr); if ( rc ) @@ -1446,19 +1446,19 @@ static int gicv3_iomem_deny_access(const struct domain *d) return rc; } - if ( cbase != INVALID_PADDR ) + if ( cbase_v3 != INVALID_PADDR ) { - mfn = cbase >> PAGE_SHIFT; - nr = PFN_UP(csize); + mfn = cbase_v3 >> PAGE_SHIFT; + nr = PFN_UP(csize_v3); rc = iomem_deny_access(d, mfn, mfn + nr); if ( rc ) return rc; } - if ( vbase != INVALID_PADDR ) + if ( vbase_v3 != INVALID_PADDR ) { - mfn = vbase >> PAGE_SHIFT; - nr = PFN_UP(csize); + mfn = vbase_v3 >> PAGE_SHIFT; + nr = PFN_UP(csize_v3); return iomem_deny_access(d, mfn, mfn + nr); } @@ -1564,8 +1564,8 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, /* Read from APIC table and fill up the GIC variables */ if ( !cpu_base_assigned ) { - cbase = processor->base_address; - vbase = processor->gicv_base_address; + cbase_v3 = processor->base_address; + vbase_v3 = processor->gicv_base_address; gicv3_info.maintenance_irq = processor->vgic_interrupt; if ( processor->flags & ACPI_MADT_VGIC_IRQ_MODE ) @@ -1577,8 +1577,8 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, } else { - if ( cbase != processor->base_address - || vbase != processor->gicv_base_address + if ( cbase_v3 != processor->base_address + || vbase_v3 != processor->gicv_base_address || gicv3_info.maintenance_irq != processor->vgic_interrupt ) { printk("GICv3: GICC entries are not same in MADT table\n"); @@ -1599,7 +1599,7 @@ gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header, if ( BAD_MADT_ENTRY(dist, end) ) return -EINVAL; - dbase = dist->base_address; + dbase_v3 = dist->base_address; return 0; } @@ -1674,7 +1674,7 @@ static void __init gicv3_acpi_init(void) if ( count <= 0 ) panic("GICv3: No valid GICD entries exists\n"); - gicv3_ioremap_distributor(dbase); + gicv3_ioremap_distributor(dbase_v3); /* Get number of redistributor */ count = acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR, @@ -1722,15 +1722,15 @@ static void __init gicv3_acpi_init(void) * Also set the size of the GICC and GICV when there base address * is not invalid as those values are not present in ACPI. */ - if ( !cbase ) - cbase = INVALID_PADDR; + if ( !cbase_v3 ) + cbase_v3 = INVALID_PADDR; else - csize = SZ_8K; + csize_v3 = SZ_8K; - if ( !vbase ) - vbase = INVALID_PADDR; + if ( !vbase_v3 ) + vbase_v3 = INVALID_PADDR; else - vsize = GUEST_GICC_SIZE; + vsize_v3 = GUEST_GICC_SIZE; } #else @@ -1789,7 +1789,7 @@ static int __init gicv3_init(void) " gic_maintenance_irq=%u\n" " gic_rdist_stride=%#x\n" " gic_rdist_regions=%d\n", - dbase, gicv3_info.maintenance_irq, + dbase_v3, gicv3_info.maintenance_irq, gicv3.rdist_stride, gicv3.rdist_count); printk(" redistributor regions:\n"); for ( i = 0; i < gicv3.rdist_count; i++ ) @@ -1803,7 +1803,7 @@ static int __init gicv3_init(void) reg = readl_relaxed(GICD + GICD_TYPER); intid_bits = GICD_TYPE_ID_BITS(reg); - vgic_v3_setup_hw(dbase, gicv3.rdist_count, gicv3.rdist_regions, intid_bits); + vgic_v3_setup_hw(dbase_v3, gicv3.rdist_count, gicv3.rdist_regions, intid_bits); gicv3_init_v2(); spin_lock_init(&gicv3.lock);