]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
xen/arm: vgic-v2: Drop cbase from arch_domain
authorJulien Grall <julien.grall@citrix.com>
Tue, 29 Sep 2015 16:21:38 +0000 (17:21 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 1 Oct 2015 12:51:58 +0000 (13:51 +0100)
The field value is only used within a single function in the vgic-v2
emulation. So it's not necessary to store the value in the domain
structure.

This is also saving 8 bytes on a structure which begin to be constrained
(the maximum size of struct domain is 4KB).

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/vgic-v2.c
xen/include/asm-arm/domain.h

index f886724a0c4d8ea69217085fc9798f50912fafad..309d579e398625ceb6dc5943c5984bf1ff697e27 100644 (file)
@@ -548,6 +548,7 @@ static int vgic_v2_vcpu_init(struct vcpu *v)
 static int vgic_v2_domain_init(struct domain *d)
 {
     int i, ret;
+    paddr_t cbase;
 
     /*
      * The hardware domain gets the hardware address.
@@ -556,12 +557,12 @@ static int vgic_v2_domain_init(struct domain *d)
     if ( is_hardware_domain(d) )
     {
         d->arch.vgic.dbase = vgic_v2_hw.dbase;
-        d->arch.vgic.cbase = vgic_v2_hw.cbase;
+        cbase = vgic_v2_hw.cbase;
     }
     else
     {
         d->arch.vgic.dbase = GUEST_GICD_BASE;
-        d->arch.vgic.cbase = GUEST_GICC_BASE;
+        cbase = GUEST_GICC_BASE;
     }
 
     /*
@@ -571,16 +572,16 @@ static int vgic_v2_domain_init(struct domain *d)
      * The second page is always mapped at +4K irrespective of the
      * GIC_64K_STRIDE quirk. The DTB passed to the guest reflects this.
      */
-    ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase), 1,
+    ret = map_mmio_regions(d, paddr_to_pfn(cbase), 1,
                            paddr_to_pfn(vgic_v2_hw.vbase));
     if ( ret )
         return ret;
 
     if ( !platform_has_quirk(PLATFORM_QUIRK_GIC_64K_STRIDE) )
-        ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
+        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
                                1, paddr_to_pfn(vgic_v2_hw.vbase + PAGE_SIZE));
     else
-        ret = map_mmio_regions(d, paddr_to_pfn(d->arch.vgic.cbase + PAGE_SIZE),
+        ret = map_mmio_regions(d, paddr_to_pfn(cbase + PAGE_SIZE),
                                1, paddr_to_pfn(vgic_v2_hw.vbase + SZ_64K));
 
     if ( ret )
index 01859cc073211379391fffc8fb48af34f8cf0bc5..b89727e9f4df2f1c151ccd706f150b9c8ce67d5c 100644 (file)
@@ -102,7 +102,6 @@ struct arch_domain
         struct pending_irq *pending_irqs;
         /* Base address for guest GIC */
         paddr_t dbase; /* Distributor base address */
-        paddr_t cbase; /* CPU base address */
 #ifdef HAS_GICV3
         /* GIC V3 addressing */
         /* List of contiguous occupied by the redistributors */