summaryrefslogtreecommitdiff
path: root/drivers/xen/pci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-09-27 09:55:30 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-09-27 09:55:30 -0700
commit653608c67ae3dce1c5dee8c620ce6016e174bbd1 (patch)
treeac055981ed8ed789284cd810c450595651d4311f /drivers/xen/pci.c
parente477dba5442c0af7acb9e8bbbbde1108a37ed39c (diff)
parent47ffe0578aee45fed3a06d5dcff76cdebb303163 (diff)
downloadlinux-653608c67ae3dce1c5dee8c620ce6016e174bbd1.tar.gz
linux-653608c67ae3dce1c5dee8c620ce6016e174bbd1.tar.bz2
linux-653608c67ae3dce1c5dee8c620ce6016e174bbd1.zip
Merge tag 'for-linus-6.12-rc1a-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip
Pull more xen updates from Juergen Gross: "A second round of Xen related changes and features: - a small fix of the xen-pciback driver for a warning issued by sparse - support PCI passthrough when using a PVH dom0 - enable loading the kernel in PVH mode at arbitrary addresses, avoiding conflicts with the memory map when running as a Xen dom0 using the host memory layout" * tag 'for-linus-6.12-rc1a-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip: x86/pvh: Add 64bit relocation page tables x86/kernel: Move page table macros to header x86/pvh: Set phys_base when calling xen_prepare_pvh() x86/pvh: Make PVH entrypoint PIC for x86-64 xen: sync elfnote.h from xen tree xen/pciback: fix cast to restricted pci_ers_result_t and pci_power_t xen/privcmd: Add new syscall to get gsi from dev xen/pvh: Setup gsi for passthrough device xen/pci: Add a function to reset device for xen
Diffstat (limited to 'drivers/xen/pci.c')
-rw-r--r--drivers/xen/pci.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
index a2facd8f7e51..416f231809cb 100644
--- a/drivers/xen/pci.c
+++ b/drivers/xen/pci.c
@@ -173,6 +173,19 @@ static int xen_remove_device(struct device *dev)
return r;
}
+int xen_reset_device(const struct pci_dev *dev)
+{
+ struct pci_device_reset device = {
+ .dev.seg = pci_domain_nr(dev->bus),
+ .dev.bus = dev->bus->number,
+ .dev.devfn = dev->devfn,
+ .flags = PCI_DEVICE_RESET_FLR,
+ };
+
+ return HYPERVISOR_physdev_op(PHYSDEVOP_pci_device_reset, &device);
+}
+EXPORT_SYMBOL_GPL(xen_reset_device);
+
static int xen_pci_notifier(struct notifier_block *nb,
unsigned long action, void *data)
{