mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/common: add dom0 xen command line argument for Arm
Currently x86 defines a Xen command line argument dom0=<list> where there can be specified dom0 controlling sub-options, to use it also on Arm, move the code that loops through the list of arguments from x86 to the common code and from there, call architecture specific functions to handle the comma separated sub-options. No functional changes are intended. Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
This commit is contained in:
1 parent
ac5855d5c7
commit
f2095a51ac
4 files changed
+47
-30
No files matched your search
@@ -60,6 +60,11 @@ static int __init parse_dom0_mem(const char *s)
|
||||
}
|
||||
custom_param("dom0_mem", parse_dom0_mem);
|
||||
|
||||
int __init parse_arch_dom0_param(const char *s, const char *e)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Override macros from asm/page.h to make them work with mfn_t */
|
||||
#undef virt_to_mfn
|
||||
#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
|
||||
|
||||
+18
-30
@@ -266,42 +266,30 @@ bool __initdata opt_dom0_pvh = !IS_ENABLED(CONFIG_PV);
|
||||
bool __initdata opt_dom0_verbose = IS_ENABLED(CONFIG_VERBOSE_DEBUG);
|
||||
bool __initdata opt_dom0_msr_relaxed;
|
||||
|
||||
static int __init cf_check parse_dom0_param(const char *s)
|
||||
int __init parse_arch_dom0_param(const char *s, const char *e)
|
||||
{
|
||||
const char *ss;
|
||||
int rc = 0;
|
||||
int val;
|
||||
|
||||
do {
|
||||
int val;
|
||||
|
||||
ss = strchr(s, ',');
|
||||
if ( !ss )
|
||||
ss = strchr(s, '\0');
|
||||
|
||||
if ( IS_ENABLED(CONFIG_PV) && !cmdline_strcmp(s, "pv") )
|
||||
opt_dom0_pvh = false;
|
||||
else if ( IS_ENABLED(CONFIG_HVM) && !cmdline_strcmp(s, "pvh") )
|
||||
opt_dom0_pvh = true;
|
||||
if ( IS_ENABLED(CONFIG_PV) && !cmdline_strcmp(s, "pv") )
|
||||
opt_dom0_pvh = false;
|
||||
else if ( IS_ENABLED(CONFIG_HVM) && !cmdline_strcmp(s, "pvh") )
|
||||
opt_dom0_pvh = true;
|
||||
#ifdef CONFIG_SHADOW_PAGING
|
||||
else if ( (val = parse_boolean("shadow", s, ss)) >= 0 )
|
||||
opt_dom0_shadow = val;
|
||||
else if ( (val = parse_boolean("shadow", s, e)) >= 0 )
|
||||
opt_dom0_shadow = val;
|
||||
#endif
|
||||
else if ( (val = parse_boolean("verbose", s, ss)) >= 0 )
|
||||
opt_dom0_verbose = val;
|
||||
else if ( IS_ENABLED(CONFIG_PV) &&
|
||||
(val = parse_boolean("cpuid-faulting", s, ss)) >= 0 )
|
||||
opt_dom0_cpuid_faulting = val;
|
||||
else if ( (val = parse_boolean("msr-relaxed", s, ss)) >= 0 )
|
||||
opt_dom0_msr_relaxed = val;
|
||||
else
|
||||
rc = -EINVAL;
|
||||
else if ( (val = parse_boolean("verbose", s, e)) >= 0 )
|
||||
opt_dom0_verbose = val;
|
||||
else if ( IS_ENABLED(CONFIG_PV) &&
|
||||
(val = parse_boolean("cpuid-faulting", s, e)) >= 0 )
|
||||
opt_dom0_cpuid_faulting = val;
|
||||
else if ( (val = parse_boolean("msr-relaxed", s, e)) >= 0 )
|
||||
opt_dom0_msr_relaxed = val;
|
||||
else
|
||||
return -EINVAL;
|
||||
|
||||
s = ss + 1;
|
||||
} while ( *ss );
|
||||
|
||||
return rc;
|
||||
return 0;
|
||||
}
|
||||
custom_param("dom0", parse_dom0_param);
|
||||
|
||||
static char __initdata opt_dom0_ioports_disable[200] = "";
|
||||
string_param("dom0_ioports_disable", opt_dom0_ioports_disable);
|
||||
|
||||
@@ -364,6 +364,29 @@ static int __init cf_check parse_extra_guest_irqs(const char *s)
|
||||
}
|
||||
custom_param("extra_guest_irqs", parse_extra_guest_irqs);
|
||||
|
||||
static int __init cf_check parse_dom0_param(const char *s)
|
||||
{
|
||||
const char *ss;
|
||||
int rc = 0;
|
||||
|
||||
do {
|
||||
int ret;
|
||||
|
||||
ss = strchr(s, ',');
|
||||
if ( !ss )
|
||||
ss = strchr(s, '\0');
|
||||
|
||||
ret = parse_arch_dom0_param(s, ss);
|
||||
if ( ret && !rc )
|
||||
rc = ret;
|
||||
|
||||
s = ss + 1;
|
||||
} while ( *ss );
|
||||
|
||||
return rc;
|
||||
}
|
||||
custom_param("dom0", parse_dom0_param);
|
||||
|
||||
/*
|
||||
* Release resources held by a domain. There may or may not be live
|
||||
* references to the domain, and it may or may not be fully constructed.
|
||||
|
||||
@@ -16,6 +16,7 @@ typedef union {
|
||||
struct vcpu *vcpu_create(struct domain *d, unsigned int vcpu_id);
|
||||
|
||||
unsigned int dom0_max_vcpus(void);
|
||||
int parse_arch_dom0_param(const char *s, const char *e);
|
||||
struct vcpu *alloc_dom0_vcpu0(struct domain *dom0);
|
||||
|
||||
int vcpu_reset(struct vcpu *);
|
||||
|
||||