]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/vcpu: relax VCPUOP_initialise restriction for non-PV vCPUs
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 25 Mar 2024 09:48:23 +0000 (10:48 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 25 Mar 2024 09:48:23 +0000 (10:48 +0100)
There's no reason to force HVM guests to have a valid vcpu_info area when
initializing a vCPU, as the vCPU can also be brought online using the local
APIC, and on that path there's no requirement for vcpu_info to be setup ahead
of the bring up.  Note an HVM vCPU can operate normally without making use of
vcpu_info, and in fact does so when brought up via the local APIC.

Restrict the check against dummy_vcpu_info to only apply to PV guests.

Fixes: 192df6f9122d ('x86: allow HVM guests to use hypercalls to bring up vCPUs')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/compat/domain.c
xen/common/domain.c

index 7ff238cc265645e8b8a130b682794aa8e4a2453a..6b4afc8232171a94132919a0b015cfe411329ecc 100644 (file)
@@ -49,7 +49,7 @@ int compat_common_vcpu_op(int cmd, struct vcpu *v,
     {
     case VCPUOP_initialise:
     {
-        if ( v->vcpu_info_area.map == &dummy_vcpu_info )
+        if ( is_pv_domain(d) && v->vcpu_info_area.map == &dummy_vcpu_info )
             return -EINVAL;
 
 #ifdef CONFIG_HVM
index 9b42eee44af65785ea643dd7061a7d3e8f7638ea..ceb44c826685b437d51789bde699f94744a761a8 100644 (file)
@@ -1827,7 +1827,7 @@ long common_vcpu_op(int cmd, struct vcpu *v, XEN_GUEST_HANDLE_PARAM(void) arg)
     switch ( cmd )
     {
     case VCPUOP_initialise:
-        if ( v->vcpu_info_area.map == &dummy_vcpu_info )
+        if ( is_pv_domain(d) && v->vcpu_info_area.map == &dummy_vcpu_info )
             return -EINVAL;
 
         rc = arch_initialise_vcpu(v, arg);