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 )