[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: Luca Fancellu <luca.fancellu@xxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 15 Oct 2021 16:32:08 +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=o+H1+SA3XGSvjOPHbiJJ1jibJht7HXe+gh1tDK4mLA4=; b=X2W1tpu6FF8OclRe8I813VY4BXpsYRZPJr3OJnK4pE2P7m1It+nIlQVb2Be2iBdyFG8jV9InkZaEUQGxaxUpMZ9vmbu7TdFyzobZp79ANIBBPoNpwBbevywMdb8jGiBXLvxj57m+xFWxriVp2iKYF72hjkI/UeYZ2z+oObrXH4gkqq+rnPyJ8VBOGPvMsvnC19gPQwvangdq1hn0CqG0qhyiCdrprIZ7PoE/LxlHpewSNoygylN8tcjBW0CUu/KzKh/kypFT1ppSQ1qZ6PcRVzogMbDez1vavXnsqNib17E+ZTwYgGtnCdZdLcatvdDImuetVqRf/v3UmWUEC7iYQA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DALIi+Prq9V4SwTYINtw3zhnn/Ra12OWT6qLCvSGNYRJixiWXxIrmIOeJBsnoae3/liNnrSRK1O8kGgFuesrYX3TmO/soRyHYtojXQG8UqDa+2P3wD4/tNan2EaBYFX44VZFEfgqSG0I20u3h+H5ql1cXiO2KNvaYYOvrzw8DV4LL2ktYFl4HCHVpXrjhoaba3KuXklbXVHaekJ7C1Dk4iAxHj9eCxXpVtS6pjmlyLGStlDlS+L8d0mPA8cuYc9Zm3t6sHcc4AaUR8hJJuFsNCbBKO6I2lA+v+3hpk9231XrMSr4N6kSfIup4jJoC3WStfGITHcJJJe/rVhnupc2Mg==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, 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 14:32:56 +0000
  • Ironport-data: A9a23:XuSUHqg3uRtzKlcw6siNuVT9X161SBYKZh0ujC45NGQN5FlHY01je htvWmyFaPbcNDf2KY92OYq3oExUuZ7Qzd8xGgRrrH1mRC0b9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oAMKRCQ7InQLlbGILes1htZGEk0FU/NtTo5w7Rg29Yx3IDga++wk YiaT/P3aQfNNwFcagr424rbwP+4lK2v0N+wlgVWicFj5DcypVFMZH4sDfjZw0/DaptVBoaHq 9Prl9lVyI97EyAFUbtJmp6jGqEDryW70QKm0hK6UID66vROS7BbPg/W+5PwZG8O4whlkeydx /0KpbjvR1kEHJbvnfYMbxpxDSZ7HoFZreqvzXiX6aR/zmXDenrohf5vEFs3LcsT/eMf7WNmr KJCbmpXN1ba2rzwkOnTpupE36zP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nnWeC6TspYti0NC5DHScDioYJYDAMvaPFf+cb9c8KxbsigN96AZm UJobM4In5qY0TQ507FACX/LraQd6LgWbg4rtwL9wduMIVQh7pzKoTosE2qljPlDLUzwHJDw2vI bvodQWXX2+naHFi5CRh4r1s1Ou4h7CCVK/ZUMsEN2+J6Flz8V8zQZqw7YZown7s6iz7043YICG ZDCe3HaN9nn5Lh4o9aAA71dLxZy1qVOywsObcxflotu4djHi7FP+Ea9Ns3TYFLy6NwQcunSd70 iQhyd7o/spbytDcs3b0znAdA
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Oct 15, 2021 at 03:00:21PM +0100, Luca Fancellu wrote:
> 
> 
> > On 15 Oct 2021, at 14:47, Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
> > 
> > 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?
> 
> Hi Roger,
> 
> Bertrand is going to send the v7, however I’m keen to do this test but 
> unfortunately
> I’ve never used it before and I don’t have an x86 environment, do you have any
> resource that I can read or some guidance?

Oh, you just need to build it (make) and then run it (make run). If
it returns success everything is fine.

Regards, Roger.



 


Rackspace

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