x86/hvm: short-circuit HVM shadow guest creation earlier

If shadow paging has been compiled out short circuit the creation of HVM
guests that attempt to use shadow paging at arch_sanitise_domain_config().
There's no need to further build the domain when creation is doomed to fail
later on.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
This commit is contained in:
Roger Pau Monne committed 2026-02-10 08:58:25 +01:00
1 parent 1ee8b11c11
commit ddd52db068
1 file changed
+6
+6
View File
@@ -627,6 +627,12 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
return -EINVAL;
}
if ( hvm && !hap && !IS_ENABLED(CONFIG_SHADOW_PAGING) )
{
dprintk(XENLOG_INFO, "Shadow paging requested but not available\n");
return -EINVAL;
}
if ( !hvm )
/*
* It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.