From 810a50db69703f715d199d6b3a5f08193155d48b Mon Sep 17 00:00:00 2001 From: Julien Grall Date: Tue, 29 Sep 2015 17:21:38 +0100 Subject: [PATCH] xen/arm: vgic-v2: Drop cbase from arch_domain 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 Acked-by: Ian Campbell --- xen/arch/arm/vgic-v2.c | 11 ++++++----- xen/include/asm-arm/domain.h | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/vgic-v2.c b/xen/arch/arm/vgic-v2.c index f886724a0c..309d579e39 100644 --- a/xen/arch/arm/vgic-v2.c +++ b/xen/arch/arm/vgic-v2.c @@ -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 ) diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h index 01859cc073..b89727e9f4 100644 --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -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 */ -- 2.30.2