linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: "boris.ostrovsky@oracle.com" <boris.ostrovsky@oracle.com>,
	"julien@xen.org" <julien@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 1/2] xen-pciback: prepare for the split for stub and PV
Date: Tue, 28 Sep 2021 09:20:14 +0200	[thread overview]
Message-ID: <2b4dc684-a00f-1a08-92b0-7b0b614aeb24@suse.com> (raw)
In-Reply-To: <51e38ddc-49df-2e70-d094-71d045297ab1@epam.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 5113 bytes --]

On 28.09.21 09:17, Oleksandr Andrushchenko wrote:
> 
> On 28.09.21 09:59, Juergen Gross wrote:
>> On 28.09.21 08:56, Oleksandr Andrushchenko wrote:
>>>
>>> On 28.09.21 09:42, Jan Beulich wrote:
>>>> On 28.09.2021 06:18, Stefano Stabellini wrote:
>>>>> On Mon, 27 Sep 2021, Juergen Gross wrote:
>>>>>> On 27.09.21 09:35, Oleksandr Andrushchenko wrote:
>>>>>>> On 27.09.21 10:26, Jan Beulich wrote:
>>>>>>>> On 27.09.2021 08:58, Oleksandr Andrushchenko wrote:
>>>>>>>>> From: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
>>>>>>>>>
>>>>>>>>> Currently PCI backend implements multiple functionalities at a time.
>>>>>>>>> To name a few:
>>>>>>>>> 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.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Oleksandr Andrushchenko
>>>>>>>>> <oleksandr_andrushchenko@epam.com>
>>>>>>>>>
>>>>>>>>> ---
>>>>>>>>> Changes since v3:
>>>>>>>>> - Move CONFIG_XEN_PCIDEV_STUB to the second patch
>>>>>>>> I'm afraid this wasn't fully done:
>>>>>>>>
>>>>>>>>> --- a/drivers/xen/xen-pciback/Makefile
>>>>>>>>> +++ b/drivers/xen/xen-pciback/Makefile
>>>>>>>>> @@ -1,5 +1,6 @@
>>>>>>>>>       # SPDX-License-Identifier: GPL-2.0
>>>>>>>>>       obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o
>>>>>>>>> +obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o
>>>>>>>> While benign when added here, this addition still doesn't seem to
>>>>>>>> belong here.
>>>>>>> My bad. So, it seems without CONFIG_XEN_PCIDEV_STUB the change seems
>>>>>>>
>>>>>>> to be non-functional. With CONFIG_XEN_PCIDEV_STUB we fail to build on 32-bit
>>>>>>>
>>>>>>> architectures...
>>>>>>>
>>>>>>> What would be the preference here? Stefano suggested that we still define
>>>>>>>
>>>>>>> CONFIG_XEN_PCIDEV_STUB, but in disabled state, e.g. we add tristate to it
>>>>>>>
>>>>>>> in the second patch
>>>>>>>
>>>>>>> Another option is just to squash the two patches.
>>>>>> Squashing would be fine for me.
>>>>>     It is fine for me to squash the two patches.
>>>>>
>>>>> But in any case, wouldn't it be better to modify that specific change to:
>>>>>
>>>>> diff --git a/drivers/xen/xen-pciback/Makefile b/drivers/xen/xen-pciback/Makefile
>>>>> index e2cb376444a6..e23c758b85ae 100644
>>>>> --- a/drivers/xen/xen-pciback/Makefile
>>>>> +++ b/drivers/xen/xen-pciback/Makefile
>>>>> @@ -1,6 +1,5 @@
>>>>>     # SPDX-License-Identifier: GPL-2.0
>>>>> -obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o
>>>>> -obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o
>>>>> +obj-$(CONFIG_XEN_PCI_STUB) += xen-pciback.o
>>>> But that wouldn't allow the driver to be a module anymore, would it?
>>>
>>> Exactly. I forgot that when playing with module/built-in I was not able
>>>
>>> to control that anymore because CONFIG_XEN_PCI_STUB will always be
>>>
>>> in "y" state, thus even if you have CONFIG_XEN_PCIDEV_BACKEND=m
>>>
>>> you won't be able to build it as module. So, I will probably put a comment
>>>
>>> about that in the Makefile explaining the need for
>>>
>>> obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o
>>> obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o
>>
>> In case the real split between both parts of xen-pciback is done this
>> will be needed anyway.
> 
> Yes, it will
> 
> So, I'll put a comment in the Makefile:
> 
> # N.B. This cannot be expressed with a single line using CONFIG_XEN_PCI_STUB
> 
> # as it always remains in "y" state, thus preventing the driver to be built as
> 
> # a module.
> 
> obj-$(CONFIG_XEN_PCIDEV_BACKEND) += xen-pciback.o
> obj-$(CONFIG_XEN_PCIDEV_STUB) += xen-pciback.o
> 
> Will this be ok or needs some re-wording?

I'd add that CONFIG_XEN_PCIDEV_BACKEND and CONFIG_XEN_PCIDEV_STUB are
mutually exclusive.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2021-09-28  7:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27  6:58 [PATCH v4 1/2] xen-pciback: prepare for the split for stub and PV Oleksandr Andrushchenko
2021-09-27  6:58 ` [PATCH v4 2/2] xen-pciback: allow compiling on other archs than x86 Oleksandr Andrushchenko
2021-09-27  7:26 ` [PATCH v4 1/2] xen-pciback: prepare for the split for stub and PV Jan Beulich
2021-09-27  7:35   ` Oleksandr Andrushchenko
2021-09-27  7:48     ` Jan Beulich
2021-09-27  7:54     ` Juergen Gross
2021-09-28  4:18       ` Stefano Stabellini
2021-09-28  4:53         ` Oleksandr Andrushchenko
2021-09-28  6:42         ` Jan Beulich
2021-09-28  6:56           ` Oleksandr Andrushchenko
2021-09-28  6:59             ` Juergen Gross
2021-09-28  7:17               ` Oleksandr Andrushchenko
2021-09-28  7:20                 ` Juergen Gross [this message]
2021-09-28  7:24                   ` Oleksandr Andrushchenko
2021-09-28  7:26                     ` Juergen Gross
2021-09-28  7:20                 ` Stefano Stabellini
2021-09-28  7:24                   ` Oleksandr Andrushchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2b4dc684-a00f-1a08-92b0-7b0b614aeb24@suse.com \
    --to=jgross@suse.com \
    --cc=Oleksandr_Andrushchenko@epam.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).