public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, jiaxin.wu@intel.com
Cc: aaron.young@oracle.com,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: [ann] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Date: Thu, 1 Oct 2020 11:59:42 +0200	[thread overview]
Message-ID: <162138ff-e88a-a1c6-0b81-c6d91b1a955e@redhat.com> (raw)
In-Reply-To: <DM5PR11MB13722B796E2D9203D8D95FD0FE700@DM5PR11MB1372.namprd11.prod.outlook.com>

Hello Jiaxin,

On 07/29/20 10:37, Wu, Jiaxin wrote:
> Hi Laszlo,
>
> Appreciate your feedback! Thank you very much.

if you are still interested in using this feature, I have some good
news.

As of current edk2 master (to be entirely precise: as of edk2 commit
cbccf995920a), and as of upstream QEMU commit 6e2e2e8a4220, the "VCPU
hotplug with SMM" feature is considered complete.

Both the singular "virsh setvcpu" command (which gives you precise NUMA
affinity for the VCPU being hot-plugged), and the plural "virsh
setvcpus" command, are expected to work. (For plugging.)

I'm repeating a short summary here about the necessary configuration on
your end:

* install a Linux guest as described in my Wiki article:

  https://github.com/tianocore/tianocore.github.io/wiki/Testing-SMM-with-QEMU,-KVM-and-libvirt

* modify the domain XML for the guest:,

 - replace the "pc-q35-2.9" machine type with "pc-q35-5.2"

 - replace the following stanza:

   <vcpu placement='static'>4</vcpu>

   with:

  <vcpu placement='static' current='2'>4</vcpu>
  <vcpus>
    <vcpu id='0' enabled='yes' hotpluggable='no'/>
    <vcpu id='1' enabled='no' hotpluggable='yes'/>
    <vcpu id='2' enabled='yes' hotpluggable='yes'/>
    <vcpu id='3' enabled='no' hotpluggable='yes'/>
  </vcpus>

* With Linux guests, you may have to online the just-plugged VCPUs in
  the guest as a separate step (dependent on your guest Linux
  distribution). For this, you can either use (in the guest) commands
  like

  echo 1 > /sys/devices/system/cpu/cpu2/online
  echo 1 > /sys/devices/system/cpu/cpu3/online

  (note that the numbering is in order of the Linux guest learning of
  the processor).

  Alternatively, in case you used the plural "virsh setvcpus" command,
  *and* you have the guest agent running in your guest, you can follow
  up with

  virsh setvcpus ... --guest

  on the host side (the "--guest" option being the important one). This
  will ask the QEMU guest agent to perform the same onlining as the
  explicit "echo" commands above.

* Windows guests do not need separate onlining of the hot-added CPUs.
  The oldest Windows release that (to my knowledge) supports CPU hotplug
  is Windows Server 2008 R2 *Datacenter* edition.

Thanks
Laszlo


      reply	other threads:[~2020-10-01  9:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-23 17:25 [PATCH 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE Laszlo Ersek
2020-02-23 17:25 ` [PATCH 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure Laszlo Ersek
2020-02-23 17:25 ` [PATCH 02/16] UefiCpuPkg/PiSmmCpuDxeSmm: fix S3 Resume for CPU hotplug Laszlo Ersek
2020-02-23 17:25 ` [PATCH 03/16] OvmfPkg: clone SmmCpuPlatformHookLib from UefiCpuPkg Laszlo Ersek
2020-02-23 17:25 ` [PATCH 04/16] OvmfPkg: enable SMM Monarch Election in PiSmmCpuDxeSmm Laszlo Ersek
2020-02-23 17:25 ` [PATCH 05/16] OvmfPkg: enable CPU hotplug support " Laszlo Ersek
2020-02-23 17:25 ` [PATCH 06/16] OvmfPkg/CpuHotplugSmm: introduce skeleton for CPU Hotplug SMM driver Laszlo Ersek
2020-02-23 17:25 ` [PATCH 07/16] OvmfPkg/CpuHotplugSmm: add hotplug register block helper functions Laszlo Ersek
2020-02-23 17:25 ` [PATCH 08/16] OvmfPkg/CpuHotplugSmm: define the QEMU_CPUHP_CMD_GET_ARCH_ID macro Laszlo Ersek
2020-02-23 17:25 ` [PATCH 09/16] OvmfPkg/CpuHotplugSmm: add function for collecting CPUs with events Laszlo Ersek
2020-02-23 17:25 ` [PATCH 10/16] OvmfPkg/CpuHotplugSmm: collect " Laszlo Ersek
2020-02-23 17:25 ` [PATCH 11/16] OvmfPkg/CpuHotplugSmm: introduce Post-SMM Pen for hot-added CPUs Laszlo Ersek
2020-02-23 17:25 ` [PATCH 12/16] OvmfPkg/CpuHotplugSmm: introduce First SMI Handler " Laszlo Ersek
2020-02-24  9:10   ` [edk2-devel] " Laszlo Ersek
2020-02-26 21:22     ` Laszlo Ersek
2020-02-23 17:25 ` [PATCH 13/16] OvmfPkg/CpuHotplugSmm: complete root MMI handler for CPU hotplug Laszlo Ersek
2020-02-23 17:25 ` [PATCH 14/16] OvmfPkg: clone CpuS3DataDxe from UefiCpuPkg Laszlo Ersek
2020-02-23 17:25 ` [PATCH 15/16] OvmfPkg/CpuS3DataDxe: superficial cleanups Laszlo Ersek
2020-02-23 17:25 ` [PATCH 16/16] OvmfPkg/CpuS3DataDxe: enable S3 resume after CPU hotplug Laszlo Ersek
2020-02-24 16:31 ` [PATCH 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE Ard Biesheuvel
2020-07-24  6:26 ` [edk2-devel] " Wu, Jiaxin
2020-07-24 16:01   ` Laszlo Ersek
2020-07-29  8:37     ` Wu, Jiaxin
2020-10-01  9:59       ` Laszlo Ersek [this message]

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-list 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=162138ff-e88a-a1c6-0b81-c6d91b1a955e@redhat.com \
    --to=devel@edk2.groups.io \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox