mbox series

[v7,00/12] PCI devices passthrough on Arm, part 3

Message ID 20230613103159.524763-1-volodymyr_babchuk@epam.com (mailing list archive)
Headers show
Series PCI devices passthrough on Arm, part 3 | expand

Message

Volodymyr Babchuk June 13, 2023, 10:32 a.m. UTC
Hello,

This is another another version of vPCI rework (previous one can be
found at [1]). The biggest change is how vPCI locking is done. This
series uses per-domain vPCI rwlock.

Note that this series does not include my work on reference counting
for PCI devices because this counting does not resolve isses we are
having for vPCI. While it is (maybe) nice to have PCI refcounting, it
does not moves us towards PCI on ARM.


[1] https://lore.kernel.org/all/20220204063459.680961-1-andr2000@gmail.com/

Oleksandr Andrushchenko (12):
  vpci: introduce per-domain lock to protect vpci structure
  vpci: restrict unhandled read/write operations for guests
  vpci: add hooks for PCI device assign/de-assign
  vpci/header: implement guest BAR register handlers
  rangeset: add RANGESETF_no_print flag
  vpci/header: handle p2m range sets per BAR
  vpci/header: program p2m with guest BAR view
  vpci/header: emulate PCI_COMMAND register for guests
  vpci/header: reset the command register when adding devices
  vpci: add initial support for virtual PCI bus topology
  xen/arm: translate virtual PCI bus topology for guests
  xen/arm: account IO handlers for emulated PCI MSI-X

 xen/arch/arm/vpci.c           |  31 ++-
 xen/arch/x86/hvm/vmsi.c       |   7 +
 xen/common/domain.c           |   3 +
 xen/common/rangeset.c         |   5 +-
 xen/drivers/Kconfig           |   4 +
 xen/drivers/passthrough/pci.c |  16 ++
 xen/drivers/vpci/header.c     | 485 ++++++++++++++++++++++++++++------
 xen/drivers/vpci/msi.c        |  29 +-
 xen/drivers/vpci/msix.c       |  55 +++-
 xen/drivers/vpci/vpci.c       | 257 ++++++++++++++++--
 xen/include/xen/pci.h         |   1 +
 xen/include/xen/rangeset.h    |   5 +-
 xen/include/xen/sched.h       |  11 +
 xen/include/xen/vpci.h        |  47 +++-
 14 files changed, 826 insertions(+), 130 deletions(-)

Comments

Stewart Hildebrand June 15, 2023, 2:01 a.m. UTC | #1
On 6/13/23 06:32, Volodymyr Babchuk wrote:
> Hello,
> 
> This is another another version of vPCI rework (previous one can be
> found at [1]). The biggest change is how vPCI locking is done. This
> series uses per-domain vPCI rwlock.
> 
> Note that this series does not include my work on reference counting
> for PCI devices because this counting does not resolve isses we are
> having for vPCI. While it is (maybe) nice to have PCI refcounting, it
> does not moves us towards PCI on ARM.
> 
> 
> [1] https://lore.kernel.org/all/20220204063459.680961-1-andr2000@gmail.com/

Thanks for sending this!

Should this be v8? I see v7 at [2].

I had to rewind my xen.git back to 67c28bfc5245 for this series to apply cleanly (just before ee045f3a4a6d "vpci/header: cope with devices not having vpci allocated").

[2] https://lists.xenproject.org/archives/html/xen-devel/2022-07/msg01127.html
Volodymyr Babchuk June 15, 2023, 9:39 a.m. UTC | #2
Hi Stewart,

Stewart Hildebrand <stewart.hildebrand@amd.com> writes:

