All of lore.kernel.org
 help / color / mirror / Atom feed
From: Igor Druzhinin <igor.druzhinin@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: <paul@xen.org>, <wl@xen.org>, <iwj@xenproject.org>,
	<anthony.perard@citrix.com>, <andrew.cooper3@citrix.com>,
	<george.dunlap@citrix.com>, <jbeulich@suse.com>, <julien@xen.org>,
	<sstabellini@kernel.org>, <roger.pau@citrix.com>,
	Igor Druzhinin <igor.druzhinin@citrix.com>
Subject: [PATCH 2/2] viridian: allow vCPU hotplug for Windows VMs
Date: Fri, 8 Jan 2021 00:46:36 +0000	[thread overview]
Message-ID: <1610066796-17266-2-git-send-email-igor.druzhinin@citrix.com> (raw)
In-Reply-To: <1610066796-17266-1-git-send-email-igor.druzhinin@citrix.com>

If Viridian extensions are enabled, Windows wouldn't currently allow
a hotplugged vCPU to be brought up dynamically. We need to expose a special
bit to let the guest know we allow it. It appears we can just start exposing
it without worrying too much about compatibility - see relevant QEMU
discussion here:

https://patchwork.kernel.org/project/qemu-devel/patch/1455364815-19586-1-git-send-email-den@openvz.org/

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
---
 xen/arch/x86/hvm/viridian/viridian.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c
index ae1ea86..76e8291 100644
--- a/xen/arch/x86/hvm/viridian/viridian.c
+++ b/xen/arch/x86/hvm/viridian/viridian.c
@@ -76,6 +76,7 @@ typedef union _HV_CRASH_CTL_REG_CONTENTS
 } HV_CRASH_CTL_REG_CONTENTS;
 
 /* Viridian CPUID leaf 3, Hypervisor Feature Indication */
+#define CPUID3D_CPU_DYNAMIC_PARTITIONING (1 << 3)
 #define CPUID3D_CRASH_MSRS (1 << 10)
 #define CPUID3D_SINT_POLLING (1 << 17)
 
@@ -179,8 +180,11 @@ void cpuid_viridian_leaves(const struct vcpu *v, uint32_t leaf,
         res->a = u.lo;
         res->b = u.hi;
 
+        /* Expose ability to bring up VPs dynamically - allows vCPU hotplug */
+        res->d = CPUID3D_CPU_DYNAMIC_PARTITIONING;
+
         if ( viridian_feature_mask(d) & HVMPV_crash_ctl )
-            res->d = CPUID3D_CRASH_MSRS;
+            res->d |= CPUID3D_CRASH_MSRS;
         if ( viridian_feature_mask(d) & HVMPV_synic )
             res->d |= CPUID3D_SINT_POLLING;
 
-- 
2.7.4



  reply	other threads:[~2021-01-08  0:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08  0:46 [PATCH 1/2] viridian: remove implicit limit of 64 VPs per partition Igor Druzhinin
2021-01-08  0:46 ` Igor Druzhinin [this message]
2021-01-08  8:38   ` [PATCH 2/2] viridian: allow vCPU hotplug for Windows VMs Paul Durrant
2021-01-08 11:29     ` Igor Druzhinin
2021-01-08 11:33       ` Paul Durrant
2021-01-08 11:35         ` Igor Druzhinin
2021-01-08 11:40           ` Paul Durrant
2021-01-08 11:42             ` Igor Druzhinin
2021-01-08  8:32 ` [PATCH 1/2] viridian: remove implicit limit of 64 VPs per partition Paul Durrant
2021-01-08 10:15   ` Andrew Cooper
2021-01-08 11:48   ` Igor Druzhinin
2021-01-09  0:55   ` Igor Druzhinin
2021-01-11  8:45     ` Paul Durrant
2021-01-11  8:59       ` Jan Beulich
2021-01-11  9:09         ` Paul Durrant
2021-01-11  9:12           ` Paul Durrant
2021-01-11  9:16             ` Jan Beulich
2021-01-11  9:20               ` Paul Durrant
2021-01-11 13:34               ` Igor Druzhinin
2021-01-11 13:38                 ` Jan Beulich
2021-01-11 13:47                   ` Paul Durrant
2021-01-11 13:50                     ` Igor Druzhinin
2021-01-11  9:13           ` Jan Beulich
2021-01-08  9:19 ` Jan Beulich
2021-01-08 11:27   ` Igor Druzhinin
2021-01-08 13:17     ` Jan Beulich
2021-01-08 13:25       ` Igor Druzhinin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1610066796-17266-2-git-send-email-igor.druzhinin@citrix.com \
    --to=igor.druzhinin@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=paul@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.