[edk2] [PATCH 0/5] OvmfPkg: recognize an extended TSEG when QEMU offers it

Laszlo Ersek posted 5 patches 6 years, 10 months ago
Failed in applying to current master (apply log)
There is a newer version of this series
OvmfPkg/Include/IndustryStandard/Q35MchIch9.h     |   4 +
OvmfPkg/Include/Library/Q35TsegSizeLib.h          |  74 +++++++
OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c   | 230 ++++++++++++++++++++
OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf |  47 ++++
OvmfPkg/OvmfPkg.dec                               |  13 +-
OvmfPkg/OvmfPkgIa32.dsc                           |   1 +
OvmfPkg/OvmfPkgIa32X64.dsc                        |   1 +
OvmfPkg/OvmfPkgX64.dsc                            |   1 +
OvmfPkg/PlatformPei/MemDetect.c                   |   7 +-
OvmfPkg/PlatformPei/PlatformPei.inf               |   2 +-
OvmfPkg/SmmAccess/SmmAccess2Dxe.inf               |   1 +
OvmfPkg/SmmAccess/SmmAccessPei.c                  |   7 +-
OvmfPkg/SmmAccess/SmmAccessPei.inf                |   4 +-
OvmfPkg/SmmAccess/SmramInternal.c                 |  13 +-
14 files changed, 384 insertions(+), 21 deletions(-)
create mode 100644 OvmfPkg/Include/Library/Q35TsegSizeLib.h
create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c
create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf
[edk2] [PATCH 0/5] OvmfPkg: recognize an extended TSEG when QEMU offers it
Posted by Laszlo Ersek 6 years, 10 months ago
In <https://bugzilla.redhat.com/show_bug.cgi?id=1447027> we found that
the SMM_REQUIRE build of OVMF cannot boot with as many VCPUs as we'd
like, due to SMRAM exhaustion (even with the largest TSEG, 8MB).

Related thread on edk2-devel:
<https://lists.01.org/pipermail/edk2-devel/2017-May/010371.html>.

The QEMU patch at
<http://mid.mail-archive.com/20170608161013.17920-1-lersek@redhat.com>
adds a new device property / PCI config register to the Q35 board's DRAM
controller. The property allows the user (and new Q35 machine types by
default) to specify an arbitrary TSEG size (expressed as a number of
megabytes). The register enables the firmware to query the size /
availability of the feature. The extended size, when available, can be
selected by writing the "11" bitmask to the ESMRAMC.TSEG_SZ register
bit-field. This bitmask (similarly to the invented register's location
in PCI config space) is defined as reserved in the original Q35/MCH
spec.

This series adds support for the feature to OVMF. When an extended TSEG
is offered, OVMF will choose it.

The first four patches extract Q35TsegSizeLib, centralizing the
interpretation of ESMRAMC.TSEG_SZ between PlatformPei, SmmAccessPei and
SmmAccess2Dxe. This subset of patches incurs no observable change in
behavior.

The last patch implements the feature in Q35TsegSizeLib.

Repo:   https://github.com/lersek/edk2.git
Branch: extended_tseg_bz1447027

Cc: Jordan Justen <jordan.l.justen@intel.com>

Thanks
Laszlo

Laszlo Ersek (5):
  OvmfPkg: introduce Q35TsegSizeLib (class header and sole lib instance)
  OvmfPkg/PlatformPei: rebase to Q35TsegSizeLib
  OvmfPkg/SmmAccess: rebase code unique to SmmAccessPei to
    Q35TsegSizeLib
  OvmfPkg/SmmAccess: rebase shared PEIM/DXE code to Q35TsegSizeLib
  OvmfPkg/Q35TsegSizeLib: recognize an extended TSEG when QEMU offers it

 OvmfPkg/Include/IndustryStandard/Q35MchIch9.h     |   4 +
 OvmfPkg/Include/Library/Q35TsegSizeLib.h          |  74 +++++++
 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c   | 230 ++++++++++++++++++++
 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf |  47 ++++
 OvmfPkg/OvmfPkg.dec                               |  13 +-
 OvmfPkg/OvmfPkgIa32.dsc                           |   1 +
 OvmfPkg/OvmfPkgIa32X64.dsc                        |   1 +
 OvmfPkg/OvmfPkgX64.dsc                            |   1 +
 OvmfPkg/PlatformPei/MemDetect.c                   |   7 +-
 OvmfPkg/PlatformPei/PlatformPei.inf               |   2 +-
 OvmfPkg/SmmAccess/SmmAccess2Dxe.inf               |   1 +
 OvmfPkg/SmmAccess/SmmAccessPei.c                  |   7 +-
 OvmfPkg/SmmAccess/SmmAccessPei.inf                |   4 +-
 OvmfPkg/SmmAccess/SmramInternal.c                 |  13 +-
 14 files changed, 384 insertions(+), 21 deletions(-)
 create mode 100644 OvmfPkg/Include/Library/Q35TsegSizeLib.h
 create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c
 create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf

