mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
build: convert HAS_PCI use to Kconfig
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>
This commit is contained in:
1 parent
e7bb2a30a3
commit
1809d50035
15 files changed
+37
-31
No files matched your search
@@ -61,7 +61,6 @@ CFLAGS-$(HAS_GDBSX) += -DHAS_GDBSX
|
||||
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
|
||||
|
||||
@@ -4,6 +4,7 @@ config X86_64
|
||||
config X86
|
||||
def_bool y
|
||||
select HAS_PASSTHROUGH
|
||||
select HAS_PCI
|
||||
|
||||
config ARCH_DEFCONFIG
|
||||
string
|
||||
|
||||
@@ -7,7 +7,6 @@ HAS_NUMA := y
|
||||
HAS_VGA := y
|
||||
HAS_VIDEO := y
|
||||
HAS_CPUFREQ := y
|
||||
HAS_PCI := y
|
||||
HAS_NS16550 := y
|
||||
HAS_EHCI := y
|
||||
HAS_KEXEC := y
|
||||
|
||||
+1
-1
@@ -401,7 +401,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef HAS_PCI
|
||||
#ifdef CONFIG_HAS_PCI
|
||||
case XEN_SYSCTL_pcitopoinfo:
|
||||
{
|
||||
xen_sysctl_pcitopoinfo_t *ti = &op->u.pcitopoinfo;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
menu "Device Drivers"
|
||||
|
||||
source "drivers/passthrough/Kconfig"
|
||||
|
||||
source "drivers/pci/Kconfig"
|
||||
|
||||
endmenu
|
||||
@@ -1,6 +1,6 @@
|
||||
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
|
||||
+12
-12
@@ -16,7 +16,7 @@
|
||||
#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>
|
||||
@@ -64,7 +64,7 @@ static struct ns16550 {
|
||||
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 */
|
||||
@@ -97,7 +97,7 @@ struct ns16550_config_param {
|
||||
};
|
||||
|
||||
|
||||
#ifdef HAS_PCI
|
||||
#ifdef CONFIG_HAS_PCI
|
||||
enum {
|
||||
param_default = 0,
|
||||
param_trumanage,
|
||||
@@ -475,7 +475,7 @@ static int ns16550_getc(struct serial_port *port, char *pc)
|
||||
|
||||
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;
|
||||
|
||||
@@ -621,7 +621,7 @@ static void __init ns16550_init_postirq(struct serial_port *port)
|
||||
|
||||
ns16550_setup_postirq(uart);
|
||||
|
||||
#ifdef HAS_PCI
|
||||
#ifdef CONFIG_HAS_PCI
|
||||
if ( uart->bar || uart->ps_bdf_enable )
|
||||
{
|
||||
if ( !uart->enable_ro )
|
||||
@@ -650,7 +650,7 @@ static void ns16550_suspend(struct serial_port *port)
|
||||
|
||||
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);
|
||||
@@ -659,7 +659,7 @@ static void ns16550_suspend(struct serial_port *port)
|
||||
|
||||
static void _ns16550_resume(struct serial_port *port)
|
||||
{
|
||||
#ifdef HAS_PCI
|
||||
#ifdef CONFIG_HAS_PCI
|
||||
struct ns16550 *uart = port->uart;
|
||||
|
||||
if ( uart->bar )
|
||||
@@ -797,7 +797,7 @@ static int __init check_existence(struct ns16550 *uart)
|
||||
return 1; /* Everything is MMIO */
|
||||
#endif
|
||||
|
||||
#ifdef HAS_PCI
|
||||
#ifdef CONFIG_HAS_PCI
|
||||
pci_serial_early_init(uart);
|
||||
#endif
|
||||
|
||||
@@ -828,7 +828,7 @@ static int __init check_existence(struct ns16550 *uart)
|
||||
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)
|
||||
{
|
||||
@@ -1030,7 +1030,7 @@ static void __init ns16550_parse_port_config(
|
||||
|
||||
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) )
|
||||
@@ -1053,7 +1053,7 @@ static void __init ns16550_parse_port_config(
|
||||
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],
|
||||
@@ -1094,7 +1094,7 @@ static void ns16550_init_common(struct ns16550 *uart)
|
||||
{
|
||||
uart->clock_hz = UART_CLOCK_HZ;
|
||||
|
||||
#ifdef HAS_PCI
|
||||
#ifdef CONFIG_HAS_PCI
|
||||
uart->enable_ro = 0;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -5,5 +5,5 @@ subdir-$(arm) += arm
|
||||
|
||||
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
|
||||
@@ -353,7 +353,7 @@ int iommu_do_domctl(
|
||||
if ( !iommu_enabled )
|
||||
return -ENOSYS;
|
||||
|
||||
#ifdef HAS_PCI
|
||||
#ifdef CONFIG_HAS_PCI
|
||||
ret = iommu_do_pci_domctl(domctl, d, u_domctl);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
# Select HAS_PCI if PCI is supported
|
||||
config HAS_PCI
|
||||
bool
|
||||
@@ -87,7 +87,7 @@ enum iommu_feature
|
||||
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;
|
||||
@@ -141,7 +141,7 @@ struct iommu_ops {
|
||||
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);
|
||||
@@ -174,7 +174,7 @@ int iommu_get_reserved_device_memory(iommu_grdm_t *, void *);
|
||||
|
||||
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
|
||||
|
||||
@@ -323,7 +323,7 @@ static XSM_INLINE int xsm_get_vnumainfo(XSM_DEFAULT_ARG struct domain *d)
|
||||
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);
|
||||
|
||||
@@ -114,7 +114,7 @@ struct xsm_operations {
|
||||
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);
|
||||
@@ -469,7 +469,7 @@ static inline int xsm_pci_config_permission (xsm_default_t def, struct domain *d
|
||||
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);
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
|
||||
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);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#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>
|
||||
@@ -111,7 +111,7 @@ static int get_irq_sid(int irq, u32 *sid, struct avc_audit_data *ad)
|
||||
}
|
||||
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 ) {
|
||||
@@ -853,7 +853,7 @@ static int flask_map_domain_pirq (struct domain *d)
|
||||
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;
|
||||
@@ -899,7 +899,7 @@ static int flask_unmap_domain_pirq (struct domain *d)
|
||||
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;
|
||||
|
||||
@@ -1213,7 +1213,7 @@ static int flask_mem_sharing(struct domain *d)
|
||||
}
|
||||
#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;
|
||||
@@ -1725,7 +1725,7 @@ static struct xsm_operations flask_ops = {
|
||||
.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,
|
||||
|
||||