mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-22 17:17:44 +07:00
Merge branch 'pci/host-hv' into next
* pci/host-hv: PCI: hv: Add paravirtual PCI front-end for Microsoft Hyper-V VMs PCI: Look up IRQ domain by fwnode_handle PCI: Add fwnode_handle to x86 pci_sysdata
This commit is contained in:
commit
cfeb8139a1
@ -5193,6 +5193,7 @@ F: arch/x86/kernel/cpu/mshyperv.c
|
|||||||
F: drivers/hid/hid-hyperv.c
|
F: drivers/hid/hid-hyperv.c
|
||||||
F: drivers/hv/
|
F: drivers/hv/
|
||||||
F: drivers/input/serio/hyperv-keyboard.c
|
F: drivers/input/serio/hyperv-keyboard.c
|
||||||
|
F: drivers/pci/host/pci-hyperv.c
|
||||||
F: drivers/net/hyperv/
|
F: drivers/net/hyperv/
|
||||||
F: drivers/scsi/storvsc_drv.c
|
F: drivers/scsi/storvsc_drv.c
|
||||||
F: drivers/video/fbdev/hyperv_fb.c
|
F: drivers/video/fbdev/hyperv_fb.c
|
||||||
|
@ -20,6 +20,9 @@ struct pci_sysdata {
|
|||||||
#ifdef CONFIG_X86_64
|
#ifdef CONFIG_X86_64
|
||||||
void *iommu; /* IOMMU private data */
|
void *iommu; /* IOMMU private data */
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
|
||||||
|
void *fwnode; /* IRQ domain for MSI assignment */
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int pci_routeirq;
|
extern int pci_routeirq;
|
||||||
@ -32,6 +35,7 @@ extern int noioapicreroute;
|
|||||||
static inline int pci_domain_nr(struct pci_bus *bus)
|
static inline int pci_domain_nr(struct pci_bus *bus)
|
||||||
{
|
{
|
||||||
struct pci_sysdata *sd = bus->sysdata;
|
struct pci_sysdata *sd = bus->sysdata;
|
||||||
|
|
||||||
return sd->domain;
|
return sd->domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +45,17 @@ static inline int pci_proc_domain(struct pci_bus *bus)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
|
||||||
|
static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
|
||||||
|
{
|
||||||
|
struct pci_sysdata *sd = bus->sysdata;
|
||||||
|
|
||||||
|
return sd->fwnode;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define pci_root_bus_fwnode _pci_root_bus_fwnode
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Can be used to override the logic in pci_scan_bus for skipping
|
/* Can be used to override the logic in pci_scan_bus for skipping
|
||||||
already-configured bus numbers - to be used for buggy BIOSes
|
already-configured bus numbers - to be used for buggy BIOSes
|
||||||
or architectures with incomplete PCI setup by the loader */
|
or architectures with incomplete PCI setup by the loader */
|
||||||
|
@ -121,5 +121,11 @@ config PCI_LABEL
|
|||||||
def_bool y if (DMI || ACPI)
|
def_bool y if (DMI || ACPI)
|
||||||
select NLS
|
select NLS
|
||||||
|
|
||||||
source "drivers/pci/hotplug/Kconfig"
|
config PCI_HYPERV
|
||||||
|
tristate "Hyper-V PCI Frontend"
|
||||||
|
depends on PCI && X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
|
||||||
|
help
|
||||||
|
The PCI device frontend driver allows the kernel to import arbitrary
|
||||||
|
PCI devices from a PCI backend to support PCI driver domains.
|
||||||
|
|
||||||
source "drivers/pci/host/Kconfig"
|
source "drivers/pci/host/Kconfig"
|
||||||
|
@ -3,6 +3,7 @@ obj-$(CONFIG_PCIE_DW_PLAT) += pcie-designware-plat.o
|
|||||||
obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o
|
obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o
|
||||||
obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
|
obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
|
||||||
obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
|
obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
|
||||||
|
obj-$(CONFIG_PCI_HYPERV) += pci-hyperv.o
|
||||||
obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
|
obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
|
||||||
obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
|
obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
|
||||||
obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
|
obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
|
||||||
|
2346
drivers/pci/host/pci-hyperv.c
Normal file
2346
drivers/pci/host/pci-hyperv.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -15,6 +15,7 @@
|
|||||||
#include <linux/pci-aspm.h>
|
#include <linux/pci-aspm.h>
|
||||||
#include <linux/aer.h>
|
#include <linux/aer.h>
|
||||||
#include <linux/acpi.h>
|
#include <linux/acpi.h>
|
||||||
|
#include <linux/irqdomain.h>
|
||||||
#include "pci.h"
|
#include "pci.h"
|
||||||
|
|
||||||
#define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */
|
#define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */
|
||||||
@ -674,6 +675,20 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus)
|
|||||||
if (!d)
|
if (!d)
|
||||||
d = pci_host_bridge_acpi_msi_domain(bus);
|
d = pci_host_bridge_acpi_msi_domain(bus);
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
|
||||||
|
/*
|
||||||
|
* If no IRQ domain was found via the OF tree, try looking it up
|
||||||
|
* directly through the fwnode_handle.
|
||||||
|
*/
|
||||||
|
if (!d) {
|
||||||
|
struct fwnode_handle *fwnode = pci_root_bus_fwnode(bus);
|
||||||
|
|
||||||
|
if (fwnode)
|
||||||
|
d = irq_find_matching_fwnode(fwnode,
|
||||||
|
DOMAIN_BUS_PCI_MSI);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1522,6 +1522,10 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; }
|
|||||||
|
|
||||||
#include <asm/pci.h>
|
#include <asm/pci.h>
|
||||||
|
|
||||||
|
#ifndef pci_root_bus_fwnode
|
||||||
|
#define pci_root_bus_fwnode(bus) NULL
|
||||||
|
#endif
|
||||||
|
|
||||||
/* these helpers provide future and backwards compatibility
|
/* these helpers provide future and backwards compatibility
|
||||||
* for accessing popular PCI BAR info */
|
* for accessing popular PCI BAR info */
|
||||||
#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
|
#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
|
||||||
|
Loading…
Reference in New Issue
Block a user