From patchwork Wed Jun 14 16:52:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 9786927 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 0925B60325 for ; Wed, 14 Jun 2017 16:54:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E299B285E6 for ; Wed, 14 Jun 2017 16:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D32F428618; Wed, 14 Jun 2017 16:54:19 +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 51B51285E6 for ; Wed, 14 Jun 2017 16:54:18 +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 1dLBX9-0006gl-J5; Wed, 14 Jun 2017 16:52:43 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLBX8-0006ec-Af for xen-devel@lists.xenproject.org; Wed, 14 Jun 2017 16:52:42 +0000 Received: from [193.109.254.147] by server-10.bemta-6.messagelabs.com id 0A/3F-03613-9D961495; Wed, 14 Jun 2017 16:52:41 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTfdmpmO kwbs5whbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8avtudsBcv5KjbMusPSwHiQu4uRi0NIYDOj RM/yh2wQznJGiabpi1m7GDk52AR0JXbcfM0MYosIhEo8XfCdGaSIWeA6o8TpHfPZQBLCAm4SZ 9ZvYASxWQRUJdpa1oI18wpYS3w7+JUJxJYQkJNoOH8fbBAnUHzq9slAcQ6gbVYSN1foT2DkXs DIsIpRvTi1qCy1SNdIL6koMz2jJDcxM0fX0MBMLze1uDgxPTUnMalYLzk/dxMj0L8MQLCDcdl fp0OMkhxMSqK8UwUdI4X4kvJTKjMSizPii0pzUosPMcpwcChJ8B7OAMoJFqWmp1akZeYAAw0m LcHBoyTCuzUVKM1bXJCYW5yZDpE6xagoJc57FqRPACSRUZoH1wYL7kuMslLCvIxAhwjxFKQW5 WaWoMq/YhTnYFQS5i1LB5rCk5lXAjf9FdBiJqDFQRccQBaXJCKkpBoYG7SyDtzXeGy854T1k6 2anCbnDhaZfAvIK1cRbFdo5hZx+N7J15mS8OFqt073VfntBlztYiYJqafNHsZNUXojYqmRtNn h2ITPnzleMARbnZLdNyN6ylmmZtdNTK0MEzWZuiv/Gqq27Cuv0UhW2jypSODaAcUzdyLXFE3b OMeunHvDh4si/l+VWIozEg21mIuKEwGOxGYmaQIAAA== X-Env-Sender: andre.przywara@arm.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1497459160!54835705!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 37616 invoked from network); 14 Jun 2017 16:52:41 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-15.tower-27.messagelabs.com with SMTP; 14 Jun 2017 16:52:41 -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 985E315B2; Wed, 14 Jun 2017 09:52:40 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.207.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 497053F3E1; Wed, 14 Jun 2017 09:52:39 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Wed, 14 Jun 2017 17:52:06 +0100 Message-Id: <20170614165223.7543-18-andre.przywara@arm.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170614165223.7543-1-andre.przywara@arm.com> References: <20170614165223.7543-1-andre.przywara@arm.com> Cc: xen-devel@lists.xenproject.org, Vijaya Kumar K , Vijay Kilari , Shanker Donthineni , Manish Jaggi Subject: [Xen-devel] [PATCH v12 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 c53fa9c..30981b2 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__ */ /*