From patchwork Thu Mar 16 11:20:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 9627967 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 583136048C for ; Thu, 16 Mar 2017 11:21:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A65D285B5 for ; Thu, 16 Mar 2017 11:21:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F11928604; Thu, 16 Mar 2017 11:21:08 +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 20A92285B5 for ; Thu, 16 Mar 2017 11:21:07 +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 1coTR0-0007wH-GB; Thu, 16 Mar 2017 11:19:10 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coTQz-0007tR-CX for xen-devel@lists.xenproject.org; Thu, 16 Mar 2017 11:19:09 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id E2/4F-27751-CA47AC85; Thu, 16 Mar 2017 11:19:08 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRWlGSWpSXmKPExsVysyfVTXdNyak Igw0zGS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyXGx+zFLR1MlZ82veXqYFxUXoXIxeHkMBm Ronug5/YIJzljBKfdsxl7GLk5GAT0JXYcfM1M4gtIhAqMefnIzCbWaBS4uKH/WwgtrCAp8Sle d9YQGwWAVWJHbeWsILYvAI2Ei/WXgCLSwjISTScvw/WywkU7zi5B6xXSMBa4vPRz+wTGLkXMD KsYtQoTi0qSy3SNTLQSyrKTM8oyU3MzNE1NDDTy00tLk5MT81JTCrWS87P3cQI9DEDEOxg/LU s4BCjJAeTkiivlvmpCCG+pPyUyozE4oz4otKc1OJDjDIcHEoSvNXFQDnBotT01Iq0zBxgsMGk JTh4lER4C0DSvMUFibnFmekQqVOMuhyL/u1+wyTEkpeflyolzmsDUiQAUpRRmgc3Ahb4lxhlp YR5GYGOEuIpSC3KzSxBlX/FKM7BqCTMuxVkCk9mXgncpldARzABHfH2wwmQI0oSEVJSDYz9zq dPylzxlr6cIaj2Lz7dQj52sc3xG1/Xv11l31+w5Hzd8/hZkeKHtqoceLXV4J5NrymD0IX/nV7 nxLc18N8PO8fZb7PDhN/NJbDpk6nLlOuSN5s+GJ7Mm+B3o2Kv9avUhqbvN3yKp5SHsCxeltLC y6Ph83T5rZOn8nP0WM9n+KpIZHmd/KbEUpyRaKjFXFScCADNMViydwIAAA== X-Env-Sender: andre.przywara@arm.com X-Msg-Ref: server-14.tower-27.messagelabs.com!1489663147!79661196!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.2.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4967 invoked from network); 16 Mar 2017 11:19:07 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-14.tower-27.messagelabs.com with SMTP; 16 Mar 2017 11:19:07 -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 0A254150C; Thu, 16 Mar 2017 04:19:07 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.207.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 011E03F5C9; Thu, 16 Mar 2017 04:19:05 -0700 (PDT) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Thu, 16 Mar 2017 11:20:17 +0000 Message-Id: <20170316112030.20419-15-andre.przywara@arm.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170316112030.20419-1-andre.przywara@arm.com> References: <20170316112030.20419-1-andre.przywara@arm.com> Cc: xen-devel@lists.xenproject.org, Shanker Donthineni , Vijay Kilari Subject: [Xen-devel] [PATCH v2 14/27] ARM: vGICv3: introduce basic ITS emulation bits 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 Create a new file to hold the emulation code for the ITS widget. For now we emulate the memory mapped ITS registers and provide a stub to introduce the ITS command handling framework (but without actually emulating any commands at this time). Signed-off-by: Andre Przywara --- xen/arch/arm/Makefile | 1 + xen/arch/arm/vgic-v3-its.c | 487 ++++++++++++++++++++++++++++++++++++++ xen/arch/arm/vgic-v3.c | 9 - xen/include/asm-arm/gic_v3_defs.h | 19 ++ 4 files changed, 507 insertions(+), 9 deletions(-) create mode 100644 xen/arch/arm/vgic-v3-its.c diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 02a8737..e7ce2c83 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -47,6 +47,7 @@ obj-y += traps.o obj-y += vgic.o obj-y += vgic-v2.o obj-$(CONFIG_HAS_GICV3) += vgic-v3.o +obj-$(CONFIG_HAS_ITS) += vgic-v3-its.o obj-y += vm_event.o obj-y += vtimer.o obj-y += vpsci.o diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c new file mode 100644 index 0000000..5337638 --- /dev/null +++ b/xen/arch/arm/vgic-v3-its.c @@ -0,0 +1,487 @@ +/* + * xen/arch/arm/vgic-v3-its.c + * + * ARM Interrupt Translation Service (ITS) emulation + * + * Andre Przywara + * Copyright (c) 2016,2017 ARM Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Data structure to describe a virtual ITS */ +struct virt_its { + struct domain *d; + spinlock_t vcmd_lock; /* protects the virtual command buffer */ + uint64_t cbaser; + uint64_t *cmdbuf; + int cwriter; + int creadr; + spinlock_t its_lock; /* protects the collection and device tables */ + uint64_t baser0, baser1; + uint16_t *coll_table; + int max_collections; + uint64_t *dev_table; + int max_devices; + bool enabled; +}; + +/* + * An Interrupt Translation Table Entry: this is indexed by a + * DeviceID/EventID pair and is located in guest memory. + */ +struct vits_itte +{ + uint32_t vlpi; + uint16_t collection; +}; + +/************************************** + * Functions that handle ITS commands * + **************************************/ + +static uint64_t its_cmd_mask_field(uint64_t *its_cmd, + int word, int shift, int size) +{ + return (le64_to_cpu(its_cmd[word]) >> shift) & (BIT(size) - 1); +} + +#define its_cmd_get_command(cmd) its_cmd_mask_field(cmd, 0, 0, 8) +#define its_cmd_get_deviceid(cmd) its_cmd_mask_field(cmd, 0, 32, 32) +#define its_cmd_get_size(cmd) its_cmd_mask_field(cmd, 1, 0, 5) +#define its_cmd_get_id(cmd) its_cmd_mask_field(cmd, 1, 0, 32) +#define its_cmd_get_physical_id(cmd) its_cmd_mask_field(cmd, 1, 32, 32) +#define its_cmd_get_collection(cmd) its_cmd_mask_field(cmd, 2, 0, 16) +#define its_cmd_get_target_addr(cmd) its_cmd_mask_field(cmd, 2, 16, 32) +#define its_cmd_get_validbit(cmd) its_cmd_mask_field(cmd, 2, 63, 1) + +#define ITS_CMD_BUFFER_SIZE(baser) ((((baser) & 0xff) + 1) << 12) + +static int vgic_its_handle_cmds(struct domain *d, struct virt_its *its, + uint32_t writer) +{ + uint64_t *cmdptr; + + if ( !its->cmdbuf ) + return -1; + + if ( writer >= ITS_CMD_BUFFER_SIZE(its->cbaser) ) + return -1; + + spin_lock(&its->vcmd_lock); + + while ( its->creadr != writer ) + { + cmdptr = its->cmdbuf + (its->creadr / sizeof(*its->cmdbuf)); + switch (its_cmd_get_command(cmdptr)) + { + case GITS_CMD_SYNC: + /* We handle ITS commands synchronously, so we ignore SYNC. */ + break; + default: + gdprintk(XENLOG_G_WARNING, "ITS: unhandled ITS command %ld\n", + its_cmd_get_command(cmdptr)); + break; + } + + its->creadr += ITS_CMD_SIZE; + if ( its->creadr == ITS_CMD_BUFFER_SIZE(its->cbaser) ) + its->creadr = 0; + } + its->cwriter = writer; + + spin_unlock(&its->vcmd_lock); + + return 0; +} + +/***************************** + * ITS registers read access * + *****************************/ + +/* + * The physical address is encoded slightly differently depending on + * the used page size: the highest four bits are stored in the lowest + * four bits of the field for 64K pages. + */ +static paddr_t get_baser_phys_addr(uint64_t reg) +{ + if ( reg & BIT(9) ) + return (reg & GENMASK(47, 16)) | ((reg & GENMASK(15, 12)) << 36); + else + return reg & GENMASK(47, 12); +} + +static int vgic_v3_its_mmio_read(struct vcpu *v, mmio_info_t *info, + register_t *r, void *priv) +{ + struct virt_its *its = priv; + + switch ( info->gpa & 0xffff ) + { + case VREG32(GITS_CTLR): + if ( info->dabt.size != DABT_WORD ) goto bad_width; + *r = vgic_reg32_extract(its->enabled | BIT(31), info); + break; + case VREG32(GITS_IIDR): + if ( info->dabt.size != DABT_WORD ) goto bad_width; + *r = vgic_reg32_extract(GITS_IIDR_VALUE, info); + break; + case VREG64(GITS_TYPER): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + *r = vgic_reg64_extract(0x1eff1, info); + break; + case VREG64(GITS_CBASER): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + *r = vgic_reg64_extract(its->cbaser, info); + break; + case VREG64(GITS_CWRITER): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + *r = vgic_reg64_extract(its->cwriter, info); + break; + case VREG64(GITS_CREADR): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + *r = vgic_reg64_extract(its->creadr, info); + break; + case VREG64(GITS_BASER0): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + *r = vgic_reg64_extract(its->baser0, info); + break; + case VREG64(GITS_BASER1): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + *r = vgic_reg64_extract(its->baser1, info); + break; + case VRANGE64(GITS_BASER2, GITS_BASER7): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + *r = vgic_reg64_extract(0, info); + break; + case VREG32(GICD_PIDR2): + if ( info->dabt.size != DABT_WORD ) goto bad_width; + *r = vgic_reg32_extract(GICV3_GICD_PIDR2, info); + break; + } + + return 1; + +bad_width: + domain_crash_synchronous(); + + return 0; +} + +/****************************** + * ITS registers write access * + ******************************/ + +static int its_baser_table_size(uint64_t baser) +{ + int page_size = 0; + + switch ( (baser >> 8) & 3 ) + { + case 0: page_size = SZ_4K; break; + case 1: page_size = SZ_16K; break; + case 2: + case 3: page_size = SZ_64K; break; + } + + return page_size * ((baser & GENMASK(7, 0)) + 1); +} + +static int its_baser_nr_entries(uint64_t baser) +{ + int entry_size = ((baser & GENMASK(52, 48)) >> 48) + 1; + + return its_baser_table_size(baser) / entry_size; +} + +static void vgic_its_map_cmdbuf(struct virt_its *its) +{ + if ( its->cmdbuf || !(its->cbaser & GITS_VALID_BIT) ) + return; + + get_guest_pages(its->d, its->cbaser & GENMASK(51, 12), + (its->cbaser & 0xff) + 1); + its->cmdbuf = map_guest_pages(its->d, its->cbaser & GENMASK(51, 12), + (its->cbaser & 0xff) + 1); +} + +static void vgic_its_unmap_cmdbuf(struct virt_its *its) +{ + int nr_pages = (its->cbaser & 0xff) + 1; + + if ( !its->cmdbuf ) + return; + + unmap_guest_pages(its->cmdbuf, nr_pages); + put_guest_pages(its->d, its->cbaser & GENMASK(51, 12), nr_pages); + + its->cmdbuf = NULL; +} + +static void* vgic_its_map_its_table(struct virt_its *its, uint64_t reg) +{ + void *ret; + int table_size = its_baser_table_size(reg); + + if ( !(reg & GITS_VALID_BIT) ) + return NULL; + + get_guest_pages(its->d, get_baser_phys_addr(reg), table_size >> PAGE_SHIFT); + ret = map_guest_pages(its->d, get_baser_phys_addr(reg), + table_size >> PAGE_SHIFT); + memset(ret, 0, table_size); + + return ret; +} + +static void vgic_its_unmap_its_table(struct domain *d, void *table, + uint64_t reg) +{ + if ( !table ) + return; + + unmap_guest_pages(table, its_baser_table_size(reg) >> PAGE_SHIFT); + put_guest_pages(d, get_baser_phys_addr(reg), + its_baser_table_size(reg) >> PAGE_SHIFT); +} + +static void vgic_v3_its_change_its_status(struct virt_its *its, bool status) +{ + if ( !status ) + { + its->enabled = false; + return; + } + + vgic_its_map_cmdbuf(its); + + if ( !its->dev_table ) + its->dev_table = vgic_its_map_its_table(its, its->baser0); + + if ( !its->coll_table ) + its->coll_table = vgic_its_map_its_table(its, its->baser1); + + its->enabled = true; +} + +static void sanitize_its_base_reg(uint64_t *reg) +{ + uint64_t r = *reg; + + /* Avoid outer shareable. */ + switch ( (r >> GITS_BASER_SHAREABILITY_SHIFT) & 0x03 ) + { + case GIC_BASER_OuterShareable: + r = r & ~GITS_BASER_SHAREABILITY_MASK; + r |= GIC_BASER_InnerShareable << GITS_BASER_SHAREABILITY_SHIFT; + break; + default: + break; + } + + /* Avoid any inner non-cacheable mapping. */ + switch ( (r >> GITS_BASER_INNER_CACHEABILITY_SHIFT) & 0x07 ) + { + case GIC_BASER_CACHE_nCnB: + case GIC_BASER_CACHE_nC: + r = r & ~GITS_BASER_INNER_CACHEABILITY_MASK; + r |= GIC_BASER_CACHE_RaWb << GITS_BASER_INNER_CACHEABILITY_SHIFT; + break; + default: + break; + } + + /* Only allow non-cacheable or same-as-inner. */ + switch ( (r >> GITS_BASER_OUTER_CACHEABILITY_SHIFT) & 0x07 ) + { + case GIC_BASER_CACHE_SameAsInner: + case GIC_BASER_CACHE_nC: + break; + default: + r = r & ~GITS_BASER_OUTER_CACHEABILITY_MASK; + r |= GIC_BASER_CACHE_nC << GITS_BASER_OUTER_CACHEABILITY_SHIFT; + break; + } + + *reg = r; +} + +static int vgic_v3_its_mmio_write(struct vcpu *v, mmio_info_t *info, + register_t r, void *priv) +{ + struct domain *d = v->domain; + struct virt_its *its = priv; + uint64_t reg; + uint32_t reg32, ctlr; + + switch ( info->gpa & 0xffff ) + { + case VREG32(GITS_CTLR): + if ( info->dabt.size != DABT_WORD ) goto bad_width; + + ctlr = its->enabled ? GITS_CTLR_ENABLE : 0; + reg32 = ctlr; + vgic_reg32_update(®32, r, info); + its->enabled = reg32 & GITS_CTLR_ENABLE; + + if ( ctlr ^ reg32 ) + vgic_v3_its_change_its_status(its, its->enabled); + return 1; + + case VREG32(GITS_IIDR): + goto write_ignore_32; + case VREG32(GITS_TYPER): + goto write_ignore_32; + case VREG64(GITS_CBASER): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + + /* Changing base registers with the ITS enabled is UNPREDICTABLE. */ + if ( its->enabled ) + return 1; + + reg = its->cbaser; + vgic_reg64_update(®, r, info); + sanitize_its_base_reg(®); + + vgic_its_unmap_cmdbuf(its); + its->cbaser = reg; + + return 1; + + case VREG64(GITS_CWRITER): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + reg = its->cwriter & 0xfffe0; + vgic_reg64_update(®, r, info); + its->cwriter = reg & 0xfffe0; + + if ( its->enabled ) + vgic_its_handle_cmds(d, its, reg); + + return 1; + + case VREG64(GITS_CREADR): + goto write_ignore_64; + case VREG64(GITS_BASER0): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + + /* Changing base registers with the ITS enabled is UNPREDICTABLE. */ + if ( its->enabled ) + return 1; + + reg = its->baser0; + vgic_reg64_update(®, r, info); + + reg &= ~GITS_BASER_RO_MASK; + reg |= (sizeof(uint64_t) - 1) << GITS_BASER_ENTRY_SIZE_SHIFT; + reg |= GITS_BASER_TYPE_DEVICE << GITS_BASER_TYPE_SHIFT; + sanitize_its_base_reg(®); + + /* Has the table address been changed or invalidated? */ + if ( !(reg & GITS_VALID_BIT) || + get_baser_phys_addr(reg) != get_baser_phys_addr(its->baser0) ) + { + vgic_its_unmap_its_table(its->d, its->dev_table, reg); + its->dev_table = NULL; + } + + if ( reg & GITS_VALID_BIT ) + its->max_devices = its_baser_nr_entries(reg); + else + its->max_devices = 0; + + its->baser0 = reg; + return 1; + case VREG64(GITS_BASER1): + if ( info->dabt.size < DABT_WORD ) goto bad_width; + + /* Changing base registers with the ITS enabled is UNPREDICTABLE. */ + if ( its->enabled ) + return 1; + + reg = its->baser1; + vgic_reg64_update(®, r, info); + reg &= ~GITS_BASER_RO_MASK; + reg |= (sizeof(uint16_t) - 1) << GITS_BASER_ENTRY_SIZE_SHIFT; + reg |= GITS_BASER_TYPE_COLLECTION << GITS_BASER_TYPE_SHIFT; + sanitize_its_base_reg(®); + + if ( !(reg & GITS_VALID_BIT) || + get_baser_phys_addr(reg) != get_baser_phys_addr(its->baser1) ) + { + vgic_its_unmap_its_table(its->d, its->coll_table, reg); + its->coll_table = NULL; + } + + if ( reg & GITS_VALID_BIT ) + its->max_collections = its_baser_nr_entries(reg); + else + its->max_collections = 0; + its->baser1 = reg; + return 1; + case VRANGE64(GITS_BASER2, GITS_BASER7): + goto write_ignore_64; + default: + gdprintk(XENLOG_G_WARNING, "ITS: unhandled ITS register 0x%lx\n", + info->gpa & 0xffff); + return 0; + } + + return 1; + +write_ignore_64: + if ( ! vgic_reg64_check_access(info->dabt) ) goto bad_width; + return 1; + +write_ignore_32: + if ( info->dabt.size != DABT_WORD ) goto bad_width; + return 1; + +bad_width: + printk(XENLOG_G_ERR "%pv vGICR: bad read width %d r%d offset %#08lx\n", + v, info->dabt.size, info->dabt.reg, info->gpa & 0xffff); + + domain_crash_synchronous(); + + return 0; +} + +static const struct mmio_handler_ops vgic_its_mmio_handler = { + .read = vgic_v3_its_mmio_read, + .write = vgic_v3_its_mmio_write, +}; + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * indent-tabs-mode: nil + * End: + */ diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c index de625bf..d1382be 100644 --- a/xen/arch/arm/vgic-v3.c +++ b/xen/arch/arm/vgic-v3.c @@ -159,15 +159,6 @@ static void vgic_store_irouter(struct domain *d, struct vgic_irq_rank *rank, rank->vcpu[offset] = new_vcpu->vcpu_id; } -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/gic_v3_defs.h b/xen/include/asm-arm/gic_v3_defs.h index 878bae2..1e88d6b 100644 --- a/xen/include/asm-arm/gic_v3_defs.h +++ b/xen/include/asm-arm/gic_v3_defs.h @@ -153,6 +153,16 @@ #define LPI_PROP_RES1 (1 << 1) #define LPI_PROP_ENABLED (1 << 0) +/* + * PIDR2: Only bits[7:4] are not implementation defined. We are + * emulating a GICv3 ([7:4] = 0x3). + * + * We don't emulate a specific registers scheme so implement the others + * bits as RES0 as recommended by the spec (see 8.1.13 in ARM IHI 0069A). + */ +#define GICV3_GICD_PIDR2 0x30 +#define GICV3_GICR_PIDR2 GICV3_GICD_PIDR2 + #define GICH_VMCR_EOI (1 << 9) #define GICH_VMCR_VENG1 (1 << 1) @@ -196,6 +206,15 @@ struct rdist_region { bool single_rdist; }; +/* + * 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_GIC_V3_DEFS_H__ */ /*