From: Jan Beulich <jbeulich@suse.com>
To: Mykyta Poturai <Mykyta_Poturai@epam.com>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>,
"Daniel P. Smith" <dpsmith@apertussolutions.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"Stewart Hildebrand" <stewart.hildebrand@amd.com>
Subject: Re: [PATCH v3 5/7] vpci: add SR-IOV support for PVH Dom0
Date: Wed, 6 May 2026 13:54:09 +0200 [thread overview]
Message-ID: <e5844c28-aa68-4bf6-8287-a4ceeda3a1d2@suse.com> (raw)
In-Reply-To: <d0916f22-b5c0-4c93-935c-4cbe17e626d4@epam.com>
On 06.05.2026 11:39, Mykyta Poturai wrote:
> On 5/4/26 08:37, Jan Beulich wrote:
>> On 23.04.2026 12:12, Mykyta Poturai wrote:
>>> On 4/21/26 17:43, Jan Beulich wrote:
>>>> On 09.04.2026 16:01, Mykyta Poturai wrote:
>>>>> From: Stewart Hildebrand <stewart.hildebrand@amd.com>
>>>>>
>>>>> This code is expected to only be used by privileged domains,
>>>>> unprivileged domains should not get access to the SR-IOV capability.
>>>>>
>>>>> Implement RW handlers for PCI_SRIOV_CTRL register to dynamically
>>>>> map/unmap VF BARS. Recalculate BAR sizes before mapping VFs to account
>>>>> for possible changes in the system page size register. Also force VFs to
>>>>> always use emulated reads for command register, this is needed to
>>>>> prevent some drivers accidentally unmapping BARs.
>>>>
>>>> This apparently refers to the change to vpci_init_header(). Writes are
>>>> already intercepted. How would a read lead to accidental BAR unmap? Even
>>>> for writes I don't see how a VF driver could accidentally unmap BARs, as
>>>> the memory decode bit there is hardwired to 0.
>>>>
>>>>> Discovery of VFs is
>>>>> done by Dom0, which must register them with Xen.
>>>>
>>>> If we intercept control register writes, why would we still require
>>>> Dom0 to report the VFs that appear?
>>>>
>>>
>>> Sorry, I don't understand this question. You specifically requested this
>>> to be done this way in V2. Quoting your reply from V2 below.
>>>
>>> > Aren't you effectively busy-waiting for these 100ms, by simply
>>> returning "true"
>>> > from vpci_process_pending() until the time has passed? This imo is a
>>> no-go. You
>>> > want to set a timer and put the vCPU to sleep, to wake it up again
>>> when the
>>> > timer has expired. That'll then eliminate the need for the
>>> not-so-nice patch 4.
>>>
>>> > Question is whether we need to actually go this far (right away). I
>>> expect you
>>> > don't mean to hand PFs to DomU-s. As long as we keep them in the hardware
>>> > domain, can't we trust it to set things up correctly, just like we
>>> trust it in
>>> > a number of other aspects?
>>
>> How's any of this related to the question I raised here, or your reply
>> thereto? If we intercept PCI_SRIOV_CTRL, we know when VFs are created.
>> Why still demand Dom0 to report them then?
>>
>
> The spec states that VFs can take up to 100ms after the VF_ENABLE bit is
> set to become alive. We discussed in the V2 that it is not acceptable to
> do a required 100ms wait in Xen while blocking a domain. And not doing
> that blocking would require some mechanism to only allow a domain to run
> for precisely 99(or more?)ms. You yourself suggested that we can trust
> the hardware domain with registering VFs if we already trust it with
> other PCI-related stuff. Did you change your mind, or am I completely
> misunderstanding this question?
No, I still think that we can trust hwdom enough. Nevertheless we should
aim at being independent of it where possible. And I seem to recall that
I had also outlined an approach how to avoid spin-waiting for 100ms in
the hypervisor.
Jan
next prev parent reply other threads:[~2026-05-06 11:54 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-09 14:01 [PATCH v3 0/7] Implement SR-IOV support for PVH Mykyta Poturai
2026-04-09 14:01 ` [PATCH v3 2/7] vpci: rename and export vpci_guest_mem_bar_{read,write} Mykyta Poturai
2026-04-22 10:27 ` Roger Pau Monné
2026-04-09 14:01 ` [PATCH v3 1/7] vpci: rename and export vpci_modify_bars Mykyta Poturai
2026-04-09 14:01 ` [PATCH v3 3/7] vpci: Use pervcpu ranges for BAR mapping Mykyta Poturai
2026-04-22 11:00 ` Roger Pau Monné
2026-04-22 12:04 ` Jan Beulich
2026-04-22 14:20 ` Roger Pau Monné
2026-04-09 14:01 ` [PATCH v3 4/7] vpci: allow queueing of mapping operations Mykyta Poturai
2026-04-22 11:38 ` Roger Pau Monné
2026-04-09 14:01 ` [PATCH v3 5/7] vpci: add SR-IOV support for PVH Dom0 Mykyta Poturai
2026-04-09 15:27 ` Daniel P. Smith
2026-04-21 14:43 ` Jan Beulich
2026-04-23 10:12 ` Mykyta Poturai
2026-05-04 5:37 ` Jan Beulich
2026-05-06 9:39 ` Mykyta Poturai
2026-05-06 11:54 ` Jan Beulich [this message]
2026-05-07 20:40 ` Volodymyr Babchuk
2026-05-08 5:52 ` Jan Beulich
2026-05-11 14:10 ` Volodymyr Babchuk
2026-05-12 6:20 ` Jan Beulich
2026-05-12 7:32 ` Mykyta Poturai
2026-05-12 8:58 ` Roger Pau Monné
2026-05-12 10:28 ` Volodymyr Babchuk
2026-05-12 13:22 ` Roger Pau Monné
2026-05-12 10:44 ` Jan Beulich
2026-05-12 11:11 ` Roger Pau Monné
2026-05-08 5:52 ` Jan Beulich
2026-04-22 14:19 ` Roger Pau Monné
2026-04-28 20:05 ` Stewart Hildebrand
2026-04-09 14:01 ` [PATCH v3 6/7] vpci: add SR-IOV support for DomUs Mykyta Poturai
2026-04-21 14:55 ` Jan Beulich
2026-04-24 6:34 ` Mykyta Poturai
2026-04-09 14:01 ` [PATCH v3 7/7] docs: Update SR-IOV support status Mykyta Poturai
2026-04-21 14:56 ` Jan Beulich
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=e5844c28-aa68-4bf6-8287-a4ceeda3a1d2@suse.com \
--to=jbeulich@suse.com \
--cc=Mykyta_Poturai@epam.com \
--cc=dpsmith@apertussolutions.com \
--cc=roger.pau@citrix.com \
--cc=stewart.hildebrand@amd.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.