[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH v2 06/25] arm: new VGIC: Add GICv3 IDREGS register handler


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Fri, 10 Nov 2023 12:56:18 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8BO6CE7jJalbeGAgdrTFV8nvHA8V1OULfNTQToPec3E=; b=S5LuMvMCuJfbgSvqkGpDC+Lwgj6PsjgIYNQu/pXCQHajiLBZ50NJxWeKSjBD+GXMGDlez/23z62m4PtpP2xYexb8DuoAf2YPobgg996VsPuVBQu65mIMc5jKxllfnncH9d3ZmWtBozSIx+BNIGmg7mcUK/FTjB6w9oADuz2ZS0B47KlmPwjLboWnXzhDUIcuBDww0WSKNMhJtWrkMwzMavM7KOMjfg+18K1hXAQypn/gEXq0Wn2odxdf5HHqHJfqZNw3OIsI+o9CFsydpe/QUD+jjN4EliYeoQI0J7RDul4n7WlvQy55r2QXnTiAysmKlDl/OpcR0YHMBRwcPuo+wQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LGvA/t2f94c/luHukq+n5yhivan/BrS5nFOp4FOmiaHHs+AgR1GrZwO2wwMy5yYGlTzEBAS8SZMPNM3Sboh/GYSlfB695dfdw9HEhdtZr/3UmNNN1kNo1wmiq25/FBjnMuYFn6y/VtCndyDL10C3eqYXmP9nkBgCNMOwZOaRrc2/FrLV6TopNShX2eUP35gKLFv1U1pMm+Btno27UGiNiQFGqFFcKlBTZpz80z1JpLKrECHvSrhdJ+1JWRrauCLt9g3HX+CJ+NDac3eMce0VqgceTlMvLl2SIQoyZfUprp/6LzwsM83EirKgD4CxbStuCzdgSqxodtkhbIM4GSIuXA==
  • Cc: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Fri, 10 Nov 2023 12:56:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHaE9VLeDi6QUYO20y4T5ZlvdbpBQ==
  • Thread-topic: [XEN PATCH v2 06/25] arm: new VGIC: Add GICv3 IDREGS register handler

We implement the only one ID register that is required by the
architecture, also this is the one that Linux actually checks.

Based on Linux commit 54f59d2b3a0a3d by Andre Przywara

Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
---
 xen/arch/arm/vgic/vgic-mmio-v3.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/vgic/vgic-mmio-v3.c b/xen/arch/arm/vgic/vgic-mmio-v3.c
index 707a38c727..ccdf3b9456 100644
--- a/xen/arch/arm/vgic/vgic-mmio-v3.c
+++ b/xen/arch/arm/vgic/vgic-mmio-v3.c
@@ -152,6 +152,19 @@ static unsigned long vgic_mmio_read_v3r_iidr(struct vcpu 
*vcpu, paddr_t addr,
            (IMPLEMENTER_ARM << 0);
 }
 
+static unsigned long vgic_mmio_read_v3_idregs(struct vcpu *vcpu, paddr_t addr,
+                                              unsigned int len)
+{
+    switch ( addr & 0xfff )
+    {
+    case GICD_ICPIDR2:
+        /* report a GICv3 compliant implementation */
+        return 0x3b;
+    }
+
+    return 0;
+}
+
 static const struct vgic_register_region vgic_v3_dist_registers[] = {
     REGISTER_DESC_WITH_LENGTH(GICD_CTLR,
         vgic_mmio_read_v3_misc, vgic_mmio_write_v3_misc,
@@ -196,7 +209,7 @@ static const struct vgic_register_region 
vgic_v3_dist_registers[] = {
         vgic_mmio_read_raz, vgic_mmio_write_wi, 64,
         VGIC_ACCESS_64bit | VGIC_ACCESS_32bit),
     REGISTER_DESC_WITH_LENGTH(GICD_IDREGS,
-        vgic_mmio_read_raz, vgic_mmio_write_wi, 48,
+        vgic_mmio_read_v3_idregs, vgic_mmio_write_wi, 48,
         VGIC_ACCESS_32bit),
 };
 
@@ -233,7 +246,7 @@ static const struct vgic_register_region 
vgic_v3_rd_registers[] = {
         vgic_mmio_read_raz, vgic_mmio_write_wi, 4,
         VGIC_ACCESS_32bit),
     REGISTER_DESC_WITH_LENGTH(GICR_IDREGS,
-        vgic_mmio_read_raz, vgic_mmio_write_wi, 48,
+        vgic_mmio_read_v3_idregs, vgic_mmio_write_wi, 48,
         VGIC_ACCESS_32bit),
     /* SGI_base registers */
     REGISTER_DESC_WITH_LENGTH(SZ_64K + GICR_IGROUPR0,
-- 
2.34.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.