mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen: Split HAS_DEVICE_TREE in two
Moving forward the idea is for there to be: 1. Basic DT support: used by dom0less/hyperlaunch. 2. Full DT support: used for device discovery and HW setup. Rename HAS_DEVICE_TREE to HAS_DEVICE_TREE_DISCOVERY to describe (2) and create a new DEVICE_TREE_PARSE to describe (1). Have DEVICE_TREE_PARSE selected by both HAS_DEVICE_TREE_DISCOVERY and DOM0LESS_BOOT. Add a dependency on STATIC_MEMORY for discovery, as it relies on the memory map itself being described on the DTB. Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com> Acked-by: Jan Beulich <jbeulich@suse.com> #iommu Reviewed-by: Oleksii Kurochko<oleksii.kurochko@gmail.com> # riscv Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
1 parent
ae96841fff
commit
215fd869b2
20 files changed
+50
-45
No files matched your search
+1
-1
@@ -92,7 +92,7 @@ config VERBOSE_DEBUG
|
||||
|
||||
config DEVICE_TREE_DEBUG
|
||||
bool "Device tree debug messages"
|
||||
depends on HAS_DEVICE_TREE
|
||||
depends on DEVICE_TREE_PARSE
|
||||
help
|
||||
Device tree parsing and DOM0 device tree building messages are
|
||||
logged in the Xen ring buffer.
|
||||
|
||||
@@ -17,7 +17,7 @@ config ARM
|
||||
select FUNCTION_ALIGNMENT_4B
|
||||
select GENERIC_UART_INIT
|
||||
select HAS_ALTERNATIVE if HAS_VMAP
|
||||
select HAS_DEVICE_TREE
|
||||
select HAS_DEVICE_TREE_DISCOVERY
|
||||
select HAS_DOM0LESS
|
||||
select HAS_GRANT_CACHE_FLUSH if GRANT_TABLE
|
||||
select HAS_STACK_PROTECTOR
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
config PPC
|
||||
def_bool y
|
||||
select FUNCTION_ALIGNMENT_4B
|
||||
select HAS_DEVICE_TREE
|
||||
select HAS_DEVICE_TREE_DISCOVERY
|
||||
select HAS_UBSAN
|
||||
select HAS_VMAP
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ config RISCV
|
||||
select FUNCTION_ALIGNMENT_16B
|
||||
select GENERIC_BUG_FRAME
|
||||
select GENERIC_UART_INIT
|
||||
select HAS_DEVICE_TREE
|
||||
select HAS_DEVICE_TREE_DISCOVERY
|
||||
select HAS_PMAP
|
||||
select HAS_UBSAN
|
||||
select HAS_VMAP
|
||||
|
||||
+10
-5
@@ -12,9 +12,14 @@ config CORE_PARKING
|
||||
bool
|
||||
depends on NR_CPUS > 1
|
||||
|
||||
config DEVICE_TREE_PARSE
|
||||
bool
|
||||
select LIBFDT
|
||||
|
||||
config DOM0LESS_BOOT
|
||||
bool "Dom0less boot support" if EXPERT
|
||||
depends on HAS_DOM0LESS && HAS_DEVICE_TREE && DOMAIN_BUILD_HELPERS
|
||||
depends on HAS_DOM0LESS && DOMAIN_BUILD_HELPERS
|
||||
select DEVICE_TREE_PARSE
|
||||
default y
|
||||
help
|
||||
Dom0less boot support enables Xen to create and start domU guests during
|
||||
@@ -85,9 +90,9 @@ config HAS_ALTERNATIVE
|
||||
config HAS_COMPAT
|
||||
bool
|
||||
|
||||
config HAS_DEVICE_TREE
|
||||
config HAS_DEVICE_TREE_DISCOVERY
|
||||
bool
|
||||
select LIBFDT
|
||||
select DEVICE_TREE_PARSE
|
||||
|
||||
config HAS_DOM0LESS
|
||||
bool
|
||||
@@ -154,7 +159,7 @@ config NUMA
|
||||
|
||||
config STATIC_MEMORY
|
||||
bool "Static Allocation Support (UNSUPPORTED)" if UNSUPPORTED
|
||||
depends on DOM0LESS_BOOT
|
||||
depends on DOM0LESS_BOOT && HAS_DEVICE_TREE_DISCOVERY
|
||||
help
|
||||
Static Allocation refers to system or sub-system(domains) for
|
||||
which memory areas are pre-defined by configuration using physical
|
||||
@@ -553,7 +558,7 @@ config DOM0_MEM
|
||||
|
||||
config DTB_FILE
|
||||
string "Absolute path to device tree blob"
|
||||
depends on HAS_DEVICE_TREE
|
||||
depends on HAS_DEVICE_TREE_DISCOVERY
|
||||
help
|
||||
When using a bootloader that has no device tree support or when there
|
||||
is no bootloader at all, use this option to specify the absolute path
|
||||
|
||||
+2
-2
@@ -6,9 +6,9 @@ obj-$(CONFIG_HYPFS_CONFIG) += config_data.o
|
||||
obj-$(CONFIG_CORE_PARKING) += core_parking.o
|
||||
obj-y += cpu.o
|
||||
obj-$(CONFIG_DEBUG_TRACE) += debugtrace.o
|
||||
obj-$(CONFIG_HAS_DEVICE_TREE) += device.o
|
||||
obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device.o
|
||||
obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
|
||||
obj-$(CONFIG_HAS_DEVICE_TREE) += device-tree/
|
||||
obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device-tree/
|
||||
obj-$(CONFIG_IOREQ_SERVER) += dm.o
|
||||
obj-y += domain.o
|
||||
obj-y += event_2l.o
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
|
||||
#include <asm/device.h>
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
|
||||
extern const struct device_desc _sdevice[], _edevice[];
|
||||
|
||||
@@ -56,7 +56,7 @@ enum device_class device_get_class(const struct dt_device_node *dev)
|
||||
return DEVICE_UNKNOWN;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_HAS_DEVICE_TREE_DISCOVERY */
|
||||
|
||||
#ifdef CONFIG_ACPI
|
||||
|
||||
|
||||
@@ -623,7 +623,7 @@ static int __init __maybe_unused set_color(uint32_t mask, int bpp,
|
||||
return max(*pos + *sz, bpp);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_HAS_DEVICE_TREE
|
||||
#ifndef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
static int __init efi_check_dt_boot(const EFI_LOADED_IMAGE *loaded_image)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -67,7 +67,7 @@ endmenu
|
||||
|
||||
config BOOT_TIME_CPUPOOLS
|
||||
bool "Create cpupools at boot time"
|
||||
depends on HAS_DEVICE_TREE
|
||||
depends on HAS_DEVICE_TREE_DISCOVERY
|
||||
help
|
||||
Creates cpupools during boot time and assigns cpus to them. Cpupools
|
||||
options can be specified in the device tree.
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <xen/8250-uart.h>
|
||||
#include <xen/vmap.h>
|
||||
#include <asm/io.h>
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
#include <asm/device.h>
|
||||
#endif
|
||||
#ifdef CONFIG_X86
|
||||
@@ -1766,7 +1766,7 @@ void __init ns16550_init(int index, struct ns16550_defaults *defaults)
|
||||
|
||||
#endif /* CONFIG_X86 */
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
|
||||
const void *data)
|
||||
{
|
||||
@@ -1845,7 +1845,7 @@ DT_DEVICE_START(ns16550, "NS16550 UART", DEVICE_SERIAL)
|
||||
.init = ns16550_uart_dt_init,
|
||||
DT_DEVICE_END
|
||||
|
||||
#endif /* HAS_DEVICE_TREE */
|
||||
#endif /* HAS_DEVICE_TREE_DISCOVERY */
|
||||
|
||||
#if defined(CONFIG_ACPI) && defined(CONFIG_ARM)
|
||||
#include <xen/acpi.h>
|
||||
|
||||
@@ -5,6 +5,6 @@ obj-$(CONFIG_ARM) += arm/
|
||||
|
||||
obj-y += iommu.o
|
||||
obj-$(CONFIG_HAS_PCI) += pci.o
|
||||
obj-$(CONFIG_HAS_DEVICE_TREE) += device_tree.o
|
||||
obj-$(CONFIG_HAS_DEVICE_TREE_DISCOVERY) += device_tree.o
|
||||
obj-$(CONFIG_HAS_PCI) += ats.o
|
||||
obj-$(CONFIG_HAS_PCI_MSI) += msi.o
|
||||
@@ -638,7 +638,7 @@ int iommu_do_domctl(
|
||||
ret = iommu_do_pci_domctl(domctl, d, u_domctl);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
if ( ret == -ENODEV )
|
||||
ret = iommu_do_dt_domctl(domctl, d, u_domctl);
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
enum device_type
|
||||
{
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
DEV_DT,
|
||||
#endif
|
||||
DEV_PCI
|
||||
@@ -26,7 +26,7 @@ enum device_class
|
||||
struct device
|
||||
{
|
||||
enum device_type type;
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
struct dt_device_node *of_node; /* Used by drivers imported from Linux */
|
||||
#endif
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
@@ -37,7 +37,7 @@ struct device
|
||||
|
||||
typedef struct device device_t;
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
|
||||
#include <xen/device_tree.h>
|
||||
|
||||
@@ -87,9 +87,9 @@ struct device_desc {
|
||||
int (*init)(struct dt_device_node *dev, const void *data);
|
||||
};
|
||||
|
||||
#else /* !CONFIG_HAS_DEVICE_TREE */
|
||||
#else /* !CONFIG_HAS_DEVICE_TREE_DISCOVERY */
|
||||
#define dev_is_dt(dev) ((void)(dev), false)
|
||||
#endif /* CONFIG_HAS_DEVICE_TREE */
|
||||
#endif /* CONFIG_HAS_DEVICE_TREE_DISCOVERY */
|
||||
|
||||
#define dev_is_pci(dev) ((dev)->type == DEV_PCI)
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ struct msi_msg;
|
||||
#define PT_IRQ_TIME_OUT MILLISECS(8)
|
||||
#endif /* HAS_PCI */
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
#include <xen/device_tree.h>
|
||||
|
||||
#ifdef CONFIG_HAS_PASSTHROUGH
|
||||
@@ -309,7 +309,7 @@ static inline int iommu_add_dt_pci_sideband_ids(struct pci_dev *pdev)
|
||||
|
||||
#endif /* HAS_PASSTHROUGH */
|
||||
|
||||
#endif /* HAS_DEVICE_TREE */
|
||||
#endif /* HAS_DEVICE_TREE_DISCOVERY */
|
||||
|
||||
struct page_info;
|
||||
|
||||
@@ -376,7 +376,7 @@ struct iommu_ops {
|
||||
int (*get_reserved_device_memory)(iommu_grdm_t *func, void *ctxt);
|
||||
void (*dump_page_tables)(struct domain *d);
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
/*
|
||||
* All IOMMU drivers which support generic IOMMU DT bindings should use
|
||||
* this callback. This is a way for the framework to provide the driver
|
||||
@@ -424,7 +424,7 @@ struct domain_iommu {
|
||||
/* iommu_ops */
|
||||
const struct iommu_ops *platform_ops;
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
/* List of DT devices assigned to this domain */
|
||||
struct list_head dt_devices;
|
||||
#endif
|
||||
|
||||
@@ -423,7 +423,7 @@ static XSM_INLINE int cf_check xsm_deassign_device(
|
||||
|
||||
#endif /* HAS_PASSTHROUGH && HAS_PCI */
|
||||
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISCOVERY)
|
||||
static XSM_INLINE int cf_check xsm_assign_dtdevice(
|
||||
XSM_DEFAULT_ARG struct domain *d, const char *dtpath)
|
||||
{
|
||||
@@ -438,7 +438,7 @@ static XSM_INLINE int cf_check xsm_deassign_dtdevice(
|
||||
return xsm_default_action(action, current->domain, d);
|
||||
}
|
||||
|
||||
#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE */
|
||||
#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE_DISCOVERY */
|
||||
|
||||
static XSM_INLINE int cf_check xsm_resource_plug_core(XSM_DEFAULT_VOID)
|
||||
{
|
||||
|
||||
@@ -127,7 +127,7 @@ struct xsm_ops {
|
||||
int (*deassign_device)(struct domain *d, uint32_t machine_bdf);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISCOVERY)
|
||||
int (*assign_dtdevice)(struct domain *d, const char *dtpath);
|
||||
int (*deassign_dtdevice)(struct domain *d, const char *dtpath);
|
||||
#endif
|
||||
@@ -549,7 +549,7 @@ static inline int xsm_deassign_device(
|
||||
}
|
||||
#endif /* HAS_PASSTHROUGH && HAS_PCI) */
|
||||
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISCOVERY)
|
||||
static inline int xsm_assign_dtdevice(
|
||||
xsm_default_t def, struct domain *d, const char *dtpath)
|
||||
{
|
||||
@@ -562,7 +562,7 @@ static inline int xsm_deassign_dtdevice(
|
||||
return alternative_call(xsm_ops.deassign_dtdevice, d, dtpath);
|
||||
}
|
||||
|
||||
#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE */
|
||||
#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE_DISCOVERY */
|
||||
|
||||
static inline int xsm_resource_plug_pci(xsm_default_t def, uint32_t machine_bdf)
|
||||
{
|
||||
@@ -807,7 +807,7 @@ int xsm_multiboot_policy_init(
|
||||
struct boot_info *bi, void **policy_buffer, size_t *policy_size);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
/*
|
||||
* Initialize XSM
|
||||
*
|
||||
@@ -857,7 +857,7 @@ static inline int xsm_multiboot_init(struct boot_info *bi)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
static inline int xsm_dt_init(void)
|
||||
{
|
||||
return 0;
|
||||
@@ -867,7 +867,7 @@ static inline bool has_xsm_magic(paddr_t start)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_HAS_DEVICE_TREE */
|
||||
#endif /* CONFIG_HAS_DEVICE_TREE_DISCOVERY */
|
||||
|
||||
#endif /* CONFIG_XSM */
|
||||
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops = {
|
||||
.deassign_device = xsm_deassign_device,
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISCOVERY)
|
||||
.assign_dtdevice = xsm_assign_dtdevice,
|
||||
.deassign_dtdevice = xsm_deassign_dtdevice,
|
||||
#endif
|
||||
|
||||
@@ -1464,7 +1464,7 @@ static int cf_check flask_deassign_device(
|
||||
}
|
||||
#endif /* HAS_PASSTHROUGH && HAS_PCI */
|
||||
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISCOVERY)
|
||||
static int flask_test_assign_dtdevice(const char *dtpath)
|
||||
{
|
||||
uint32_t rsid;
|
||||
@@ -1525,7 +1525,7 @@ static int cf_check flask_deassign_dtdevice(
|
||||
return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_DEVICE,
|
||||
NULL);
|
||||
}
|
||||
#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE */
|
||||
#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE_DISCOVERY */
|
||||
|
||||
static int cf_check flask_platform_op(uint32_t op)
|
||||
{
|
||||
@@ -1995,7 +1995,7 @@ static const struct xsm_ops __initconst_cf_clobber flask_ops = {
|
||||
.deassign_device = flask_deassign_device,
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE)
|
||||
#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISCOVERY)
|
||||
.assign_dtdevice = flask_assign_dtdevice,
|
||||
.deassign_dtdevice = flask_deassign_dtdevice,
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@
|
||||
#include <asm/setup.h>
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
#include <asm/setup.h>
|
||||
#endif
|
||||
|
||||
@@ -166,7 +166,7 @@ int __init xsm_multiboot_init(struct boot_info *bi)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
int __init xsm_dt_init(void)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <asm/setup.h>
|
||||
#endif
|
||||
#include <xen/bitops.h>
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
# include <asm/setup.h>
|
||||
# include <xen/device_tree.h>
|
||||
#endif
|
||||
@@ -65,7 +65,7 @@ int __init xsm_multiboot_policy_init(
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE
|
||||
#ifdef CONFIG_HAS_DEVICE_TREE_DISCOVERY
|
||||
int __init xsm_dt_policy_init(void **policy_buffer, size_t *policy_size)
|
||||
{
|
||||
struct boot_module *mod = boot_module_find_by_kind(BOOTMOD_XSM_POLICY);
|
||||
|
||||