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

[PATCH 05/11] xen/arm: vgic: introduce vgic.cbase


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>
  • From: Penny Zheng <penny.zheng@xxxxxxx>
  • Date: Thu, 23 Sep 2021 03:11:09 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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; bh=8mymiVU6RzNe2URN+GFVNzglxdb0Bxcz77lG7C4aSLI=; b=TCiv/3ClcRi+R9WXzCpnoN3MYeWqX5KUQeED5q7b9AwXS/WIG4mElCxKsQb4RWW8Iw03BbL+ATCIiaeYcxiiPt6FFCDvzgsSz0cdB5oDuUkuN307Gh8ZxD0KlBS52Ax4T2byVXjOiGUdA37BUzV3ydPBaeGQXe+UgdMrtBsKklZN8dEpKhQ9oqsZzLaY+oRE7Y7lr46AjavlSdRkw3GuHBmqdUdjDtNzFevfWgw0UvCGbsI1DWWgHKBBGhtUAU9Oe07fxs+m7ot18IFmrKYw7BEyY2KcQd3jaiETPoAkqPz/oKqr2YRVwufmNq448qqc2Opwi81t3LdvNLlSUS5Xgg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kp7JW3SPkZTY5hxQi8HAeL0s7uw8wnulE0FaPPL8AjcvN0DrZoKlufiGxpu9UKXI09K3q9J+y70unC9EFlYkqlWDQXHcLlYcFakMHcCFY/hANqI2+/29MbNiq8Om+F/ytolv9hTyWlKxRADUDP14ef01+JvR1b6+5C94zcvBjQTq0uV4q8k+Ixlblvmwy64kJIPyUB9sGtArg1HHK2cPbA4eSOz+yVOIcGuWI3udj5nei6slZH2P6ZRquHT7P7j8d/tJf+hzOzxlPau02UIuxUif695u90IX2k4ZSUYVusW84+5Q5m2xTiXYPQi3QvHYxx/g2r3FDBMSqe8CPID5IA==
  • Cc: <Bertrand.Marquis@xxxxxxx>, <Penny.Zheng@xxxxxxx>, <Wei.Chen@xxxxxxx>
  • Delivery-date: Thu, 23 Sep 2021 03:11:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>

Add a field in struct vgic_dist to store the cpu interface base address,
similar to the existing dbase field.

Use the field in vgic_v2_domain_init, instead of original local variable.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
---
 xen/arch/arm/vgic-v2.c     | 10 +++++-----
 xen/include/asm-arm/vgic.h |  1 +
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c
index b2da886adc..b34ec88106 100644
--- a/xen/arch/arm/vgic-v2.c
+++ b/xen/arch/arm/vgic-v2.c
@@ -652,7 +652,7 @@ static int vgic_v2_vcpu_init(struct vcpu *v)
 static int vgic_v2_domain_init(struct domain *d)
 {
     int ret;
-    paddr_t cbase, csize;
+    paddr_t csize;
     paddr_t vbase;
 
     /*
@@ -669,7 +669,7 @@ static int vgic_v2_domain_init(struct domain *d)
          * Note that we assume the size of the CPU interface is always
          * aligned to PAGE_SIZE.
          */
-        cbase = vgic_v2_hw.cbase;
+        d->arch.vgic.cbase = vgic_v2_hw.cbase;
         csize = vgic_v2_hw.csize;
         vbase = vgic_v2_hw.vbase;
     }
@@ -683,7 +683,7 @@ static int vgic_v2_domain_init(struct domain *d)
          * region.
          */
         BUILD_BUG_ON(GUEST_GICC_SIZE != SZ_8K);
-        cbase = GUEST_GICC_BASE;
+        d->arch.vgic.cbase = GUEST_GICC_BASE;
         csize = GUEST_GICC_SIZE;
         vbase = vgic_v2_hw.vbase + vgic_v2_hw.aliased_offset;
     }
@@ -692,8 +692,8 @@ static int vgic_v2_domain_init(struct domain *d)
      * Map the gic virtual cpu interface in the gic cpu interface
      * region of the guest.
      */
-    ret = map_mmio_regions(d, gaddr_to_gfn(cbase), csize / PAGE_SIZE,
-                           maddr_to_mfn(vbase));
+    ret = map_mmio_regions(d, gaddr_to_gfn(d->arch.vgic.cbase),
+                           csize / PAGE_SIZE, maddr_to_mfn(vbase));
     if ( ret )
         return ret;
 
diff --git a/xen/include/asm-arm/vgic.h b/xen/include/asm-arm/vgic.h
index e1bc5113da..d5ad1f387b 100644
--- a/xen/include/asm-arm/vgic.h
+++ b/xen/include/asm-arm/vgic.h
@@ -152,6 +152,7 @@ struct vgic_dist {
     struct pending_irq *pending_irqs;
     /* Base address for guest GIC */
     paddr_t dbase; /* Distributor base address */
+    paddr_t cbase; /* CPU interface base address */
 #ifdef CONFIG_GICV3
     /* GIC V3 addressing */
     /* List of contiguous occupied by the redistributors */
-- 
2.25.1




 


Rackspace

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