-- 
2.9.3

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/5] OvmfPkg: recognize an extended TSEG when QEMU offers it
Posted by Laszlo Ersek 6 years, 10 months ago
Jordan,

On 06/08/17 19:13, Laszlo Ersek wrote:
> In <https://bugzilla.redhat.com/show_bug.cgi?id=1447027> we found that
> the SMM_REQUIRE build of OVMF cannot boot with as many VCPUs as we'd
> like, due to SMRAM exhaustion (even with the largest TSEG, 8MB).
> 
> Related thread on edk2-devel:
> <https://lists.01.org/pipermail/edk2-devel/2017-May/010371.html>.
> 
> The QEMU patch at
> <http://mid.mail-archive.com/20170608161013.17920-1-lersek@redhat.com>
> adds a new device property / PCI config register to the Q35 board's DRAM
> controller. The property allows the user (and new Q35 machine types by
> default) to specify an arbitrary TSEG size (expressed as a number of
> megabytes). The register enables the firmware to query the size /
> availability of the feature. The extended size, when available, can be
> selected by writing the "11" bitmask to the ESMRAMC.TSEG_SZ register
> bit-field. This bitmask (similarly to the invented register's location
> in PCI config space) is defined as reserved in the original Q35/MCH
> spec.
> 
> This series adds support for the feature to OVMF. When an extended TSEG
> is offered, OVMF will choose it.
> 
> The first four patches extract Q35TsegSizeLib, centralizing the
> interpretation of ESMRAMC.TSEG_SZ between PlatformPei, SmmAccessPei and
> SmmAccess2Dxe. This subset of patches incurs no observable change in
> behavior.
> 
> The last patch implements the feature in Q35TsegSizeLib.
> 
> Repo:   https://github.com/lersek/edk2.git
> Branch: extended_tseg_bz1447027
> 
> Cc: Jordan Justen <jordan.l.justen@intel.com>

Can you please review this set?

Thanks,
Laszlo


> Laszlo Ersek (5):
>   OvmfPkg: introduce Q35TsegSizeLib (class header and sole lib instance)
>   OvmfPkg/PlatformPei: rebase to Q35TsegSizeLib
>   OvmfPkg/SmmAccess: rebase code unique to SmmAccessPei to
>     Q35TsegSizeLib
>   OvmfPkg/SmmAccess: rebase shared PEIM/DXE code to Q35TsegSizeLib
>   OvmfPkg/Q35TsegSizeLib: recognize an extended TSEG when QEMU offers it
> 
>  OvmfPkg/Include/IndustryStandard/Q35MchIch9.h     |   4 +
>  OvmfPkg/Include/Library/Q35TsegSizeLib.h          |  74 +++++++
>  OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c   | 230 ++++++++++++++++++++
>  OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf |  47 ++++
>  OvmfPkg/OvmfPkg.dec                               |  13 +-
>  OvmfPkg/OvmfPkgIa32.dsc                           |   1 +
>  OvmfPkg/OvmfPkgIa32X64.dsc                        |   1 +
>  OvmfPkg/OvmfPkgX64.dsc                            |   1 +
>  OvmfPkg/PlatformPei/MemDetect.c                   |   7 +-
>  OvmfPkg/PlatformPei/PlatformPei.inf               |   2 +-
>  OvmfPkg/SmmAccess/SmmAccess2Dxe.inf               |   1 +
>  OvmfPkg/SmmAccess/SmmAccessPei.c                  |   7 +-
>  OvmfPkg/SmmAccess/SmmAccessPei.inf                |   4 +-
>  OvmfPkg/SmmAccess/SmramInternal.c                 |  13 +-
>  14 files changed, 384 insertions(+), 21 deletions(-)
>  create mode 100644 OvmfPkg/Include/Library/Q35TsegSizeLib.h
>  create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c
>  create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf
> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/5] OvmfPkg: recognize an extended TSEG when QEMU offers it
Posted by Jordan Justen 6 years, 10 months ago
On 2017-06-08 10:13:28, Laszlo Ersek wrote:
> In <https://bugzilla.redhat.com/show_bug.cgi?id=1447027> we found that
> the SMM_REQUIRE build of OVMF cannot boot with as many VCPUs as we'd
> like, due to SMRAM exhaustion (even with the largest TSEG, 8MB).
> 
> Related thread on edk2-devel:
> <https://lists.01.org/pipermail/edk2-devel/2017-May/010371.html>.
> 
> The QEMU patch at
> <http://mid.mail-archive.com/20170608161013.17920-1-lersek@redhat.com>

