mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
build: convert HAS_PASSTHROUGH use to Kconfig
Use the Kconfig generated HAS_PASSTHROUGH defines for 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> Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
1 parent
a75bdd57ca
commit
e0d44c1f94
15 files changed
+29
-25
No files matched your search
@@ -58,7 +58,6 @@ CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
|
||||
CFLAGS-$(lock_profile) += -DLOCK_PROFILE
|
||||
CFLAGS-$(HAS_ACPI) += -DHAS_ACPI
|
||||
CFLAGS-$(HAS_GDBSX) += -DHAS_GDBSX
|
||||
CFLAGS-$(HAS_PASSTHROUGH) += -DHAS_PASSTHROUGH
|
||||
CFLAGS-$(HAS_DEVICE_TREE) += -DHAS_DEVICE_TREE
|
||||
CFLAGS-$(HAS_MEM_ACCESS) += -DHAS_MEM_ACCESS
|
||||
CFLAGS-$(HAS_MEM_PAGING) += -DHAS_MEM_PAGING
|
||||
|
||||
@@ -16,6 +16,7 @@ config ARM_64
|
||||
|
||||
config ARM
|
||||
def_bool y
|
||||
select HAS_PASSTHROUGH
|
||||
|
||||
config ARCH_DEFCONFIG
|
||||
string
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
HAS_DEVICE_TREE := y
|
||||
HAS_VIDEO := y
|
||||
HAS_ARM_HDLCD := y
|
||||
HAS_PASSTHROUGH := y
|
||||
HAS_PDX := y
|
||||
|
||||
CFLAGS += -I$(BASEDIR)/include
|
||||
|
||||
@@ -3,6 +3,7 @@ config X86_64
|
||||
|
||||
config X86
|
||||
def_bool y
|
||||
select HAS_PASSTHROUGH
|
||||
|
||||
config ARCH_DEFCONFIG
|
||||
string
|
||||
|
||||
@@ -8,7 +8,6 @@ HAS_VGA := y
|
||||
HAS_VIDEO := y
|
||||
HAS_CPUFREQ := y
|
||||
HAS_PCI := y
|
||||
HAS_PASSTHROUGH := y
|
||||
HAS_NS16550 := y
|
||||
HAS_EHCI := y
|
||||
HAS_KEXEC := y
|
||||
|
||||
@@ -18,7 +18,7 @@ CHECK_TYPE(domid);
|
||||
CHECK_mem_access_op;
|
||||
CHECK_vmemrange;
|
||||
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
struct get_reserved_device_memory {
|
||||
struct compat_reserved_device_memory_map map;
|
||||
unsigned int used_entries;
|
||||
@@ -340,7 +340,7 @@ int compat_memory_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) compat)
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
case XENMEM_reserved_device_memory_map:
|
||||
{
|
||||
struct get_reserved_device_memory grdm;
|
||||
|
||||
+4
-4
@@ -651,7 +651,7 @@ static int xenmem_add_to_physmap(struct domain *d,
|
||||
xatp->gpfn += start;
|
||||
xatp->size -= start;
|
||||
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
if ( need_iommu(d) )
|
||||
this_cpu(iommu_dont_flush_iotlb) = 1;
|
||||
#endif
|
||||
@@ -674,7 +674,7 @@ static int xenmem_add_to_physmap(struct domain *d,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
if ( need_iommu(d) )
|
||||
{
|
||||
this_cpu(iommu_dont_flush_iotlb) = 0;
|
||||
@@ -801,7 +801,7 @@ static int construct_memop_from_reservation(
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
struct get_reserved_device_memory {
|
||||
struct xen_reserved_device_memory_map map;
|
||||
unsigned int used_entries;
|
||||
@@ -1245,7 +1245,7 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
case XENMEM_reserved_device_memory_map:
|
||||
{
|
||||
struct get_reserved_device_memory grdm;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
menu "Device Drivers"
|
||||
|
||||
source "drivers/passthrough/Kconfig"
|
||||
endmenu
|
||||
@@ -1,6 +1,6 @@
|
||||
subdir-y += char
|
||||
subdir-$(HAS_CPUFREQ) += cpufreq
|
||||
subdir-$(HAS_PCI) += pci
|
||||
subdir-$(HAS_PASSTHROUGH) += passthrough
|
||||
subdir-$(CONFIG_HAS_PASSTHROUGH) += passthrough
|
||||
subdir-$(HAS_ACPI) += acpi
|
||||
subdir-$(HAS_VIDEO) += video
|
||||
@@ -0,0 +1,4 @@
|
||||
|
||||
# Select HAS_PASSTHROUGH if device pass through is supported
|
||||
config HAS_PASSTHROUGH
|
||||
bool
|
||||
@@ -366,7 +366,7 @@ struct domain
|
||||
|
||||
int64_t time_offset_seconds;
|
||||
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
/* Does this guest need iommu mappings (-1 meaning "being set up")? */
|
||||
s8 need_iommu;
|
||||
#endif
|
||||
@@ -839,7 +839,7 @@ void watchdog_domain_destroy(struct domain *d);
|
||||
#define has_hvm_container_vcpu(v) (has_hvm_container_domain((v)->domain))
|
||||
#define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
|
||||
cpumask_weight((v)->cpu_hard_affinity) == 1)
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
#define need_iommu(d) ((d)->need_iommu)
|
||||
#else
|
||||
#define need_iommu(d) (0)
|
||||
|
||||
@@ -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(HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
static XSM_INLINE int xsm_get_device_group(XSM_DEFAULT_ARG uint32_t machine_bdf)
|
||||
{
|
||||
XSM_ASSERT_ACTION(XSM_HOOK);
|
||||
@@ -350,7 +350,7 @@ static XSM_INLINE int xsm_deassign_device(XSM_DEFAULT_ARG struct domain *d, uint
|
||||
|
||||
#endif /* HAS_PASSTHROUGH && HAS_PCI */
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
static XSM_INLINE int xsm_test_assign_dtdevice(XSM_DEFAULT_ARG const char *dtpath)
|
||||
{
|
||||
XSM_ASSERT_ACTION(XSM_HOOK);
|
||||
|
||||
@@ -114,14 +114,14 @@ 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(HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(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);
|
||||
int (*deassign_device) (struct domain *d, uint32_t machine_bdf);
|
||||
#endif
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
int (*test_assign_dtdevice) (const char *dtpath);
|
||||
int (*assign_dtdevice) (struct domain *d, const char *dtpath);
|
||||
int (*deassign_dtdevice) (struct domain *d, const char *dtpath);
|
||||
@@ -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(HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(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);
|
||||
@@ -491,7 +491,7 @@ static inline int xsm_deassign_device(xsm_default_t def, struct domain *d, uint3
|
||||
}
|
||||
#endif /* HAS_PASSTHROUGH && HAS_PCI) */
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
static inline int xsm_assign_dtdevice(xsm_default_t def, struct domain *d,
|
||||
const char *dtpath)
|
||||
{
|
||||
|
||||
+2
-2
@@ -89,14 +89,14 @@ 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(HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(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);
|
||||
set_to_dummy_if_null(ops, deassign_device);
|
||||
#endif
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
set_to_dummy_if_null(ops, test_assign_dtdevice);
|
||||
set_to_dummy_if_null(ops, assign_dtdevice);
|
||||
set_to_dummy_if_null(ops, deassign_dtdevice);
|
||||
|
||||
@@ -588,7 +588,7 @@ static int flask_domctl(struct domain *d, int cmd)
|
||||
case XEN_DOMCTL_ioport_permission:
|
||||
case XEN_DOMCTL_ioport_mapping:
|
||||
#endif
|
||||
#ifdef HAS_PASSTHROUGH
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
/*
|
||||
* These have individual XSM hooks
|
||||
* (drivers/passthrough/{pci,device_tree.c)
|
||||
@@ -1213,7 +1213,7 @@ static int flask_mem_sharing(struct domain *d)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
static int flask_get_device_group(uint32_t machine_bdf)
|
||||
{
|
||||
u32 rsid;
|
||||
@@ -1279,7 +1279,7 @@ static int flask_deassign_device(struct domain *d, uint32_t machine_bdf)
|
||||
}
|
||||
#endif /* HAS_PASSTHROUGH && HAS_PCI */
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
static int flask_test_assign_dtdevice(const char *dtpath)
|
||||
{
|
||||
u32 rsid;
|
||||
@@ -1725,14 +1725,14 @@ static struct xsm_operations flask_ops = {
|
||||
.remove_from_physmap = flask_remove_from_physmap,
|
||||
.map_gmfn_foreign = flask_map_gmfn_foreign,
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_PCI)
|
||||
.get_device_group = flask_get_device_group,
|
||||
.test_assign_device = flask_test_assign_device,
|
||||
.assign_device = flask_assign_device,
|
||||
.deassign_device = flask_deassign_device,
|
||||
#endif
|
||||
|
||||
#if defined(HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(HAS_DEVICE_TREE)
|
||||
.test_assign_dtdevice = flask_test_assign_dtdevice,
|
||||
.assign_dtdevice = flask_assign_dtdevice,
|
||||
.deassign_dtdevice = flask_deassign_dtdevice,
|
||||
|
||||