From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH 5/8] xen/arm: vgic-v2: Drop cbase from arch_domain Date: Tue, 22 Sep 2015 18:47:39 +0100 Message-ID: <1442944062-4324-6-git-send-email-julien.grall@citrix.com> References: <1442944062-4324-1-git-send-email-julien.grall@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZeRgo-0007I1-3Z for xen-devel@lists.xenproject.org; Tue, 22 Sep 2015 17:49:14 +0000 In-Reply-To: <1442944062-4324-1-git-send-email-julien.grall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Julien Grall , stefano.stabellini@citrix.com, ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org 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 --- 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 fa71598..ecd6bf3 100644 --- a/xen/arch/arm/vgic-v2.c +++ b/xen/arch/arm/vgic-v2.c @@ -546,6 +546,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. @@ -554,12 +555,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; } /* @@ -569,16 +570,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 c3f5a95..ba430a7 100644 --- a/xen/include/asm-arm/domain.h +++ b/xen/include/asm-arm/domain.h @@ -101,7 +101,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.1.4