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

Re: [PATCH] xen-pciback: allow compiling on other archs than x86


  • To: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Tue, 16 Nov 2021 10:45:43 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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=Xd9jVMIXqutzTSzByHQ4Gz4jQ298DCDpvO0GuYHH8Fk=; b=Jdf+QczamQsf6I6czfGvdhKxnC0jXtH1EX7wqjHkgyCLejz/cyOyRjNW/Qll0QlAGiclSb/5p5fsyW5Tad7H3VNfn4cBqsSjgHUan7LxqUW33nYHcU4ngKh76eIBFpfYWig07CUSm7tuv2BKA2quWskSatGmfdq8XM2eI+IXMP7JDE4LiCTywFpSdhV3gSzvVC5VXt0VUo6w423rOJ82glBI0huiwpz3DCPM2jqlqjQkkvVoZrFwip+jKinsUdMvNOZkZZLJvqsCPjV/Dvp1EZB89so1Oh13Hm3e0JMHeA9jhEyij4iAZ6j8ZX1goJwUG2vUrbJnKnHyGuiHmomBkA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c3/zrPwv6eA+fVnjpwOHXmQBd0aKFu4RvmwopKPXYQiZXbVk/HoTZP9tx6YlVp1Wi9VKsCDpfP+rrPs66jWDI8ggtnREb5M4k0DOA7eoz03y/s8Qgq4zps+gAT7dI6RqGARHv0dtgzWkjblDZeW11zFgvFL31RCVcLWzIIKlHrUL9HJ5BCzo4WzQ+gcbAgOCzqFb8yIyBWX+WJuheMyuLXTjvI7WGQD3jViOHtAmCpmM2ulweHhJ9Did2w4ka5atELXDt6162aH1nf9RIwm5PrDWR2bppr6aES5eFYLrcEdpjuKnnstPI0jauLiOatYer3zBKFa6sX2kPVUcUrVxqA==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Anastasiia Lukianenko <Anastasiia_Lukianenko@xxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Tue, 16 Nov 2021 10:46:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHXy8L4matlcvklF0O8ro+XGa1E1qwGA0aAgAATaYA=
  • Thread-topic: [PATCH] xen-pciback: allow compiling on other archs than x86

Hi, Geert!

On 16.11.21 11:36, Geert Uytterhoeven wrote:
> Hi Oleksandr,
>
> On Thu, Oct 28, 2021 at 8:15 AM Oleksandr Andrushchenko
> <andr2000@xxxxxxxxx> wrote:
>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>>
>> Xen-pciback driver was designed to be built for x86 only. But it
>> can also be used by other architectures, e.g. Arm.
>>
>> Currently PCI backend implements multiple functionalities at a time,
>> such as:
>> 1. It is used as a database for assignable PCI devices, e.g. xl
>>     pci-assignable-{add|remove|list} manipulates that list. So, whenever
>>     the toolstack needs to know which PCI devices can be passed through
>>     it reads that from the relevant sysfs entries of the pciback.
>> 2. It is used to hold the unbound PCI devices list, e.g. when passing
>>     through a PCI device it needs to be unbound from the relevant device
>>     driver and bound to pciback (strictly speaking it is not required
>>     that the device is bound to pciback, but pciback is again used as a
>>     database of the passed through PCI devices, so we can re-bind the
>>     devices back to their original drivers when guest domain shuts down)
>> 3. Device reset for the devices being passed through
>> 4. Para-virtualised use-cases support
>>
>> The para-virtualised part of the driver is not always needed as some
>> architectures, e.g. Arm or x86 PVH Dom0, are not using backend-frontend
>> model for PCI device passthrough.
>>
>> For such use-cases make the very first step in splitting the
>> xen-pciback driver into two parts: Xen PCI stub and PCI PV backend
>> drivers.
>>
>> For that add new configuration options CONFIG_XEN_PCI_STUB and
>> CONFIG_XEN_PCIDEV_STUB, so the driver can be limited in its
>> functionality, e.g. no support for para-virtualised scenario.
>> x86 platform will continue using CONFIG_XEN_PCIDEV_BACKEND for the
>> fully featured backend driver.
>>
>> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx>
>> Signed-off-by: Anastasiia Lukianenko <anastasiia_lukianenko@xxxxxxxx>
>> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
>> Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
> Thanks for your patch, which is now commit a67efff28832a597
> ("xen-pciback: allow compiling on other archs than x86")
> in v5.16-rc1.
>
>> --- a/drivers/xen/Kconfig
>> +++ b/drivers/xen/Kconfig
>> @@ -181,10 +181,34 @@ config SWIOTLB_XEN
>>          select DMA_OPS
>>          select SWIOTLB
>>
>> +config XEN_PCI_STUB
>> +       bool
>> +
>> +config XEN_PCIDEV_STUB
>> +       tristate "Xen PCI-device stub driver"
>> +       depends on PCI && !X86 && XEN
>> +       depends on XEN_BACKEND
>> +       select XEN_PCI_STUB
>> +       default m
> Please note that this means "default y" if CONFIG_MODULES=n.
> Perhaps this should be "default m if MODULES" instead?
I don't really have strong opinion on this and will let Xen maintainers
speak: @Boris, @Juergen what's your preference here?
>
>> +       help
>> +         The PCI device stub driver provides limited version of the PCI
>> +         device backend driver without para-virtualized support for guests.
>> +         If you select this to be a module, you will need to make sure no
>> +         other driver has bound to the device(s) you want to make visible to
>> +         other guests.
>> +
>> +         The "hide" parameter (only applicable if backend driver is compiled
>> +         into the kernel) allows you to bind the PCI devices to this module
>> +         from the default device drivers. The argument is the list of PCI 
>> BDFs:
>> +         xen-pciback.hide=(03:00.0)(04:00.0)
>> +
>> +         If in doubt, say m.
>> +
>>   config XEN_PCIDEV_BACKEND
>>          tristate "Xen PCI-device backend driver"
>>          depends on PCI && X86 && XEN
>>          depends on XEN_BACKEND
>> +       select XEN_PCI_STUB
>>          default m
>>          help
>>            The PCI device backend driver allows the kernel to export 
>> arbitrary
> Gr{oetje,eeting}s,
>
>                          Geert
Thank you,
Oleksandr
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> geert@xxxxxxxxxxxxxx
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
>                                  -- Linus Torvalds

 


Rackspace

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