From patchwork Fri Jun 9 17:41:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 9778969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 430BB60318 for ; Fri, 9 Jun 2017 17:43:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F63B286E0 for ; Fri, 9 Jun 2017 17:43:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 235E2286E7; Fri, 9 Jun 2017 17:43:40 +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=-4.2 required=2.0 tests=BAYES_00, 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 AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 18FBE286E0 for ; Fri, 9 Jun 2017 17:43:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJNvE-0003oj-LT; Fri, 09 Jun 2017 17:42:08 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJNvD-0003mG-EC for xen-devel@lists.xenproject.org; Fri, 09 Jun 2017 17:42:07 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 40/62-11537-EEDDA395; Fri, 09 Jun 2017 17:42:06 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRWlGSWpSXmKPExsVysyfVTffdXat Ig/1zWSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozJ3yayFyznq+jZfYGtgfEgdxcjF4eQwGZG iZ+PT7FDOMsZJSY//8nUxcjJwSagK7Hj5mtmEFtEIFTi6YLvzCBFzALXGSVO75jPBpIQFnCTu LHtBiOIzSKgKnH10WKwOK+AtcSqW70sILaEgJxEw/n7YIM4geLb9qwFqxESsJJoOXSZfQIj9w JGhlWMGsWpRWWpRbpGBnpJRZnpGSW5iZk5uoYGxnq5qcXFiempOYlJxXrJ+bmbGIE+rmdgYNz B2HzC7xCjJAeTkijvtAKrSCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvK/uAOUEi1LTUyvSMnOA wQaTluDgURLhfXESKM1bXJCYW5yZDpE6xagoJc7rBAxRIQGQREZpHlwbLMAvMcpKCfMyMjAwC PEUpBblZpagyr9iFOdgVBLmNQSZwpOZVwI3/RXQYiagxUveWYAsLklESEk1MG4M/7434WeZ63 7OKNsrRV033U8uvb0xzmv5vGtlVns3XL+klrFtQsoOl+D/VvbxXxV2Ck0/WZXJU19VP01Zu2X DJLHO+vVe0/18L0lOm8J/WUA76fucgP4PoXPvhq9x0jg8x753okD0Oe0n4d2P8o+s6v7BvuGi T+LWRVcUTb7VyUyVUXi9caYSS3FGoqEWc1FxIgA5leuPawIAAA== X-Env-Sender: andre.przywara@arm.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1497030125!100881644!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 60035 invoked from network); 9 Jun 2017 17:42:05 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-15.tower-31.messagelabs.com with SMTP; 9 Jun 2017 17:42:05 -0000 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 4DD8515BF; Fri, 9 Jun 2017 10:42:05 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.207.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 04F1E3F578; Fri, 9 Jun 2017 10:42:03 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Fri, 9 Jun 2017 18:41:24 +0100 Message-Id: <20170609174141.5068-18-andre.przywara@arm.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170609174141.5068-1-andre.przywara@arm.com> References: <20170609174141.5068-1-andre.przywara@arm.com> Cc: xen-devel@lists.xenproject.org, Vijaya Kumar K , Vijay Kilari , Shanker Donthineni , Manish Jaggi Subject: [Xen-devel] [PATCH v11 17/34] ARM: vGICv3: re-use vgic_reg64_check_access X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP vgic_reg64_check_access() checks for a valid access width of a 64-bit MMIO register, which is useful beyond the current GICv3 emulation only. Move this function to the vgic-emul.h to be easily reusable. Signed-off-by: Andre Przywara Acked-by: Julien Grall --- xen/arch/arm/vgic-v3.c | 9 --------- xen/include/asm-arm/vgic-emul.h | 9 +++++++++ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index c571ea9..f32e419 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -161,15 +161,6 @@ static void vgic_store_irouter(struct domain *d, struct vgic_irq_rank *rank, } } -static inline bool vgic_reg64_check_access(struct hsr_dabt dabt) -{ - /* - * 64 bits registers can be accessible using 32-bit and 64-bit unless - * stated otherwise (See 8.1.3 ARM IHI 0069A). - */ - return ( dabt.size == DABT_DOUBLE_WORD || dabt.size == DABT_WORD ); -} - static int __vgic_v3_rdistr_rd_mmio_read(struct vcpu *v, mmio_info_t *info, uint32_t gicr_reg, register_t *r) diff --git a/xen/include/asm-arm/vgic-emul.h b/xen/include/asm-arm/vgic-emul.h index 184a1f0..e52fbaa 100644 --- a/xen/include/asm-arm/vgic-emul.h +++ b/xen/include/asm-arm/vgic-emul.h @@ -12,6 +12,15 @@ #define VRANGE32(start, end) start ... end + 3 #define VRANGE64(start, end) start ... end + 7 +/* + * 64 bits registers can be accessible using 32-bit and 64-bit unless + * stated otherwise (See 8.1.3 ARM IHI 0069A). + */ +static inline bool vgic_reg64_check_access(struct hsr_dabt dabt) +{ + return ( dabt.size == DABT_DOUBLE_WORD || dabt.size == DABT_WORD ); +} + #endif /* __ASM_ARM_VGIC_EMUL_H__ */ /*