From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 08/15] xen/arm: vgic-v3: Emulate correctly the re-distributor Date: Tue, 03 Feb 2015 13:09:31 +0000 Message-ID: <54D0C88B.1060800@linaro.org> References: <1422555950-31821-1-git-send-email-julien.grall@linaro.org> <1422555950-31821-9-git-send-email-julien.grall@linaro.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 1YIdEv-0004ti-Se for xen-devel@lists.xenproject.org; Tue, 03 Feb 2015 13:10:01 +0000 Received: by mail-wg0-f42.google.com with SMTP id x13so44611592wgg.1 for ; Tue, 03 Feb 2015 05:10:00 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Vijay Kilari Cc: xen-devel@lists.xenproject.org, Vijaya Kumar K , Stefano Stabellini , Ian Campbell , Tim Deegan List-Id: xen-devel@lists.xenproject.org Hello Vijay, On 03/02/15 06:47, Vijay Kilari wrote: > On Thu, Jan 29, 2015 at 11:55 PM, Julien Grall wrote: >> @@ -909,8 +911,15 @@ static int gicv_v3_init(struct domain *d) >> >> for ( i = 0; i < gicv3.rdist_count; i++ ) >> { >> + paddr_t size = gicv3.rdist_regions[i].size; >> + >> d->arch.vgic.rdist_regions[i].base = gicv3.rdist_regions[i].base; >> - d->arch.vgic.rdist_regions[i].size = gicv3.rdist_regions[i].size; >> + d->arch.vgic.rdist_regions[i].size = size; >> + >> + /* Set the first CPU handled by this region */ >> + d->arch.vgic.rdist_regions[i].first_cpu = first_cpu; >> + >> + first_cpu += size / d->arch.vgic.rdist_stride; > > Here you rely on size, The size might not be always map to > number of cpus in that region. We should rely on GICR_TYPER_LAST > to know the last cpu in the region. This is the emulated GIC for DOM0... we don't have to expose the same re-distributors layout as the hardware. By same layout I mean, the base address of the redistributor for virtual CPUn is equal to base address of the re-distributor for physical CPUn. If your DOM0 rely on having exactly the same layout, that means that your kernel is clearly buggy... Regards, -- Julien Grall