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 )