On 13.11.2023 20:05, Stewart Hildebrand wrote: > On 11/13/23 08:26, Jan Beulich wrote: >> On 02.11.2023 20:59, Stewart Hildebrand wrote: >>> @@ -575,6 +577,18 @@ static int sanitise_domain_config(struct >>> xen_domctl_createdomain *config) >>> return -EINVAL; >>> } >>> >>> + if ( vpci && !hvm ) >>> + { >>> + dprintk(XENLOG_INFO, "vPCI requested for non-HVM guest\n"); >>> + return -EINVAL; >>> + } >>> + >>> + if ( vpci && !IS_ENABLED(CONFIG_HAS_VPCI) ) >>> + { >>> + dprintk(XENLOG_INFO, "vPCI requested but not enabled\n"); >>> + return -EINVAL; >>> + } >> >> Maybe flip the order of these checks? But I'm uncertain about the first >> one anyway: Isn't this something that needs deciding per-arch? > > In v4, the equivalent of the ( vpci && !hvm ) check was indeed in > xen/arch/x86/domain.c:emulation_flags_ok(), but it seemed there was a > suggestion that it be moved to common code... See discussion at [1]. How > about putting it back into xen/arch/x86/domain.c, in > arch_sanitise_domain_config(), not emulation_flags_ok()?
Actually no, I take back that part of the comment. I think I mistakenly considered PVH as "non-HVM" (as the log message has it). Jan > [1] https://lists.xenproject.org/archives/html/xen-devel/2023-10/msg02345.html