public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: edk2-devel-groups-io <devel@edk2.groups.io>
Cc: "Ard Biesheuvel" <ard.biesheuvel@linaro.org>,
	"Eric Dong" <eric.dong@intel.com>,
	"Hao A Wu" <hao.a.wu@intel.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Jian J Wang" <jian.j.wang@intel.com>,
	"Jiewen Yao" <jiewen.yao@intel.com>,
	"Jordan Justen" <jordan.l.justen@intel.com>,
	"Michael Kinney" <michael.d.kinney@intel.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Ray Ni" <ray.ni@intel.com>,
	"Boris Ostrovsky" <boris.ostrovsky@oracle.com>
Subject: Re: [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE
Date: Thu, 5 Mar 2020 09:32:21 +0100	[thread overview]
Message-ID: <193b1113-af0e-e8d6-b6d8-8fde0e326456@redhat.com> (raw)
In-Reply-To: <58071145-b4a3-57bb-85ec-cc53539f22c2@redhat.com>

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


      reply	other threads:[~2020-03-05  8:32 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 22:11 [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE Laszlo Ersek
2020-02-26 22:11 ` [PATCH v2 01/16] MdeModulePkg/PiSmmCore: log SMM image start failure Laszlo Ersek
2020-03-02 12:47   ` [edk2-devel] " Laszlo Ersek
2020-03-02 12:55     ` Liming Gao
2020-03-02 13:46   ` Philippe Mathieu-Daudé
2020-03-03  0:46   ` Dong, Eric
2020-02-26 22:11 ` [PATCH v2 02/16] UefiCpuPkg/PiSmmCpuDxeSmm: fix S3 Resume for CPU hotplug Laszlo Ersek
2020-02-28  3:05   ` [edk2-devel] " Dong, Eric
2020-02-28 10:50     ` Laszlo Ersek
2020-03-04 12:23     ` Laszlo Ersek
2020-03-04 14:36       ` Dong, Eric
2020-02-26 22:11 ` [PATCH v2 03/16] OvmfPkg: clone SmmCpuPlatformHookLib from UefiCpuPkg Laszlo Ersek
2020-03-02 13:27   ` Ard Biesheuvel
2020-03-02 13:49   ` Philippe Mathieu-Daudé
2020-02-26 22:11 ` [PATCH v2 04/16] OvmfPkg: enable SMM Monarch Election in PiSmmCpuDxeSmm Laszlo Ersek
2020-03-02 13:32   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 05/16] OvmfPkg: enable CPU hotplug support " Laszlo Ersek
2020-03-02 13:33   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 06/16] OvmfPkg/CpuHotplugSmm: introduce skeleton for CPU Hotplug SMM driver Laszlo Ersek
2020-03-02 13:44   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 07/16] OvmfPkg/CpuHotplugSmm: add hotplug register block helper functions Laszlo Ersek
2020-03-02 13:24   ` Philippe Mathieu-Daudé
2020-03-02 13:45   ` [edk2-devel] " Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 08/16] OvmfPkg/CpuHotplugSmm: define the QEMU_CPUHP_CMD_GET_ARCH_ID macro Laszlo Ersek
2020-03-02 13:22   ` Philippe Mathieu-Daudé
2020-03-02 13:45   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 09/16] OvmfPkg/CpuHotplugSmm: add function for collecting CPUs with events Laszlo Ersek
2020-03-02 13:49   ` Ard Biesheuvel
2020-03-02 20:34   ` Philippe Mathieu-Daudé
2020-03-03 10:31     ` Laszlo Ersek
2020-02-26 22:11 ` [PATCH v2 10/16] OvmfPkg/CpuHotplugSmm: collect " Laszlo Ersek
2020-03-02 13:58   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 11/16] OvmfPkg/CpuHotplugSmm: introduce Post-SMM Pen for hot-added CPUs Laszlo Ersek
2020-03-02 14:02   ` [edk2-devel] " Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 12/16] OvmfPkg/CpuHotplugSmm: introduce First SMI Handler " Laszlo Ersek
2020-03-02 14:03   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 13/16] OvmfPkg/CpuHotplugSmm: complete root MMI handler for CPU hotplug Laszlo Ersek
2020-03-02 14:05   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 14/16] OvmfPkg: clone CpuS3DataDxe from UefiCpuPkg Laszlo Ersek
2020-03-02 13:44   ` Philippe Mathieu-Daudé
2020-03-02 14:06   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 15/16] OvmfPkg/CpuS3DataDxe: superficial cleanups Laszlo Ersek
2020-03-02 13:25   ` Philippe Mathieu-Daudé
2020-03-02 14:06   ` Ard Biesheuvel
2020-02-26 22:11 ` [PATCH v2 16/16] OvmfPkg/CpuS3DataDxe: enable S3 resume after CPU hotplug Laszlo Ersek
2020-03-02 14:16   ` Ard Biesheuvel
2020-03-02 15:46 ` [edk2-devel] [PATCH v2 00/16] OvmfPkg: support VCPU hotplug with -D SMM_REQUIRE Boris Ostrovsky
2020-03-02 19:22   ` Laszlo Ersek
2020-03-02 19:59 ` Laszlo Ersek
2020-03-04 13:29   ` Philippe Mathieu-Daudé
2020-03-04 18:09     ` Laszlo Ersek
2020-03-04 12:29 ` Laszlo Ersek
2020-03-05  8:32   ` 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=193b1113-af0e-e8d6-b6d8-8fde0e326456@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