All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] vPCI: account for hidden devices in modify_bars()
@ 2021-08-30 13:04 Jan Beulich
  2021-08-31  5:35 ` Oleksandr Andrushchenko
  2021-09-14 10:00 ` Roger Pau Monné
  0 siblings, 2 replies; 18+ messages in thread
From: Jan Beulich @ 2021-08-30 13:04 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monné

Hidden devices (e.g. an add-in PCI serial card used for Xen's serial
console) are associated with DomXEN, not Dom0. This means that while
looking for overlapping BARs such devices cannot be found on Dom0's
list of devices; DomXEN's list also needs to be scanned.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
RFC: Patch intentionally mis-formatted, as the necessary re-indentation
     would make the diff difficult to read. At this point I'd merely
     like to gather input towards possible better approaches to solve
     the issue (not the least because quite possibly there are further
     places needing changing).

--- a/xen/drivers/vpci/header.c
+++ b/xen/drivers/vpci/header.c
@@ -206,6 +206,7 @@ static int modify_bars(const struct pci_
     struct vpci_header *header = &pdev->vpci->header;
     struct rangeset *mem = rangeset_new(NULL, NULL, 0);
     struct pci_dev *tmp, *dev = NULL;
+    const struct domain *d;
     const struct vpci_msix *msix = pdev->vpci->msix;
     unsigned int i;
     int rc;
@@ -265,7 +266,8 @@ static int modify_bars(const struct pci_
      * Check for overlaps with other BARs. Note that only BARs that are
      * currently mapped (enabled) are checked for overlaps.
      */
-    for_each_pdev ( pdev->domain, tmp )
+for ( d = pdev->domain; ; d = dom_xen ) {//todo
+    for_each_pdev ( d, tmp )
     {
         if ( tmp == pdev )
         {
@@ -282,6 +284,7 @@ static int modify_bars(const struct pci_
                  */
                 continue;
         }
+if ( !tmp->vpci ) { ASSERT(d == dom_xen && system_state < SYS_STATE_active); continue; }//todo
 
         for ( i = 0; i < ARRAY_SIZE(tmp->vpci->header.bars); i++ )
         {
@@ -308,6 +311,7 @@ static int modify_bars(const struct pci_
             }
         }
     }
+if ( !is_hardware_domain(d) ) break; }//todo
 
     ASSERT(dev);
 



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

end of thread, other threads:[~2021-09-14 16:05 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 13:04 [PATCH RFC] vPCI: account for hidden devices in modify_bars() Jan Beulich
2021-08-31  5:35 ` Oleksandr Andrushchenko
2021-08-31  6:51   ` Jan Beulich
2021-08-31  7:06     ` Oleksandr Andrushchenko
2021-08-31  7:47       ` Jan Beulich
2021-08-31  7:56         ` Oleksandr Andrushchenko
2021-08-31  8:05           ` Jan Beulich
2021-08-31  8:14             ` Oleksandr Andrushchenko
2021-08-31  8:35               ` Jan Beulich
2021-09-01  4:50                 ` Oleksandr Andrushchenko
2021-09-01  8:20                   ` Jan Beulich
2021-09-14 10:00 ` Roger Pau Monné
2021-09-14 10:12   ` Jan Beulich
2021-09-14 11:21     ` Roger Pau Monné
2021-09-14 12:05       ` Jan Beulich
2021-09-14 14:22         ` Roger Pau Monné
2021-09-14 15:16           ` Jan Beulich
2021-09-14 16:04             ` 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.