[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] x86/vcpu: relax VCPUOP_initialise restriction for non-PV vCPUs



commit 03e484a4f6fbf833f5b6fba3b8cebf43ca433f3a
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Mar 25 10:48:23 2024 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Mar 25 10:48:23 2024 +0100

    x86/vcpu: relax VCPUOP_initialise restriction for non-PV vCPUs
    
    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@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/common/compat/domain.c | 2 +-
 xen/common/domain.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c
index 7ff238cc26..6b4afc8232 100644
--- a/xen/common/compat/domain.c
+++ b/xen/common/compat/domain.c
@@ -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
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 9b42eee44a..ceb44c8266 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -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);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.