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

Re: [PATCH v6 2/3] xen/arm: Enable the existing x86 virtual PCI support for ARM.


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 15 Oct 2021 15:47:27 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aV5AwARp94NX6IihHSUjnTV9/aEWOTrRgdUCmtrUkHE=; b=d+DGmKkehXOE0NdN0qKbuAtSUjwsbS1l1oLF3fK1iyaVffO3ax/vDqYM1gYRzcQfBdMJNXcbyxgFpmY3YzfnNqsaCDlP6ITR1HdpkSCnCF5/PgLT88XAEJH8PR5ey/Q32hM7hVBiShUFmpEoC6x/vWa7HjU0xZsv2sZAHR9iNQLUb2HjNcuoye1r6g7Qco0OUJKmciaZMdGON+WfceHODZ49WEWKpaYCg9aMaZoHA2iAyt8q+rQLNaxEkryE0ntdosiT+NbG6Z0WsSk2twr6Ly0cSaTxAOiTOj8KcGr20X0fWZMjBLbXG2+JNbbY8Oh0ChdjUD7GTcs/tIB+SDs+Jg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HXaT/VwYAR1RVNe+0MbAb5smi3GMw1VI5rYI7DhREvpvRVVNcEIfhswQLhFgyN198bm7CPEBRdW41FOMWtBvBDEQVTDBLKvcY7pItCqilqdK5h3rTxRy2mFtkHWaRP628fG6YSu+PP029gMGqYk4vaOBJnsKoTxjjfCvzsCiAmnyz/GdM/rr3JtRhvbZAAtv0YTJfpSpFCL/RGEzMYAUEZNNj5Aa2rzEG92HsjCjOblSXXPQZDhVSSLOex2ollWQ0c9VaoiIz5bEKW2PN/NdcSETLUFcGDdzfdwHgUinGnGnbi8OhI+GgL83++SwG02+epN9BnPJN2ghaFADxiB5hQ==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, "Rahul Singh" <Rahul.Singh@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Paul Durrant <paul@xxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Fri, 15 Oct 2021 13:47:51 +0000
  • Ironport-data: A9a23:WRdGZq/ZOjepbniI6j+1DrUDkHiTJUtcMsCJ2f8bNWPcYEJGY0x3m msfDW3UPfiIazamc9tyPYnjoUpT75bSn9ZhHgNspSA8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si9AttENlFEkvU2ybuOU5NXsZ2YhGGeIdA970Ug6wrZg39Yx6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPhfk OwWsZOwYz0UHbLpxeQiCkgFDwdxaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguw5K8bm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OwcSeX36n6LRfHCCvteBZFMdx1LCYng/ CrCdJ0+Kcp9mgcP1zhMfkFpuP5Ilrim4Z8s1RDYPDO9v/dtL88rlGxmQqF8uIooXgtNT8bgsJ+ LnogGEhPCHdhrU8GzOV591FQp/8wkEecASnz2wyHGmsvlF/Zoa4dLm0w3M1xDe5DkeEkPvJ0zW LAg12fsnOkoKlE0/USs9ewp9Pa7T99XjEy1B5286wPUavw2/ku4sTeqaciAPTPxdz+d0W0AJQy sMizc8aVr6IqrRNRSQUEl44F
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Oct 15, 2021 at 10:48:41AM +0000, Bertrand Marquis wrote:
> Hi Jan,
> 
> > On 15 Oct 2021, at 11:41, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> > 
> > On 15.10.2021 12:33, Bertrand Marquis wrote:
> >>> On 15 Oct 2021, at 11:24, Jan Beulich <jbeulich@xxxxxxxx> wrote:
> >>> On 15.10.2021 11:52, Bertrand Marquis wrote:
> >>>>> On 15 Oct 2021, at 09:32, Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
> >>>>> On Thu, Oct 14, 2021 at 03:49:50PM +0100, Bertrand Marquis wrote:
> >>>>>> @@ -752,6 +752,19 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn,
> >>>>>> 
> >>>>>>   check_pdev(pdev);
> >>>>>> 
> >>>>>> +#ifdef CONFIG_ARM
> >>>>>> +    /*
> >>>>>> +     * On ARM PCI devices discovery will be done by Dom0. Add vpci 
> >>>>>> handler when
> >>>>>> +     * Dom0 inform XEN to add the PCI devices in XEN.
> >>>>>> +     */
> >>>>>> +    ret = vpci_add_handlers(pdev);
> >>>>>> +    if ( ret )
> >>>>>> +    {
> >>>>>> +        printk(XENLOG_ERR "Setup of vPCI failed: %d\n", ret);
> >>>>>> +        goto out;
> >>>>>> +    }
> >>>>>> +#endif
> >>>>> 
> >>>>> I think vpci_add_handlers should be called after checking that
> >>>>> pdev->domain is != NULL, so I would move this chunk a bit below.
> >>>> 
> >>>> On arm this would prevent the dom0less use case or to have the PCI
> >>>> bus enumerated from an other domain.
> >>>> @oleksandr: can you comment on this one, you might have a better
> >>>> answer than me on this ?
> >>> 
> >>> Well, without Xen doing the enumeration, some other entity would need
> >>> to do so, including the reporting to Xen. Obviously without a Dom0 it
> >>> would be ambiguous which domain to assign the device to; perhaps it
> >>> should be the caller in this case? That would make that caller domain
> >>> a pseudo-hwdom though, as far as PCI is concerned, which may not be
> >>> desirable according to my (limited) understanding of dom0less.
> >> 
> >> This is not really related to this patch but the plan is the following:
> >> - enumeration would have to be done by the firmware or boot loader before
> >> - xen will have some code to detect PCI devices
> >> - dom0less can be used to assign PCI devices to guest
> >> 
> >> Anyway does not change the fact that this must be called when domain is
> >> not NULL and I will fix that.
> > 
> > Since we now all seem to agree that the NULL would have been a problem,
> > may I ask in how far any of this has actually been tested?
> 
> With the whole serie currently on gitlab we have extensively tested passing
> through PCI devices on Arm in several configuration (number of device, MSI,
> MSI-X) and check that PCI was still functional on x86.
> 
> With the patches pushed to Xen right now it was checked that:
> - xen compiles properly on arm32, arm64 and x86
> - xen compiles properly with VPCI activated (using a patch) on arm32 and arm64
> - xen on x86 is functionnal (using basic test on QEMU)
> - xen on arm64 is functionnal (with some extensive tests on different targets)

I thinks it's unlikely, but since I haven't checked myself, could you
see if the vpci user-space test harness (tools/tests/vpci) still
builds and functions properly?

Thanks, Roger.



 


Rackspace

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