From: Stewart Hildebrand <stewart.hildebrand@amd.com>
To: Julien Grall <julien@xen.org>, Jan Beulich <jbeulich@suse.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Paul Durrant" <paul@xen.org>,
"Roger Pau Monné" <roger.pau@citrix.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 4/5] [FUTURE] xen/arm: enable vPCI for domUs
Date: Tue, 31 Oct 2023 10:15:38 -0400 [thread overview]
Message-ID: <a31ebacb-b454-4636-8d75-df85d07f3399@amd.com> (raw)
In-Reply-To: <784fa30f-cdce-4d0b-97d1-a22ac52aa8c9@xen.org>
On 10/31/23 09:17, Julien Grall wrote:
> Hi,
>
> On 31/10/2023 11:03, Jan Beulich wrote:
>> On 31.10.2023 00:52, Stewart Hildebrand wrote:
>>> --- a/xen/drivers/passthrough/pci.c
>>> +++ b/xen/drivers/passthrough/pci.c
>>> @@ -1618,6 +1618,16 @@ int iommu_do_pci_domctl(
>>> bus = PCI_BUS(machine_sbdf);
>>> devfn = PCI_DEVFN(machine_sbdf);
>>> + if ( IS_ENABLED(CONFIG_ARM) &&
>>> + !is_hardware_domain(d) &&
>>> + !is_system_domain(d) &&
>>> + (!IS_ENABLED(CONFIG_HAS_VPCI_GUEST_SUPPORT) || !has_vpci(d)) )
>>
>> I don't think you need the explicit ARM check; that's redundant with
>> checking !HAS_VPCI_GUEST_SUPPORT.
Currently that is true. However, this is allowing for the possibility that we eventually may want to enable PCI passthrough for PVH domU using vPCI (e.g. hyperlaunch, or eliminating qemu backend), in which case we may want to enable CONFIG_HAS_VPCI_GUEST_SUPPORT=y on x86.
>> It's also not really clear why you
>> need to check for the system domain here.
xl pci-assignable-add will assign the device to domIO, which doesn't have vPCI, but it is still a valid assignment. Perhaps an in code comment would be helpful for clarity?
>
> I might be missing but I wouldn't expect the domain to have vPCI enabled if CONFIG_HAVE_VPCI_GUEST_SUPPORT=n. So why can't this simply be:
>
> if ( !has_vcpi(d) )
> {
> ...
> }
Right, the CONFIG_HAVE_VPCI_GUEST_SUPPORT check here is not strictly needed because this case is already caught by the other half of this patch in xen/arch/arm/vpci.c. This simplifies it to:
if ( IS_ENABLED(CONFIG_ARM) &&
!is_hardware_domain(d) &&
!is_system_domain(d) /* !domIO */ &&
!has_vpci(d) )
On x86, unless I misunderstood something, I think it's valid to assign PCI devices to a domU without has_vpci().
BTW, it's valid for has_vpci() to be true and CONFIG_HAVE_VPCI_GUEST_SUPPORT=n for dom0.
next prev parent reply other threads:[~2023-10-31 14:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 23:52 [PATCH v4 0/5] Kconfig for PCI passthrough on ARM Stewart Hildebrand
2023-10-30 23:52 ` [PATCH v4 1/5] xen/arm: pci: introduce PCI_PASSTHROUGH Kconfig option Stewart Hildebrand
2023-10-30 23:52 ` [PATCH v4 2/5] xen/vpci: move xen_domctl_createdomain vPCI flag to common Stewart Hildebrand
2023-10-31 10:56 ` Jan Beulich
2023-10-31 17:27 ` Stewart Hildebrand
2023-10-30 23:52 ` [PATCH v4 3/5] xen/arm: enable vPCI for dom0 Stewart Hildebrand
2023-10-30 23:52 ` [PATCH v4 4/5] [FUTURE] xen/arm: enable vPCI for domUs Stewart Hildebrand
2023-10-31 11:03 ` Jan Beulich
2023-10-31 13:17 ` Julien Grall
2023-10-31 14:15 ` Stewart Hildebrand [this message]
2023-10-31 16:17 ` Jan Beulich
2023-10-30 23:52 ` [PATCH v4 5/5] [FUTURE] tools/arm: " Stewart Hildebrand
2023-11-01 9:25 ` [PATCH v4 0/5] Kconfig for PCI passthrough on ARM Christian Lindig
2023-11-02 17:53 ` Stewart Hildebrand
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=a31ebacb-b454-4636-8d75-df85d07f3399@amd.com \
--to=stewart.hildebrand@amd.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=paul@xen.org \
--cc=roger.pau@citrix.com \
--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 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.