From patchwork Wed Mar 27 18:45:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873869 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C795014DE for ; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B35652876D for ; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A75BD28802; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5F54028755 for ; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYY-0001ha-Ht; Wed, 27 Mar 2019 18:45:46 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYX-0001hU-Dj for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:45 +0000 X-Inumbo-ID: 86eae7ac-50c0-11e9-bc90-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 86eae7ac-50c0-11e9-bc90-bc764e045a96; Wed, 27 Mar 2019 18:45:43 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9D676A78; Wed, 27 Mar 2019 11:45:43 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 664323F557; Wed, 27 Mar 2019 11:45:41 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:20 +0000 Message-Id: <20190327184531.30986-2-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 01/12] 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: Artem_Mygaiev@epam.com, sstabellini@kernel.org, Andrii_Anisov@epam.com, Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Oleksandr_Tyshchenko@epam.com, Julien Grall , Jan Beulich , Wei Liu MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 039274ea61..48c50b5ad7 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 Mar 27 18:45:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873877 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9EED14DE for ; Wed, 27 Mar 2019 18:48:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D51F52875F for ; Wed, 27 Mar 2019 18:48:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C96FF287F2; Wed, 27 Mar 2019 18:48:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7406A2875F for ; Wed, 27 Mar 2019 18:48:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYZ-0001hk-S6; Wed, 27 Mar 2019 18:45:47 +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 1h9DYY-0001hZ-GE for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:46 +0000 X-Inumbo-ID: 87c0f8e0-50c0-11e9-9d59-237d42e54f21 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 87c0f8e0-50c0-11e9-9d59-237d42e54f21; Wed, 27 Mar 2019 18:45:45 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1A6BD1596; Wed, 27 Mar 2019 11:45:45 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DB29B3F557; Wed, 27 Mar 2019 11:45:43 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:21 +0000 Message-Id: <20190327184531.30986-3-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 02/12] xen/arm: fix get_cpu_info() when built with clang 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang understands the GCCism in use here, but still complains that sp is unitialised. In such cases, resort to the older versions of this code, which directly read sp into the temporary variable. Note that we still keep the GCCism in the default case, as it causes GCC to create rather better assembly. This is based on the x86 counterpart. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- xen/include/asm-arm/current.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/include/asm-arm/current.h b/xen/include/asm-arm/current.h index c4af66fbb9..6b7c1df64d 100644 --- a/xen/include/asm-arm/current.h +++ b/xen/include/asm-arm/current.h @@ -28,8 +28,16 @@ struct cpu_info { static inline struct cpu_info *get_cpu_info(void) { +#ifdef __clang__ + unsigned long sp; + + asm ("mov %0, sp" : "=r" (sp)); +#else register unsigned long sp asm ("sp"); - return (struct cpu_info *)((sp & ~(STACK_SIZE - 1)) + STACK_SIZE - sizeof(struct cpu_info)); +#endif + + return (struct cpu_info *)((sp & ~(STACK_SIZE - 1)) + + STACK_SIZE - sizeof(struct cpu_info)); } #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs) From patchwork Wed Mar 27 18:45:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873859 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 54546186E for ; Wed, 27 Mar 2019 18:47:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F82F28755 for ; Wed, 27 Mar 2019 18:47:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 330852876D; Wed, 27 Mar 2019 18:47:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DFC0C28755 for ; Wed, 27 Mar 2019 18:47:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYb-0001iJ-Aj; Wed, 27 Mar 2019 18:45:49 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYZ-0001hm-W3 for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:48 +0000 X-Inumbo-ID: 889007ed-50c0-11e9-bc90-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 889007ed-50c0-11e9-bc90-bc764e045a96; Wed, 27 Mar 2019 18:45:46 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8B98815BF; Wed, 27 Mar 2019 11:45:46 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 585533F557; Wed, 27 Mar 2019 11:45:45 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:22 +0000 Message-Id: <20190327184531.30986-4-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 03/12] xen/arm: zynqmp: Fix header guard for xilinx-zynqmp-eemi.h 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The header guard for xilinx-zynqmp-eemi.h is not followed by a #define of the macro used in the guard. Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h b/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h index 72aadf7a44..cf25a9014d 100644 --- a/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h +++ b/xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h @@ -12,7 +12,7 @@ */ #ifndef __ASM_ARM_PLATFORMS_ZYNQMP_H -#define __ASM_ASM_PLATFORMS_ZYNQMP_H +#define __ASM_ARM_PLATFORMS_ZYNQMP_H #include #include From patchwork Wed Mar 27 18:45:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873863 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5B7414DE for ; Wed, 27 Mar 2019 18:48:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1DB828755 for ; Wed, 27 Mar 2019 18:48:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6568287F2; Wed, 27 Mar 2019 18:48:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6AB1D28755 for ; Wed, 27 Mar 2019 18:48:00 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYc-0001jA-M7; Wed, 27 Mar 2019 18:45:50 +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 1h9DYc-0001j1-03 for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:50 +0000 X-Inumbo-ID: 89c6428a-50c0-11e9-8ffe-0b705e907f2a Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 89c6428a-50c0-11e9-8ffe-0b705e907f2a; Wed, 27 Mar 2019 18:45:48 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 506E41596; Wed, 27 Mar 2019 11:45:48 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CA0793F557; Wed, 27 Mar 2019 11:45:46 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:23 +0000 Message-Id: <20190327184531.30986-5-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 04/12] xen/arm: memaccess: Initialize correctly *access in __p2m_get_mem_access 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: Artem_Mygaiev@epam.com, sstabellini@kernel.org, Andrii_Anisov@epam.com, Razvan Cojocaru , Oleksandr_Tyshchenko@epam.com, Julien Grall , Tamas K Lengyel MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The commit 8d84e701fd "xen/arm: initialize access" initializes *access using the wrong enumeration type. This result to a warning using clang: mem_access.c:50:20: error: implicit conversion from enumeration type 'p2m_access_t' to different enumeration type 'xenmem_access_t' [-Werror,-Wenum-conversion] *access = p2m->default_access; ~ ~~~~~^~~~~~~~~~~~~~ The correct solution is to use the array memaccess that will do the conversion between the 2 enums. Fixes: 8d84e701fd ("xen/arm: initialize access") Signed-off-by: Julien Grall Acked-by: Razvan Cojocaru --- This patch is candidate for backporting in 4.12. --- xen/arch/arm/mem_access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/mem_access.c b/xen/arch/arm/mem_access.c index db49372a2c..3e3620294c 100644 --- a/xen/arch/arm/mem_access.c +++ b/xen/arch/arm/mem_access.c @@ -47,7 +47,7 @@ static int __p2m_get_mem_access(struct domain *d, gfn_t gfn, }; ASSERT(p2m_is_locked(p2m)); - *access = p2m->default_access; + *access = memaccess[p2m->default_access]; /* If no setting was ever set, just return rwx. */ if ( !p2m->mem_access_enabled ) From patchwork Wed Mar 27 18:45:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E4C7186E for ; Wed, 27 Mar 2019 18:47:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0903128755 for ; Wed, 27 Mar 2019 18:47:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0CFA2876D; Wed, 27 Mar 2019 18:47:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A585F28755 for ; Wed, 27 Mar 2019 18:47:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYe-0001jR-1G; Wed, 27 Mar 2019 18:45:52 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYd-0001jI-0n for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:51 +0000 X-Inumbo-ID: 8a9984f2-50c0-11e9-bc90-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 8a9984f2-50c0-11e9-bc90-bc764e045a96; Wed, 27 Mar 2019 18:45:50 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C1B68A78; Wed, 27 Mar 2019 11:45:49 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8E6753F557; Wed, 27 Mar 2019 11:45:48 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:24 +0000 Message-Id: <20190327184531.30986-6-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 05/12] xen/arm64: bitops: Match the register size with the value size in flsl 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang is pickier than GCC for the register size in asm statement. It expects the register size to match the value size. The instruction clz is expecting the two operands to be the same size (i.e 32-bit or 64-bit). As the flsl function is dealing with 64-bit value, we need to make the destination variable 64-bit as well. While at it, add a newline before the return statement. Signed-off-by: Julien Grall --- xen/include/asm-arm/arm64/bitops.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/include/asm-arm/arm64/bitops.h b/xen/include/asm-arm/arm64/bitops.h index 6bf1922680..05045f1109 100644 --- a/xen/include/asm-arm/arm64/bitops.h +++ b/xen/include/asm-arm/arm64/bitops.h @@ -34,12 +34,13 @@ static /*__*/always_inline unsigned long __ffs(unsigned long word) static inline int flsl(unsigned long x) { - int ret; + uint64_t ret; if (__builtin_constant_p(x)) return generic_flsl(x); asm("clz\t%0, %1" : "=r" (ret) : "r" (x)); + return BITS_PER_LONG - ret; } From patchwork Wed Mar 27 18:45:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F76C186E for ; Wed, 27 Mar 2019 18:47:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A42F28755 for ; Wed, 27 Mar 2019 18:47:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E1362876D; Wed, 27 Mar 2019 18:47:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C447728755 for ; Wed, 27 Mar 2019 18:47:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYf-0001jh-BY; Wed, 27 Mar 2019 18:45:53 +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 1h9DYe-0001jU-6j for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:52 +0000 X-Inumbo-ID: 8b6cb592-50c0-11e9-aa93-9f7bd1018adb Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 8b6cb592-50c0-11e9-aa93-9f7bd1018adb; Wed, 27 Mar 2019 18:45:51 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3FED315BF; Wed, 27 Mar 2019 11:45:51 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0BA3E3F557; Wed, 27 Mar 2019 11:45:49 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:25 +0000 Message-Id: <20190327184531.30986-7-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 06/12] xen/arm64: sysreg: Implement the 32-bit helpers using the 64-bit helpers 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang is pickier than GCC for the register size in asm statement. It expects the register size to match the value size. The instructions msr/mrs are expecting a 64-bit register. This means the implementation of the 32-bit helpers is not correct. The easiest solution is to implement the 32-bit helpers using the 64-bit helpers. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/include/asm-arm/arm64/sysregs.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/xen/include/asm-arm/arm64/sysregs.h b/xen/include/asm-arm/arm64/sysregs.h index 08585a969e..c60029d38f 100644 --- a/xen/include/asm-arm/arm64/sysregs.h +++ b/xen/include/asm-arm/arm64/sysregs.h @@ -59,14 +59,9 @@ /* Access to system registers */ -#define READ_SYSREG32(name) ({ \ - uint32_t _r; \ - asm volatile("mrs %0, "__stringify(name) : "=r" (_r)); \ - _r; }) -#define WRITE_SYSREG32(v, name) do { \ - uint32_t _r = v; \ - asm volatile("msr "__stringify(name)", %0" : : "r" (_r)); \ -} while (0) +#define READ_SYSREG32(name) ((uint32_t)READ_SYSREG64(name)) + +#define WRITE_SYSREG32(v, name) WRITE_SYSREG64((uint64_t)v, name) #define WRITE_SYSREG64(v, name) do { \ uint64_t _r = v; \ From patchwork Wed Mar 27 18:45:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873871 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E31111874 for ; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD92128755 for ; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1DC92899D; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7A6BC2875F for ; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYh-0001kd-MV; Wed, 27 Mar 2019 18:45:55 +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 1h9DYf-0001jl-KX for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:53 +0000 X-Inumbo-ID: 8c483d2e-50c0-11e9-af78-2ff39fb9a87f Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 8c483d2e-50c0-11e9-af78-2ff39fb9a87f; Wed, 27 Mar 2019 18:45:53 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B0636A78; Wed, 27 Mar 2019 11:45:52 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7CD533F557; Wed, 27 Mar 2019 11:45:51 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:26 +0000 Message-Id: <20190327184531.30986-8-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 07/12] xen/arm: cpuerrata: Match register size with value size in check_workaround_* 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang is pickier than GCC for the register size in asm statement. It expects the register size to match the value size. The asm statement expects a 32-bit (resp. 64-bit) value on Arm32 (resp. Arm64) whereas the value is a boolean (Clang consider to be 32-bit). It would be possible to impose 32-bit register for both architecture but this require the code to use __OP32. However, it does not really improve the assembly generated. Instead, replace switch the variable to use register_t. Signed-off-by: Julien Grall --- xen/include/asm-arm/cpuerrata.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/asm-arm/cpuerrata.h b/xen/include/asm-arm/cpuerrata.h index 55ddfda272..88ef3ca934 100644 --- a/xen/include/asm-arm/cpuerrata.h +++ b/xen/include/asm-arm/cpuerrata.h @@ -14,7 +14,7 @@ static inline bool check_workaround_##erratum(void) \ return false; \ else \ { \ - bool ret; \ + register_t ret; \ \ asm volatile (ALTERNATIVE("mov %0, #0", \ "mov %0, #1", \ From patchwork Wed Mar 27 18:45:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873861 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A523186E for ; Wed, 27 Mar 2019 18:48:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35FD228755 for ; Wed, 27 Mar 2019 18:48:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 29C4D2876D; Wed, 27 Mar 2019 18:48:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C907528755 for ; Wed, 27 Mar 2019 18:47:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYi-0001kp-2S; Wed, 27 Mar 2019 18:45:56 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYh-0001kO-A2 for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:55 +0000 X-Inumbo-ID: 8d201b26-50c0-11e9-bc90-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 8d201b26-50c0-11e9-bc90-bc764e045a96; Wed, 27 Mar 2019 18:45:54 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2DDE41596; Wed, 27 Mar 2019 11:45:54 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EE6DA3F557; Wed, 27 Mar 2019 11:45:52 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:27 +0000 Message-Id: <20190327184531.30986-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 08/12] xen/arm: cpufeature: Match register size with value size in cpus_have_const_cap 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang is pickier than GCC for the register size in asm statement. It expects the register size to match the value size. The asm statement expects a 32-bit (resp. 64-bit) value on Arm32 (resp. Arm64) whereas the value is a boolean (Clang consider to be 32-bit). It would be possible to impose 32-bit register for both architecture but this require the code to use __OP32. However, it does no really improve the assembly generated. Instead, replace switch the variable to use register_t. Signed-off-by: Julien Grall --- xen/include/asm-arm/cpufeature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/include/asm-arm/cpufeature.h b/xen/include/asm-arm/cpufeature.h index c2c8f3417c..d06f09ecfa 100644 --- a/xen/include/asm-arm/cpufeature.h +++ b/xen/include/asm-arm/cpufeature.h @@ -67,7 +67,7 @@ static inline bool cpus_have_cap(unsigned int num) /* System capability check for constant cap */ #define cpus_have_const_cap(num) ({ \ - bool __ret; \ + register_t __ret; \ \ asm volatile (ALTERNATIVE("mov %0, #0", \ "mov %0, #1", \ From patchwork Wed Mar 27 18:45:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873873 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1760D18A6 for ; Wed, 27 Mar 2019 18:48:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 02B052875F for ; Wed, 27 Mar 2019 18:48:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAA0628755; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9ED02287F2 for ; Wed, 27 Mar 2019 18:48:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYk-0001lu-Er; Wed, 27 Mar 2019 18:45:58 +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 1h9DYi-0001lA-Rd for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:56 +0000 X-Inumbo-ID: 8e108d6e-50c0-11e9-bcc2-637fee61a28f Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 8e108d6e-50c0-11e9-bcc2-637fee61a28f; Wed, 27 Mar 2019 18:45:56 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9F44DA78; Wed, 27 Mar 2019 11:45:55 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6BFA83F557; Wed, 27 Mar 2019 11:45:54 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:28 +0000 Message-Id: <20190327184531.30986-10-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 09/12] xen/arm: guest_walk: Avoid theoritical unitialized value in get_top_bit 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang 8.0 throws an error in the get_top_bit function: guest_walk.c:328:15: error: variable 'topbit' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] else if ( is_64bit_domain(d) ) ^~~~~~~~~~~~~~~~~~ This is happening because clang thinks that is_32bit_domain(d) is not the exact inverse of is_64bit_domain(d). So it expects a else case to handle the case where the latter call is false. In other part of the code, dealing with difference between 32-bit and 64-bit domain, we usually use if ( is_XXbit_domain ) ... else ... So use the same pattern here. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/arch/arm/guest_walk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/guest_walk.c b/xen/arch/arm/guest_walk.c index 7db7a7321b..1bee198777 100644 --- a/xen/arch/arm/guest_walk.c +++ b/xen/arch/arm/guest_walk.c @@ -325,7 +325,7 @@ static unsigned int get_top_bit(struct domain *d, vaddr_t gva, register_t tcr) */ if ( is_32bit_domain(d) ) topbit = 31; - else if ( is_64bit_domain(d) ) + else { if ( ((gva & BIT_ULL(55)) && (tcr & TCR_EL1_TBI1)) || (!(gva & BIT_ULL(55)) && (tcr & TCR_EL1_TBI0)) ) From patchwork Wed Mar 27 18:45:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9BE9414DE for ; Wed, 27 Mar 2019 18:47:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8716028755 for ; Wed, 27 Mar 2019 18:47:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B1532875F; Wed, 27 Mar 2019 18:47:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 66DBD28BBF for ; Wed, 27 Mar 2019 18:47:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYl-0001mh-Q2; Wed, 27 Mar 2019 18:45:59 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYk-0001lv-Gk for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:58 +0000 X-Inumbo-ID: 8ed960d7-50c0-11e9-bc90-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 8ed960d7-50c0-11e9-bc90-bc764e045a96; Wed, 27 Mar 2019 18:45:57 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1C2EF1596; Wed, 27 Mar 2019 11:45:57 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DD0EB3F557; Wed, 27 Mar 2019 11:45:55 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:29 +0000 Message-Id: <20190327184531.30986-11-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 10/12] xen/arm: mm: Mark check_memory_layout_alignment_constraints as unused 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang will throw an error if a function is unused unless you tell to ignore it. This can be done using __maybe_unused. Signed-off-by: Julien Grall --- xen/arch/arm/mm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 01ae2cccc0..d37925051a 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -160,7 +160,8 @@ unsigned long total_pages; extern char __init_begin[], __init_end[]; /* Checking VA memory layout alignment. */ -static inline void check_memory_layout_alignment_constraints(void) { +static __maybe_unused void check_memory_layout_alignment_constraints(void) +{ /* 2MB aligned regions */ BUILD_BUG_ON(XEN_VIRT_START & ~SECOND_MASK); BUILD_BUG_ON(FIXMAP_ADDR(0) & ~SECOND_MASK); From patchwork Wed Mar 27 18:45:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0922514DE for ; Wed, 27 Mar 2019 18:48:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E879A28755 for ; Wed, 27 Mar 2019 18:48:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC57D28802; Wed, 27 Mar 2019 18:48:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDD662875F for ; Wed, 27 Mar 2019 18:48:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYm-0001mv-53; Wed, 27 Mar 2019 18:46:00 +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 1h9DYl-0001mT-Ht for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:45:59 +0000 X-Inumbo-ID: 8fde43f2-50c0-11e9-8ce9-23a7eae2d9e0 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id 8fde43f2-50c0-11e9-8ce9-23a7eae2d9e0; Wed, 27 Mar 2019 18:45:59 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8E7B3A78; Wed, 27 Mar 2019 11:45:58 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5B44F3F557; Wed, 27 Mar 2019 11:45:57 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:30 +0000 Message-Id: <20190327184531.30986-12-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 11/12] xen/arm: traps: Mark check_stack_alignment_constraints as unused 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Clang will throw an error if a function is unused unless you tell to ignore it. This can be done using __maybe_unused. Signed-off-by: Julien Grall --- xen/arch/arm/traps.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c index d8b9a8a0f0..661475666a 100644 --- a/xen/arch/arm/traps.c +++ b/xen/arch/arm/traps.c @@ -54,7 +54,8 @@ * that both the kernel half of struct cpu_user_regs (which is pushed in * entry.S) and struct cpu_info (which lives at the bottom of a Xen * stack) must be doubleword-aligned in size. */ -static inline void check_stack_alignment_constraints(void) { +static void __maybe_unused check_stack_alignment_constraints(void) +{ #ifdef CONFIG_ARM_64 BUILD_BUG_ON((sizeof (struct cpu_user_regs)) & 0xf); BUILD_BUG_ON((offsetof(struct cpu_user_regs, spsr_el1)) & 0xf); From patchwork Wed Mar 27 18:45:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 10873875 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC96F14DE for ; Wed, 27 Mar 2019 18:48:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D524A28755 for ; Wed, 27 Mar 2019 18:48:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8C982876D; Wed, 27 Mar 2019 18:48:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 546CB28755 for ; Wed, 27 Mar 2019 18:48:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYo-0001ps-J0; Wed, 27 Mar 2019 18:46:02 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1h9DYn-0001os-C2 for xen-devel@lists.xenproject.org; Wed, 27 Mar 2019 18:46:01 +0000 X-Inumbo-ID: 90a1495a-50c0-11e9-bc90-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 90a1495a-50c0-11e9-bc90-bc764e045a96; Wed, 27 Mar 2019 18:46:00 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0B7271596; Wed, 27 Mar 2019 11:46:00 -0700 (PDT) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CC9263F557; Wed, 27 Mar 2019 11:45:58 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 27 Mar 2019 18:45:31 +0000 Message-Id: <20190327184531.30986-13-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190327184531.30986-1-julien.grall@arm.com> References: <20190327184531.30986-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH 12/12] xen/arm64: __cmpxchg and __cmpxchg_mb should always be inline 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: Artem_Mygaiev@epam.com, Oleksandr_Tyshchenko@epam.com, Julien Grall , sstabellini@kernel.org, Andrii_Anisov@epam.com MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Currently __cmpxchg_mb and __cmpxchg are only marked inline. The compiler is free to decide to not honor the inline. This will result to generate code use __bad_cmpxchg and lead a link failure. This was caught by Clang 8.0. Signed-off-by: Julien Grall Reviewed-by: Stefano Stabellini --- xen/include/asm-arm/arm64/cmpxchg.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/include/asm-arm/arm64/cmpxchg.h b/xen/include/asm-arm/arm64/cmpxchg.h index ae42b2f5ff..359271173e 100644 --- a/xen/include/asm-arm/arm64/cmpxchg.h +++ b/xen/include/asm-arm/arm64/cmpxchg.h @@ -63,8 +63,9 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size extern void __bad_cmpxchg(volatile void *ptr, int size); -static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, - unsigned long new, int size) +static always_inline unsigned long __cmpxchg(volatile void *ptr, + unsigned long old, + unsigned long new, int size) { unsigned long oldval = 0, res; @@ -137,8 +138,9 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, return oldval; } -static inline unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old, - unsigned long new, int size) +static always_inline unsigned long __cmpxchg_mb(volatile void *ptr, + unsigned long old, + unsigned long new, int size) { unsigned long ret;