This patch hasn't been merged to qemu yet, right? Would you propose
that we wait until this is merged to qemu master, or present in a qemu
release before merging the OVMF support? At what point does qemu
consider it an unchangable supported feature?

-Jordan

> adds a new device property / PCI config register to the Q35 board's DRAM
> controller. The property allows the user (and new Q35 machine types by
> default) to specify an arbitrary TSEG size (expressed as a number of
> megabytes). The register enables the firmware to query the size /
> availability of the feature. The extended size, when available, can be
> selected by writing the "11" bitmask to the ESMRAMC.TSEG_SZ register
> bit-field. This bitmask (similarly to the invented register's location
> in PCI config space) is defined as reserved in the original Q35/MCH
> spec.
> 
> This series adds support for the feature to OVMF. When an extended TSEG
> is offered, OVMF will choose it.
> 
> The first four patches extract Q35TsegSizeLib, centralizing the
> interpretation of ESMRAMC.TSEG_SZ between PlatformPei, SmmAccessPei and
> SmmAccess2Dxe. This subset of patches incurs no observable change in
> behavior.
> 
> The last patch implements the feature in Q35TsegSizeLib.
> 
> Repo:   https://github.com/lersek/edk2.git
> Branch: extended_tseg_bz1447027
> 
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (5):
>   OvmfPkg: introduce Q35TsegSizeLib (class header and sole lib instance)
>   OvmfPkg/PlatformPei: rebase to Q35TsegSizeLib
>   OvmfPkg/SmmAccess: rebase code unique to SmmAccessPei to
>     Q35TsegSizeLib
>   OvmfPkg/SmmAccess: rebase shared PEIM/DXE code to Q35TsegSizeLib
>   OvmfPkg/Q35TsegSizeLib: recognize an extended TSEG when QEMU offers it
> 
>  OvmfPkg/Include/IndustryStandard/Q35MchIch9.h     |   4 +
>  OvmfPkg/Include/Library/Q35TsegSizeLib.h          |  74 +++++++
>  OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c   | 230 ++++++++++++++++++++
>  OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf |  47 ++++
>  OvmfPkg/OvmfPkg.dec                               |  13 +-
>  OvmfPkg/OvmfPkgIa32.dsc                           |   1 +
>  OvmfPkg/OvmfPkgIa32X64.dsc                        |   1 +
>  OvmfPkg/OvmfPkgX64.dsc                            |   1 +
>  OvmfPkg/PlatformPei/MemDetect.c                   |   7 +-
>  OvmfPkg/PlatformPei/PlatformPei.inf               |   2 +-
>  OvmfPkg/SmmAccess/SmmAccess2Dxe.inf               |   1 +
>  OvmfPkg/SmmAccess/SmmAccessPei.c                  |   7 +-
>  OvmfPkg/SmmAccess/SmmAccessPei.inf                |   4 +-
>  OvmfPkg/SmmAccess/SmramInternal.c                 |  13 +-
>  14 files changed, 384 insertions(+), 21 deletions(-)
>  create mode 100644 OvmfPkg/Include/Library/Q35TsegSizeLib.h
>  create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c
>  create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf
> 
> -- 
> 2.9.3
> 
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/5] OvmfPkg: recognize an extended TSEG when QEMU offers it
Posted by Laszlo Ersek 6 years, 10 months ago
On 06/19/17 20:09, Jordan Justen wrote:
> On 2017-06-08 10:13:28, Laszlo Ersek wrote:
>> In <https://bugzilla.redhat.com/show_bug.cgi?id=1447027> we found that
>> the SMM_REQUIRE build of OVMF cannot boot with as many VCPUs as we'd
>> like, due to SMRAM exhaustion (even with the largest TSEG, 8MB).
>>
>> Related thread on edk2-devel:
>> <https://lists.01.org/pipermail/edk2-devel/2017-May/010371.html>.
>>
>> The QEMU patch at
>> <http://mid.mail-archive.com/20170608161013.17920-1-lersek@redhat.com>
> 
> This patch hasn't been merged to qemu yet, right? Would you propose
> that we wait until this is merged to qemu master, or present in a qemu
> release before merging the OVMF support? At what point does qemu
> consider it an unchangable supported feature?

The QEMU patch is now part of a pending PULL request:

http://lists.nongnu.org/archive/html/qemu-devel/2017-06/msg03901.html

Given that the QEMU patch (intentionally) preserves compatibility /
behavior for earlier machine types, we can safely commit the OVMF series
once upstream QEMU merges the patch. Using pc-q35-2.9 or earlier machine
types, the feature won't be (or won't appear) available; with
pc-q35-2.10 or later, the feature will be turned on.