> On 6/13/23 06:32, Volodymyr Babchuk wrote:
>> Hello,
>> 
>> This is another another version of vPCI rework (previous one can be
>> found at [1]). The biggest change is how vPCI locking is done. This
>> series uses per-domain vPCI rwlock.
>> 
>> Note that this series does not include my work on reference counting
>> for PCI devices because this counting does not resolve isses we are
>> having for vPCI. While it is (maybe) nice to have PCI refcounting, it
>> does not moves us towards PCI on ARM.
>> 
>> 
>> [1]
>> https://urldefense.com/v3/__https://lore.kernel.org/all/20220204063459.680961-1-andr2000@gmail.com/__;!!GF_29dbcQIUBPA!0BUqPos1zFKUoPwbKLLwKItNgBVPaBgxmH1Y6zXpms2bngrlWrzB-qMNvIaiAy2WSWMa93UrlvRi0ijYP8X4Ymx07GXYPO1W$
>> [lore[.]kernel[.]org]
>
> Thanks for sending this!
>
> Should this be v8? I see v7 at [2].

Oops, my bad. 

> I had to rewind my xen.git back to 67c28bfc5245 for this series to apply cleanly (just before ee045f3a4a6d "vpci/header: cope with devices not having vpci allocated").

I rebased this series onto staging about two weeks ago. Looks like
there was new changes into the PCI code after that.

Should I send a new, real v8 which is rebased onto current staging, or
we'll wait for review for the current set of patches?
Jan Beulich June 15, 2023, 12:16 p.m. UTC | #3
On 15.06.2023 11:39, Volodymyr Babchuk wrote:
> Stewart Hildebrand <stewart.hildebrand@amd.com> writes:
>> On 6/13/23 06:32, Volodymyr Babchuk wrote:
>>> Hello,
>>>
>>> This is another another version of vPCI rework (previous one can be
>>> found at [1]). The biggest change is how vPCI locking is done. This
>>> series uses per-domain vPCI rwlock.
>>>
>>> Note that this series does not include my work on reference counting
>>> for PCI devices because this counting does not resolve isses we are
>>> having for vPCI. While it is (maybe) nice to have PCI refcounting, it
>>> does not moves us towards PCI on ARM.
>>>
>>>
>>> [1]
>>> https://urldefense.com/v3/__https://lore.kernel.org/all/20220204063459.680961-1-andr2000@gmail.com/__;!!GF_29dbcQIUBPA!0BUqPos1zFKUoPwbKLLwKItNgBVPaBgxmH1Y6zXpms2bngrlWrzB-qMNvIaiAy2WSWMa93UrlvRi0ijYP8X4Ymx07GXYPO1W$
>>> [lore[.]kernel[.]org]
>>
>> Thanks for sending this!
>>
>> Should this be v8? I see v7 at [2].
> 
> Oops, my bad. 
> 
>> I had to rewind my xen.git back to 67c28bfc5245 for this series to apply cleanly (just before ee045f3a4a6d "vpci/header: cope with devices not having vpci allocated").
> 
> I rebased this series onto staging about two weeks ago. Looks like
> there was new changes into the PCI code after that.
> 
> Should I send a new, real v8 which is rebased onto current staging, or
> we'll wait for review for the current set of patches?

Please send a version which, at least at the time of posting, actually
applies. Taking into account Stewart's observation on the version
number makes it even more desirable to have a re-post.

Jan
Volodymyr Babchuk June 21, 2023, 10:11 p.m. UTC | #4
Hi Jan,

Jan Beulich <jbeulich@suse.com> writes:

