linux/arch/x86/pci/xen.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Xen PCI - handle PCI (INTx) and MSI infrastructure calls for PV, HVM and
 * initial domain support. We also handle the DSDT _PRT callbacks for GSI's
 * used in HVM and initial domain mode (PV does not parse ACPI, so it has no
 * concept of GSIs). Under PV we hook under the pnbbios API for IRQs and
 * 0xcf8 PCI configuration read/write.
 *
 *   Author: Ryan Wilson <[email protected]>
 *           Konrad Rzeszutek Wilk <[email protected]>
 *           Stefano Stabellini <[email protected]>
 */
#include <linux/export.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/acpi.h>

#include <linux/io.h>
#include <asm/io_apic.h>
#include <asm/pci_x86.h>

#include <asm/xen/hypervisor.h>

#include <xen/features.h>
#include <xen/events.h>
#include <xen/pci.h>
#include <asm/xen/pci.h>
#include <asm/xen/cpuid.h>
#include <asm/apic.h>
#include <asm/acpi.h>
#include <asm/i8259.h>

static int xen_pcifront_enable_irq(struct pci_dev *dev)
{}

#ifdef CONFIG_ACPI
static int xen_register_pirq(u32 gsi, int triggering, bool set_pirq)
{}

static int acpi_register_gsi_xen_hvm(struct device *dev, u32 gsi,
				     int trigger, int polarity)
{}

#ifdef CONFIG_XEN_PV_DOM0
static int xen_register_gsi(u32 gsi, int triggering, int polarity)
{}

static int acpi_register_gsi_xen(struct device *dev, u32 gsi,
				 int trigger, int polarity)
{}
#endif
#endif

#if defined(CONFIG_PCI_MSI)
#include <linux/msi.h>

struct xen_pci_frontend_ops *xen_pci_frontend;
EXPORT_SYMBOL_GPL();

struct xen_msi_ops {};

static struct xen_msi_ops xen_msi_ops __ro_after_init;

static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{}

static void xen_msi_compose_msg(struct pci_dev *pdev, unsigned int pirq,
		struct msi_msg *msg)
{}

static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{}

#ifdef CONFIG_XEN_PV_DOM0
static bool __read_mostly pci_seg_supported =;

static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{}

bool xen_initdom_restore_msi(struct pci_dev *dev)
{}
#else /* CONFIG_XEN_PV_DOM0 */
#define xen_initdom_setup_msi_irqs
#endif /* !CONFIG_XEN_PV_DOM0 */

static void xen_teardown_msi_irqs(struct pci_dev *dev)
{}

static void xen_pv_teardown_msi_irqs(struct pci_dev *dev)
{}

static int xen_msi_domain_alloc_irqs(struct irq_domain *domain,
				     struct device *dev,  int nvec)
{}

static void xen_msi_domain_free_irqs(struct irq_domain *domain,
				     struct device *dev)
{}

static struct msi_domain_ops xen_pci_msi_domain_ops =;

static struct msi_domain_info xen_pci_msi_domain_info =;

/*
 * This irq domain is a blatant violation of the irq domain design, but
 * distangling XEN into real irq domains is not a job for mere mortals with
 * limited XENology. But it's the least dangerous way for a mere mortal to
 * get rid of the arch_*_msi_irqs() hackery in order to store the irq
 * domain pointer in struct device. This irq domain wrappery allows to do
 * that without breaking XEN terminally.
 */
static __init struct irq_domain *xen_create_pci_msi_domain(void)
{}

static __init void xen_setup_pci_msi(void)
{}

#else /* CONFIG_PCI_MSI */
static inline void xen_setup_pci_msi(void) { }
#endif /* CONFIG_PCI_MSI */

int __init pci_xen_init(void)
{}

#ifdef CONFIG_PCI_MSI
static void __init xen_hvm_msi_init(void)
{}
#endif

int __init pci_xen_hvm_init(void)
{}

#ifdef CONFIG_XEN_PV_DOM0
int __init pci_xen_initial_domain(void)
{}
#endif