From: Chen Baozi Subject: [PATCH V2 6/8] tools/libxl: Make DT node of GICv3 according to max_vcpus Date: Sat, 23 May 2015 21:52:31 +0800 Message-ID: <1432389153-28207-7-git-send-email-cbz@baozis.org> References: <1432389153-28207-1-git-send-email-cbz@baozis.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Yw9rm-0007ZH-60 for xen-devel@lists.xenproject.org; Sat, 23 May 2015 13:53:30 +0000 In-Reply-To: <1432389153-28207-1-git-send-email-cbz@baozis.org> 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 , Wei Liu , Chen Baozi , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org From: Chen Baozi Since the size of GICR is determined by the number of CPU cores, add 'nr_cpus' parameter when creating its DT node and set gicr0_size dynamically. Signed-off-by: Chen Baozi --- tools/libxl/libxl_arm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c index c5088c4..75d2aed 100644 --- a/tools/libxl/libxl_arm.c +++ b/tools/libxl/libxl_arm.c @@ -407,13 +407,13 @@ static int make_gicv2_node(libxl__gc *gc, void *fdt, return 0; } -static int make_gicv3_node(libxl__gc *gc, void *fdt) +static int make_gicv3_node(libxl__gc *gc, void *fdt, const int nr_cpus) { int res; const uint64_t gicd_base = GUEST_GICV3_GICD_BASE; const uint64_t gicd_size = GUEST_GICV3_GICD_SIZE; const uint64_t gicr0_base = GUEST_GICV3_GICR0_BASE; - const uint64_t gicr0_size = GUEST_GICV3_GICR0_SIZE; + const uint64_t gicr0_size = GUEST_GICV3_RDIST_STRIDE * nr_cpus; const char *name = GCSPRINTF("interrupt-controller@%"PRIx64, gicd_base); res = fdt_begin_node(fdt, name); @@ -640,7 +640,7 @@ next_resize: GUEST_GICC_BASE, GUEST_GICC_SIZE) ); break; case XEN_DOMCTL_CONFIG_GIC_V3: - FDT( make_gicv3_node(gc, fdt) ); + FDT( make_gicv3_node(gc, fdt, info->max_vcpus) ); break; default: LOG(ERROR, "Unknown GIC version %s", -- 2.1.4