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

Laszlo Ersek lersek at redhat.com
Thu Mar 5 08:32:21 UTC 2020


On 03/04/20 13:29, Laszlo Ersek wrote:
> On 02/26/20 23:11, Laszlo Ersek wrote:
>> Supersedes: <20200223172537.28464-1-lersek at 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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list