aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/pci.h
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-06-22 13:43:00 +0200
committerJan Beulich <jbeulich@suse.com>2012-06-22 13:43:00 +0200
commit56b3130c1a4ffc3c1a045559240261b892b9b880 (patch)
treecfa39d69fc251380e7358e1230c3a1c3c654cf0a /xen/include/xen/pci.h
parent7f15d8540d2ea880170194700a8fb4600da8643b (diff)
downloadxen-56b3130c1a4ffc3c1a045559240261b892b9b880.tar.gz
xen-56b3130c1a4ffc3c1a045559240261b892b9b880.tar.bz2
xen-56b3130c1a4ffc3c1a045559240261b892b9b880.zip
AMD IOMMU: add mechanism to protect their PCI devices' config spaces
Recent Dom0 kernels want to disable PCI MSI on all devices, yet doing so on AMD IOMMUs (which get represented by a PCI device) disables part of the functionality set up by the hypervisor. Add a mechanism to mark certain PCI devices as having write protected config spaces (both through port based [method 1] accesses and, for x86-64, mmconfig), and use that for AMD's IOMMUs. Note that due to ptwr_do_page_fault() being run first, there'll be a MEM_LOG() issued for each such mmconfig based write attempt. If that's undesirable, the order of the calls in fixup_page_fault() would need to be swapped. Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: Wei Wang <wei.wang2@amd.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/include/xen/pci.h')
-rw-r--r--xen/include/xen/pci.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 60e0b21092..d302034e30 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -98,8 +98,11 @@ struct pci_dev *pci_lock_domain_pdev(
void setup_dom0_pci_devices(struct domain *, void (*)(struct pci_dev *));
void pci_release_devices(struct domain *d);
int pci_add_segment(u16 seg);
+const unsigned long *pci_get_ro_map(u16 seg);
int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *);
int pci_remove_device(u16 seg, u8 bus, u8 devfn);
+int pci_ro_device(int seg, int bus, int devfn);
+void arch_pci_ro_device(int seg, int bdf);
struct pci_dev *pci_get_pdev(int seg, int bus, int devfn);
struct pci_dev *pci_get_pdev_by_domain(
struct domain *, int seg, int bus, int devfn);