I agree we should wait until Michael's qemu PULL req is actually merged.
There's no reason (specific to QEMU) to wait with the OVMF patches
longer than that. (SeaBIOS follows the same method.)

Thanks
Laszlo


>> adds a new device property / PCI config register to the Q35 board's DRAM
>> controller. The property allows the user (and new Q35 machine types by
>> default) to specify an arbitrary TSEG size (expressed as a number of
>> megabytes). The register enables the firmware to query the size /
>> availability of the feature. The extended size, when available, can be
>> selected by writing the "11" bitmask to the ESMRAMC.TSEG_SZ register
>> bit-field. This bitmask (similarly to the invented register's location
>> in PCI config space) is defined as reserved in the original Q35/MCH
>> spec.
>>
>> This series adds support for the feature to OVMF. When an extended TSEG
>> is offered, OVMF will choose it.
>>
>> The first four patches extract Q35TsegSizeLib, centralizing the
>> interpretation of ESMRAMC.TSEG_SZ between PlatformPei, SmmAccessPei and
>> SmmAccess2Dxe. This subset of patches incurs no observable change in
>> behavior.
>>
>> The last patch implements the feature in Q35TsegSizeLib.
>>
>> Repo:   https://github.com/lersek/edk2.git
>> Branch: extended_tseg_bz1447027
>>
>> Cc: Jordan Justen <jordan.l.justen@intel.com>
>>
>> Thanks
>> Laszlo
>>
>> Laszlo Ersek (5):
>>   OvmfPkg: introduce Q35TsegSizeLib (class header and sole lib instance)
>>   OvmfPkg/PlatformPei: rebase to Q35TsegSizeLib
>>   OvmfPkg/SmmAccess: rebase code unique to SmmAccessPei to
>>     Q35TsegSizeLib
>>   OvmfPkg/SmmAccess: rebase shared PEIM/DXE code to Q35TsegSizeLib
>>   OvmfPkg/Q35TsegSizeLib: recognize an extended TSEG when QEMU offers it
>>
>>  OvmfPkg/Include/IndustryStandard/Q35MchIch9.h     |   4 +
>>  OvmfPkg/Include/Library/Q35TsegSizeLib.h          |  74 +++++++
>>  OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c   | 230 ++++++++++++++++++++
>>  OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf |  47 ++++
>>  OvmfPkg/OvmfPkg.dec                               |  13 +-
>>  OvmfPkg/OvmfPkgIa32.dsc                           |   1 +
>>  OvmfPkg/OvmfPkgIa32X64.dsc                        |   1 +
>>  OvmfPkg/OvmfPkgX64.dsc                            |   1 +
>>  OvmfPkg/PlatformPei/MemDetect.c                   |   7 +-
>>  OvmfPkg/PlatformPei/PlatformPei.inf               |   2 +-
>>  OvmfPkg/SmmAccess/SmmAccess2Dxe.inf               |   1 +
>>  OvmfPkg/SmmAccess/SmmAccessPei.c                  |   7 +-
>>  OvmfPkg/SmmAccess/SmmAccessPei.inf                |   4 +-
>>  OvmfPkg/SmmAccess/SmramInternal.c                 |  13 +-
>>  14 files changed, 384 insertions(+), 21 deletions(-)
>>  create mode 100644 OvmfPkg/Include/Library/Q35TsegSizeLib.h
>>  create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.c
>>  create mode 100644 OvmfPkg/Library/Q35TsegSizeLib/Q35TsegSizeLib.inf
>>
>> -- 
>> 2.9.3
>>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 0/5] OvmfPkg: recognize an extended TSEG when QEMU offers it
Posted by Laszlo Ersek 6 years, 10 months ago
On 06/20/17 00:39, Laszlo Ersek wrote:
> On 06/19/17 20:09, Jordan Justen wrote:
>> On 2017-06-08 10:13:28, Laszlo Ersek wrote:
>>> In <https://bugzilla.redhat.com/show_bug.cgi?id=1447027> we found that
>>> the SMM_REQUIRE build of OVMF cannot boot with as many VCPUs as we'd
>>> like, due to SMRAM exhaustion (even with the largest TSEG, 8MB).
>>>
>>> Related thread on edk2-devel:
>>> <https://lists.01.org/pipermail/edk2-devel/2017-May/010371.html>.
>>>
>>> The QEMU patch at
>>> <http://mid.mail-archive.com/20170608161013.17920-1-lersek@redhat.com>
>>
>> This patch hasn't been merged to qemu yet, right?

Merged now: QEMU commit 2f295167e0c4.

Thanks
Laszlo
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel