RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1849177 - OVMF: negotiate "SMI on VCPU hotplug" with QEMU
Summary: OVMF: negotiate "SMI on VCPU hotplug" with QEMU
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: edk2
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: pre-dev-freeze
: ---
Assignee: Laszlo Ersek
QA Contact: Yumei Huang
URL:
Whiteboard:
Depends On: 1454803
Blocks: 1849170 1849172
TreeView+ depends on / blocked
 
Reported: 2020-06-19 18:36 UTC by Ademar Reis
Modified: 2021-05-18 15:51 UTC (History)
15 users (show)

Fixed In Version: edk2-20200602gitca407c7246bf-4.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 15:50:59 UTC
Type: Feature Request
Target Upstream Version: edk2-stable202008
Embargoed:


Attachments (Terms of Use)
preliminary upstream patch (applies to upstream 239b50a86370) (4.84 KB, patch)
2020-06-22 14:56 UTC, Laszlo Ersek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
TianoCore 2929 0 None None None 2020-08-26 20:43:09 UTC

Description Ademar Reis 2020-06-19 18:36:20 UTC
VCPU hotplug in edk2, as it is today, doesn't work with the QEMU implementation of VCPU hotplug (being tracked in bug 1849170).

We need to raise SMI on CPU hotplug, with control value ICH9_APM_CNT_CPU_HOTPLUG (4), in the "etc/smi/supported-features" and "etc/smi/requested-features" fw_cfg files.

The vCPU hotplug feature needs to be tested with both changes in place: this BZ and the QEMU changes in bug 1849170.

Notice that VCPU hot-UNPLUG may not work yet. This is being tracked in a separate QEMU BZ: bug 1849172. Still, QEMU should not crash or hang if unplug is unsupported.

This bug was initially created as a copy of Bug #1454803

Comment 1 Laszlo Ersek 2020-06-22 14:56:11 UTC
Created attachment 1698308 [details]
preliminary upstream patch (applies to upstream 239b50a86370)

[PATCH] OvmfPkg/SmmControl2Dxe: negotiate ICH9_LPC_SMI_F_CPU_HOTPLUG

