All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Julien Grall <julien.grall@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org,
	Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>,
	Vijay Kilari <vijay.kilari@gmail.com>,
	Shanker Donthineni <shankerd@codeaurora.org>,
	Manish Jaggi <mjaggi@caviumnetworks.com>
Subject: [PATCH v11 32/34] ARM: vITS: increase mmio_count for each ITS
Date: Fri,  9 Jun 2017 18:41:39 +0100	[thread overview]
Message-ID: <20170609174141.5068-33-andre.przywara@arm.com> (raw)
In-Reply-To: <20170609174141.5068-1-andre.przywara@arm.com>

Increase the count of MMIO regions needed by one for each ITS Dom0 has
to emulate. We emulate the ITSes 1:1 from the hardware, so the number
is the number of host ITSes.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/vgic-v3-its.c       | 15 +++++++++++++++
 xen/arch/arm/vgic-v3.c           |  3 +++
 xen/include/asm-arm/gic_v3_its.h |  7 +++++++
 3 files changed, 25 insertions(+)

diff --git a/xen/arch/arm/vgic-v3-its.c b/xen/arch/arm/vgic-v3-its.c
index d3e0324..4eef37e 100644
--- a/xen/arch/arm/vgic-v3-its.c
+++ b/xen/arch/arm/vgic-v3-its.c
@@ -1455,6 +1455,21 @@ static const struct mmio_handler_ops vgic_its_mmio_handler = {
     .write = vgic_v3_its_mmio_write,
 };
 
+unsigned int vgic_v3_its_count(const struct domain *d)
+{
+    struct host_its *hw_its;
+    unsigned int ret = 0;
+
+    /* Only Dom0 can use emulated ITSes so far. */
+    if ( !is_hardware_domain(d) )
+        return 0;
+
+    list_for_each_entry(hw_its, &host_its_list, entry)
+        ret++;
+
+    return ret;
+}
+
 int vgic_v3_its_init_domain(struct domain *d)
 {
     spin_lock_init(&d->arch.vgic.its_devices_lock);
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 296991a..cddb920 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1814,6 +1814,9 @@ int vgic_v3_init(struct domain *d, int *mmio_count)
     /* GICD region + number of Redistributors */
     *mmio_count = vgic_v3_rdist_count(d) + 1;
 
+    /* one region per ITS */
+    *mmio_count += vgic_v3_its_count(d);
+
     register_vgic_ops(d, &v3_ops);
 
     return 0;
diff --git a/xen/include/asm-arm/gic_v3_its.h b/xen/include/asm-arm/gic_v3_its.h
index ce46a3f..459b6fe 100644
--- a/xen/include/asm-arm/gic_v3_its.h
+++ b/xen/include/asm-arm/gic_v3_its.h
@@ -137,6 +137,8 @@ void gicv3_its_dt_init(const struct dt_device_node *node);
 
 bool gicv3_its_host_has_its(void);
 
+unsigned int vgic_v3_its_count(const struct domain *d);
+
 void gicv3_do_LPI(unsigned int lpi);
 
 int gicv3_lpi_init_rdist(void __iomem * rdist_base);
@@ -194,6 +196,11 @@ static inline bool gicv3_its_host_has_its(void)
     return false;
 }
 
