Don't allow the hardware domain write access the PCI config space of
devices marked as read-only.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
#define xfree(p) free(p)
#define pci_get_pdev_by_domain(...) &test_pdev
+#define pci_get_ro_map(...) NULL
+
+#define test_bit(...) false
/* Dummy native helpers. Writes are ignored, reads return 1's. */
#define pci_conf_read8(...) 0xff
const struct pci_dev *pdev;
const struct vpci_register *r;
unsigned int data_offset = 0;
+ const unsigned long *ro_map = pci_get_ro_map(sbdf.seg);
if ( !size )
{
return;
}
+ if ( ro_map && test_bit(sbdf.bdf, ro_map) )
+ /* Ignore writes to read-only devices. */
+ return;
+
/*
* Find the PCI dev matching the address.
* Passthrough everything that's not trapped.