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: 161274 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6829019jan; Wed, 27 Mar 2019 11:47:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqza0y7ylCNaVk0+JwUyzu2bNc73WcZTMGhRYW3qeH743pfKhLqYYhy4kdEDoxgWfFBEFT/d X-Received: by 2002:a5b:78f:: with SMTP id b15mr30841128ybq.366.1553712450274; Wed, 27 Mar 2019 11:47:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712450; cv=none; d=google.com; s=arc-20160816; b=jKFoj+8r2IQZpU/niVsp2wyPmVH1I50yjZYnwhcjzlgEld1ZJMTYTE2JkGMHhBYMAM 8zbiTnDHl69EiK9o8fbOp/hqRcpknP5/NAe3AsvZFJQIb/reWkRdqHR2Ej/HXaqZZinz I4+EmH2ysCD6xV8GBSrRreAzE7ERq0SdmuIatuUindQy/BV3/Iw266asKM3tYhDoMbf0 B05dAM3nQgOetH2Pi8mwk7yczcEpJCWFedmGcLGNJ8oaCUe7iLcn4cHdLHqfUYlfVLMZ tNbGcTk+kWsK8v1tBs3j87kAtRcRT4caL/IUBgbpt3aveTL4Fx3rAuoDLzgFLSTnWGJi N9XA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=2Zs8EIRhdJi72X5jBjqAeNbvd2h0Dh1mF1gKYW8hHrI=; b=I0mj8khcM8a0JdoUoew9F0ixzr/HCxNm3NYnN8KVjvXH61kFT6q+KLBPcaFLOmpl1p q9EaIrti+oIqf3I3pMPvyd1zKkSMIojRBGyKboBsv7xgj3MOQuriXN3+d242zuVIeFxw 5R52DhMjMci7vOHyroSdBO6lXaLA+FoS+cEPLvGmFMXVz7aMagBdaUsGnjiURyfTMuJ3 hLa7XgsqjQifbDNH6NDDSIeIIfV9LWxWiev9lcIf4DH9q72GHdcKa9PK7pPtxHVouhVx 2PGSpMeSyQG9j7NPWwusxy51ypRMIyc2p0JdSiHgUzoqasR87pTt9jxpzCIBVRADjTjX GUDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id z82si9492670ywz.210.2019.03.27.11.47.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161271 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6828976jan; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7HlojjisFQakFVwR9chRHFThM/d5431c0ftJEwHFGTiIAMiyurLOqWlHz59H9yQqZ2XYv X-Received: by 2002:a81:2d09:: with SMTP id t9mr2239358ywt.436.1553712448539; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712448; cv=none; d=google.com; s=arc-20160816; b=cMhrnU+sGRLTMFr6/q3C2hkJ51/0GTyXE5yo0fz+l9bk8ZdIZTg/ou+DDOtV3OcvMN qdPfTGU5+jAdQlvoTtXS2YbIS0wROqZ34HDizlmN3e3Qux0idZXM8s/wbIXGcRl+zx+F QgP5tkqRX9bcwDhAs8Srt54c1WybT9fPPhmiRcHs1GZqPgxTmp/jN9mAuOrMFeU0ej0u f45ScjjWaL4cQe5xCAEKKJpL4A1x+eBW2zYAgujXPH6PVzllW7tQOHBo1rwBnGB4y6yd KUrTT9iFtM6pcHDX3/A8eI+3ml4jZmvGVpjXlsLS/pvCTk8hK91K6Nh+JMdXEc3HEknG eGZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=AhRi03kU6/Azx8E7KGJ7ezPHfhrzFac22xEajYLfl6Q=; b=IrO1HWmqcsocBmbp3ADFdj0HYq+/HF5Vi0W8lYHhC5bBpDwR8ds9Q7Au4kzFW/1E69 fG9sj9OhqjvpqdT980teBVfLiHpJWRhoH6E78q2IDeXxr8a9PUICi1Hn/ToiZZotAFyI u5YF4bIWffSF3A8K6UNG+ZI9AW1PZelS0LW3wKWL3UUpWul5LsLyNmDEiFZ9+CVxnISq CBUpxkUDYrQ6s9H3PdVryoowD9fnwhkDUfalqqcZ3W3Iq9EAGYj59ixdvxSHgqe+udby xHxMYEglov2TdZZaAB1yTzLaRrkaJ3YLDWcqnSqZLXNHfQ6sQFCXC5mIuAmcQVzAoCKk EAzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id 7si9758310ywc.169.2019.03.27.11.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161272 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6828990jan; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFlUbJscXmxI87ifpSicS5sWPgIYH6VrcdQX7IGAMN9qOp3aFjIZuL9rdQFzk7WeU+cDwI X-Received: by 2002:a25:5785:: with SMTP id l127mr31174027ybb.395.1553712449081; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712449; cv=none; d=google.com; s=arc-20160816; b=IgeGWi6JXQmt3ojO7aRMYIPsEm0AsIP3Ac4uhcFK3U1x0g1uVdeQJLEqVv1dzvrts1 gMuA+1hXEfIz1IYlhEtRAb9/p91081GX6B18mb28gMdH9aFNRgp07agKTEaJ5IvnScMj kFljZvFNY/s89kkha3xv5VOF276CxCWecywF1BUBVsghB8rL6EWNxnffRS/DkxKvRwCf Rl5RIONkGbrBfCw8dz/kO2CC6j8Rd1oj2Rg9AdYA/ynnOiiNSdmsn6QkCmHRvmsIm6gp 5uBnUDphjTFF4P3FpHciaxDvhCCwfTDW35p37pksGuQ1pg8KzbPs+Itz2ll0Kx3AP/jR Mzwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=Ku33yhKgay5gzzG4GIECOQw2QULD8swyxi641uuotDc=; b=oGNAS2pX/+XPaoD8hRY7nHWTjHNKzqiKwMcvbqsioiWHeNAWw/3j6yAXzMaCacTPpG p2yNDEpNW+wTC4118GBYsSYCs/mQjO6kOf/84eR+hV3vGCLFtZ6mAdPvI4jfNFU3eHCi wnX96e7DAcowSwIrZG2pzPsGZ1TSgUTvhg2rfTw4tZNzUTAPtMgJiwifyhzT6dgx5KqX 9gfjZl8SzCRn968UDmkAXLOGLLhsrMUx+OZxpc0C8TPGD6gSPu1dLBuNfMGk10b5LwWY 7qKQ6czKrIr98h9l6BItclj5TyVrLmFUdRIes5q+PijRimQ7sOEa6fK+OjXY7jx8UXyc Hp8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id a129si9028145ywb.47.2019.03.27.11.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161270 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6828974jan; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEolVgcnA2aZAB4rZeYMhajnjzTmHjeqkcTnr+awmv4Ro0CZ6aQbkkuwDurY2piOqTY6Aj X-Received: by 2002:a25:61c8:: with SMTP id v191mr30092399ybb.489.1553712448442; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712448; cv=none; d=google.com; s=arc-20160816; b=zT/Guy7dtKl4stafX4STZU1BW7bcxbhC0IRfIsXmT7XU/AnJ/BCPr36mdBPv7Dpt6o 0UdReau2nSLEgQmS3ctS9mbRSknlAtoCYaEVXCb7/c3OWu8dvTJkgnILE4Swi6fNSXRC VkaI9dRaG51otP/1S0j/VuoOS4b1unp+nQtwONOzWZBezjRqxXIx6AhQB4y1sr3ihiME gLd+Rd58rg2bg1qmn7OGk9+0l1PhoWn0ysWlFQftZwUnPzAgP+305yIwshi3BtNeg5iF 12j1gLqo8901hKXkWLgdXyF1sipv6T8SV9Wagp/UTOpNcFWtgKnwoN5KeM6A/+rzbl4S FjXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=iejrp+grZWG0cjULylmjer2i61mnKv1l1ZLLXdtcAtk=; b=c5whml0xhHKTO9qHG+D9gfW4iyzvoOJ0y6ZeYD3ZO5k6B2ufy/rWtGPyAmWJZrbKPc WKv0BnrZYUwILfquo81ztEnpnbkj1QzTZYGHQSMoeWYsu6iBLcGKkpgy8YaaAE6i74DA REjZ4PB72DY4ygSJ8ev88FpePmuBIyV6DzsGCAZPRbU69Az6sXAUxDmNoDhfWVqGnwZk Z9RX2i6gZ3mIpojVjYqg1jjP6qBJmlq3REfW2OwHW1YPv6v6tBuCA/sBiOqmTrEJz0y2 yHTnjfoAmlSyBZlxsbdiAGAPq8Ei/Ri/ruH7MTKkI9zyI9w/thn3XZJbl9KJUGnBNBha x+eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id i67si13395424ywi.387.2019.03.27.11.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161268 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6828972jan; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3ZQ79tp+E6leVxGpnq4x7IhHteM4X7Aw/Cfwoy3r3nmGE69nH/8ys3p8Vr1fFu0BrQlJl X-Received: by 2002:a81:5f86:: with SMTP id t128mr33718526ywb.467.1553712448349; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712448; cv=none; d=google.com; s=arc-20160816; b=ES7cCsnUFlQpTIhC9WnDDRXYMEifNhJ+ZeE2SIpcPVZycR5qmKzSs8BWDzty0+z/+U xzjQeYPddaZXy2rsL5iKE0lkoOsQ93pMvBzPmpCIU9/7eYgKzvdgZeH9nuzeABcPVVVX yLx0aJh5iHzS0UO4SShF4yzcwAISYGkXVZTY8bQL9tCfImB1DTb1Plj1YWeLHEF6qDcd 9WEPPJcOXlHJcp9exjyXqZZkrMxdtsnnhxjAujv7h05cl1/VnReM/5VRM4dv1X7uOMJC H6d9aGtdLR1/AuOrmtryRLYyj0I+TnXJP9tX5blkuNMhrhU5BbckCkn+qGq9dDVxWk0c OpUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=zdfoeIptthxFyG8tddWwvRsGYpLogftZmy59HmF0pYQ=; b=rQuoxHlIZmfcI1zS/hGuHE79aCQYpHwnAaIqnFxTcQ+P0TZqB8lXQqYMsGjq3obdIv wly9T4Qz5e7+8xVaN2nTxL+EWmXbCkAISV9n8VsVAt0SkAHnX6pFkdrbRFuuGIYcyB2g SuH8k+MZJRNAd2NjNbGaLxHKqZ1i6nPZr8gqXQECOY3HBmDkKFASrLBUXcYStNxHQxUN 02IdD/6jKRN0jgF9WsGWXCMvNy6h0RL9UV/LrKzICn6g6nFKzCBI2ubOqkcatAiuUaTN /bTTCG/NJaQC3/b82fnH4AqAYwRprAxFP2A2WNVHSBWazWcH3ElNb+fR5CgbEg6tOoYy QXsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id o129si13840762ywe.81.2019.03.27.11.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161267 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6828968jan; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAnERpIgEXsZgcMedbzfnJRwHS15/cg34i9Cc/w+lapJMTdgZeJRrUDdxP5gsEftpTITmq X-Received: by 2002:a81:2511:: with SMTP id l17mr33593795ywl.288.1553712448254; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712448; cv=none; d=google.com; s=arc-20160816; b=E685JAOolph76vRAl2C4cUiMGA3lTg+CnzCLR3SH/cJZDdY7O+ktDGK6zj53vgHsto VZ1MDVDjzAn5qax0S0W9lDkhVZab3kR1YJA/FNAdHAHUEsfEytbrZHxg6KKK53u7vXEA 5aRPQB0mbOSeYOLQKzdcv8Rz4ifcYtgxGftA+uY/aQcmABx3qdWuT4GwdDcL/bWIbARY TpXgEUDoKZCC7poFQ7Y0+KNeuQSjnD8Hn31GIv5krDkI1WByCzXTLM+s+VaU/eRN6xhR X7j5y2QrzvUWGw3MeowUXEQmZL+9YsqyMVBCrl778sTrR5WhtQIUZMPx51B51zW017un r8Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=8DqzNT+1eqAUVQzUS8cZmk13+wbzfmV2BRc/+KDKHWY=; b=yP5Wpf0QipFKhHAwqzfdb1XI5GRHQaErivee5F8Bee9LnO5M1vYg29oJNehkmJcjSo 1aMouUVBLhPD9FGzTtdZST4dt2b+0GaOEY3nIvkuhwxxfxXrRRrh42jrWnBLYHZYYf1I t4WnTeSZGAoIbztlMaORMym5uTEBh4LnNxZTrzbyFWSvPw5K3ia30KchoGEm5J3lJEYW 9JUz1WnoppBNt+efDzBwr5PE3PvA+IosRVJfjNtAu3LkEoCZS8yoyacgPQDPdZBSHIGY lUG2rc899xtQmx95NKhkMUg3roonxkMs/ytgse47tC65kV2GwoexAZcjDTeeb+AEvalH DuZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id b12si7453692ywh.256.2019.03.27.11.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161278 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6829003jan; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlALBntV/qlPFhx7sW0z9FuweJ8t+XwqymCZcy+BQlIEX7AHMpN19msPHj/wNUGG4ldirt X-Received: by 2002:a25:105:: with SMTP id 5mr6684992ybb.501.1553712449493; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712449; cv=none; d=google.com; s=arc-20160816; b=FhGjxrc3VVQ38vDr5S0LFnzAVC8cw0VMtPWsX5L6sdLSn3RXk6jFg+bnUKXfwe9Kwa Ra7/xij5sZaDR2L/0h5NoYWekwyFhxC7sEOADahX08cTIEkLA2RzvMkmfsjxLsgkQ6BL Np9kfORWhFaggSZH61SB9s1g+W/asknS58d7k4V1IC5kVC3fu+pM1G+cB71k6WIQCA64 7S138Ethm5AWxQLv6tvIICIN/V4fRAFRAmAdUG8pdr14XSrX/cMLj1gIzgv5yfRXcjnq uUdGsiMSf2rA4nWrsnHk/KQ27EMQDniLPs322N7xEvcZkxmifKhOEs0FqCn5l7BwMT23 9bJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=dhU2nKYyW2ll/sQn1c8uOrfMqpVg6UAxUKqCLzYSC7A=; b=ygPwZbo6AESTLHbcO7jEGNGLgXV84TvJLfF4mkhUAfXBDftlGOfpz3YSynS2ts0lHK GPeGqkF6qL6fvvNQrWyTVw//4KNWUqOs/E0YsX5Ic5CGU9MGXiSVQ2nHgMP6byU33NXc sOc1fPMk6iP+VpBMC4Co3e08T52T9dUDtzpensI5nFWZeoZxy8wAuHtdRqt4wHrLD0Ao OPfnWMqGTjbvn2W2YDjyer+0ec2tdqMjX/rYiydac3qyNclAFMpNwqtHJfvtcigUP1Ui UFHri2zU589NktlevvgitIZOGPM3pfw3aBLl25KeHg8+8+gpVAu6HwqZGBbkDHt9v7O8 3c5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id j185si6923110ywj.204.2019.03.27.11.47.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161276 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6828984jan; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMACrPS6SAm+u2cFHe1ms72W5QZ+kB9qCs5BwxTbtzFB71PhNKizG59lf8/+BRR/euFTuw X-Received: by 2002:a81:2ed2:: with SMTP id u201mr32126480ywu.72.1553712448720; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712448; cv=none; d=google.com; s=arc-20160816; b=pmjOae3Qu+WHdhu0dF4DLYABBfssQqhrN+rxRin0EVQP3Y2fhJQN81W0S9GC/t/KoU t6VyLU65LyPzFSgyQDHrOIT0QuazsPwvmBT2i7wfDDUrCNn5EX8Y83pV1TBiUR/jkf5q cYBe3Zi7QbWNADztnmjA+DchyQWOnSdnbnAhzYpCsBxPA/Ihz0msfSbugLchMaVrkxXS mGv+dazleQW5NGBdlLqAk+pE+TLeniwyNWEvSkXmzeSJI3bYHglGpuwTS82H2P9mtLRp 8N/Q8qJE6NzhnGKheeBPj2h/IuoUlxllkQFTBgWp+VGZrM2A8ZEjrMm1T3X3JZR7+NAg +ZuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=v8pCTRRjCpkDJJVnmEiLWuTZarn0Ao1Bm1gCBp6dTu0=; b=iSDC79jfX93YY430LRtl4EFTPrNaG6diT+6kShq7h8DibgBstvLzUvpe2jn4lKpbhE rW+r1kaqujYeB8YlepbFTUw/EKOf3LEx/3dYP34O+2+340u63KKjMk8XmYNA4YPPWGye kySrRcEOrLLGuS+bo+KboxABuf0nIcImP7Oeo3GeFkpHufekAcgfydu6Bg7fNQq3P8Xz 0Js9Q9cMhScuP6jrY1pUuPVQuixWFit4rkRcdyt0F4rsUqvSaHUvjO7sxmtN20botzHg ho46SJtm/ljJkUlynAaqA54yTE2d+cPK/nFac3HHGeQUp9VMfYQzk1ixXqMAZu2e/09/ qzdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id r186si5797543ywg.107.2019.03.27.11.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161273 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6829000jan; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqx11uqqkGY6VecEE4W8ADCC+I0MDUaulg2wA6r7EMJvQnR0cL7rqHdZ3O5frWyS3c6Uc6im X-Received: by 2002:a81:a6c5:: with SMTP id d188mr32792368ywh.46.1553712449362; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712449; cv=none; d=google.com; s=arc-20160816; b=jUQ4L7VpH9qwneomn5fiZG8reCE2Od+ojWttj1NyrASVIA+ZCHjXvRUqlxvT9GYYYN CW5k0TuuwCNlh36P0+hIvHyd8vhAKiemodWVKsLuFknXEzhj6/LCbfMWTZZJtHTIJ3pd G4Z3eydfVX4i05n1obXRTYRbKBCu6MbvclcbCdu0QHfogsu3Qk7+ArFtAqK8qBIYXjSF VB6rf6sqSE4GqSug4kQITQVBwAqal55Jmsvd2njxAC5d6NwBrUhJallV1dnEMMF7DSTE EQ+/cUhmEcT9/zwnPkJrF5MDIglqjZnDXoLb/ioLQJKDEgelU/nfUH4Kiq5hPU2pHx0B gobw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=dJRS3KM9HaH+9JVKfpxR4tj4nkWxdaaJMTn1ip0j9As=; b=chXyrTXhwylnrlTy0V0JIAbKe7HjE4I/A/GeYcAyNbupuOLdS92AsYm78acbEuhViW iUQFGPZ9OhXsodc2EYimIp2MbxU9Rb/+3lOTs0CfXJgkTJh7slJ/H20AL891NNQs0A1G QatQElkVWIWwdk/a3ehjjTSFYzHFVqTmlLyVTrgHPyb158J2tON4mOHIjGbXx8/eDeKZ x4wQfqO4SqTvlhu3kyQJTQ2SqcGRyIcWS+fRj3VMBotpwpLZMYYRZfwqsO8xWRka4ziB heOxu0f3GLA8XyblzlQ9JmgIUKsiaoeZd12x9GX0nILXpfi9X9l+cLzuUKzHJfkyTFgV B1Fg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id v66si6451102ywa.75.2019.03.27.11.47.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161269 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6828969jan; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIsnGHw91sr2+RmbJm2GMd1j+D4szp6LhjxOPbJb28v/OVa0g2XbYuT/npERf1a3M7Zv9L X-Received: by 2002:a25:9788:: with SMTP id i8mr31945407ybo.506.1553712448317; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712448; cv=none; d=google.com; s=arc-20160816; b=gqqR8w1qmVRi9iyN8kFghNhLmKpGNgkcIJTbf6NvhLn0q7kWzyaxVbuh0PuwVUejTi /5fxmii8JUxuJ0iGGmgWJnQAzMNWuPJxDv0ZH5mcHEIgiFUgCS4hIBWxumR++cKwx7Y1 8BHZDBx7OolguDGYM94g/U4Oz3O+Ui4gp+HvmxhsDGWhsC1h0AOU051MMhaS5F0D8BMA QiR1XQMnpR2+NpQ/EgOg/AwYh3k5nyJzhJX9IerlMc0xfMF0BlGcdh6xntFzfJWGt/40 Cg4aXpT7s5XRRheLrzK7UdJMpNmoRxns0dPbMrURWuBgWfkPbtKv60AwuWp8HwZR26eV Yw6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=AlHuCyeZvTV61fx+uw8Qe4YpgMSL/M9Y7mcqCHZrQSQ=; b=BQuG5qUp1dRYxWibz5laSfW3ARq0Yi6EcixdtajHs6EAoPdNqzRv9t7fBbg53ZbQiY 0xN3eKCO68Fn2YddgaWTIJIozZjc+KnDvMDaOFj0rkSfe7GSd4/hb9HTFIkCxRJVEt7u zHFi1u2fN4bOkCg6Kj708scNUzZ7gtMtSNmTQ0FB5troHg7Mksm2koNGYGs54CTt429h ufYBJVQNhPj5srsughYWgCvbQ7xbgMFl4g0oT6zsnKvzskwiFoGD0PhVczM1jOJ2z+a7 PnhWhSPNHcKBzknSP8pXEUD9diMe21DXmbr+L0pTal0u2y8MBShSX95jD97BcIoqcfpp YbRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id f197si13683106yba.77.2019.03.27.11.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161275 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6828981jan; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX2s3pVnf565/F+P7YpvT/sN4GMytmL0KxAc66gDjs7jsjH2jRr6KDPmYOW/ya3qwrVF69 X-Received: by 2002:a81:4f01:: with SMTP id d1mr31969260ywb.326.1553712448126; Wed, 27 Mar 2019 11:47:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712448; cv=none; d=google.com; s=arc-20160816; b=ecT5MRj1WnS4eyTFwfa25VlSRAwY5ffgK5PlElnnMQ55t/mfQBV2N22bmchjhVFSJq n8Q7qe6TXu+r08s/9rS1gpXlRkEILESvO9ty6UwRlhCP/LriiOWVo1HmvRgAVMpCUYH3 RYJqS7WGT6xVa2KjcXF6kl6i8QobHia9UWCRhGspxf1dxf4S6rocRpU7emxDC1X0yDfo jImRMxuoLkKehnjzqZeswpdO+lsnddO1l9fShgQFavh0vVHf4JFMMhF51u59DMiRxa40 CbnQjdRw2PeyuKJN72Lz5xvH2jYpg0qlkaAmmztCNC7MoMUdYzB7zXV0ikbhv5+ykA2f GBGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=JL95K8SQi9ypzKTFfryC4isT3qLCHS2IXNqL86PhUmY=; b=e0dgcLZuZFrduVk9JJG8sfnYGAkJAC0JeHAPVu69IIRr1M1Y5zknj37Hgo1ZZBEwLH Kh2U8P6OirLUZvSYNvu4BlA/rduxOnx4+sOf5xmZyGcsht6ungTWVElgxK8lIqV3z91v WInIgs5Kjr1b2YUsZhqJDu2SC1JP9saCGH6a0MIEEnjyJaJT1THfgGONk4BhqXWYK27D 1teB470NMs2QQwFMGjZLwkoWxysrE0Kyk7g7FVnxSE7TE6y0jHu9uxF8IAgwSDmfxDAL ZXkVvtb96xb7Ry+s8J6lKpBA1r2tzXC01fEgmlzJfocUwhrdxRLJF/i3kQZIkJ766GUh PUIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id b83si6437287ywb.121.2019.03.27.11.47.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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: 161279 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp6829005jan; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjkJD8Gj0vlon4rI7pGVolW1982OZzWTcNNY8mgJioKy/2BwtRk2lD6JRXBCPVItA8ZZgo X-Received: by 2002:a81:3247:: with SMTP id y68mr32076825ywy.359.1553712449561; Wed, 27 Mar 2019 11:47:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712449; cv=none; d=google.com; s=arc-20160816; b=Ann8TDyoRQaQRB7pIpUHndbnJsjaR+cX2Sy7UztgrXPrNX0INL6v+vjgN9DJlhbGFv EBadEP2Q3y2jrl0n1+Xlv1sayQ92RUz1Ki6K82YW2IBtcsP5tx3liynIrlGvlbrJU63O h29KvicCVoF8MQGgG3iaawcl9iPFcPmqW4Y2mfl29BPtfwGiyJNho5JVfEheRfjkhSkm hCo4AT+YuxWvQot1z+Dv5dL6m16hLfo6i/5tN2sB0ziqi9tfkk00h0yd9LYe4VLUlL2/ RMiSsmoRxrSvTg2ebBkq1wuSvY/EM7nWwF+M6LGcKtSAKxJKmR/SxoMd56c6xL5jadLL RkJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=BxMe19Z/8r867rsdvcMowl9HUuEpsoEPim08dgmt/cs=; b=JTgYZK7ZrMsugr7GO1u8qSFiJ2X3dMnAC4calvr/9U1ua2UP8nDlOhn2Kfc3mng/yO H86b4N44/68UVYWIpZCooNXZE0ZfTsXdlwz4mvsOI7cDnCV5WmKe5GCW3cqFALpWolK7 UBk6swL5DDMZ07BzbcyRv/AKgFcFo6c0b8nXUxtci/Ux2xEOReqOowpkwhr740mjmfDE SsyecRpqafmk3NwTmEr58LQK+gNrdOCILCUR9HZDoKDYSzqp7aEmZS0whkHCu/b0FrBF /KvOTF4f66YwUl1pNtz3bz4kqt5sm7TXCKD21TdCq/ZLX8pAql7Ga+4cOyC4tgCWPkN4 Xb2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id w186si12440392ywc.259.2019.03.27.11.47.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2019 11:47:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) 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 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" 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;