+static inline unsigned int vgic_v3_its_count(const struct domain *d)
+{
+    return 0;
+}
+
 static inline void gicv3_do_LPI(unsigned int lpi)
 {
     /* We don't enable LPIs without an ITS. */
-- 
2.9.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-06-09 17:42 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09 17:41 [PATCH v11 00/34] arm64: Dom0 ITS emulation Andre Przywara
2017-06-09 17:41 ` [PATCH v11 01/34] ARM: vGIC: avoid rank lock when reading priority Andre Przywara
2017-06-12 14:49   ` Julien Grall
2017-06-12 22:34     ` Stefano Stabellini
2017-06-13  9:01       ` Julien Grall
2017-06-13 22:19         ` Stefano Stabellini
2017-06-14  8:55           ` Julien Grall
2017-06-14 11:22             ` Andre Przywara
2017-06-14 11:27               ` Julien Grall
2017-06-14 17:32             ` Stefano Stabellini
2017-06-14 17:44               ` Julien Grall
2017-06-14 18:15                 ` Stefano Stabellini
2017-06-14 18:32                   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 02/34] ARM: GICv3: enable ITS on the host Andre Przywara
2017-06-12 14:51   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 03/34] ARM: GICv3: enable LPIs " Andre Przywara
2017-06-09 17:41 ` [PATCH v11 04/34] ARM: GICv3: setup number of LPI bits for a GICv3 guest Andre Przywara
2017-06-12 15:03   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 05/34] ARM: vGIC: rework gic_remove_from_queues() Andre Przywara
2017-06-12 15:15   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 06/34] ARM: vGIC: move irq_to_pending() calls under the VGIC VCPU lock Andre Przywara
2017-06-12 15:22   ` Julien Grall
2017-06-12 22:43     ` Stefano Stabellini
2017-06-09 17:41 ` [PATCH v11 07/34] ARM: vGIC: introduce gic_remove_irq() Andre Przywara
2017-06-12 15:28   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 08/34] ARM: GIC: Add checks for NULL pointer pending_irq's Andre Przywara
2017-06-12 15:30   ` Julien Grall
2017-06-12 22:44   ` Stefano Stabellini
2017-06-09 17:41 ` [PATCH v11 09/34] ARM: GICv3: introduce separate pending_irq structs for LPIs Andre Przywara
2017-06-09 17:41 ` [PATCH v11 10/34] ARM: GIC: export and extend vgic_init_pending_irq() Andre Przywara
2017-06-12 15:36   ` Julien Grall
2017-06-14 15:54     ` Andre Przywara
2017-06-14 16:33       ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 11/34] ARM: vGIC: cache virtual LPI priority in struct pending_irq Andre Przywara
2017-06-12 15:39   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 12/34] ARM: vGIC: add LPI VCPU ID to " Andre Przywara
2017-06-12 15:46   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 13/34] ARM: GIC: ITS: remove no longer needed VCPU ID in host LPI entry Andre Przywara
2017-06-12 15:47   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 14/34] ARM: GICv3: forward pending LPIs to guests Andre Przywara
2017-06-12 15:53   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 15/34] ARM: vGICv3: handle virtual LPI pending and property tables Andre Przywara
2017-06-09 17:41 ` [PATCH v11 16/34] ARM: introduce vgic_access_guest_memory() Andre Przywara
2017-06-09 17:41 ` [PATCH v11 17/34] ARM: vGICv3: re-use vgic_reg64_check_access Andre Przywara
2017-06-09 17:41 ` [PATCH v11 18/34] ARM: vGIC: advertise LPI support Andre Przywara
2017-06-12 16:02   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 19/34] ARM: vITS: add command handling stub and MMIO emulation Andre Przywara
2017-06-12 16:04   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 20/34] ARM: vITS: introduce translation table walks Andre Przywara
2017-06-12 16:07   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 21/34] ARM: vITS: provide access to struct pending_irq Andre Przywara
2017-06-09 17:41 ` [PATCH v11 22/34] ARM: vITS: handle INT command Andre Przywara
2017-06-09 17:41 ` [PATCH v11 23/34] ARM: vITS: handle MAPC command Andre Przywara
2017-06-09 17:41 ` [PATCH v11 24/34] ARM: vITS: handle CLEAR command Andre Przywara
2017-06-12 16:19   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 25/34] ARM: vITS: handle MAPD command Andre Przywara
2017-06-13 22:02   ` Stefano Stabellini
2017-06-09 17:41 ` [PATCH v11 26/34] ARM: GICv3: handle unmapped LPIs Andre Przywara
2017-06-12 16:30   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 27/34] ARM: vITS: handle MAPTI/MAPI command Andre Przywara
2017-06-12 16:36   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 28/34] ARM: vITS: handle MOVI command Andre Przywara
2017-06-12 16:37   ` Julien Grall
2017-06-09 17:41 ` [PATCH v11 29/34] ARM: vITS: handle DISCARD command Andre Przywara
2017-06-09 17:41 ` [PATCH v11 30/34] ARM: vITS: handle INV command Andre Przywara
2017-06-09 17:41 ` [PATCH v11 31/34] ARM: vITS: handle INVALL command Andre Przywara
2017-06-12 16:41   ` Julien Grall
2017-06-09 17:41 ` Andre Przywara [this message]
2017-06-09 17:41 ` [PATCH v11 33/34] ARM: vITS: create and initialize virtual ITSes for Dom0 Andre Przywara
2017-06-09 17:41 ` [PATCH v11 34/34] ARM: vITS: create ITS subnodes for Dom0 DT Andre Przywara
2017-06-12  5:04 ` [PATCH v11 00/34] arm64: Dom0 ITS emulation Manish Jaggi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170609174141.5068-33-andre.przywara@arm.com \
    --to=andre.przywara@arm.com \
    --cc=Vijaya.Kumar@caviumnetworks.com \
    --cc=julien.grall@arm.com \
    --cc=mjaggi@caviumnetworks.com \
    --cc=shankerd@codeaurora.org \
    --cc=sstabellini@kernel.org \
    --cc=vijay.kilari@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.