All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/vcpu: relax VCPUOP_initialise restriction for non-PV vCPUs
@ 2024-03-20 13:57 Roger Pau Monne
  2024-03-20 14:06 ` Andrew Cooper
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Roger Pau Monne @ 2024-03-20 13:57 UTC (permalink / raw)
  To: xen-devel
  Cc: Roger Pau Monne, Andrew Cooper, George Dunlap, Jan Beulich,
	Julien Grall, Stefano Stabellini, Wei Liu

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.

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>
---
 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 7ff238cc2656..6b4afc823217 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 f6f557499660..d956dc09eca0 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1817,7 +1817,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);
-- 
2.44.0



^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-03-27  7:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20 13:57 [PATCH] x86/vcpu: relax VCPUOP_initialise restriction for non-PV vCPUs Roger Pau Monne
2024-03-20 14:06 ` Andrew Cooper
2024-03-20 14:26   ` Roger Pau Monné
2024-03-20 14:39     ` Andrew Cooper
2024-03-26 22:08       ` Julien Grall
2024-03-27  7:15         ` Jan Beulich
2024-03-20 15:03   ` Jan Beulich
2024-03-20 15:09 ` Jan Beulich
2024-03-20 15:20   ` Andrew Cooper
2024-03-21  7:55     ` Jan Beulich
2024-03-20 16:29   ` Roger Pau Monné
2024-03-21  8:07     ` Jan Beulich
2024-03-21  9:10       ` Roger Pau Monné
2024-03-21  9:17         ` Jan Beulich
2024-03-21  9:57           ` Roger Pau Monné
2024-03-21 10:18             ` Jan Beulich
2024-03-25 10:17 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.