[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 09/12] xen/arm: if is_domain_direct_mapped use native addresses for GICv3


  • To: Julien Grall <julien@xxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
  • Date: Fri, 8 May 2020 17:06:50 -0700 (PDT)
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=epam.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZH0sWIKra/opr9d1Bhi9Dt35s70uZNG4dRQKOY59tIA=; b=QmX+03nsLzEHP8NDNeQDdbhzkxYhWjZ8zeBDLtmjYSjigs67FWKaYcIyx/KVMHEn59NZVj8NEmyp8OtQB0e/0fU2be0oTJFR0R2CphSeZlA7uKXZLWOjASnZqtaIOtEGkKSMzpFU6lLkoNaaHSA0lDXRvUPUa/QjDEWePwzuNsaY0ewYuKvlwGKHCqM9dhbCkhX7LKyflzS/tq9z3Cbi91fkdGTRpaemkg4y05cRQjcKBSR20242sNCfVVivh9jNEeR57r3ivQgmcdGlMb9RjAxYsZ4xDZCVP0+f/8uFcsQF2DWKzaIT97sU4yo8Uf0SfQroFdVnU9hX//egYoIX2w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zme4ZBlaCjpSqGiNjvCVs7dyL0ePyKo3wqnZxDJwUnAcK3pc1j97k/Jx/owzGXcl20Y/LsNgoHCBPogfOhsjXVDyZou/B3LElhmOPnpSq+yYeqok85syuWPFHB+WM+Tbf7GAH1dMhxwtZRxJjwSC/M2O12nAklK0h26914itUtd9agMM4TcdC73CEqBscD+05Sarac0CY1NiyP3F9JJB39IsRdU/4dFVuTXmJ/245AFHWUNRwN0XCgh8eNyvTj6MfiBJS2BgkUbyPxc/qkJfzWw0lNlGNY1ho4BTHYH2o21Z9HGFIb4JIBBylJM0OWxw2zZMgJcZHshtgSEpvfvnuQ==
  • Authentication-results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; epam.com; dkim=none (message not signed) header.d=none;epam.com; dmarc=bestguesspass action=none header.from=xilinx.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr_Babchuk@xxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
  • Delivery-date: Sat, 09 May 2020 00:07:04 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, 1 May 2020, Julien Grall wrote:
> Hi Stefano,
> 
> On 01/05/2020 02:31, Stefano Stabellini wrote:
> > On Wed, 15 Apr 2020, Julien Grall wrote:
> > > > diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
> > > > index 4e60ba15cc..4cf430f865 100644
> > > > --- a/xen/arch/arm/vgic-v3.c
> > > > +++ b/xen/arch/arm/vgic-v3.c
> > > > @@ -1677,13 +1677,25 @@ static int vgic_v3_domain_init(struct domain *d)
> > > 
> > > 
> > > I think you also want to modify vgic_v3_max_rdist_count().
> > 
> > I don't think so: domUs even direct-mapped still only get 1 rdist
> > region. This patch is not changing the layout of the domU gic, it is
> > only finding a "hole" in the physical address space to make sure there
> > are no conflicts (or at least minimize the chance of conflicts.)
> 
> How do you know the "hole" is big enough?
> 
> > 
> > > >         * Domain 0 gets the hardware address.
> > > >         * Guests get the virtual platform layout.
> > > 
> > > This comment needs to be updated.
> > 
> > Yep, I'll do
> > 
> > 
> > > >         */
> > > > -    if ( is_hardware_domain(d) )
> > > > +    if ( is_domain_direct_mapped(d) )
> > > >        {
> > > >            unsigned int first_cpu = 0;
> > > > +        unsigned int nr_rdist_regions;
> > > >              d->arch.vgic.dbase = vgic_v3_hw.dbase;
> > > >    -        for ( i = 0; i < vgic_v3_hw.nr_rdist_regions; i++ )
> > > > +        if ( is_hardware_domain(d) )
> > > > +        {
> > > > +            nr_rdist_regions = vgic_v3_hw.nr_rdist_regions;
> > > > +            d->arch.vgic.intid_bits = vgic_v3_hw.intid_bits;
> > > > +        }
> > > > +        else
> > > > +        {
> > > > +            nr_rdist_regions = 1;
> > > 
> > > What does promise your the rdist region will be big enough to cater all
> > > the
> > > re-distributors for your domain?
> > 
> > Good point. I'll add an explicit check for that with at least a warning.
> > I don't think we want to return error because the configuration it is
> > still likely to work.
> 
> No it is not going to work. Imagine you have have a guest with 3 vCPUs but the
> first re-distributor region can only cater 2 re-distributor. How is this going
> to be fine to continue?
> 
> For dom0, we are re-using the same hole but possibly not all of them. Why
> can't we do that for domU?

I implemented what you suggested



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.