All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] vpci/header: cope with devices not having vpci allocated
@ 2023-05-25 14:54 Roger Pau Monne
  2023-05-25 15:22 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Roger Pau Monne @ 2023-05-25 14:54 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

When traversing the list of pci devices assigned to a domain cope with
some of them not having the vpci struct allocated. It should be
possible for the hardware domain to have read-only devices assigned
that are not handled by vPCI, such support will be added by further
patches.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Changes since v1:
 - Do not mention domU plans.
---
 xen/drivers/vpci/header.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/xen/drivers/vpci/header.c b/xen/drivers/vpci/header.c
index ec2e978a4e6b..766fd98b2196 100644
--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -289,6 +289,14 @@ static int modify_bars(const struct pci_dev *pdev, uint16_t cmd, bool rom_only)
      */
     for_each_pdev ( pdev->domain, tmp )
     {
+        if ( !tmp->vpci )
+            /*
+             * For the hardware domain it's possible to have devices assigned
+             * to it that are not handled by vPCI, either because those are
+             * read-only devices, or because vPCI setup has failed.
+             */
+            continue;
+
         if ( tmp == pdev )
         {
             /*
-- 
2.40.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] vpci/header: cope with devices not having vpci allocated
  2023-05-25 14:54 [PATCH v2] vpci/header: cope with devices not having vpci allocated Roger Pau Monne
@ 2023-05-25 15:22 ` Jan Beulich
  2023-05-29  8:52   ` Roger Pau Monné
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2023-05-25 15:22 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

On 25.05.2023 16:54, Roger Pau Monne wrote:
> When traversing the list of pci devices assigned to a domain cope with
> some of them not having the vpci struct allocated. It should be
> possible for the hardware domain to have read-only devices assigned
> that are not handled by vPCI, such support will be added by further
> patches.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

I was wondering whether to put an assertion in (permitting both DomXEN
and hwdom, i.e. slightly more relaxed than I had it).

Jan


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] vpci/header: cope with devices not having vpci allocated
  2023-05-25 15:22 ` Jan Beulich
@ 2023-05-29  8:52   ` Roger Pau Monné
  0 siblings, 0 replies; 3+ messages in thread
From: Roger Pau Monné @ 2023-05-29  8:52 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

On Thu, May 25, 2023 at 05:22:53PM +0200, Jan Beulich wrote:
> On 25.05.2023 16:54, Roger Pau Monne wrote:
> > When traversing the list of pci devices assigned to a domain cope with
> > some of them not having the vpci struct allocated. It should be
> > possible for the hardware domain to have read-only devices assigned
> > that are not handled by vPCI, such support will be added by further
> > patches.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>

Thanks.

> I was wondering whether to put an assertion in (permitting both DomXEN
> and hwdom, i.e. slightly more relaxed than I had it).

I also wondered it, but didn't think it was very helpful, but that was
back when I had the comment about how I envisioned this to work for
domUs.

Let me know if you want me to add it.

Thanks, Roger.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-29  8:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-25 14:54 [PATCH v2] vpci/header: cope with devices not having vpci allocated Roger Pau Monne
2023-05-25 15:22 ` Jan Beulich
2023-05-29  8:52   ` Roger Pau Monné

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.