(not posting this upstream until I can test it with Igor's patches for bug 1849170 -- see bug 1849170 comment 4)

Comment 4 Laszlo Ersek 2020-07-14 18:44:30 UTC
Posted upstream patch:

* [edk2-devel] [PATCH] OvmfPkg/SmmControl2Dxe: negotiate ICH9_LPC_SMI_F_CPU_HOTPLUG

https://edk2.groups.io/g/devel/message/62561
http://mid.mail-archive.com/20200714184305.9814-1-lersek@redhat.com

Comment 6 Laszlo Ersek 2020-08-24 16:48:41 UTC
(In reply to Laszlo Ersek from comment #4)
> Posted upstream patch:
> 
> * [edk2-devel] [PATCH] OvmfPkg/SmmControl2Dxe: negotiate
> ICH9_LPC_SMI_F_CPU_HOTPLUG
> 
> https://edk2.groups.io/g/devel/message/62561
> http://mid.mail-archive.com/20200714184305.9814-1-lersek@redhat.com

Merged up-stream as commit 5ba203b54e59, via <https://github.com/tianocore/edk2/pull/897>.

Comment 8 Laszlo Ersek 2020-08-26 10:27:55 UTC
(In reply to Laszlo Ersek from comment #6)
> (In reply to Laszlo Ersek from comment #4)
> > Posted upstream patch:
> > 
> > * [edk2-devel] [PATCH] OvmfPkg/SmmControl2Dxe: negotiate
> > ICH9_LPC_SMI_F_CPU_HOTPLUG
> > 
> > https://edk2.groups.io/g/devel/message/62561
> > http://mid.mail-archive.com/20200714184305.9814-1-lersek@redhat.com
> 
> Merged up-stream as commit 5ba203b54e59, via
> <https://github.com/tianocore/edk2/pull/897>.

We might have to revert his (= just the feat negotiation), approaching the edk2-stable202008 release, due to various races found recently:

http://mid.mail-archive.com/cfd4dd52-4827-2288-4b4e-b396d48494f0@redhat.com
https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg06579.html

Comment 9 Laszlo Ersek 2020-08-26 20:43:09 UTC
Additional patches should be posted for upstream OVMF, in order to fix
the races:

https://bugzilla.tianocore.org/show_bug.cgi?id=2929

This is necessary for a released upstream version of OVMF to negotiate
ICH9_LPC_SMI_F_CPU_HOTPLUG with QEMU (from a usability perspective). If
those patches are merged in time for edk2-stable202008, then this BZ can
be moved again to POST / TestOnly / ...

Otherwise, 5ba203b54e59 will have to be reverted, and this BZ will have
to remain in ASSIGNED status for a while.

Comment 10 Laszlo Ersek 2020-08-26 22:26:35 UTC
Posted

* [edk2-devel] [PATCH 0/2]
  OvmfPkg: fix race conditions in VCPU hotplug (for edk2-stable202008)

https://edk2.groups.io/g/devel/message/64659
http://mid.mail-archive.com/20200826222129.25798-1-lersek@redhat.com

Comment 11 Laszlo Ersek 2020-08-27 18:15:50 UTC
(In reply to Laszlo Ersek from comment #10)
> Posted
> 
> * [edk2-devel] [PATCH 0/2]
>   OvmfPkg: fix race conditions in VCPU hotplug (for edk2-stable202008)
> 
> https://edk2.groups.io/g/devel/message/64659
> http://mid.mail-archive.com/20200826222129.25798-1-lersek@redhat.com

Merged as commit range 63d92674d240..cbccf995920a, via <https://github.com/tianocore/edk2/pull/905>.

Comment 14 Laszlo Ersek 2020-11-09 21:15:24 UTC
Virt-QE:

- This RHBZ completes the work from
  <https://bugzilla.redhat.com/show_bug.cgi?id=1454803>.

- Please use the singular "virsh setvcpu DOMAIN --enable VCPU# --live"
  command, for hot-plugging a particular CPU (this lets you pick a CPU
  with specific topology coordinates).

- Please also use the "virsh setvcpus DOMAIN VCPU_COUNT --live" command,
  for hot-plugging more than 1 VCPU in very quick succession, without
  specifying topology indexes.

- Windows guests preceding the Windows 10 family are out of scope,
  down-stream. Also, Windows Client OSes may be out of scope (consult
  other sources for determining what Windows 10 releases (Client vs.
  Server) are supposed to support VCPU hotplug).

- Note that this edk2 BZ is testable on a qemu-kvm build that fixes
  <https://bugzilla.redhat.com/show_bug.cgi?id=1849170>:

  - Both plug and unplug attempts should be rejected gracefully by
    "virsh" when using the "pc-q35-rhel8.3.0" machine type, or earlier.

  - When using "pc-q35-rhel8.4.0", unplug attempts should be rejected
    gracefully, and plug attempts should succeed.

- Furthermore, edk2 BZ should be regression-tested against the
  RHEL-8.3.0 qemu-kvm build that fixes
  <https://bugzilla.redhat.com/show_bug.cgi?id=1846886>.

  Both plug and unplug are supposed to fail gracefully. (Note that the
  highest version Q35 machine type with such a build is
  "pc-q35-rhel8.3.0".)

- Hot-plugged VCPUs may have to be manually onlined in the Linux guest,
  dependent on guest Linux distro.

  A host-side shorthand for that is the "--guest" option of the (plural)
  "virsh setvcpus" command. Otherwise, manipulate the
  "/sys/devices/system/cpu/cpu<N>/online" pseudo-files in the guest
  directly. (Note that the numbering of these guest-side pathnames is in
  order of the guest kernel *learning of* the hot-added processors; it
  does not necessarily reflect APIC ID order, or libvirt domain XML VCPU
  order.)

- When plugging, you may test VCPU overcommit, but:

  - please note that the performance hit may be significant,

  - please keep
    <https://bugzilla.redhat.com/show_bug.cgi?id=1861718#c24> in mind
    ("we do not support CPU overcommit on a per VM basis").

Comment 16 Yanan Fu 2020-11-25 03:42:52 UTC
Hi Laszlo,

I found one new edk2 build which fix this bz refer to the change log:
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=1390673

But this bug still in POST status, is this normal ? Could you help check it ?
Thanks!

Comment 19 Yumei Huang 2021-01-04 08:58:18 UTC
Hi Laszlo,

I hit error "cpu hotplug with SMI wasn't enabled by firmware" when testing cpu hotplug under ovmf[1]. Igor said it looks like firmware patches weren't backported yet. Would you please double check if all the edk2 patches have been backported to edk2-20200602gitca407c7246bf-4.el8? Thanks!

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1849170#c15

Comment 20 Laszlo Ersek 2021-01-06 10:57:10 UTC
Yes, edk2-20200602gitca407c7246bf-4.el8 should contain everything needed.

I'll respond under bug 1849170.

Comment 21 Yumei Huang 2021-01-07 02:16:35 UTC
Thanks Laszlo!

I'm extending ITM to be same as bug 1849170.

Comment 22 Yumei Huang 2021-01-19 08:59:58 UTC
Verify:
qemu-kvm-5.2.0-3.module+el8.4.0+9499+42e58f08
kernel-4.18.0-275.el8.x86_64
edk2-ovmf-20200602gitca407c7246bf-4.el8.noarch
guest: RHEL8.4, Win2019
machine type: pc-q35-rhel8.4.0

Test scenarios:
1. Hotplug single vcpu to guest w/ and w/o cpu overcommit, test passed.
2. Hotplug multiple vcpus to guest w/ and w/o cpu overcommit, test passed.
3. Unplug vcpu from rhel guest, hit error "cpu hot-unplug with SMI wasn't enabled by firmware" as expected.

Comment 24 errata-xmlrpc 2021-05-18 15:50:59 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (edk2 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2021:1856


Note You need to log in before you can comment on or make changes to this bug.