Message ID | 20161003100948.b4uhjv45urnhttg4@mac (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 03.10.16 at 12:09, <roger.pau@citrix.com> wrote: > I've added the following patch to my queue, in order to allow the user to > select whether they want to use HAP or shadow, I've tested it locally and > there seems to be no issues in building a PVHv2 Dom0 using shadow. Hmm, two remarks: For one, I'm not convinced of the need to move the definition. It being where it is now allows the string literal to be discarded post boot. And considering that the option has presumably been broken for PV for a long time and was never working for PVHv1, I'm also unconvinced using it (and hence retaining its existence) is a good idea - I'd much rather see "dom0hvm=hap" and "dom0hvm=shadow" supported along with the booleans which can be given to it right now. > --- a/xen/include/asm-x86/setup.h > +++ b/xen/include/asm-x86/setup.h > @@ -51,6 +51,12 @@ void microcode_grab_module( > > extern uint8_t kbd_shift_flags; > > +#ifdef CONFIG_SHADOW_PAGING > +extern bool opt_dom0_shadow; > +#else > +#define opt_dom0_shadow 0 Please use "false" here. Jan
On 04/10/2016 07:54, Jan Beulich wrote: >>>> On 03.10.16 at 12:09, <roger.pau@citrix.com> wrote: >> I've added the following patch to my queue, in order to allow the user to >> select whether they want to use HAP or shadow, I've tested it locally and >> there seems to be no issues in building a PVHv2 Dom0 using shadow. > Hmm, two remarks: For one, I'm not convinced of the need to move > the definition. It being where it is now allows the string literal to be > discarded post boot. And considering that the option has presumably > been broken for PV for a long time and was never working for PVHv1, > I'm also unconvinced using it (and hence retaining its existence) is a > good idea - I'd much rather see "dom0hvm=hap" and > "dom0hvm=shadow" supported along with the booleans which can > be given to it right now. We already have a large number of dom0$foo options which are inconsistent with underscores or no word breaks. Could we introduce a dom0= instead and run it like the existing iommu= to avoid gaining any new top level dom0$foo options? ~Andrew
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 80e20fa..17956e2 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -203,13 +203,6 @@ struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0) return setup_dom0_vcpu(dom0, 0, cpumask_first(&dom0_cpus)); } -#ifdef CONFIG_SHADOW_PAGING -static bool_t __initdata opt_dom0_shadow; -boolean_param("dom0_shadow", opt_dom0_shadow); -#else -#define opt_dom0_shadow 0 -#endif - static char __initdata opt_dom0_ioports_disable[200] = ""; string_param("dom0_ioports_disable", opt_dom0_ioports_disable); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 9272318..252125d 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -79,6 +79,11 @@ boolean_param("dom0pvh", opt_dom0pvh); static bool_t __initdata opt_dom0hvm; boolean_param("dom0hvm", opt_dom0hvm); +#ifdef CONFIG_SHADOW_PAGING +bool __initdata opt_dom0_shadow; +boolean_param("dom0_shadow", opt_dom0_shadow); +#endif + /* **** Linux config option: propagated to domain0. */ /* "acpi=off": Sisables both ACPI table parsing and interpreter. */ /* "acpi=force": Override the disable blacklist. */ @@ -1500,7 +1505,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) domcr_flags |= DOMCRF_pvh | DOMCRF_hap; if ( opt_dom0hvm ) { - domcr_flags |= DOMCRF_hvm | (hvm_funcs.hap_supported ? DOMCRF_hap : 0); + domcr_flags |= DOMCRF_hvm | + (hvm_funcs.hap_supported && !opt_dom0_shadow ? + DOMCRF_hap : 0); config.emulation_flags = XEN_X86_EMU_LAPIC|XEN_X86_EMU_IOAPIC; } diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index c65b79c..888d952 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -51,6 +51,12 @@ void microcode_grab_module( extern uint8_t kbd_shift_flags; +#ifdef CONFIG_SHADOW_PAGING +extern bool opt_dom0_shadow; +#else +#define opt_dom0_shadow 0 +#endif + #ifdef NDEBUG # define highmem_start 0 #else