[edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE

Laszlo Ersek posted 16 patches 5 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/20200226221156.29589-1-lersek@redhat.com
MdeModulePkg/Core/PiSmmCore/Dispatcher.c                                                                                                              |   6 +
OvmfPkg/CpuHotplugSmm/ApicId.h                                                                                                                        |  23 ++
OvmfPkg/CpuHotplugSmm/CpuHotplug.c                                                                                                                    | 426 ++++++++++++++++++++
OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf                                                                                                               |  64 +++
OvmfPkg/CpuHotplugSmm/FirstSmiHandler.nasm                                                                                                            | 154 +++++++
OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h                                                                                                        |  47 +++
OvmfPkg/CpuHotplugSmm/PostSmmPen.nasm                                                                                                                 | 151 +++++++
OvmfPkg/CpuHotplugSmm/QemuCpuhp.c                                                                                                                     | 301 ++++++++++++++
OvmfPkg/CpuHotplugSmm/QemuCpuhp.h                                                                                                                     |  61 +++
OvmfPkg/CpuHotplugSmm/Smbase.c                                                                                                                        | 267 ++++++++++++
OvmfPkg/CpuHotplugSmm/Smbase.h                                                                                                                        |  46 +++
OvmfPkg/Include/IndustryStandard/Q35MchIch9.h                                                                                                         |   5 +-
OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h                                                                                                     |   3 +
OvmfPkg/OvmfPkgIa32.dsc                                                                                                                               |   7 +-
OvmfPkg/OvmfPkgIa32.fdf                                                                                                                               |   3 +-
OvmfPkg/OvmfPkgIa32X64.dsc                                                                                                                            |   7 +-
OvmfPkg/OvmfPkgIa32X64.fdf                                                                                                                            |   3 +-
OvmfPkg/OvmfPkgX64.dsc                                                                                                                                |   7 +-
OvmfPkg/OvmfPkgX64.fdf                                                                                                                                |   3 +-
UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.c     |  45 ++-
UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.inf |  24 +-
UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c                                                                                                                     |  14 +-
{UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3Data.c                                                                                                      |  99 +++--
{UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3DataDxe.inf                                                                                                 |  30 +-
24 files changed, 1707 insertions(+), 89 deletions(-)
copy UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.c (61%)
copy UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.inf (43%)
copy {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3Data.c (77%)
copy {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3DataDxe.inf (69%)
create mode 100644 OvmfPkg/CpuHotplugSmm/ApicId.h
create mode 100644 OvmfPkg/CpuHotplugSmm/CpuHotplug.c
create mode 100644 OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
create mode 100644 OvmfPkg/CpuHotplugSmm/FirstSmiHandler.nasm
create mode 100644 OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h
create mode 100644 OvmfPkg/CpuHotplugSmm/PostSmmPen.nasm
create mode 100644 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c
create mode 100644 OvmfPkg/CpuHotplugSmm/QemuCpuhp.h
create mode 100644 OvmfPkg/CpuHotplugSmm/Smbase.c
create mode 100644 OvmfPkg/CpuHotplugSmm/Smbase.h
[edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Posted by Laszlo Ersek 5 years, 11 months ago
Supersedes: <20200223172537.28464-1-lersek@redhat.com>
Bugzilla:   https://bugzilla.tianocore.org/show_bug.cgi?id=1512
Repo:       https://github.com/lersek/edk2.git
Branch:     vcpu_hotplug_smm_bz_1512_v2

V1 was posted at:

* [edk2-devel] [PATCH 00/16]
  OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE

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

New in v2:

- Document (in patch#11) and implement (in patch#12) the "combined"
  approach described here:

  http://mid.mail-archive.com/111145fc-be3d-2a9a-a126-c14345a8a8a4@redhat.com
  https://edk2.groups.io/g/devel/message/54754

  The idea is basically to make the SMM Monarch wait not just until the
  hot-added CPU hits the normal RAM Post-SMM Pen (which is safe wrt.
  ordering, but can be attacked by the OS), but *also* until the
  hot-added CPU is just about to execute RSM first (which is a bit less
  safe wrt. ordering, but cannot be attacked by the OS).

- Pick up Ard's conditional A-b for the other patches, which have not
  been modified.

- Rebase to master, and retest.

See the Notes sections on the individual patches.

I wanted to get v2 out on the list before having to ask Intel folks to
do an incremental review.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Ray Ni <ray.ni@intel.com>

Thanks,
Laszlo

Laszlo Ersek (16):
  MdeModulePkg/PiSmmCore: log SMM image start failure
  UefiCpuPkg/PiSmmCpuDxeSmm: fix S3 Resume for CPU hotplug
  OvmfPkg: clone SmmCpuPlatformHookLib from UefiCpuPkg
  OvmfPkg: enable SMM Monarch Election in PiSmmCpuDxeSmm
  OvmfPkg: enable CPU hotplug support in PiSmmCpuDxeSmm
  OvmfPkg/CpuHotplugSmm: introduce skeleton for CPU Hotplug SMM driver
  OvmfPkg/CpuHotplugSmm: add hotplug register block helper functions
  OvmfPkg/CpuHotplugSmm: define the QEMU_CPUHP_CMD_GET_ARCH_ID macro
  OvmfPkg/CpuHotplugSmm: add function for collecting CPUs with events
  OvmfPkg/CpuHotplugSmm: collect CPUs with events
  OvmfPkg/CpuHotplugSmm: introduce Post-SMM Pen for hot-added CPUs
  OvmfPkg/CpuHotplugSmm: introduce First SMI Handler for hot-added CPUs
  OvmfPkg/CpuHotplugSmm: complete root MMI handler for CPU hotplug
  OvmfPkg: clone CpuS3DataDxe from UefiCpuPkg
  OvmfPkg/CpuS3DataDxe: superficial cleanups
  OvmfPkg/CpuS3DataDxe: enable S3 resume after CPU hotplug

 MdeModulePkg/Core/PiSmmCore/Dispatcher.c                                                                                                              |   6 +
 OvmfPkg/CpuHotplugSmm/ApicId.h                                                                                                                        |  23 ++
 OvmfPkg/CpuHotplugSmm/CpuHotplug.c                                                                                                                    | 426 ++++++++++++++++++++
 OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf                                                                                                               |  64 +++
 OvmfPkg/CpuHotplugSmm/FirstSmiHandler.nasm                                                                                                            | 154 +++++++
 OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h                                                                                                        |  47 +++
 OvmfPkg/CpuHotplugSmm/PostSmmPen.nasm                                                                                                                 | 151 +++++++
 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c                                                                                                                     | 301 ++++++++++++++
 OvmfPkg/CpuHotplugSmm/QemuCpuhp.h                                                                                                                     |  61 +++
 OvmfPkg/CpuHotplugSmm/Smbase.c                                                                                                                        | 267 ++++++++++++
 OvmfPkg/CpuHotplugSmm/Smbase.h                                                                                                                        |  46 +++
 OvmfPkg/Include/IndustryStandard/Q35MchIch9.h                                                                                                         |   5 +-
 OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h                                                                                                     |   3 +
 OvmfPkg/OvmfPkgIa32.dsc                                                                                                                               |   7 +-
 OvmfPkg/OvmfPkgIa32.fdf                                                                                                                               |   3 +-
 OvmfPkg/OvmfPkgIa32X64.dsc                                                                                                                            |   7 +-
 OvmfPkg/OvmfPkgIa32X64.fdf                                                                                                                            |   3 +-
 OvmfPkg/OvmfPkgX64.dsc                                                                                                                                |   7 +-
 OvmfPkg/OvmfPkgX64.fdf                                                                                                                                |   3 +-
 UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.c     |  45 ++-
 UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.inf |  24 +-
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c                                                                                                                     |  14 +-
 {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3Data.c                                                                                                      |  99 +++--
 {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3DataDxe.inf                                                                                                 |  30 +-
 24 files changed, 1707 insertions(+), 89 deletions(-)
 copy UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.c (61%)
 copy UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.inf (43%)
 copy {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3Data.c (77%)
 copy {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3DataDxe.inf (69%)
 create mode 100644 OvmfPkg/CpuHotplugSmm/ApicId.h
 create mode 100644 OvmfPkg/CpuHotplugSmm/CpuHotplug.c
 create mode 100644 OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
 create mode 100644 OvmfPkg/CpuHotplugSmm/FirstSmiHandler.nasm
 create mode 100644 OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h
 create mode 100644 OvmfPkg/CpuHotplugSmm/PostSmmPen.nasm
 create mode 100644 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c
 create mode 100644 OvmfPkg/CpuHotplugSmm/QemuCpuhp.h
 create mode 100644 OvmfPkg/CpuHotplugSmm/Smbase.c
 create mode 100644 OvmfPkg/CpuHotplugSmm/Smbase.h


base-commit: edfe16a6d9f8c6830d7ad93ee7616225fe4e9c13
-- 
2.19.1.3.g30247aa5d201


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#54945): https://edk2.groups.io/g/devel/message/54945
Mute This Topic: https://groups.io/mt/71575167/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Posted by Boris Ostrovsky 5 years, 11 months ago
On Wed, Feb 26, 2020 at 05:12 PM, Laszlo Ersek wrote:

> 
> Supersedes: <20200223172537.28464-1-lersek@redhat.com>
> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> Repo: https://github.com/lersek/edk2.git
> Branch: vcpu_hotplug_smm_bz_1512_v2
> 
> V1 was posted at:
> 
> * [edk2-devel] [PATCH 00/16]
> OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
> 
> https://edk2.groups.io/g/devel/message/54734
> http://mid.mail-archive.com/20200223172537.28464-1-lersek@redhat.com

Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55234): https://edk2.groups.io/g/devel/message/55234
Mute This Topic: https://groups.io/mt/71575167/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Posted by Laszlo Ersek 5 years, 11 months ago
On 03/02/20 16:46, Boris Ostrovsky wrote:
> On Wed, Feb 26, 2020 at 05:12 PM, Laszlo Ersek wrote:
> 
>>
>> Supersedes: <20200223172537.28464-1-lersek@redhat.com>
>> Bugzilla: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
>> Repo: https://github.com/lersek/edk2.git
>> Branch: vcpu_hotplug_smm_bz_1512_v2
>>
>> V1 was posted at:
>>
>> * [edk2-devel] [PATCH 00/16]
>> OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
>>
>> https://edk2.groups.io/g/devel/message/54734
>> http://mid.mail-archive.com/20200223172537.28464-1-lersek@redhat.com
> 
> Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> 

Thanks!
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55235): https://edk2.groups.io/g/devel/message/55235
Mute This Topic: https://groups.io/mt/71575167/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Posted by Laszlo Ersek 5 years, 11 months ago
On 02/26/20 23:11, Laszlo Ersek wrote:
> Supersedes: <20200223172537.28464-1-lersek@redhat.com>
> Bugzilla:   https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> Repo:       https://github.com/lersek/edk2.git
> Branch:     vcpu_hotplug_smm_bz_1512_v2
> 
> V1 was posted at:
> 
> * [edk2-devel] [PATCH 00/16]
>   OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
> 
>   https://edk2.groups.io/g/devel/message/54734
>   http://mid.mail-archive.com/20200223172537.28464-1-lersek@redhat.com
> 
> New in v2:
> 
> - Document (in patch#11) and implement (in patch#12) the "combined"
>   approach described here:
> 
>   http://mid.mail-archive.com/111145fc-be3d-2a9a-a126-c14345a8a8a4@redhat.com
>   https://edk2.groups.io/g/devel/message/54754
> 
>   The idea is basically to make the SMM Monarch wait not just until the
>   hot-added CPU hits the normal RAM Post-SMM Pen (which is safe wrt.
>   ordering, but can be attacked by the OS), but *also* until the
>   hot-added CPU is just about to execute RSM first (which is a bit less
>   safe wrt. ordering, but cannot be attacked by the OS).
> 
> - Pick up Ard's conditional A-b for the other patches, which have not
>   been modified.
> 
> - Rebase to master, and retest.
> 
> See the Notes sections on the individual patches.
> 
> I wanted to get v2 out on the list before having to ask Intel folks to
> do an incremental review.
> 
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Michael Kinney <michael.d.kinney@intel.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Ray Ni <ray.ni@intel.com>
> 
> Thanks,
> Laszlo
> 
> Laszlo Ersek (16):
>   MdeModulePkg/PiSmmCore: log SMM image start failure
>   UefiCpuPkg/PiSmmCpuDxeSmm: fix S3 Resume for CPU hotplug
>   OvmfPkg: clone SmmCpuPlatformHookLib from UefiCpuPkg
>   OvmfPkg: enable SMM Monarch Election in PiSmmCpuDxeSmm
>   OvmfPkg: enable CPU hotplug support in PiSmmCpuDxeSmm
>   OvmfPkg/CpuHotplugSmm: introduce skeleton for CPU Hotplug SMM driver
>   OvmfPkg/CpuHotplugSmm: add hotplug register block helper functions
>   OvmfPkg/CpuHotplugSmm: define the QEMU_CPUHP_CMD_GET_ARCH_ID macro
>   OvmfPkg/CpuHotplugSmm: add function for collecting CPUs with events
>   OvmfPkg/CpuHotplugSmm: collect CPUs with events
>   OvmfPkg/CpuHotplugSmm: introduce Post-SMM Pen for hot-added CPUs
>   OvmfPkg/CpuHotplugSmm: introduce First SMI Handler for hot-added CPUs
>   OvmfPkg/CpuHotplugSmm: complete root MMI handler for CPU hotplug
>   OvmfPkg: clone CpuS3DataDxe from UefiCpuPkg
>   OvmfPkg/CpuS3DataDxe: superficial cleanups
>   OvmfPkg/CpuS3DataDxe: enable S3 resume after CPU hotplug
> 
>  MdeModulePkg/Core/PiSmmCore/Dispatcher.c                                                                                                              |   6 +
>  OvmfPkg/CpuHotplugSmm/ApicId.h                                                                                                                        |  23 ++
>  OvmfPkg/CpuHotplugSmm/CpuHotplug.c                                                                                                                    | 426 ++++++++++++++++++++
>  OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf                                                                                                               |  64 +++
>  OvmfPkg/CpuHotplugSmm/FirstSmiHandler.nasm                                                                                                            | 154 +++++++
>  OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h                                                                                                        |  47 +++
>  OvmfPkg/CpuHotplugSmm/PostSmmPen.nasm                                                                                                                 | 151 +++++++
>  OvmfPkg/CpuHotplugSmm/QemuCpuhp.c                                                                                                                     | 301 ++++++++++++++
>  OvmfPkg/CpuHotplugSmm/QemuCpuhp.h                                                                                                                     |  61 +++
>  OvmfPkg/CpuHotplugSmm/Smbase.c                                                                                                                        | 267 ++++++++++++
>  OvmfPkg/CpuHotplugSmm/Smbase.h                                                                                                                        |  46 +++
>  OvmfPkg/Include/IndustryStandard/Q35MchIch9.h                                                                                                         |   5 +-
>  OvmfPkg/Include/IndustryStandard/QemuCpuHotplug.h                                                                                                     |   3 +
>  OvmfPkg/OvmfPkgIa32.dsc                                                                                                                               |   7 +-
>  OvmfPkg/OvmfPkgIa32.fdf                                                                                                                               |   3 +-
>  OvmfPkg/OvmfPkgIa32X64.dsc                                                                                                                            |   7 +-
>  OvmfPkg/OvmfPkgIa32X64.fdf                                                                                                                            |   3 +-
>  OvmfPkg/OvmfPkgX64.dsc                                                                                                                                |   7 +-
>  OvmfPkg/OvmfPkgX64.fdf                                                                                                                                |   3 +-
>  UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.c     |  45 ++-
>  UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.inf |  24 +-
>  UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c                                                                                                                     |  14 +-
>  {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3Data.c                                                                                                      |  99 +++--
>  {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3DataDxe.inf                                                                                                 |  30 +-
>  24 files changed, 1707 insertions(+), 89 deletions(-)
>  copy UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.c => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.c (61%)
>  copy UefiCpuPkg/Library/SmmCpuPlatformHookLibNull/SmmCpuPlatformHookLibNull.inf => OvmfPkg/Library/SmmCpuPlatformHookLibQemu/SmmCpuPlatformHookLibQemu.inf (43%)
>  copy {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3Data.c (77%)
>  copy {UefiCpuPkg => OvmfPkg}/CpuS3DataDxe/CpuS3DataDxe.inf (69%)
>  create mode 100644 OvmfPkg/CpuHotplugSmm/ApicId.h
>  create mode 100644 OvmfPkg/CpuHotplugSmm/CpuHotplug.c
>  create mode 100644 OvmfPkg/CpuHotplugSmm/CpuHotplugSmm.inf
>  create mode 100644 OvmfPkg/CpuHotplugSmm/FirstSmiHandler.nasm
>  create mode 100644 OvmfPkg/CpuHotplugSmm/FirstSmiHandlerContext.h
>  create mode 100644 OvmfPkg/CpuHotplugSmm/PostSmmPen.nasm
>  create mode 100644 OvmfPkg/CpuHotplugSmm/QemuCpuhp.c
>  create mode 100644 OvmfPkg/CpuHotplugSmm/QemuCpuhp.h
>  create mode 100644 OvmfPkg/CpuHotplugSmm/Smbase.c
>  create mode 100644 OvmfPkg/CpuHotplugSmm/Smbase.h
> 
> 
> base-commit: edfe16a6d9f8c6830d7ad93ee7616225fe4e9c13
> 

Merged as commit range 61d3b2d4279e..1158fc8e2c7b, via
<https://github.com/tianocore/edk2/pull/416/>.

Thanks
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55410): https://edk2.groups.io/g/devel/message/55410
Mute This Topic: https://groups.io/mt/71575167/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Posted by Laszlo Ersek 5 years, 11 months ago
On 03/04/20 13:29, Laszlo Ersek wrote:
> On 02/26/20 23:11, Laszlo Ersek wrote:
>> Supersedes: <20200223172537.28464-1-lersek@redhat.com>
>> Bugzilla:   https://bugzilla.tianocore.org/show_bug.cgi?id=1512
>> Repo:       https://github.com/lersek/edk2.git
>> Branch:     vcpu_hotplug_smm_bz_1512_v2
>>
>> V1 was posted at:
>>
>> * [edk2-devel] [PATCH 00/16]
>>   OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
>>
>>   https://edk2.groups.io/g/devel/message/54734
>>   http://mid.mail-archive.com/20200223172537.28464-1-lersek@redhat.com
>>
>> New in v2:
>>
>> - Document (in patch#11) and implement (in patch#12) the "combined"
>>   approach described here:
>>
>>   http://mid.mail-archive.com/111145fc-be3d-2a9a-a126-c14345a8a8a4@redhat.com
>>   https://edk2.groups.io/g/devel/message/54754
>>
>>   The idea is basically to make the SMM Monarch wait not just until
>>   the hot-added CPU hits the normal RAM Post-SMM Pen (which is safe
>>   wrt. ordering, but can be attacked by the OS), but *also* until the
>>   hot-added CPU is just about to execute RSM first (which is a bit
>>   less safe wrt. ordering, but cannot be attacked by the OS).
>>
>> - Pick up Ard's conditional A-b for the other patches, which have not
>>   been modified.
>>
>> - Rebase to master, and retest.

> Merged as commit range 61d3b2d4279e..1158fc8e2c7b, via
> <https://github.com/tianocore/edk2/pull/416/>.

I've successfully tested this (now upstream) series with
- Windows Server 2012 R2 Standard, and
- Windows Server 2016 v1803
guests as well.

For that, an ACPI tweak is needed on the QEMU side (on top of Igor's PoC
patch). Namely, in the ASL quoted in the v1 blurb that's linked above,
Windows's ACPI parser does not like the "SMIR" OperationRegion to be
nested in a device, such as \_SB.SMI0.

("Does not like" means that Windows crashes during boot.)

Instead, Windows wants the OperationRegion directly under the \_SB
scope; like this:

> @@ -82,25 +82,10 @@
>              }
>          }
>
> -        Device (SMI0)
> +        OperationRegion (SMIR, SystemIO, 0xB2, One)
> +        Field (SMIR, ByteAcc, NoLock, WriteAsZeros)
>          {
> -            Name (_HID, "PNP0A06" /* Generic Container Device */)  // _HID: Hardware ID
> -            Name (_UID, "SMI resources")  // _UID: Unique ID
> -            Name (_STA, 0x0B)  // _STA: Status
> -            Name (_CRS, ResourceTemplate ()  // _CRS: Current Resource Settings
> -            {
> -                IO (Decode16,
> -                    0x00B2,             // Range Minimum
> -                    0x00B2,             // Range Maximum
> -                    0x01,               // Alignment
> -                    0x01,               // Length
> -                    )
> -            })
> -            OperationRegion (SMIR, SystemIO, 0xB2, One)
> -            Field (SMIR, ByteAcc, NoLock, WriteAsZeros)
> -            {
> -                SMIC,   8
> -            }
> +            SMIC,   8
>          }
>      }
>
> @@ -3037,7 +3022,7 @@
>              Method (CSCN, 0, Serialized)
>              {
>                  Acquire (\_SB.PCI0.PRES.CPLK, 0xFFFF)
> -                \_SB.SMI0.SMIC = 0x04
> +                \_SB.SMIC = 0x04
>                  Local0 = One
>                  While ((Local0 == One))
>                  {

The Linux guest is happy either way.

Thanks
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55485): https://edk2.groups.io/g/devel/message/55485
Mute This Topic: https://groups.io/mt/71575167/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Posted by Laszlo Ersek 5 years, 11 months ago
On 02/26/20 23:11, Laszlo Ersek wrote:
> Supersedes: <20200223172537.28464-1-lersek@redhat.com>
> Bugzilla:   https://bugzilla.tianocore.org/show_bug.cgi?id=1512
> Repo:       https://github.com/lersek/edk2.git
> Branch:     vcpu_hotplug_smm_bz_1512_v2
> 
> V1 was posted at:
> 
> * [edk2-devel] [PATCH 00/16]
>   OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
> 
>   https://edk2.groups.io/g/devel/message/54734
>   http://mid.mail-archive.com/20200223172537.28464-1-lersek@redhat.com
> 
> New in v2:
> 
> - Document (in patch#11) and implement (in patch#12) the "combined"
>   approach described here:
> 
>   http://mid.mail-archive.com/111145fc-be3d-2a9a-a126-c14345a8a8a4@redhat.com
>   https://edk2.groups.io/g/devel/message/54754
> 
>   The idea is basically to make the SMM Monarch wait not just until the
>   hot-added CPU hits the normal RAM Post-SMM Pen (which is safe wrt.
>   ordering, but can be attacked by the OS), but *also* until the
>   hot-added CPU is just about to execute RSM first (which is a bit less
>   safe wrt. ordering, but cannot be attacked by the OS).
> 
> - Pick up Ard's conditional A-b for the other patches, which have not
>   been modified.
> 
> - Rebase to master, and retest.

Thanks everyone for the feedback!

I plan to push this series soon after the hard feature freeze ends, and
edk2-stable202002 is tagged. I have three questions / remarks regarding
that:

- Phil, please tell me if you'd like me to hold the series for longer.
(You seem to have reached the end of the series, and I'm unsure about
the skipped patches -- maybe you want to skip them, maybe you need more
time for them.)

- I've talked to Igor about ordering the merging of the firmware set vs.
the merging of the QEMU patches. Igor made the great point that in this
case, QEMU is the user / consumer (ACPI payload) of the firmware
feature, and so the firmware stuff should go in first. I hadn't thought
of that, but he convinced me. The QEMU PoC patch is available, Boris has
tested the patches against each other, and this OVMF set in itself does
not regress anything functional. (Note that, while several patches in
the series *do* affect code paths that are independent of CPU hotplug, I
also regression-tested those.)

- Once the set is "in", I'll mark TianoCore#1512 as one of the new
features (for the first stable tag *after* edk2-stable202002) at
<https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning>.

Thanks
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55236): https://edk2.groups.io/g/devel/message/55236
Mute This Topic: https://groups.io/mt/71575167/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Posted by Philippe Mathieu-Daudé 5 years, 11 months ago
On 3/2/20 8:59 PM, Laszlo Ersek wrote:
> On 02/26/20 23:11, Laszlo Ersek wrote:
>> Supersedes: <20200223172537.28464-1-lersek@redhat.com>
>> Bugzilla:   https://bugzilla.tianocore.org/show_bug.cgi?id=1512
>> Repo:       https://github.com/lersek/edk2.git
>> Branch:     vcpu_hotplug_smm_bz_1512_v2
>>
>> V1 was posted at:
>>
>> * [edk2-devel] [PATCH 00/16]
>>    OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
>>
>>    https://edk2.groups.io/g/devel/message/54734
>>    http://mid.mail-archive.com/20200223172537.28464-1-lersek@redhat.com
>>
>> New in v2:
>>
>> - Document (in patch#11) and implement (in patch#12) the "combined"
>>    approach described here:
>>
>>    http://mid.mail-archive.com/111145fc-be3d-2a9a-a126-c14345a8a8a4@redhat.com
>>    https://edk2.groups.io/g/devel/message/54754
>>
>>    The idea is basically to make the SMM Monarch wait not just until the
>>    hot-added CPU hits the normal RAM Post-SMM Pen (which is safe wrt.
>>    ordering, but can be attacked by the OS), but *also* until the
>>    hot-added CPU is just about to execute RSM first (which is a bit less
>>    safe wrt. ordering, but cannot be attacked by the OS).
>>
>> - Pick up Ard's conditional A-b for the other patches, which have not
>>    been modified.
>>
>> - Rebase to master, and retest.
> 
> Thanks everyone for the feedback!
> 
> I plan to push this series soon after the hard feature freeze ends, and
> edk2-stable202002 is tagged. I have three questions / remarks regarding
> that:
> 
> - Phil, please tell me if you'd like me to hold the series for longer.
> (You seem to have reached the end of the series, and I'm unsure about
> the skipped patches -- maybe you want to skip them, maybe you need more
> time for them.)

I needed more time when this is too x86 specific, which is not my cup of 
tea. Next time!


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55412): https://edk2.groups.io/g/devel/message/55412
Mute This Topic: https://groups.io/mt/71575167/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Posted by Laszlo Ersek 5 years, 11 months ago
On 03/04/20 14:29, Philippe Mathieu-Daudé wrote:
> On 3/2/20 8:59 PM, Laszlo Ersek wrote:
>> On 02/26/20 23:11, Laszlo Ersek wrote:
>>> Supersedes: <20200223172537.28464-1-lersek@redhat.com>
>>> Bugzilla:   https://bugzilla.tianocore.org/show_bug.cgi?id=1512
>>> Repo:       https://github.com/lersek/edk2.git
>>> Branch:     vcpu_hotplug_smm_bz_1512_v2
>>>
>>> V1 was posted at:
>>>
>>> * [edk2-devel] [PATCH 00/16]
>>>    OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
>>>
>>>    https://edk2.groups.io/g/devel/message/54734
>>>    http://mid.mail-archive.com/20200223172537.28464-1-lersek@redhat.com
>>>
>>> New in v2:
>>>
>>> - Document (in patch#11) and implement (in patch#12) the "combined"
>>>    approach described here:
>>>
>>>   
>>> http://mid.mail-archive.com/111145fc-be3d-2a9a-a126-c14345a8a8a4@redhat.com
>>>
>>>    https://edk2.groups.io/g/devel/message/54754
>>>
>>>    The idea is basically to make the SMM Monarch wait not just until the
>>>    hot-added CPU hits the normal RAM Post-SMM Pen (which is safe wrt.
>>>    ordering, but can be attacked by the OS), but *also* until the
>>>    hot-added CPU is just about to execute RSM first (which is a bit less
>>>    safe wrt. ordering, but cannot be attacked by the OS).
>>>
>>> - Pick up Ard's conditional A-b for the other patches, which have not
>>>    been modified.
>>>
>>> - Rebase to master, and retest.
>>
>> Thanks everyone for the feedback!
>>
>> I plan to push this series soon after the hard feature freeze ends, and
>> edk2-stable202002 is tagged. I have three questions / remarks regarding
>> that:
>>
>> - Phil, please tell me if you'd like me to hold the series for longer.
>> (You seem to have reached the end of the series, and I'm unsure about
>> the skipped patches -- maybe you want to skip them, maybe you need more
>> time for them.)
> 
> I needed more time when this is too x86 specific, which is not my cup of
> tea. Next time!
> 

Thanks for your reviews!

Apologies for not waiting any longer -- when I started queueing the
patches from this series, for the github pull req, I checked the mailing
list archive, to see whether you had followed up since your response at
<https://edk2.groups.io/g/devel/message/55237>. This was late in the
morning today (at ~11:00 or so, in CET), and I didn't see my above
question answered either way. I had two more series to merge, and I
wanted to handle it all with a single pullreq. I'm happy to give
reviewers more time; what I'd like to receive reasonably quickly is the
request for more time (especially if the review is not occurring
linearly over the series).

Thanks!
Laszlo


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55428): https://edk2.groups.io/g/devel/message/55428
Mute This Topic: https://groups.io/mt/71575167/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-