Use the Kconfig generated CONFIG_HAS_PCI defines in the code base.
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
CFLAGS-$(HAS_MEM_ACCESS) += -DHAS_MEM_ACCESS
CFLAGS-$(HAS_MEM_PAGING) += -DHAS_MEM_PAGING
CFLAGS-$(HAS_MEM_SHARING) += -DHAS_MEM_SHARING
-CFLAGS-$(HAS_PCI) += -DHAS_PCI
CFLAGS-$(HAS_IOPORTS) += -DHAS_IOPORTS
CFLAGS-$(HAS_PDX) += -DHAS_PDX
CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
config X86
def_bool y
select HAS_PASSTHROUGH
+ select HAS_PCI
config ARCH_DEFCONFIG
string
HAS_VGA := y
HAS_VIDEO := y
HAS_CPUFREQ := y
-HAS_PCI := y
HAS_NS16550 := y
HAS_EHCI := y
HAS_KEXEC := y
break;
#endif
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
case XEN_SYSCTL_pcitopoinfo:
{
xen_sysctl_pcitopoinfo_t *ti = &op->u.pcitopoinfo;
menu "Device Drivers"
source "drivers/passthrough/Kconfig"
+
+source "drivers/pci/Kconfig"
+
endmenu
subdir-y += char
subdir-$(HAS_CPUFREQ) += cpufreq
-subdir-$(HAS_PCI) += pci
+subdir-$(CONFIG_HAS_PCI) += pci
subdir-$(CONFIG_HAS_PASSTHROUGH) += passthrough
subdir-$(HAS_ACPI) += acpi
subdir-$(HAS_VIDEO) += video
#include <xen/timer.h>
#include <xen/serial.h>
#include <xen/iocap.h>
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
#include <xen/pci.h>
#include <xen/pci_regs.h>
#include <xen/pci_ids.h>
unsigned int timeout_ms;
bool_t intr_works;
bool_t dw_usr_bsy;
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
/* PCI card parameters. */
bool_t pb_bdf_enable; /* if =1, pb-bdf effective, port behind bridge */
bool_t ps_bdf_enable; /* if =1, ps_bdf effective, port on pci card */
};
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
enum {
param_default = 0,
param_trumanage,
static void pci_serial_early_init(struct ns16550 *uart)
{
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 )
return;
ns16550_setup_postirq(uart);
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
if ( uart->bar || uart->ps_bdf_enable )
{
if ( !uart->enable_ro )
stop_timer(&uart->timer);
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
if ( uart->bar )
uart->cr = pci_conf_read16(0, uart->ps_bdf[0], uart->ps_bdf[1],
uart->ps_bdf[2], PCI_COMMAND);
static void _ns16550_resume(struct serial_port *port)
{
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
struct ns16550 *uart = port->uart;
if ( uart->bar )
return 1; /* Everything is MMIO */
#endif
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
pci_serial_early_init(uart);
#endif
return (status == 0x90);
}
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
static int __init
pci_uart_config(struct ns16550 *uart, bool_t skip_amt, unsigned int bar_idx)
{
if ( *conf == ',' && *++conf != ',' )
{
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
if ( strncmp(conf, "pci", 3) == 0 )
{
if ( pci_uart_config(uart, 1/* skip AMT */, uart - ns16550_com) )
if ( *conf == ',' && *++conf != ',' )
uart->irq = simple_strtol(conf, &conf, 10);
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
if ( *conf == ',' && *++conf != ',' )
{
conf = parse_pci(conf, NULL, &uart->ps_bdf[0],
{
uart->clock_hz = UART_CLOCK_HZ;
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
uart->enable_ro = 0;
#endif
obj-y += iommu.o
obj-$(x86) += io.o
-obj-$(HAS_PCI) += pci.o
+obj-$(CONFIG_HAS_PCI) += pci.o
obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
if ( !iommu_enabled )
return -ENOSYS;
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
ret = iommu_do_pci_domctl(domctl, d, u_domctl);
#endif
--- /dev/null
+
+# Select HAS_PCI if PCI is supported
+config HAS_PCI
+ bool
bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature);
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
void pt_pci_init(void);
struct pirq;
int (*assign_device)(struct domain *, u8 devfn, device_t *dev, u32 flag);
int (*reassign_device)(struct domain *s, struct domain *t,
u8 devfn, device_t *dev);
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
int (*get_device_group_id)(u16 seg, u8 bus, u8 devfn);
int (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
void (*read_msi_from_ire)(struct msi_desc *msi_desc, struct msi_msg *msg);
void iommu_share_p2m_table(struct domain *d);
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
int iommu_do_pci_domctl(struct xen_domctl *, struct domain *d,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t));
#endif
return xsm_default_action(action, current->domain, d);
}
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
static XSM_INLINE int xsm_get_device_group(XSM_DEFAULT_ARG uint32_t machine_bdf)
{
XSM_ASSERT_ACTION(XSM_HOOK);
int (*iomem_mapping) (struct domain *d, uint64_t s, uint64_t e, uint8_t allow);
int (*pci_config_permission) (struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t access);
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
int (*get_device_group) (uint32_t machine_bdf);
int (*test_assign_device) (uint32_t machine_bdf);
int (*assign_device) (struct domain *d, uint32_t machine_bdf);
return xsm_ops->pci_config_permission(d, machine_bdf, start, end, access);
}
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
static inline int xsm_get_device_group(xsm_default_t def, uint32_t machine_bdf)
{
return xsm_ops->get_device_group(machine_bdf);
set_to_dummy_if_null(ops, pci_config_permission);
set_to_dummy_if_null(ops, get_vnumainfo);
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
set_to_dummy_if_null(ops, get_device_group);
set_to_dummy_if_null(ops, test_assign_device);
set_to_dummy_if_null(ops, assign_device);
#include <xen/errno.h>
#include <xen/guest_access.h>
#include <xen/xenoprof.h>
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
#include <asm/msi.h>
#endif
#include <public/xen.h>
}
return security_irq_sid(irq, sid);
}
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
{
struct irq_desc *desc = irq_to_desc(irq);
if ( desc->msi_desc && desc->msi_desc->dev ) {
static int flask_map_domain_msi (struct domain *d, int irq, void *data,
u32 *sid, struct avc_audit_data *ad)
{
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
struct msi_info *msi = data;
u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
static int flask_unmap_domain_msi (struct domain *d, int irq, void *data,
u32 *sid, struct avc_audit_data *ad)
{
-#ifdef HAS_PCI
+#ifdef CONFIG_HAS_PCI
struct msi_info *msi = data;
u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
}
#endif
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
static int flask_get_device_group(uint32_t machine_bdf)
{
u32 rsid;
.remove_from_physmap = flask_remove_from_physmap,
.map_gmfn_foreign = flask_map_gmfn_foreign,
-#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
+#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI)
.get_device_group = flask_get_device_group,
.test_assign_device = flask_test_assign_device,
.assign_device = flask_assign_device,