On Tue, Aug 23, 2022 at 01:56:22PM +0200, Jan Beulich wrote:
> --- a/xen/arch/x86/hvm/dom0_build.c
> +++ b/xen/arch/x86/hvm/dom0_build.c
> @@ -55,6 +55,9 @@
> */
> #define HVM_VM86_TSS_SIZE 265
>
> +bool __initdata opt_dom0_assisted_xapic = true;
> +bool __initdata opt_dom0_assisted_x2apic = true;
Defaulting those to true unconditionally is troublesome, as the check
in arch_sanitise_domain_config() will fail if either
assisted_x{2,}apic_available is not true, and dom0 domain creation
will fail, so...
> +
> static unsigned int __initdata acpi_intr_overrides;
> static struct acpi_madt_interrupt_override __initdata *intsrcovr;
>
> --- a/xen/arch/x86/include/asm/setup.h
> +++ b/xen/arch/x86/include/asm/setup.h
> @@ -68,6 +68,14 @@ extern bool opt_dom0_verbose;
> extern bool opt_dom0_cpuid_faulting;
> extern bool opt_dom0_msr_relaxed;
>
> +#ifdef CONFIG_HVM
> +extern bool opt_dom0_assisted_xapic;
> +extern bool opt_dom0_assisted_x2apic;
> +#else
> +#define opt_dom0_assisted_xapic false
> +#define opt_dom0_assisted_x2apic false
> +#endif
> +
> #define max_init_domid (0)
>
> #endif
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -784,6 +784,11 @@ static struct domain *__init create_dom0
>
> dom0_cfg.arch.emulation_flags |=
> XEN_X86_EMU_LAPIC | XEN_X86_EMU_IOAPIC | XEN_X86_EMU_VPCI;
> +
> + if ( opt_dom0_assisted_xapic )
> + dom0_cfg.arch.misc_flags |= XEN_X86_ASSISTED_XAPIC;
> + if ( opt_dom0_assisted_x2apic )
> + dom0_cfg.arch.misc_flags |= XEN_X86_ASSISTED_X2APIC;
...the values of assisted_x{2,}apic_available need to be taken into
account here in order to avoid requesting an invalid configuration.
I could swear I have checked PVH dom0 interaction when reviewing the
original patch, but I clearly missed it.
Thanks, Roger.