> On 15.06.2023 11:39, Volodymyr Babchuk wrote:
>> Stewart Hildebrand <stewart.hildebrand@amd.com> writes:
>>> On 6/13/23 06:32, Volodymyr Babchuk wrote:
>>>> Hello,
>>>>
>>>> This is another another version of vPCI rework (previous one can be
>>>> found at [1]). The biggest change is how vPCI locking is done. This
>>>> series uses per-domain vPCI rwlock.
>>>>
>>>> Note that this series does not include my work on reference counting
>>>> for PCI devices because this counting does not resolve isses we are
>>>> having for vPCI. While it is (maybe) nice to have PCI refcounting, it
>>>> does not moves us towards PCI on ARM.
>>>>
>>>>
>>>> [1]
>>>> https://urldefense.com/v3/__https://lore.kernel.org/all/20220204063459.680961-1-andr2000@gmail.com/__;!!GF_29dbcQIUBPA!0BUqPos1zFKUoPwbKLLwKItNgBVPaBgxmH1Y6zXpms2bngrlWrzB-qMNvIaiAy2WSWMa93UrlvRi0ijYP8X4Ymx07GXYPO1W$
>>>> [lore[.]kernel[.]org]
>>>
>>> Thanks for sending this!
>>>
>>> Should this be v8? I see v7 at [2].
>> 
>> Oops, my bad. 
>> 
>>> I had to rewind my xen.git back to 67c28bfc5245 for this series to apply cleanly (just before ee045f3a4a6d "vpci/header: cope with devices not having vpci allocated").
>> 
>> I rebased this series onto staging about two weeks ago. Looks like
>> there was new changes into the PCI code after that.
>> 
>> Should I send a new, real v8 which is rebased onto current staging, or
>> we'll wait for review for the current set of patches?
>
> Please send a version which, at least at the time of posting, actually
> applies. Taking into account Stewart's observation on the version
> number makes it even more desirable to have a re-post.

I am terribly sorry about version mishmash. But Roger made valuable
comments for the first patch already.

So I'll post the updated version with an additional lock and other
fixes. Should it be v8 or v9 in that case?
Jan Beulich June 22, 2023, 7:48 a.m. UTC | #5
On 22.06.2023 00:11, Volodymyr Babchuk wrote:
> Jan Beulich <jbeulich@suse.com> writes:
>> On 15.06.2023 11:39, Volodymyr Babchuk wrote:
>>> Stewart Hildebrand <stewart.hildebrand@amd.com> writes:
>>>> On 6/13/23 06:32, Volodymyr Babchuk wrote:
>>>>> Hello,
>>>>>
>>>>> This is another another version of vPCI rework (previous one can be
>>>>> found at [1]). The biggest change is how vPCI locking is done. This
>>>>> series uses per-domain vPCI rwlock.
>>>>>
>>>>> Note that this series does not include my work on reference counting
>>>>> for PCI devices because this counting does not resolve isses we are
>>>>> having for vPCI. While it is (maybe) nice to have PCI refcounting, it
>>>>> does not moves us towards PCI on ARM.
>>>>>
>>>>>
>>>>> [1]
>>>>> https://urldefense.com/v3/__https://lore.kernel.org/all/20220204063459.680961-1-andr2000@gmail.com/__;!!GF_29dbcQIUBPA!0BUqPos1zFKUoPwbKLLwKItNgBVPaBgxmH1Y6zXpms2bngrlWrzB-qMNvIaiAy2WSWMa93UrlvRi0ijYP8X4Ymx07GXYPO1W$
>>>>> [lore[.]kernel[.]org]
>>>>
>>>> Thanks for sending this!
>>>>
>>>> Should this be v8? I see v7 at [2].
>>>
>>> Oops, my bad. 
>>>
>>>> I had to rewind my xen.git back to 67c28bfc5245 for this series to apply cleanly (just before ee045f3a4a6d "vpci/header: cope with devices not having vpci allocated").
>>>
>>> I rebased this series onto staging about two weeks ago. Looks like
>>> there was new changes into the PCI code after that.
>>>
>>> Should I send a new, real v8 which is rebased onto current staging, or
>>> we'll wait for review for the current set of patches?
>>
>> Please send a version which, at least at the time of posting, actually
>> applies. Taking into account Stewart's observation on the version
>> number makes it even more desirable to have a re-post.
> 
> I am terribly sorry about version mishmash. But Roger made valuable
> comments for the first patch already.
> 
> So I'll post the updated version with an additional lock and other
> fixes. Should it be v8 or v9 in that case?

I don't think that matters, unless you have v8 changelog entries already
which were posted with the 2nd v7. Otherwise all that's relevant is that
the version be clearly distinguishable from earlier ones.

Jan