Date   

回复: [edk2-devel] [PATCH v2 00/13] Add ACPI 6.4 header file

gaoliming
 

Thanks for your update. Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

If no other comments, I will merge this patch set for 202108 stable tag.

Thanks
Liming

-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Chris Jones
发送时间: 2021年8月6日 0:25
收件人: devel@edk2.groups.io
抄送: Sami Mujawar <Sami.Mujawar@arm.com>; Akanksha Jain
<Akanksha.Jain2@arm.com>; Ben Adderson <Ben.Adderson@arm.com>;
Michael Kinney <michael.d.kinney@intel.com>; gaoliming@byosoft.com.cn;
zhiguang.liu@intel.com; Leif Lindholm <leif.lindholm@linaro.org>; Matteo
Carlini <Matteo.Carlini@arm.com>; nd@arm.com
主题: [edk2-devel] [PATCH v2 00/13] Add ACPI 6.4 header file

Bugzilla: 3516 (https://bugzilla.tianocore.org/show_bug.cgi?id=3516)

This patch series introduces a header file for the latest version of the
ACPI 6.4 specification, January 2021. This header contains all updates
to the ACPI specification in addition to addressing a few small errors
from the previous ACPI header files.

Changes since v1:
1. Patch 13/13
- Remove EFI_ACPI_6_4_GIC_STRUCTURE field name changes. [Liming]
- Add Acpi64.h to IgnoreFiles list in MdePkg.ci.yaml. [Liming]

The changes can be seen at:
https://github.com/chris-jones-arm/edk2/tree/1661_add_acpi_64_header_v
2

Chris Jones (13):
MdePkg: Add ACPI 6.4 header file
MdePkg: Increment FADT version
MdePkg: Rename SBSA Generic Watchdog to Arm Generic Watchdog
MdePkg: Update PMTT to ACPI 6.4
MdePkg: Add SPA Location Cookie field to SPA Range structure
MdePkg: Remove DPPT table
MdePkg: Add flags and MinTransferSize to Generic Initiator
MdePkg: Add 'Type 5' PCC structure
MdePkg: Add Multiprocessor Wakeup structure
MdePkg: Add the Platform Health Assessment Table (PHAT)
MdePkg: Add Secure Access Components in the SDEV table
MdePkg: Add Cache ID to PPTT
MdePkg: Fix broken coding style in Acpi64.h

MdePkg/Include/IndustryStandard/Acpi.h | 4 +-
MdePkg/Include/IndustryStandard/Acpi64.h | 3148
++++++++++++++++++++
MdePkg/MdePkg.ci.yaml | 2 +
3 files changed, 3152 insertions(+), 2 deletions(-)
create mode 100644 MdePkg/Include/IndustryStandard/Acpi64.h

--
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")





Re: [edk2-platforms][PATCH v4 00/41] Consolidate SpiFlashCommonLib instances

Nate DeSimone
 

Hi Michael,

I have not tried actually. Now that TiogaPass has been merged upstream we have not been focusing on Mt. Olympus. I believe the original code was pair programmed by Mallik and Jiewen and neither of them seem to be interested in continuing maintenance of it. We are planning on deprecating and removing Mt. Olympus since it is unmaintained, unless someone else from Microsoft is interested in picking up maintenance of it again.

Thanks,
Nate

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
Kubacki
Sent: Monday, August 2, 2021 11:24 AM
To: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>;
devel@edk2.groups.io
Cc: Agyeman, Prince <prince.agyeman@intel.com>; Chiu, Chasel
<chasel.chiu@intel.com>; Kethi Reddy, Deepika
<deepika.kethi.reddy@intel.com>; Dong, Eric <eric.dong@intel.com>; Luo,
Heng <heng.luo@intel.com>; Jeremy Soller <jeremy@system76.com>;
Esakkithevar, Kathappan <kathappan.esakkithevar@intel.com>; Liming Gao
<gaoliming@byosoft.com.cn>; Chaganty, Rangasai V
<rangasai.v.chaganty@intel.com>
Subject: Re: [edk2-devel] [edk2-platforms][PATCH v4 00/41] Consolidate
SpiFlashCommonLib instances

Hi Nate,

Does BoardMtOlympus in edk2-platforms/master build for you?

It looks like some additional microcode patches were added and the
microcode FV was not expanded.

Generating MICROCODE_FV FV
Return Value = 2
GenFv: ERROR 3000: Invalid
the required fv image size 0x22460 exceeds the set fv image size
0x10000

- Michael

On 7/28/2021 8:08 PM, Michael Kubacki wrote:
Sure. These packages were added to edk2-platforms throughout the
lifetime of this patch series.

Hopefully this is the last rebase...

Regards,
Michael

On 7/28/2021 7:58 PM, Desimone, Nathaniel L wrote:
Hi Michael,

The change content looks good. However, after applying your patch
series PurleyOpenBoardPkg and WhitleyOpenBoardPkg no longer
compile.
Can you please fix these build errors?

For your reference, these are the tests that I ran:

build_bios.py -p BoardMtOlympus -t VS2015x86 -d build_bios.py -p
WilsonCityRvp -t VS2015x86 -d

Thanks,
Nate

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Michael Kubacki
Sent: Friday, June 25, 2021 2:21 PM
To: devel@edk2.groups.io
Cc: Agyeman, Prince <prince.agyeman@intel.com>; Chiu, Chasel
<chasel.chiu@intel.com>; Kethi Reddy, Deepika
<deepika.kethi.reddy@intel.com>; Dong, Eric <eric.dong@intel.com>;
Luo, Heng <heng.luo@intel.com>; Jeremy Soller
<jeremy@system76.com>;
Esakkithevar, Kathappan <kathappan.esakkithevar@intel.com>; Liming
Gao <gaoliming@byosoft.com.cn>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Chaganty, Rangasai V
<rangasai.v.chaganty@intel.com>
Subject: [edk2-devel] [edk2-platforms][PATCH v4 00/41] Consolidate
SpiFlashCommonLib instances

From: Michael Kubacki <michael.kubacki@microsoft.com>

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

SpiFlashCommonLib is duplicated in multiple places across the
MinPlatform design in edk2-platforms. I'm planning to build some
additional functionality on top of SpiFlashCommonLib and, ideally,
this duplication will be consolidated into a single instance usable
across all current library consumers.

This patch series focuses on consolidating the various
SpiFlashCommonLib instances as agreed upon in
https://edk2.groups.io/g/devel/message/71701.

Read the BZ for more general background around this series.

I only have an UpXtreme board on hand so maintainers/reviewers of
other board packages should test these changes on those boards.

V4 changes:
- Assigned new GUID values to the PCH SPI PPI and Protocols to
   differentiate from previous instances. This was done because
   the interface changed to identify SPI flash regions by GUID.

V3 changes:
- Added support to IntelSiliconPkg to identify flash regions by GUID
as
   requested in v2 review feedback.
V2 changes:
- Rebased patch series on current edk2-platforms master
(32183bdaa91)

Note: Previous patch series only received a couple review comments
after being on the mailing list for over 2 months. Please be
respectful of contributors time and efforts and review in a timely
manner.

Cc: Agyeman Prince <prince.agyeman@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Michael Kubacki (41):
   CometlakeOpenBoardPkg: Remove redundant IntelSiliconPkg.dec
entry
   WhiskeylakeOpenBoardPkg: Remove redundant IntelSiliconPkg.dec
entry
   CometlakeOpenBoardPkg/PeiPolicyUpdateLib: Add missing GUID to
INF
   IntelSiliconPkg: Add BIOS area base address and size PCDs
   IntelSiliconPkg: Add microcode FV PCDs
   IntelSiliconPkg: Add PCH SPI PPI
   IntelSiliconPkg: Add PCH SPI Protocol
   IntelSiliconPkg: Add SpiFlashCommonLib
   IntelSiliconPkg: Add SmmSpiFlashCommonLib
   IntelSiliconPkg: Add MM SPI FVB services
   CometlakeOpenBoardPkg: Use IntelSiliconPkg BIOS area and ucode
PCDs
   KabylakeOpenBoardPkg: Use IntelSiliconPkg BIOS area and ucode
PCDs
   SimicsOpenBoardPkg: Use IntelSiliconPkg BIOS area and ucode PCDs
   TigerlakeOpenBoardPkg: Use IntelSiliconPkg BIOS area and ucode
PCDs
   WhiskeylakeOpenBoardPkg: Use IntelSiliconPkg BIOS area and ucode
PCDs
   CoffeelakeSiliconPkg: Use IntelSiliconPkg BIOS area and ucode
PCDs
   KabylakeSiliconPkg: Use IntelSiliconPkg BIOS area and ucode PCDs
   SimicsIch10Pkg: Use IntelSiliconPkg BIOS area and ucode PCDs
   TigerlakeSiliconPkg: Use IntelSiliconPkg BIOS area and ucode PCDs
   CometlakeOpenBoardPkg: Update SpiFvbService &
SpiFlashCommonLib
   KabylakeOpenBoardPkg: Update SpiFvbService & SpiFlashCommonLib
   SimicsOpenBoardPkg: Update SpiFvbService & SpiFlashCommonLib
   TigerlakeOpenBoardPkg: Update SpiFvbService & SpiFlashCommonLib
   WhiskeylakeOpenBoardPkg: Update SpiFvbService &
SpiFlashCommonLib
   MinPlatformPkg: Remove SpiFvbService modules
   CoffeelakeSiliconPkg: Remove SmmSpiFlashCommonLib
   KabylakeSiliconPkg: Remove SmmSpiFlashCommonLib
   SimicsIch10Pkg: Remove SmmSpiFlashCommonLib
   TigerlakeOpenBoardPkg: Remove SmmSpiFlashCommonLib
   MinPlatformPkg: Remove SpiFlashCommonLibNull
   KabylakeOpenBoardPkg/PeiSerialPortLibSpiFlash: Add
IntelSiliconPkg.dec
   CoffeelakeSiliconPkg: Remove PCH SPI PPI and Protocol from
package
   KabylakeSiliconPkg: Remove PCH SPI PPI and Protocol from package
   SimicsIch10Pkg: Remove PCH SPI SMM Protocol from package
   TigerlakeSiliconPkg: Remove PCH SPI PPI and Protocol from package
   IntelSiliconPkg: Add flash region GUIDs
   IntelSiliconPkg: Identify flash regions by GUID
   CoffeelakeSiliconPkg/BasePchSpiCommonLib: Identify flash regions
by
     GUID
   KabylakeSiliconPkg: Identify flash regions by GUID
   SimicsIch10Pkg/BasePchSpiCommonLib: Identify flash regions by
GUID
   TigerlakeSiliconPkg/BasePchSpiCommonLib: Identify flash regions
by
     GUID


Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/Private/BasePchSpiCom
monLi

b/SpiCommon.c
| 144 ++++++++--

Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiF
lashCommon.c
| 196 -------------

Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiF
lashCommonSmmLib.c
|  54 ----
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/FvbInfo.c
|   0
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceCom

mon.c                                                            |
4 +-
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceMm

.c                                                                |
8 +-
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceStan

daloneMm.c                                                      |
0
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceTrad

itionalMm.c                                                     |
0

Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/Sp
i
FlashCommonSmmLib.c =>
Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFla
shC
ommonLib.c |   2 +-
  {Platform/Intel/TigerlakeOpenBoardPkg =>
Silicon/Intel/IntelSiliconPkg}/Library/SmmSpiFlashCommonLib/SpiFlash
Com mon.c                                                         |
7 +-
  {Platform/Intel/MinPlatformPkg/Flash =>
Silicon/Intel/IntelSiliconPkg}/Library/SpiFlashCommonLibNull/SpiFlas
hComm

onLibNull.c                                                  |  12
+-

Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/SecureMemoryMapConfiguration.
c
| 106 ++++++-

Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFla
shCommon.c
| 196 -------------

Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/SpiFla
shCommonSmmLib.c
|  54 ----

Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpiCommonLib/
SpiCommon.c
| 140 +++++++--

Silicon/Intel/SimicsIch10Pkg/Library/SmmSpiFlashCommonLib/SpiFlashComm
on.c
| 194 -------------

Silicon/Intel/SimicsIch10Pkg/Library/SmmSpiFlashCommonLib/SpiFlashComm
onSmmLib.c
|  54 ----

Silicon/Intel/SimicsIch10Pkg/LibraryPrivate/BasePchSpiCommonLib/SpiCom
mon.c
| 165 ++++++++---
  Silicon/Intel/SimicsIch10Pkg/Spi/Smm/PchSpi.c
|   4 +-

Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Spi/LibraryPrivate/BaseSpi
Common

Lib/SpiCommon.c
| 176
++++++++++--
  Platform/Intel/CometlakeOpenBoardPkg/BiosInfo/BiosInfo.inf
|   4 +-

Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/Fdf/Flash
MapInclude.fdf
|   4 +-

Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.d
sc
|   7 +-

Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/OpenBoardPkg.f
df
|  38 +--

Platform/Intel/CometlakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLib/
PeiPolicyUpdateLib.inf
|   2 +-

Platform/Intel/CometlakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInit
Dxe.i

nf
|   4 +-
  Platform/Intel/KabylakeOpenBoardPkg/BiosInfo/BiosInfo.inf
|   4 +-

Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/Include/Fdf/FlashMapIn
clude.fdf
|   4 +-
  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.ds
c
|   7 +-
  Platform/Intel/KabylakeOpenBoardPkg/GalagoPro3/OpenBoardPkg.fdf
|  40 +--

Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Include/Fdf/FlashMa
pInclude.fdf
|   4 +-
  Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.
dsc
|   7 +-
  Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.
fdf
|  40 +--

Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/Policy/Library/PeiSilic
onPolicyUpdateLib/PeiSiliconPolicyUpdateLib.inf
|
4 +-

Platform/Intel/KabylakeOpenBoardPkg/Library/PeiSerialPortLibSpiFlash
/PeiS

erialPortLibSpiFlash.inf
|   1 +
  Platform/Intel/MinPlatformPkg/Include/Library/SpiFlashCommonLib.h
|  98 -------
  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
|   2 -
  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
|   6 -
  Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.ds
c
|   6 +-
  Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fd
f
|   2 +-

Platform/Intel/SimicsOpenBoardPkg/BoardX58Ich10/OpenBoardPkg.fdf.inc
|   8 +-
  Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf
|   8 +-

Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMa
pInclude.fdf
|   4 +-

Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
|   7 +-

Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf
|  40 +--
  Platform/Intel/WhiskeylakeOpenBoardPkg/BiosInfo/BiosInfo.inf
|   4 +-

Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/Library/PeiPolicyUpdateLi
b/PeiPolicyUpdateLib.inf
|   1 -

Platform/Intel/WhiskeylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDx
e.inf
|   4 +-

Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Fdf/FlashMa
pInclude.fdf
|   4 +-

Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Library/BoardInitLib/
PeiMultiBoardInitPreMemLib.inf
|   2 +-
  Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.
dsc
|   7 +-
  Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/OpenBoardPkg.
fdf
|  38 +--

Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/Fdf/F
lashMapInclude.fdf
|   4 +-

Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
g.dsc
|   7 +-

Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/OpenBoardPk
g.fdf
|  38 +--

Silicon/Intel/CoffeelakeSiliconPkg/Cpu/Library/PeiCpuPolicyLib/PeiCp
uPolicy

Lib.inf
|   4 +-

Silicon/Intel/CoffeelakeSiliconPkg/Pch/Include/Private/Library/PchSp
iComm

onLib.h
|  16 +-

Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/PeiSpiLib/PeiSpiLib.i
nf
|   1 +

Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/Private/BasePchSpiCom
monLi

b/BasePchSpiCommonLib.inf
|  13 +

Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Sm
mSpiFlashCommonLib.inf
|  51 ----
  Silicon/Intel/CoffeelakeSiliconPkg/Pch/Spi/Smm/PchSpiSmm.inf
|   1 +
  Silicon/Intel/CoffeelakeSiliconPkg/SiPkg.dec
|   8 -
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceCom

mon.h                                                            |
0
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceMm

.h                                                                |
0
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceSm

m.inf                                                             |
6 +-
  {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceStan

daloneMm.inf                                                    |
6 +-
  Silicon/Intel/IntelSiliconPkg/Include/Guid/FlashRegion.h
|  45 +++
  Silicon/Intel/{CoffeelakeSiliconPkg/Pch =>
IntelSiliconPkg}/Include/Library/SpiFlashCommonLib.h
|   2 +-
  Silicon/Intel/{CoffeelakeSiliconPkg/Pch =>
IntelSiliconPkg}/Include/Ppi/Spi.h
|   4 +-
  Silicon/Intel/{CoffeelakeSiliconPkg/Pch =>
IntelSiliconPkg}/Include/Protocol/Spi.h
|  39 +--
  Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
|  37 +++
  Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
|  17 ++
  {Platform/Intel/TigerlakeOpenBoardPkg =>
Silicon/Intel/IntelSiliconPkg}/Library/SmmSpiFlashCommonLib/SmmSpiFl
ash CommonLib.inf                                                 |
24 +-
  {Platform/Intel/MinPlatformPkg/Flash =>
Silicon/Intel/IntelSiliconPkg}/Library/SpiFlashCommonLibNull/SpiFlas
hComm

onLibNull.inf                                                |   3
+-

Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiCpuPolicyLib/PeiCpuP
olicyLi

b.inf
|   4 +-
  Silicon/Intel/KabylakeSiliconPkg/Hsti/Dxe/HstiSiliconDxe.inf
|  12 +-

Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Library/SpiFlashCommonL
ib.h
|  98 -------
  Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Ppi/Spi.h
|  26 --
  Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Protocol/Spi.h
| 293 -------------------

Silicon/Intel/KabylakeSiliconPkg/Pch/IncludePrivate/Library/PchSpiCo
mmonL

ib.h
|  20 +-

Silicon/Intel/KabylakeSiliconPkg/Pch/Library/PeiSpiLib/PeiSpiLib.inf
|   1 +

Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Smm
SpiFlashCommonLib.inf
|  53 ----

Silicon/Intel/KabylakeSiliconPkg/Pch/LibraryPrivate/BasePchSpiCommonLib/
BasePchSpiCommonLib.inf
|  11 +
  Silicon/Intel/KabylakeSiliconPkg/Pch/Spi/Smm/PchSpiSmm.inf
|   1 +
  Silicon/Intel/KabylakeSiliconPkg/SiPkg.dec
|  13 +-
  Silicon/Intel/SimicsIch10Pkg/Ich10Pkg.dec
|  11 -
  Silicon/Intel/SimicsIch10Pkg/Include/Library/SpiFlashCommonLib.h
|  98 -------
  Silicon/Intel/SimicsIch10Pkg/Include/Protocol/Spi.h
| 295 -------------------

Silicon/Intel/SimicsIch10Pkg/IncludePrivate/Library/PchSpiCommonLib.
h
|  46 +--

Silicon/Intel/SimicsIch10Pkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashC
ommonLib.inf
|  50 ----

Silicon/Intel/SimicsIch10Pkg/LibraryPrivate/BasePchSpiCommonLib/BasePch
SpiCommonLib.inf
|  16 +-
  Silicon/Intel/SimicsIch10Pkg/Spi/Smm/PchSpiSmm.inf
|   3 +-
  Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/Spi.h
| 301 --------------------

Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Spi/IncludePrivate/Library
/SpiCom

monLib.h
|  16 +-

Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Spi/LibraryPrivate/BaseSpi
Common

Lib/BaseSpiCommonLib.inf
|  19 +-
  Silicon/Intel/TigerlakeSiliconPkg/IpBlock/Spi/Smm/SpiSmm.inf
|   1 +

Silicon/Intel/TigerlakeSiliconPkg/Pch/PchInit/Dxe/PchInitDxeTgl.inf
|   1 +
  Silicon/Intel/TigerlakeSiliconPkg/SiPkg.dec
|   8 -
  98 files changed, 1083 insertions(+), 2567 deletions(-)  delete
mode 100644
Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/
SpiF
lashCommon.c
  delete mode 100644
Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/
SpiF
lashCommonSmmLib.c
  rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/FvbInfo.c
(100%)
rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceCom

mon.c (96%)  rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceMm

.c (94%)  rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceStan

daloneMm.c (100%)  rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceTrad

itionalMm.c (100%)  rename
Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/Sp
i
FlashCommonSmmLib.c =>
Silicon/Intel/IntelSiliconPkg/Library/SmmSpiFlashCommonLib/SmmSpiFla
shC ommonLib.c (90%)  rename {Platform/Intel/TigerlakeOpenBoardPkg
=>
Silicon/Intel/IntelSiliconPkg}/Library/SmmSpiFlashCommonLib/SpiFlash
Com mon.c (93%)  rename {Platform/Intel/MinPlatformPkg/Flash =>
Silicon/Intel/IntelSiliconPkg}/Library/SpiFlashCommonLibNull/SpiFlas
hComm

onLibNull.c (83%)  delete mode 100644
Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Sp
iFla
shCommon.c
  delete mode 100644
Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Sp
iFla
shCommonSmmLib.c
  delete mode 100644
Silicon/Intel/SimicsIch10Pkg/Library/SmmSpiFlashCommonLib/SpiFlashCo
mm
on.c
  delete mode 100644
Silicon/Intel/SimicsIch10Pkg/Library/SmmSpiFlashCommonLib/SpiFlashCo
mm
onSmmLib.c
  delete mode 100644
Platform/Intel/MinPlatformPkg/Include/Library/SpiFlashCommonLib.h
  delete mode 100644
Silicon/Intel/CoffeelakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/
Sm
mSpiFlashCommonLib.inf
  rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceCom

mon.h (100%)  rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceMm

.h (100%)  rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceSm

m.inf (88%)  rename {Platform/Intel/MinPlatformPkg =>
Silicon/Intel/IntelSiliconPkg/Feature}/Flash/SpiFvbService/SpiFvbSer
viceStan

daloneMm.inf (88%)  create mode 100644
Silicon/Intel/IntelSiliconPkg/Include/Guid/FlashRegion.h
  rename Silicon/Intel/{CoffeelakeSiliconPkg/Pch =>
IntelSiliconPkg}/Include/Library/SpiFlashCommonLib.h (96%)  rename
Silicon/Intel/{CoffeelakeSiliconPkg/Pch =>
IntelSiliconPkg}/Include/Ppi/Spi.h
(85%)  rename Silicon/Intel/{CoffeelakeSiliconPkg/Pch =>
IntelSiliconPkg}/Include/Protocol/Spi.h (89%)  rename
{Platform/Intel/TigerlakeOpenBoardPkg =>
Silicon/Intel/IntelSiliconPkg}/Library/SmmSpiFlashCommonLib/SmmSpiFl
ash CommonLib.inf (67%)  rename
{Platform/Intel/MinPlatformPkg/Flash
=>
Silicon/Intel/IntelSiliconPkg}/Library/SpiFlashCommonLibNull/SpiFlas
hComm

onLibNull.inf (91%)  delete mode 100644
Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Library/SpiFlashCommonL
ib.h
  delete mode 100644
Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Ppi/Spi.h
  delete mode 100644
Silicon/Intel/KabylakeSiliconPkg/Pch/Include/Protocol/Spi.h
  delete mode 100644
Silicon/Intel/KabylakeSiliconPkg/Pch/Library/SmmSpiFlashCommonLib/Sm
m
SpiFlashCommonLib.inf
  delete mode 100644
Silicon/Intel/SimicsIch10Pkg/Include/Library/SpiFlashCommonLib.h
  delete mode 100644
Silicon/Intel/SimicsIch10Pkg/Include/Protocol/Spi.h
  delete mode 100644
Silicon/Intel/SimicsIch10Pkg/Library/SmmSpiFlashCommonLib/SmmSpiFlas
hC
ommonLib.inf
  delete mode 100644
Silicon/Intel/TigerlakeSiliconPkg/Include/Protocol/Spi.h

--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77097):
https://edk2.groups.io/g/devel/message/77097
Mute This Topic: https://groups.io/mt/83794775/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[nathaniel.l.desimone@intel.com]
-=-=-=-=-=-=



Re: [PATCH 1/1] MdeModulePkg/Console: Improve encoding of box drawing characters

Nate DeSimone
 

Caden,

Please make sure you test this patch thoroughly. With that...

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

Thanks!
Nate

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Caden
Kline
Sent: Thursday, July 29, 2021 7:45 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@intel.com>; Wu, Hao A
<hao.a.wu@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Ni, Ray
<ray.ni@intel.com>
Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg/Console: Improve
encoding of box drawing characters

Improved encoding of box drawing characters for different terminal types.
This includes Dec special graphics mode and more utf8.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Caden Kline <cadenkline9@gmail.com>
---
.../Universal/Console/TerminalDxe/Terminal.h | 24 +-
.../Universal/Console/TerminalDxe/Ansi.c | 2 +-
.../Console/TerminalDxe/TerminalConOut.c | 322 ++++++++++++++----
3 files changed, 269 insertions(+), 79 deletions(-)

diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
index 360e58e84743..83c3ea94a042 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h
@@ -122,7 +122,10 @@ typedef struct {
EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleInputEx; LIST_ENTRY
NotifyList; EFI_EVENT KeyNotifyProcessEvent;+ BOOLEAN
DecSpecialGraphicsMode; } TERMINAL_DEV;+// This the lenth the escape
squences for entering and exiting Dec Special Graphics Mode+#define
LENGTH_DEC_ESCAPE 0x03 #define INPUT_STATE_DEFAULT
0x00 #define INPUT_STATE_ESC 0x01@@ -169,6 +172,7 @@
typedef struct {
UINT16 Unicode; CHAR8 PcAnsi; CHAR8 Ascii;+ CHAR8
DecSpecialGraphics; } UNICODE_TO_CHAR; //@@ -1367,20 +1371,22 @@
Utf8ToUnicode (
/** Detects if a Unicode char is for Box Drawing text graphics. - @param
Graphic Unicode char to test.- @param PcAnsi Optional pointer to
return PCANSI equivalent of- Graphic.- @param Ascii Optional
pointer to return ASCII equivalent of- Graphic.-- @retval TRUE
If Graphic is a supported Unicode Box Drawing character.+ @param Graphic
Unicode char to test.+ @param PcAnsi Optional pointer to return
PCANSI equivalent of+ Graphic.+ @param Ascii
Optional pointer to return ASCII equivalent of+ Graphic.+
@param DecSpecialGraphics Optional pointer to return Dec Special Graphics
equivalent of+ Graphic.+ @retval TRUE If Graphic is a
supported Unicode Box Drawing character. **/ BOOLEAN
TerminalIsValidTextGraphics ( IN CHAR16 Graphic,- OUT CHAR8 *PcAnsi,
OPTIONAL- OUT CHAR8 *Ascii OPTIONAL+ OUT CHAR8 *PcAnsi,
OPTIONAL+ OUT CHAR8 *Ascii, OPTIONAL+ OUT CHAR8
*DecSpecialGraphics OPTIONAL ); /**diff --git
a/MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c
b/MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c
index f117d90b9de3..5ae5a4f0212e 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c
@@ -63,7 +63,7 @@ AnsiTestString (
if ( !(TerminalIsValidAscii (*WString) || TerminalIsValidEfiCntlChar
(*WString) ||- TerminalIsValidTextGraphics (*WString, &GraphicChar,
NULL) )) {+ TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL,
NULL) )) { return EFI_UNSUPPORTED; }diff --git
a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
index aae470e9562c..1c22ed426715 100644
--- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
+++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c
@@ -16,61 +16,59 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
// // UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] = {- {
BOXDRAW_HORIZONTAL, 0xc4, L'-' },- { BOXDRAW_VERTICAL,
0xb3, L'|' },- { BOXDRAW_DOWN_RIGHT, 0xda, L'/' },- {
BOXDRAW_DOWN_LEFT, 0xbf, L'\\' },- { BOXDRAW_UP_RIGHT,
0xc0, L'\\' },- { BOXDRAW_UP_LEFT, 0xd9, L'/' },- {
BOXDRAW_VERTICAL_RIGHT, 0xc3, L'|' },- {
BOXDRAW_VERTICAL_LEFT, 0xb4, L'|' },- {
BOXDRAW_DOWN_HORIZONTAL, 0xc2, L'+' },- {
BOXDRAW_UP_HORIZONTAL, 0xc1, L'+' },- {
BOXDRAW_VERTICAL_HORIZONTAL, 0xc5, L'+' },- {
BOXDRAW_DOUBLE_HORIZONTAL, 0xcd, L'-' },- {
BOXDRAW_DOUBLE_VERTICAL, 0xba, L'|' },- {
BOXDRAW_DOWN_RIGHT_DOUBLE, 0xd5, L'/' },- {
BOXDRAW_DOWN_DOUBLE_RIGHT, 0xd6, L'/' },- {
BOXDRAW_DOUBLE_DOWN_RIGHT, 0xc9, L'/' },- {
BOXDRAW_DOWN_LEFT_DOUBLE, 0xb8, L'\\' },- {
BOXDRAW_DOWN_DOUBLE_LEFT, 0xb7, L'\\' },- {
BOXDRAW_DOUBLE_DOWN_LEFT, 0xbb, L'\\' },- {
BOXDRAW_UP_RIGHT_DOUBLE, 0xd4, L'\\' },- {
BOXDRAW_UP_DOUBLE_RIGHT, 0xd3, L'\\' },- {
BOXDRAW_DOUBLE_UP_RIGHT, 0xc8, L'\\' },- {
BOXDRAW_UP_LEFT_DOUBLE, 0xbe, L'/' },- {
BOXDRAW_UP_DOUBLE_LEFT, 0xbd, L'/' },- {
BOXDRAW_DOUBLE_UP_LEFT, 0xbc, L'/' },- {
BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0xc6, L'|' },- {
BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0xc7, L'|' },- {
BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0xcc, L'|' },- {
BOXDRAW_VERTICAL_LEFT_DOUBLE, 0xb5, L'|' },- {
BOXDRAW_VERTICAL_DOUBLE_LEFT, 0xb6, L'|' },- {
BOXDRAW_DOUBLE_VERTICAL_LEFT, 0xb9, L'|' },- {
BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0xd1, L'+' },- {
BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0xd2, L'+' },- {
BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0xcb, L'+' },- {
BOXDRAW_UP_HORIZONTAL_DOUBLE, 0xcf, L'+' },- {
BOXDRAW_UP_DOUBLE_HORIZONTAL, 0xd0, L'+' },- {
BOXDRAW_DOUBLE_UP_HORIZONTAL, 0xca, L'+' },- {
BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0xd8, L'+' },- {
BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0xd7, L'+' },- {
BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0xce, L'+' },+ {
BOXDRAW_HORIZONTAL, 0xc4, L'-', 0x71 },+ { BOXDRAW_VERTICAL,
0xb3, L'|', 0x78 },+ { BOXDRAW_DOWN_RIGHT, 0xda, L'/', 0x6c },+ {
BOXDRAW_DOWN_LEFT, 0xbf, L'\\', 0x6b },+ {
BOXDRAW_UP_RIGHT, 0xc0, L'\\', 0x6d },+ { BOXDRAW_UP_LEFT,
0xd9, L'/', 0x6a },+ { BOXDRAW_VERTICAL_RIGHT, 0xc3, L'|', 0x74 },+ {
BOXDRAW_VERTICAL_LEFT, 0xb4, L'|', 0x75 },+ {
BOXDRAW_DOWN_HORIZONTAL, 0xc2, L'+', 0x77 },+ {
BOXDRAW_UP_HORIZONTAL, 0xc1, L'+', 0x76 },+ {
BOXDRAW_VERTICAL_HORIZONTAL, 0xc5, L'+', 0x6e },+ {
BOXDRAW_DOUBLE_HORIZONTAL, 0xcd, L'-', 0x71 },+ {
BOXDRAW_DOUBLE_VERTICAL, 0xba, L'|', 0x78 },+ {
BOXDRAW_DOWN_RIGHT_DOUBLE, 0xd5, L'/', 0x6c },+ {
BOXDRAW_DOWN_DOUBLE_RIGHT, 0xd6, L'/', 0x6c },+ {
BOXDRAW_DOUBLE_DOWN_RIGHT, 0xc9, L'/', 0x6c },+ {
BOXDRAW_DOWN_LEFT_DOUBLE, 0xb8, L'\\', 0x6b },+ {
BOXDRAW_DOWN_DOUBLE_LEFT, 0xb7, L'\\', 0x6b },+ {
BOXDRAW_DOUBLE_DOWN_LEFT, 0xbb, L'\\', 0x6b },+ {
BOXDRAW_UP_RIGHT_DOUBLE, 0xd4, L'\\', 0x6d },+ {
BOXDRAW_UP_DOUBLE_RIGHT, 0xd3, L'\\', 0x6d },+ {
BOXDRAW_DOUBLE_UP_RIGHT, 0xc8, L'\\', 0x6d },+ {
BOXDRAW_UP_LEFT_DOUBLE, 0xbe, L'/', 0x6a },+ {
BOXDRAW_UP_DOUBLE_LEFT, 0xbd, L'/', 0x6a },+ {
BOXDRAW_DOUBLE_UP_LEFT, 0xbc, L'/', 0x6a },+ {
BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0xc6, L'|', 0x74 },+ {
BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0xc7, L'|', 0x74 },+ {
BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0xcc, L'|', 0x74 },+ {
BOXDRAW_VERTICAL_LEFT_DOUBLE, 0xb5, L'|', 0x75 },+ {
BOXDRAW_VERTICAL_DOUBLE_LEFT, 0xb6, L'|', 0x75 },+ {
BOXDRAW_DOUBLE_VERTICAL_LEFT, 0xb9, L'|', 0x75 },+ {
BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0xd1, L'+', 0x77 },+ {
BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0xd2, L'+', 0x77 },+ {
BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0xcb, L'+', 0x77 },+ {
BOXDRAW_UP_HORIZONTAL_DOUBLE, 0xcf, L'+', 0x76 },+ {
BOXDRAW_UP_DOUBLE_HORIZONTAL, 0xd0, L'+', 0x76 },+ {
BOXDRAW_DOUBLE_UP_HORIZONTAL, 0xca, L'+', 0x76 },+ {
BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0xd8, L'+', 0x6e },+ {
BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0xd7, L'+', 0x6e },+ {
BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0xce, L'+', 0x6e }, - {
BLOCKELEMENT_FULL_BLOCK, 0xdb, L'*' },- {
BLOCKELEMENT_LIGHT_SHADE, 0xb0, L'+' },+ {
BLOCKELEMENT_FULL_BLOCK, 0xdb, L'*', 0x61 },+ {
BLOCKELEMENT_LIGHT_SHADE, 0xb0, L'+', 0x61 }, - {
GEOMETRICSHAPE_UP_TRIANGLE, '^', L'^' },- {
GEOMETRICSHAPE_RIGHT_TRIANGLE, '>', L'>' },- {
GEOMETRICSHAPE_DOWN_TRIANGLE, 'v', L'v' },- {
GEOMETRICSHAPE_LEFT_TRIANGLE, '<', L'<' },+ {
GEOMETRICSHAPE_UP_TRIANGLE, '^', L'^', L'^' },+ {
GEOMETRICSHAPE_RIGHT_TRIANGLE, '>', L'>', L'>' },+ {
GEOMETRICSHAPE_DOWN_TRIANGLE, 'v', L'v', L'v' },+ {
GEOMETRICSHAPE_LEFT_TRIANGLE, '<', L'<', L'<' }, - { ARROW_LEFT,
'<', L'<' },- { ARROW_UP, '^', L'^' },- { ARROW_RIGHT,
'>', L'>' },- { ARROW_DOWN, 'v', L'v' },-- { 0x0000,
0x00, L'\0' }+ { ARROW_LEFT, '<', L'<', L'<' },+ { ARROW_UP,
'^', L'^', L'^' },+ { ARROW_RIGHT, '>', L'>', L'>' },+ {
ARROW_DOWN, 'v', L'v', L'v' }, }; CHAR16 mSetModeString[]
= { ESC, '[', '=', '3', 'h', 0 };@@ -80,6 +78,8 @@ CHAR16
mSetCursorPositionString[] = { ESC, '[', '0', '0', ';', '0', '0', 'H', 0
CHAR16 mCursorForwardString[] = { ESC, '[', '0', '0', 'C', 0 }; CHAR16
mCursorBackwardString[] = { ESC, '[', '0', '0', 'D', 0 }; +CHAR8
SetDecModeString[] = {ESC, 0x28, 0x30};+CHAR8 ExitDecModeString[]
= {ESC, 0x28, 0x42}; // // Body of the ConOut functions //@@ -183,16 +183,19
@@ TerminalConOutOutputString (
EFI_STATUS Status; UINT8 ValidBytes; CHAR8
CrLfStr[2];+ CHAR8 DecChar;+ UINTN
ModeSwitchLength; // // flag used to indicate whether condition happens
which will cause // return EFI_WARN_UNKNOWN_GLYPH // BOOLEAN
Warning; - ValidBytes = 0;- Warning = FALSE;- AsciiChar = 0;-+ ValidBytes
= 0;+ Warning = FALSE;+ AsciiChar = 0;+ DecChar = 0;+
ModeSwitchLength = LENGTH_DEC_ESCAPE; // // get Terminal device data
structure pointer. //@@ -217,17 +220,136 @@ TerminalConOutOutputString
(
for (; *WString != CHAR_NULL; WString++) { switch (TerminalDevice-
TerminalType) {- case TerminalTypePcAnsi:- case TerminalTypeVt100:-
case TerminalTypeVt100Plus:- case TerminalTypeTtyTerm:- case
TerminalTypeLinux:+ if (!TerminalIsValidTextGraphics (*WString,
&GraphicChar, &AsciiChar, NULL)) {+ //+ // If it's not a graphic
character convert Unicode to ASCII.+ //+ GraphicChar =
(CHAR8)*WString;++ if (!(TerminalIsValidAscii (GraphicChar) ||
TerminalIsValidEfiCntlChar (GraphicChar))) {+ //+ // when this driver
use the OutputString to output control string,+ // TerminalDevice-
OutputEscChar is set to let the Esc char+ // to be output to the terminal
emulation software.+ //+ if ((GraphicChar == 27) &&
TerminalDevice->OutputEscChar) {+ GraphicChar = 27;+ } else {+
GraphicChar = '?';+ Warning = TRUE;+ }+ }++ AsciiChar =
GraphicChar;+ }+ Length = 1;+ Status = TerminalDevice->SerialIo-
Write (+ TerminalDevice->SerialIo,+
&Length,+ &GraphicChar+ );++ if
(EFI_ERROR (Status)) {+ goto OutputError;+ }++ break; case
TerminalTypeXtermR6:- case TerminalTypeVt400: case
TerminalTypeSCO:+ if (TerminalIsValidTextGraphics (*WString, NULL,
NULL, &DecChar) && !TerminalIsValidAscii (*WString)) {+ //Box graphics
are split into 2 types simple and advanced+ //simple are drawn with dec
special graphics+ //advanced are drawn with utf8+ //This checks for
simple because they have a lower value than the advanced+ if(*WString
< BOXDRAW_DOUBLE_HORIZONTAL) {+ if (!TerminalDevice-
DecSpecialGraphicsMode) {+ ValidBytes = 0;+
ModeSwitchLength = LENGTH_DEC_ESCAPE;+ Status =
TerminalDevice->SerialIo->Write (+ TerminalDevice-
SerialIo,+ &ModeSwitchLength,+
(UINT8 *)SetDecModeString+ );+ TerminalDevice-
DecSpecialGraphicsMode = TRUE;+ } - if (!TerminalIsValidTextGraphics
(*WString, &GraphicChar, &AsciiChar)) {+ GraphicChar = DecChar;+
Length = 1;+ } else {+ if (TerminalDevice-
DecSpecialGraphicsMode) {+ ModeSwitchLength =
LENGTH_DEC_ESCAPE;+ Status = TerminalDevice->SerialIo->Write (+
TerminalDevice->SerialIo,+ &ModeSwitchLength,+
(UINT8 *)ExitDecModeString+ );+ if
(EFI_ERROR (Status)) {+ goto OutputError;+ }++
TerminalDevice->DecSpecialGraphicsMode = FALSE;+ }++
UnicodeToUtf8 (*WString, &Utf8Char, &ValidBytes);+ Length =
ValidBytes;+ }+ } else {+ if (TerminalDevice-
DecSpecialGraphicsMode) {+ Status = TerminalDevice->SerialIo->Write
(+ TerminalDevice->SerialIo,+
&ModeSwitchLength,+ (UINT8 *)ExitDecModeString+
);+ if (EFI_ERROR (Status)) {+ goto OutputError;+ }++
TerminalDevice->DecSpecialGraphicsMode = FALSE;+ }++
GraphicChar = (CHAR8)*WString;++ if (!(TerminalIsValidAscii
(GraphicChar) || TerminalIsValidEfiCntlChar (GraphicChar))) {+ //+
// when this driver use the OutputString to output control string,+ //
TerminalDevice->OutputEscChar is set to let the Esc char+ // to be
output to the terminal emulation software.+ //+ if ((GraphicChar
== 27) && TerminalDevice->OutputEscChar) {+ GraphicChar = 27;+
Length = 1;+ } else {+ UnicodeToUtf8 (*WString, &Utf8Char,
&ValidBytes);+ Length = ValidBytes;+ }+ } else {+ Length =
1;+ }+ }++ if (ValidBytes) {+ Status = TerminalDevice->SerialIo-
Write (+ TerminalDevice->SerialIo,+
&Length,+ (UINT8 *)&Utf8Char+
);+ ValidBytes = 0;+ } else {+ Status = TerminalDevice->SerialIo-
Write (+ TerminalDevice->SerialIo,+
&Length,+ &GraphicChar+ );+ }+ if
(EFI_ERROR (Status)) {+ goto OutputError;+ }++ break;+ case
TerminalTypeVt100:+ case TerminalTypeTtyTerm:+ if
(!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiChar, NULL)) {
// // If it's not a graphic character convert Unicode to ASCII. //@@ -
248,12 +370,9 @@ TerminalConOutOutputString (
} AsciiChar = GraphicChar;- } - if (TerminalDevice-
TerminalType != TerminalTypePcAnsi) {- GraphicChar = AsciiChar;- }+
GraphicChar = AsciiChar; Length = 1; @@ -267,8 +386,67 @@
TerminalConOutOutputString (
goto OutputError; } - break;+ break;+ case
TerminalTypeVt100Plus:+ case TerminalTypeVt400:+ Length = 1;+ if
(TerminalIsValidTextGraphics (*WString, NULL, NULL, &DecChar)) {+ if
(!TerminalDevice->DecSpecialGraphicsMode) {+ ModeSwitchLength =
LENGTH_DEC_ESCAPE;+ Status = TerminalDevice->SerialIo->Write (+
TerminalDevice->SerialIo,+ &ModeSwitchLength,+
(UINT8 *)SetDecModeString+ );+ TerminalDevice-
DecSpecialGraphicsMode = TRUE;+ } + GraphicChar = DecChar;+ }
else {+ if (TerminalDevice->DecSpecialGraphicsMode) {+
ModeSwitchLength = LENGTH_DEC_ESCAPE;+ Status = TerminalDevice-
SerialIo->Write (+ TerminalDevice->SerialIo,+
&ModeSwitchLength,+ (UINT8
*)ExitDecModeString+ );++ if (EFI_ERROR (Status))
{+ goto OutputError;+ }++ TerminalDevice-
DecSpecialGraphicsMode = FALSE;+ }++ GraphicChar =
(CHAR8)*WString;++ if (!(TerminalIsValidAscii (GraphicChar) ||
TerminalIsValidEfiCntlChar (GraphicChar))) {+ //+ // when this driver
use the OutputString to output control string,+ // TerminalDevice-
OutputEscChar is set to let the Esc char+ // to be output to the terminal
emulation software.+ //+ if ((GraphicChar == 27) &&
TerminalDevice->OutputEscChar) {+ GraphicChar = 27;+ } else {+
GraphicChar = '?';+ Warning = TRUE;+ }+ }+ }++ Status =
TerminalDevice->SerialIo->Write (+ TerminalDevice-
SerialIo,+ &Length,+ &GraphicChar+
);++ if (EFI_ERROR (Status)) {+ goto OutputError;+ }++ break;+
case TerminalTypeLinux: case TerminalTypeVtUtf8: UnicodeToUtf8
(*WString, &Utf8Char, &ValidBytes); Length = ValidBytes;@@ -280,8
+458,10 @@ TerminalConOutOutputString (
if (EFI_ERROR (Status)) { goto OutputError; }+ break; }+ //
// Update cursor position. //@@ -875,7 +1055,8 @@ BOOLEAN
TerminalIsValidTextGraphics ( IN CHAR16 Graphic, OUT CHAR8 *PcAnsi,
OPTIONAL- OUT CHAR8 *Ascii OPTIONAL+ OUT CHAR8 *Ascii, OPTIONAL+
OUT CHAR8 *DecSpecialGraphics OPTIONAL ) { UNICODE_TO_CHAR
*Table;@@ -897,6 +1078,9 @@ TerminalIsValidTextGraphics (
if (Ascii != NULL) { *Ascii = Table->Ascii; }+ if (DecSpecialGraphics
!= NULL){+ *DecSpecialGraphics = Table->DecSpecialGraphics;+ }
return TRUE; }--
2.32.0



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78390): https://edk2.groups.io/g/devel/message/78390
Mute This Topic: https://groups.io/mt/84545877/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[nathaniel.l.desimone@intel.com] -=-=-=-=-=-=


Re: [edk2-platforms][PATCH v1 5/5] MinPlatformPkg/TestPointCheckLib: Make OutTable parameter optional

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
Kubacki
Sent: Thursday, August 5, 2021 7:57 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Liming Gao
<gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-devel] [edk2-platforms][PATCH v1 5/5]
MinPlatformPkg/TestPointCheckLib: Make OutTable parameter optional

From: Michael Kubacki <michael.kubacki@microsoft.com>

Makes the OutTable parameter in DumpAcpiRsdt() and DumpAcpiXsdt()
optional since the pointer passed can be NULL if the Signature pointer is also
NULL.

Can fix a potential failure in TestPointCheckAcpi().

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckA
cpi.c | 32 ++++++++++----------
1 file changed, 16 insertions(+), 16 deletions(-)

diff --git
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
Acpi.c
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
Acpi.c
index cd8f538f7f3f..3d75e5012a4c 100644
---
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
Acpi.c
+++
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh
+++ eckAcpi.c
@@ -477,7 +477,7 @@ DumpAcpiTable (
)
{
EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt;
-
+
if (Table == NULL) {
return ;
}
@@ -535,7 +535,7 @@ CheckAcpiTableResource (
)
{
EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt;
-
+
if (Table == NULL) {
return EFI_INVALID_PARAMETER;
}
@@ -592,7 +592,7 @@ EFI_STATUS
DumpAcpiRsdt (
IN EFI_ACPI_DESCRIPTION_HEADER *Rsdt,
IN UINT32 *Signature, OPTIONAL
- OUT VOID **OutTable,
+ OUT VOID **OutTable, OPTIONAL
IN BOOLEAN DumpPrint,
IN BOOLEAN CheckResource
)
@@ -610,7 +610,7 @@ DumpAcpiRsdt (

if (OutTable != NULL) {
*OutTable = NULL;
- } else {
+ } else if ((OutTable == NULL) && (Signature != NULL)) {
return EFI_INVALID_PARAMETER;
}

@@ -632,7 +632,7 @@ DumpAcpiRsdt (
*OutTable = Table;
}
}
-
+
if (OutTable != NULL) {
if (*OutTable == NULL) {
return EFI_NOT_FOUND;
@@ -646,7 +646,7 @@ EFI_STATUS
DumpAcpiXsdt (
IN EFI_ACPI_DESCRIPTION_HEADER *Xsdt,
IN UINT32 *Signature, OPTIONAL
- OUT VOID **OutTable,
+ OUT VOID **OutTable, OPTIONAL
IN BOOLEAN DumpPrint,
IN BOOLEAN CheckResource
)
@@ -662,16 +662,16 @@ DumpAcpiXsdt (
if (Xsdt == NULL) {
return EFI_INVALID_PARAMETER;
}
-
+
if (OutTable != NULL) {
*OutTable = NULL;
- } else {
+ } else if ((OutTable == NULL) && (Signature != NULL)) {
return EFI_INVALID_PARAMETER;
}

ReturnStatus = EFI_SUCCESS;
EntryCount = (Xsdt->Length - sizeof (EFI_ACPI_DESCRIPTION_HEADER)) /
sizeof(UINT64);
-
+
BasePtr = (UINTN)(Xsdt + 1);
for (Index = 0; Index < EntryCount; Index ++) {
CopyMem (&EntryPtr, (VOID *)(BasePtr + Index * sizeof(UINT64)),
sizeof(UINT64)); @@ -783,7 +783,7 @@ TestPointCheckAcpi (
if (Status == EFI_NOT_FOUND) {
Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, TRUE,
FALSE);
}
-
+
if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_ERROR, "No ACPI table\n"));
TestPointLibAppendErrorString (
@@ -796,7 +796,7 @@ TestPointCheckAcpi (
}

DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpi - Exit\n"));
-
+
return Status;
}

@@ -806,9 +806,9 @@ TestPointCheckAcpiGcdResource (
)
{
EFI_STATUS Status;
-
+
DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpiGcdResource -
Enter\n"));
-
+
//
// Check the ACPI existence
//
@@ -816,7 +816,7 @@ TestPointCheckAcpiGcdResource (
if (Status == EFI_NOT_FOUND) {
Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, FALSE,
FALSE);
}
-
+
if (!EFI_ERROR(Status)) {
//
// Then check resource in ACPI and GCD @@ -828,7 +828,7 @@
TestPointCheckAcpiGcdResource (
Status = DumpAcpiWithGuid (&gEfiAcpi10TableGuid, NULL, NULL, FALSE,
TRUE);
}
}
-
+
if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_ERROR, "ACPI table resource not in GCD\n"));
TestPointLibAppendErrorString (
@@ -840,7 +840,7 @@ TestPointCheckAcpiGcdResource (
);
}
DEBUG ((DEBUG_INFO, "==== TestPointCheckAcpiGcdResource - Exit\n"));
-
+
return Status;
}

--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78715): https://edk2.groups.io/g/devel/message/78715
Mute This Topic: https://groups.io/mt/84686310/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[nathaniel.l.desimone@intel.com]
-=-=-=-=-=-=


Re: [edk2-platforms][PATCH v1 4/5] MinPlatformPkg/TestPointCheckLib: Improve adjacent region checking

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
Kubacki
Sent: Thursday, August 5, 2021 7:57 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Liming Gao
<gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-devel] [edk2-platforms][PATCH v1 4/5]
MinPlatformPkg/TestPointCheckLib: Improve adjacent region checking

From: Michael Kubacki <michael.kubacki@microsoft.com>

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

The current logic depends on a particular order in which the descriptors for
three or more regions are placed in the array to perform proper adjacency
checking. When three or more regions are all adjacent, but neighboring
descriptors are not adjacent, the logic can improperly report a failure. Adjust
the logic so that all descriptors are checked for adjacency.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckS
mmInfo.c | 56 ++++++++++----------
1 file changed, 29 insertions(+), 27 deletions(-)

diff --git
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
SmmInfo.c
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
SmmInfo.c
index c493750a27e6..f15f76eab574 100644
---
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
SmmInfo.c
+++
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh
+++ eckSmmInfo.c
@@ -59,34 +59,36 @@ CheckSmramDescriptor (
)
{
UINTN Index;
- UINT64 Base;
+ UINTN Index2;
UINT64 Length;
+ BOOLEAN AdjacentRegion;

- Base = 0;
Length = 0;
for (Index = 0; Index < NumberOfSmmReservedRegions; Index++) {
- if (Base == 0) {
- Base = Descriptor[Index].PhysicalStart;
- Length = Descriptor[Index].PhysicalSize;
+ AdjacentRegion = FALSE;
+ for (Index2 = 0; Index2 < NumberOfSmmReservedRegions; Index2++) {
+ if ((NumberOfSmmReservedRegions == 1)
+ || (Descriptor[Index].PhysicalStart + Descriptor[Index].PhysicalSize ==
Descriptor[Index2].PhysicalStart)
+ || (Descriptor[Index2].PhysicalStart + Descriptor[Index2].PhysicalSize
== Descriptor[Index].PhysicalStart)) {
+ AdjacentRegion = TRUE;
+ break;
+ }
+ }
+
+ if (AdjacentRegion == TRUE) {
+ Length += Descriptor[Index].PhysicalSize;
} else {
- if (Base + Length == Descriptor[Index].PhysicalStart) {
- Length = Length + Descriptor[Index].PhysicalSize;
- } else if (Descriptor[Index].PhysicalStart + Descriptor[Index].PhysicalSize
== Base) {
- Base = Descriptor[Index].PhysicalStart;
- Length = Length + Descriptor[Index].PhysicalSize;
- } else {
- DEBUG ((DEBUG_ERROR, "Smram is not adjacent\n"));
- TestPointLibAppendErrorString (
- PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV,
- NULL,
-
TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERRO
R_CODE \
- TEST_POINT_DXE_SMM_READY_TO_LOCK
-
TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERRO
R_STRING
- );
- return EFI_INVALID_PARAMETER;
- }
+ DEBUG ((DEBUG_ERROR, "Smram is not adjacent\n"));
+ TestPointLibAppendErrorString (
+ PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV,
+ NULL,
+
TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERRO
R_CODE \
+ TEST_POINT_DXE_SMM_READY_TO_LOCK
+
TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERRO
R_STRING
+ );
+ return EFI_INVALID_PARAMETER;
}
- }
+ }

if (Length != GetPowerOfTwo64 (Length)) {
DEBUG ((DEBUG_ERROR, "Smram is not aligned\n")); @@ -94,7 +96,7 @@
CheckSmramDescriptor (
PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV,
NULL,

TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERRO
R_CODE \
- TEST_POINT_DXE_SMM_READY_TO_LOCK
+ TEST_POINT_DXE_SMM_READY_TO_LOCK

TEST_POINT_BYTE7_DXE_SMM_READY_TO_LOCK_SMRAM_ALIGNED_ERRO
R_STRING
);
return EFI_INVALID_PARAMETER;
@@ -111,14 +113,14 @@ TestPointCheckSmmInfo (
EFI_SMM_ACCESS2_PROTOCOL *SmmAccess;
UINTN Size;
EFI_SMRAM_DESCRIPTOR *SmramRanges;
-
+
DEBUG ((DEBUG_INFO, "==== TestPointCheckSmmInfo - Enter\n"));
-
+
Status = gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID
**)&SmmAccess);
if (EFI_ERROR (Status)) {
goto Done ;
}
-
+
Size = 0;
Status = SmmAccess->GetCapabilities (SmmAccess, &Size, NULL);
ASSERT (Status == EFI_BUFFER_TOO_SMALL); @@ -128,7 +130,7 @@
TestPointCheckSmmInfo (

Status = SmmAccess->GetCapabilities (SmmAccess, &Size, SmramRanges);
ASSERT_EFI_ERROR (Status);
-
+
DEBUG ((DEBUG_INFO, "SMRAM Info\n"));
DumpSmramDescriptor (Size / sizeof (EFI_SMRAM_DESCRIPTOR),
SmramRanges);

--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78714): https://edk2.groups.io/g/devel/message/78714
Mute This Topic: https://groups.io/mt/84686308/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[nathaniel.l.desimone@intel.com]
-=-=-=-=-=-=


Re: [edk2-platforms][PATCH v1 1/5] MinPlatformPkg/TestPointCheckLib: Fix MessageLength cast issue

Nate DeSimone
 

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: mikuback@linux.microsoft.com <mikuback@linux.microsoft.com>
Sent: Thursday, August 5, 2021 7:57 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Liming Gao
<gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-platforms][PATCH v1 1/5]
MinPlatformPkg/TestPointCheckLib: Fix MessageLength cast issue

From: Michael Kubacki <michael.kubacki@microsoft.com>

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

The MessageLength field of EFI_MM_COMMUNICATE_HEADER as defined in
MdePkg/Include/Protocol/MmCommunication.h was updated to a fixed size
as opposed to UINTN to avoid ambiguity between different caller
enviornments.

This change updates the MessageLength usage in MinPlatformPkg to support
the new field structure, in turn, fixing a build issue.

Original edk2 change:
https://bugzilla.tianocore.org/show_bug.cgi?id=3398

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckS
miHandlerInstrument.c | 4 ++--

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPoi
ntCheckLib.c | 15 ++++++++++++++-
Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe.c
| 10 +++++-----

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPoi
ntCheckLib.inf | 1 +
4 files changed, 22 insertions(+), 8 deletions(-)

diff --git
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
SmiHandlerInstrument.c
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
SmiHandlerInstrument.c
index 3ceeb821fb95..80e8d26f4e1d 100644
---
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
SmiHandlerInstrument.c
+++
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh
+++ eckSmiHandlerInstrument.c
@@ -106,7 +106,7 @@ GetSmiHandlerProfileDatabase(
CommGetInfo->Header.ReturnStatus = (UINT64)-1;
CommGetInfo->DataSize = 0;

- CommSize = sizeof(EFI_GUID) + sizeof(UINTN) + CommHeader-
MessageLength;
+ CommSize = OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) +
+ (UINTN)CommHeader->MessageLength;
Status = SmmCommunication->Communicate(SmmCommunication,
CommBuffer, &CommSize);
if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_INFO, "SmiHandlerProfile: SmmCommunication - %r\n",
Status)); @@ -139,7 +139,7 @@ GetSmiHandlerProfileDatabase(
CommGetData->Header.DataLength = sizeof(*CommGetData);
CommGetData->Header.ReturnStatus = (UINT64)-1;

- CommSize = sizeof(EFI_GUID) + sizeof(UINTN) + CommHeader-
MessageLength;
+ CommSize = OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) +
+ (UINTN)CommHeader->MessageLength;
Buffer = (UINT8 *)CommHeader + CommSize;
Size -= CommSize;

diff --git
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP
ointCheckLib.c
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP
ointCheckLib.c
index c012e0afcbaa..e5efbd059954 100644
---
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP
ointCheckLib.c
+++
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTe
+++ stPointCheckLib.c
@@ -12,6 +12,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include
<Library/DebugLib.h> #include <Library/UefiLib.h> #include
<Library/BaseMemoryLib.h>
+#include <Library/SafeIntLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/DmaRemappingReportingTable.h>
@@ -520,6 +521,7 @@ TestPointDxeSmmReadyToBootSmmPageProtection (
UINTN MemoryAttributesTableSize;
EFI_STATUS Status;
UINTN CommSize;
+ UINT64 LongCommSize;
UINT8 *CommBuffer;
EFI_SMM_COMMUNICATE_HEADER *CommHeader;
EFI_SMM_COMMUNICATION_PROTOCOL
*SmmCommunication;
@@ -620,7 +622,18 @@ TestPointDxeSmmReadyToBootSmmPageProtection
(
(UINTN)CommData->UefiMemoryAttributeTableSize
);

- CommSize = OFFSET_OF(EFI_SMM_COMMUNICATE_HEADER, Data) +
CommHeader->MessageLength;
+ Status = SafeUint64Add (OFFSET_OF
(EFI_SMM_COMMUNICATE_HEADER, Data),
+ CommHeader->MessageLength, &LongCommSize); if (EFI_ERROR (Status))
{
+ DEBUG ((DEBUG_INFO,
"TestPointDxeSmmReadyToBootSmmPageProtection: LongCommSize
calculation - %r\n", Status));
+ return EFI_SUCCESS;
+ }
+
+ Status = SafeUint64ToUintn (LongCommSize, &CommSize); if (EFI_ERROR
+ (Status)) {
+ DEBUG ((DEBUG_INFO,
"TestPointDxeSmmReadyToBootSmmPageProtection: CommSize conversion
- %r\n", Status));
+ return EFI_SUCCESS;
+ }
+
Status = SmmCommunication->Communicate(SmmCommunication,
CommBuffer, &CommSize);
if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_INFO,
"TestPointDxeSmmReadyToBootSmmPageProtection: SmmCommunication -
%r\n", Status)); diff --git
a/Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe
.c
b/Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe
.c
index 3cc5ccfef6f4..8416b36f56ae 100644
---
a/Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe
.c
+++
b/Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubD
+++ xe.c
@@ -122,7 +122,7 @@ GetTestPointDataSmm (
CommGetInfo->Header.ReturnStatus = (UINT64)-1;
CommGetInfo->DataSize = 0;

- CommSize = sizeof(EFI_GUID) + sizeof(UINTN) + CommHeader-
MessageLength;
+ CommSize = OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) +
+ (UINTN)CommHeader->MessageLength;
Status = SmmCommunication->Communicate(SmmCommunication,
CommBuffer, &CommSize);
if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_INFO, "SmiHandlerTestPoint: SmmCommunication -
%r\n", Status)); @@ -155,7 +155,7 @@ GetTestPointDataSmm (
CommGetData->Header.DataLength = sizeof(*CommGetData);
CommGetData->Header.ReturnStatus = (UINT64)-1;

- CommSize = sizeof(EFI_GUID) + sizeof(UINTN) + CommHeader-
MessageLength;
+ CommSize = OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data) +
+ (UINTN)CommHeader->MessageLength;
Buffer = (UINT8 *)CommHeader + CommSize;
Size -= CommSize;

@@ -233,7 +233,7 @@ PublishSmmTestPoint (
TestPoint = mSmmTestPointDatabase;
while ((UINTN)TestPoint < (UINTN)mSmmTestPointDatabase +
mSmmTestPointDatabaseSize) {
TestPointSize = GetTestPointInfoSize (TestPoint,
(UINTN)mSmmTestPointDatabase + mSmmTestPointDatabaseSize -
(UINTN)TestPoint);
-
+
TestPointLibSetTable (TestPoint, TestPointSize);

TestPoint = (ADAPTER_INFO_PLATFORM_TEST_POINT
*)((UINTN)TestPoint + TestPointSize); @@ -286,7 +286,7 @@
OnReadyToBoot (
EFI_EVENT ReadyToBootLaterEvent;

gBS->CloseEvent (Event);
-
+
Status = gBS->CreateEvent (
EVT_NOTIFY_SIGNAL,
TPL_CALLBACK,
@@ -295,7 +295,7 @@ OnReadyToBoot (
&ReadyToBootLaterEvent
);
ASSERT_EFI_ERROR (Status);
-
+
gBS->SignalEvent (ReadyToBootLaterEvent); }

diff --git
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP
ointCheckLib.inf
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP
ointCheckLib.inf
index 2ae1db4ee483..54b4015d6767 100644
---
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestP
ointCheckLib.inf
+++
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTe
+++ stPointCheckLib.inf
@@ -32,6 +32,7 @@ [LibraryClasses]
TestPointLib
PciSegmentLib
PciSegmentInfoLib
+ SafeIntLib

[Packages]
MinPlatformPkg/MinPlatformPkg.dec
--
2.28.0.windows.1


Re: [edk2-platforms][PATCH v1 2/5] MinPlatformPkg/TestPointCheckLib: Set required size field in protocol

Nate DeSimone
 

Hi Michael,

Comments are inline.

Thanks,
Nate

-----Original Message-----
From: mikuback@linux.microsoft.com <mikuback@linux.microsoft.com>
Sent: Thursday, August 5, 2021 7:57 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Liming Gao
<gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-platforms][PATCH v1 2/5]
MinPlatformPkg/TestPointCheckLib: Set required size field in protocol

From: Michael Kubacki <michael.kubacki@microsoft.com>

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

Per the protocol definition, the caller must allocate the input structure and
set the size field. TestPointCheckTcgTrustedBoot() does not do this which
can result in an EFI_BUFFER_TOO_SMALL error.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTc
gTrustedBoot.c | 1 +
1 file changed, 1 insertion(+)

diff --git
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
TcgTrustedBoot.c
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
TcgTrustedBoot.c
index 2a04f86fedac..7a8e3fed22f9 100644
---
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck
TcgTrustedBoot.c
+++
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh
+++ eckTcgTrustedBoot.c
@@ -41,6 +41,7 @@ TestPointCheckTcgTrustedBoot (
goto Done;
}

+ ProtocolCapability.Size = (UINT8) sizeof (ProtocolCapability);
I think we should also have a ZeroMem ((VOID *) &ProtocolCapability, sizeof (ProtocolCapability)) before setting the size.

Status = Tcg2->GetCapability (Tcg2, &ProtocolCapability);
if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_ERROR, "Tcg2->GetCapability - %r\n", Status));
--
2.28.0.windows.1


Re: [edk2-platforms][PATCH v1 3/5] MinPlatformPkg/TestPointCheckLib: Fix incorrect array index

Nate DeSimone
 

Hi Michael,

Comments are inline.

Thanks,
Nate

-----Original Message-----
From: mikuback@linux.microsoft.com <mikuback@linux.microsoft.com>
Sent: Thursday, August 5, 2021 7:57 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Liming Gao
<gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-platforms][PATCH v1 3/5]
MinPlatformPkg/TestPointCheckLib: Fix incorrect array index

From: Michael Kubacki <michael.kubacki@microsoft.com>

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

TestPointSmmEndOfDxeSmrrFunctional() uses the incorrect byte index to
skip the test. It should use byte 6 instead of byte 5.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPo
intCheckLib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTest
PointCheckLib.c
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTest
PointCheckLib.c
index 4b4f874c7bbc..3e8b2621cccd 100644
---
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTest
PointCheckLib.c
+++
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTe
+++ stPointCheckLib.c
@@ -109,7 +109,7 @@ TestPointSmmEndOfDxeSmrrFunctional (
EFI_STATUS Status;
BOOLEAN Result;

- if ((mFeatureImplemented[5] &
TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCTIONAL) == 0) {
+ if ((mFeatureImplemented[6] &
+ TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCTIONAL) == 0) {
I think we should have a #define that describes whatever "6" means in this context.

return EFI_SUCCESS;
}

@@ -125,7 +125,7 @@ TestPointSmmEndOfDxeSmrrFunctional (
TestPointLibSetFeaturesVerified (
PLATFORM_TEST_POINT_ROLE_PLATFORM_IBV,
NULL,
- 5,
+ 6,
TEST_POINT_BYTE6_SMM_END_OF_DXE_SMRR_FUNCTIONAL
);
}
--
2.28.0.windows.1


Re: [edk2-platforms][PATCH v1 0/5] MinPlatformPkg: TestPointCheckLib bug fixes and improvements

Nate DeSimone
 

Hi Michael,

Here is a summary of my feedback:

1. Patch 2/5: DxeCheckTcgTrustedBoot.c: line 44 - I think we should also have a ZeroMem ((VOID *) &ProtocolCapability, sizeof (ProtocolCapability)) before setting the size.
2. Patch 3/5: SmmTestPointCheckLib.c: line 112 - I think we should have a #define that describes whatever "6" means in this context.

Everything else looks good!

Thanks,
Nate

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael
Kubacki
Sent: Thursday, August 5, 2021 7:57 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
<nathaniel.l.desimone@intel.com>; Liming Gao
<gaoliming@byosoft.com.cn>; Dong, Eric <eric.dong@intel.com>
Subject: [edk2-devel] [edk2-platforms][PATCH v1 0/5] MinPlatformPkg:
TestPointCheckLib bug fixes and improvements

From: Michael Kubacki <mailto:michael.kubacki@microsoft.com>

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3531
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3518
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3520
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3521

This patch series groups together several bug fixes and improvements to
TestPointCheckLib. The first patch is required for the others since it fixes a
MinPlatformPkg build issue that occurs with the current edk2/master branch.

Cc: Chasel Chiu <mailto:chasel.chiu@intel.com>
Cc: Nate DeSimone <mailto:nathaniel.l.desimone@intel.com>
Cc: Liming Gao <mailto:gaoliming@byosoft.com.cn>
Cc: Eric Dong <mailto:eric.dong@intel.com>
Signed-off-by: Michael Kubacki <mailto:michael.kubacki@microsoft.com>

Michael Kubacki (5):
MinPlatformPkg/TestPointCheckLib: Fix MessageLength cast issue
MinPlatformPkg/TestPointCheckLib: Set required size field in protocol
MinPlatformPkg/TestPointCheckLib: Fix incorrect array index
MinPlatformPkg/TestPointCheckLib: Improve adjacent region checking
MinPlatformPkg/TestPointCheckLib: Make OutTable parameter optional


Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckA
cpi.c | 32 +++++------

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckS
miHandlerInstrument.c | 4 +-

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckS
mmInfo.c | 56 ++++++++++----------

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckTc
gTrustedBoot.c | 1 +

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPoi
ntCheckLib.c | 15 +++++-

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPo
intCheckLib.c | 4 +-
Platform/Intel/MinPlatformPkg/Test/TestPointStubDxe/TestPointStubDxe.c
| 10 ++--

Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeTestPoi
ntCheckLib.inf | 1 +
8 files changed, 70 insertions(+), 53 deletions(-)

--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78710): https://edk2.groups.io/g/devel/message/78710
Mute This Topic: https://groups.io/mt/84686301/1767664
Group Owner: mailto:devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub
[nathaniel.l.desimone@intel.com]
-=-=-=-=-=-=


Re: [Patch 0/3] Ext4Pkg: Add Ext4Pkg

Pedro Falcato
 

Hi Mike,

Thanks for the helpful pointers. I'll consider everything for V2,
which I'll submit as soon as possible (hopefully tomorrow).

RE: Code style. I'll re-run ECC and try to solve the issues. One thing
though: Is it possible to make an exception for the naming of
ext4-specific struct members?
Example: Members' names like "bg_block_bitmap_lo" in
EXT4_BLOCK_GROUP_DESC. I'd like to make a case for it; from my
experience with my own hobby project's ext2 driver, having names
similar to what's used in the documentation/other source code is
incredibly helpful when trying to work on the code; with the original
docs' names, which are admittedly not compliant with the EDK2 coding
style, it really makes everything much clearer when using other code
or documentation as reference. Of course, if it's not possible I'll
rename them all.

Thanks,

Pedro


On Thu, 5 Aug 2021 at 19:33, Kinney, Michael D
<michael.d.kinney@intel.com> wrote:

Hi Pedro,

1) Ext4Pkg/Ext4Dxe/Ext4Dxe.inf:

* To be consistent with other drivers, BASE_NAME should be changed from Ext4 to Ext4Dxe.
* For proper dependency checking in incremental builds, please add the .h files to the [Sources] section

Ext4Disk.h
Ext4Dxe.h

2) There are a number of code style issues that need to be addressed. Can you fix those for V2?

3) I did a quick pass to find the IA32 NOOPT VS2019 issues. With the following changes, I can get it to build. Do not know if I introduced any functional changes by mistake.

diff --git a/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c b/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
index 10a82d40a0..f2db93f02c 100644
--- a/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
+++ b/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
@@ -61,7 +61,7 @@ Ext4ReadInode (
Partition,
Inode,
Partition->InodeSize,
- Ext4BlockToByteOffset (Partition, InodeTableStart) + InodeOffset * Partition->InodeSize
+ Ext4BlockToByteOffset (Partition, InodeTableStart) + MultU64x32 (InodeOffset, Partition->InodeSize)
);

if (EFI_ERROR (Status)) {
diff --git a/Features/Ext4Pkg/Ext4Dxe/DiskUtil.c b/Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
index 1cafdd64cd..65109809c0 100644
--- a/Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
+++ b/Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
@@ -45,7 +45,7 @@ Ext4ReadBlocks (
IN EXT4_BLOCK_NR BlockNumber
)
{
- return Ext4ReadDiskIo (Partition, Buffer, NumberBlocks * Partition->BlockSize, BlockNumber * Partition->BlockSize);
+ return Ext4ReadDiskIo (Partition, Buffer, NumberBlocks * Partition->BlockSize, MultU64x32 (BlockNumber, Partition->BlockSize));
}

/**
diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h b/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
index d790e70be1..8aa584df14 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
+++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
@@ -445,6 +445,6 @@ typedef struct {
typedef UINT64 EXT4_BLOCK_NR;
typedef UINT32 EXT4_INO_NR;

-#define EXT4_INODE_SIZE(ino) (((UINT64)ino->i_size_hi << 32) | ino->i_size_lo)
+#define EXT4_INODE_SIZE(ino) (LShiftU64 (ino->i_size_hi, 32) | ino->i_size_lo)

#endif
diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
index f6875c919e..a055a139e1 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
+++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
@@ -244,7 +244,7 @@ Ext4MakeBlockNumberFromHalfs (
)
{
// High might have garbage if it's not a 64 bit filesystem
- return Ext4Is64Bit (Partition) ? Low | ((UINT64)High << 32) : Low;
+ return Ext4Is64Bit (Partition) ? (Low | LShiftU64 (High, 32)) : Low;
}

/**
@@ -297,7 +297,7 @@ Ext4BlockToByteOffset (
IN EXT4_BLOCK_NR Block
)
{
- return Partition->BlockSize * Block;
+ return MultU64x32 (Block, Partition->BlockSize);
}

/**
@@ -333,7 +333,7 @@ Ext4InodeSize (
CONST EXT4_INODE *Inode
)
{
- return ((UINT64)Inode->i_size_hi << 32) | Inode->i_size_lo;
+ return (LShiftU64 (Inode->i_size_hi, 32) | Inode->i_size_lo);
}

/**
diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
index 102b12d613..fc0185285e 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
+++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
@@ -111,6 +111,8 @@ [Sources]
Collation.c
Crc32c.c
Crc16.c
+ Ext4Disk.h
+ Ext4Dxe.h

[Packages]
MdePkg/MdePkg.dec
diff --git a/Features/Ext4Pkg/Ext4Dxe/Extents.c b/Features/Ext4Pkg/Ext4Dxe/Extents.c
index db4bf5aa3f..8c9b4a4c75 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Extents.c
+++ b/Features/Ext4Pkg/Ext4Dxe/Extents.c
@@ -210,7 +210,7 @@ Ext4ExtentIdxLeafBlock (
IN EXT4_EXTENT_INDEX *Index
)
{
- return ((UINT64)Index->ei_leaf_hi << 32) | Index->ei_leaf_lo;
+ return LShiftU64(Index->ei_leaf_hi, 32) | Index->ei_leaf_lo;
}

STATIC UINTN GetExtentRequests = 0;
diff --git a/Features/Ext4Pkg/Ext4Dxe/File.c b/Features/Ext4Pkg/Ext4Dxe/File.c
index 10dda64b16..71d36d1990 100644
--- a/Features/Ext4Pkg/Ext4Dxe/File.c
+++ b/Features/Ext4Pkg/Ext4Dxe/File.c
@@ -487,8 +487,8 @@ Ext4GetFilesystemInfo (
Info->BlockSize = Part->BlockSize;
Info->Size = NeededLength;
Info->ReadOnly = Part->ReadOnly;
- Info->VolumeSize = TotalBlocks * Part->BlockSize;
- Info->FreeSpace = FreeBlocks * Part->BlockSize;
+ Info->VolumeSize = MultU64x32 (TotalBlocks, Part->BlockSize);
+ Info->FreeSpace = MultU64x32 (FreeBlocks, Part->BlockSize);

if (VolumeName != NULL) {
StrCpyS (Info->VolumeLabel, VolNameLength + 1, VolumeName);
diff --git a/Features/Ext4Pkg/Ext4Dxe/Inode.c b/Features/Ext4Pkg/Ext4Dxe/Inode.c
index 304bf0c4a9..2a9f534d7e 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Inode.c
+++ b/Features/Ext4Pkg/Ext4Dxe/Inode.c
@@ -154,7 +154,7 @@ Ext4Read (
UINT64 ExtentOffset;
UINTN ExtentMayRead;

- ExtentStartBytes = (((UINT64)Extent.ee_start_hi << 32) | Extent.ee_start_lo) * Partition->BlockSize;
+ ExtentStartBytes = MultU64x32 (LShiftU64 (Extent.ee_start_hi, 32) | Extent.ee_start_lo, Partition->BlockSize);
ExtentLengthBytes = Extent.ee_len * Partition->BlockSize;
ExtentLogicalBytes = (UINT64)Extent.ee_block * Partition->BlockSize;
ExtentOffset = CurrentSeek - ExtentLogicalBytes;
@@ -276,17 +276,17 @@ Ext4FilePhysicalSpace (
Blocks = File->Inode->i_blocks;

if(HugeFile) {
- Blocks |= ((UINT64)File->Inode->i_osd2.data_linux.l_i_blocks_high) << 32;
+ Blocks |= LShiftU64 (File->Inode->i_osd2.data_linux.l_i_blocks_high, 32);

// If HUGE_FILE is enabled and EXT4_HUGE_FILE_FL is set in the inode's flags, each unit
// in i_blocks corresponds to an actual filesystem block
if(File->Inode->i_flags & EXT4_HUGE_FILE_FL) {
- return Blocks * File->Partition->BlockSize;
+ return MultU64x32 (Blocks, File->Partition->BlockSize);
}
}

// Else, each i_blocks unit corresponds to 512 bytes
- return Blocks * 512;
+ return MultU64x32 (Blocks, 512);
}

// Copied from EmbeddedPkg at my mentor's request.
@@ -368,7 +368,7 @@ EpochToEfiTime (
UINT32 Nanoseconds = 0; \
\
if (Ext4InodeHasField (Inode, Field ## _extra)) { \
- SecondsEpoch |= ((UINT64)(Inode->Field ## _extra & EXT4_EXTRA_TIMESTAMP_MASK)) << 32; \
+ SecondsEpoch |= LShiftU64 ((UINT64)(Inode->Field ## _extra & EXT4_EXTRA_TIMESTAMP_MASK), 32); \
Nanoseconds = Inode->Field ## _extra >> 2; \
} \
EpochToEfiTime ((UINTN)SecondsEpoch, Time); \
diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c b/Features/Ext4Pkg/Ext4Dxe/Superblock.c
index 18d8295a1f..88d01b62a8 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c
+++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c
@@ -161,7 +161,7 @@ Ext4OpenSuperblock (

DEBUG ((EFI_D_INFO, "Read only = %u\n", Partition->ReadOnly));

- Partition->BlockSize = 1024 << Sb->s_log_block_size;
+ Partition->BlockSize = (UINT32)LShiftU64 (1024, Sb->s_log_block_size);

// The size of a block group can also be calculated as 8 * Partition->BlockSize
if(Sb->s_blocks_per_group != 8 * Partition->BlockSize) {
@@ -195,7 +195,7 @@ Ext4OpenSuperblock (
}

NrBlocks = (UINTN)DivU64x32Remainder (
- Partition->NumberBlockGroups * Partition->DescSize,
+ MultU64x32 (Partition->NumberBlockGroups, Partition->DescSize),
Partition->BlockSize,
&NrBlocksRem
);
diff --git a/Features/Ext4Pkg/Ext4Pkg.dsc b/Features/Ext4Pkg/Ext4Pkg.dsc
index 62cb4e69cf..57f279a4d9 100644
--- a/Features/Ext4Pkg/Ext4Pkg.dsc
+++ b/Features/Ext4Pkg/Ext4Pkg.dsc
@@ -20,6 +20,8 @@ [Defines]
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT

+!include MdePkg/MdeLibs.dsc.inc
+
[BuildOptions]
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES




Thanks,

Mike




-----Original Message-----
From: Pedro Falcato <pedro.falcato@gmail.com>
Sent: Friday, July 30, 2021 9:17 AM
To: devel@edk2.groups.io
Cc: Pedro Falcato <pedro.falcato@gmail.com>; Leif Lindholm <leif@nuviainc.com>; Kinney, Michael D
<michael.d.kinney@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [Patch 0/3] Ext4Pkg: Add Ext4Pkg

This patch-set adds Ext4Pkg, a package designed to hold various drivers and
utilities related to the EXT4 filesystem.

Right now, it holds a single read-only UEFI EXT4 driver (Ext4Dxe), which consumes the
DISK_IO, BLOCK_IO and DISK_IO2 protocols and produce EFI_FILE_PROTOCOL and
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL; this driver allows the mounting of EXT4 partitions and
the reading of their contents.

Relevant RFC discussion, which includes a more in-depth walkthrough of EXT4 internals and
driver limitations is available at https://edk2.groups.io/g/devel/topic/84368561.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>

Pedro Falcato (3):
Ext4Pkg: Add Ext4Pkg.dec and Ext4Pkg.uni.
Ext4Pkg: Add Ext4Dxe driver.
Ext4Pkg: Add .DSC file.

Features/Ext4Pkg/Ext4Dxe/BlockGroup.c | 208 ++++++
Features/Ext4Pkg/Ext4Dxe/Collation.c | 157 +++++
Features/Ext4Pkg/Ext4Dxe/Crc16.c | 75 ++
Features/Ext4Pkg/Ext4Dxe/Crc32c.c | 84 +++
Features/Ext4Pkg/Ext4Dxe/Directory.c | 492 ++++++++++++++
Features/Ext4Pkg/Ext4Dxe/DiskUtil.c | 83 +++
Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h | 450 ++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c | 454 +++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h | 942 ++++++++++++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf | 147 ++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.uni | 15 +
Features/Ext4Pkg/Ext4Dxe/Extents.c | 616 +++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/File.c | 583 ++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/Inode.c | 468 +++++++++++++
Features/Ext4Pkg/Ext4Dxe/Partition.c | 120 ++++
Features/Ext4Pkg/Ext4Dxe/Superblock.c | 257 +++++++
Features/Ext4Pkg/Ext4Pkg.dec | 17 +
Features/Ext4Pkg/Ext4Pkg.dsc | 68 ++
Features/Ext4Pkg/Ext4Pkg.uni | 14 +
19 files changed, 5250 insertions(+)
create mode 100644 Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Collation.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Crc16.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Crc32c.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Directory.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.uni
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Extents.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/File.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Inode.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Partition.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Superblock.c
create mode 100644 Features/Ext4Pkg/Ext4Pkg.dec
create mode 100644 Features/Ext4Pkg/Ext4Pkg.dsc
create mode 100644 Features/Ext4Pkg/Ext4Pkg.uni

--
2.32.0

--
Pedro Falcato


Re: Is there any use case of FirmwarePerformanceStandaloneMm.inf now?

Kun Qin
 

Hi Dandan,

Thanks for letting me know. I added Bret and Sean to the thread for broader view in our scope.

But currently our StandaloneMm Core does not report performance data to FirmwarePerformanceStandaloneMm module.

Is the idea to centralize the performance report collection job to SmmCorePerformanceLib and remove the FirmwarePerformance**Mm driver? Is there any plan to support a Standalone instance once the traditional MM version is functional?

Thanks,
Kun

On 08/05/2021 04:44, Dandan Bi wrote:
Hi Kun,
I plan to make some change for FirmwarePerformanceSmm.inf, may also update the behavior of FirmwarePerformanceStandaloneMm.inf as they are sharing codes now.
And I saw you are the submitter of this driver. Could you help clarify following questions ? Thanks in advance.
1. Do you have the use case to leverage
FirmwarePerformanceStandaloneMm.inf to collect Standalone MM
performance data now?
2. Do you have any Library/module used by StandaloneMmCore to collect
Standalone MM performance data and report the data to
FirmwarePerformanceStandaloneMm like the SmmCorePerformanceLib used
for SMM core?
3. I plan to move some logic from FirmwarePerformanceDataTableSmm to
SmmCorePerformanceLib as below. Do you think is it ok just to remove
them from FirmwarePerformanceStandaloneMm.inf now?
If there is not any module to report Standalone MM performance data to FirmwarePerformanceStandaloneMm.inf, I think it should be OK to remove them from FirmwarePerformanceStandaloneMm now.
Change:
SMM performance data collection now:
1. SmmCorePerformanceLib collect all the performance data in SMM and
report the data to FirmwarePerformanceDataTableSmm through status
code. **
2. DxeCorePerformanceLib will communicate with
FirmwarePerformanceDataTableSmm to get the SMM performance data and
allocate performance table to store all the performance data.
Now I want to simplify the process to make DxeCorePerformanceLib communicate with SmmCorePerformanceLib directly to collect SMM performance data, so FirmwarePerformanceDataTableSmm don’t need to get the SMM performance data from SmmCorePerformanceLib and register SMI handler for the communication with DxeCorePerformanceLib.
For FirmwarePerformanceStandaloneMm.inf, just remove this logic if there is no module to prepare MM performance data to it now.
Thanks,
Dandan


Re: [PATCH] IntelFsp2Pkg: Fix multibyte array data issue

Nate DeSimone
 

Hi Tung Lun,

Is this patch still needed or was it superseded by https://edk2.groups.io/g/devel/message/75168 ?

Thanks,
Nate

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Tung Lun
Sent: Thursday, April 1, 2021 7:32 PM
To: devel@edk2.groups.io
Cc: Loo, Tung Lun <tung.lun.loo@intel.com>
Subject: [edk2-devel] [PATCH] IntelFsp2Pkg: Fix multibyte array data issue

Change-Id: Iad50d68a93ea1da13c2264fac7229f2d540531f0
Signed-off-by: Loo Tung Lun <tung.lun.loo@intel.com>
---
IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py | 1 -
1 file changed, 1 deletion(-)

diff --git a/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py b/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py
index cad9b60e73..5e94e86db5 100644
--- a/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py
+++ b/IntelFsp2Pkg/Tools/FspDscBsf2Yaml.py
@@ -291,7 +291,6 @@ class CFspDsc2Yaml():
raise Exception('DSC variable creation error !') else: raise Exception('Unsupported file "%s" !' % file_name)- gen_cfg_data.UpdateDefaultValue() self.gen_cfg_data = gen_cfg_data def print_dsc_line(self):--
2.28.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#73635): https://edk2.groups.io/g/devel/message/73635
Mute This Topic: https://groups.io/mt/81794616/1767664
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [nathaniel.l.desimone@intel.com] -=-=-=-=-=-=


[PATCH v2 3/3] OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm

Brijesh Singh
 

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

While build the initial page table, the SetCr3ForPageTables64 checks
whether SEV-ES is enabled. If so, clear the page encryption mask from the
GHCB page. Move the logic to clear the page encryption mask in the
AmdSev.asm.

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
OvmfPkg/ResetVector/Ia32/AmdSev.asm | 113 +++++++++++++++++-----
OvmfPkg/ResetVector/Ia32/PageTables64.asm | 53 ++--------
2 files changed, 94 insertions(+), 72 deletions(-)

diff --git a/OvmfPkg/ResetVector/Ia32/AmdSev.asm b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
index 87d81b01e263..fd2e6abcd4a0 100644
--- a/OvmfPkg/ResetVector/Ia32/AmdSev.asm
+++ b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
@@ -44,6 +44,27 @@ BITS 32
; The unexpected response code
%define TERM_UNEXPECTED_RESP_CODE 2

+%define PAGE_PRESENT 0x01
+%define PAGE_READ_WRITE 0x02
+%define PAGE_USER_SUPERVISOR 0x04
+%define PAGE_WRITE_THROUGH 0x08
+%define PAGE_CACHE_DISABLE 0x010
+%define PAGE_ACCESSED 0x020
+%define PAGE_DIRTY 0x040
+%define PAGE_PAT 0x080
+%define PAGE_GLOBAL 0x0100
+%define PAGE_2M_MBO 0x080
+%define PAGE_2M_PAT 0x01000
+
+%define PAGE_4K_PDE_ATTR (PAGE_ACCESSED + \
+ PAGE_DIRTY + \
+ PAGE_READ_WRITE + \
+ PAGE_PRESENT)
+
+%define PAGE_PDP_ATTR (PAGE_ACCESSED + \
+ PAGE_READ_WRITE + \
+ PAGE_PRESENT)
+

; Macro is used to issue the MSR protocol based VMGEXIT. The caller is
; responsible to populate values in the EDX:EAX registers. After the vmmcall
@@ -117,6 +138,72 @@ BITS 32
SevEsUnexpectedRespTerminate:
TerminateVmgExit TERM_UNEXPECTED_RESP_CODE

+; If SEV-ES is enabled then initialize the make the GHCB page shared
+SevClearPageEncMaskFromGHCBPage:
+ ; Check if SEV is enabled
+ cmp byte[WORK_AREA_GUEST_TYPE], 1
+ jnz SevClearPageEncMaskFromGHCBPageExit
+
+ ; Check if SEV-ES is enabled
+ cmp byte[SEV_ES_WORK_AREA], 1
+ jnz SevClearPageEncMaskFromGHCBPageExit
+
+ ;
+ ; The initial GHCB will live at GHCB_BASE and needs to be un-encrypted.
+ ; This requires the 2MB page for this range be broken down into 512 4KB
+ ; pages. All will be marked encrypted, except for the GHCB.
+ ;
+ mov ecx, (GHCB_BASE >> 21)
+ mov eax, GHCB_PT_ADDR + PAGE_PDP_ATTR
+ mov [ecx * 8 + PT_ADDR (0x2000)], eax
+
+ ;
+ ; Page Table Entries (512 * 4KB entries => 2MB)
+ ;
+ mov ecx, 512
+pageTableEntries4kLoop:
+ mov eax, ecx
+ dec eax
+ shl eax, 12
+ add eax, GHCB_BASE & 0xFFE0_0000
+ add eax, PAGE_4K_PDE_ATTR
+ mov [ecx * 8 + GHCB_PT_ADDR - 8], eax
+ mov [(ecx * 8 + GHCB_PT_ADDR - 8) + 4], edx
+ loop pageTableEntries4kLoop
+
+ ;
+ ; Clear the encryption bit from the GHCB entry
+ ;
+ mov ecx, (GHCB_BASE & 0x1F_FFFF) >> 12
+ mov [ecx * 8 + GHCB_PT_ADDR + 4], strict dword 0
+
+ mov ecx, GHCB_SIZE / 4
+ xor eax, eax
+clearGhcbMemoryLoop:
+ mov dword[ecx * 4 + GHCB_BASE - 4], eax
+ loop clearGhcbMemoryLoop
+
+SevClearPageEncMaskFromGHCBPageExit:
+ OneTimeCallRet SevClearPageEncMaskFromGHCBPage
+
+; Check if SEV is enabled, and get the C-bit mask above 31.
+; Modified: EDX
+;
+; The value is returned in the EDX
+GetSevCBitMaskAbove31:
+ ; Check if SEV is enabled
+ cmp byte[WORK_AREA_GUEST_TYPE], 1
+ jnz NoCbitValue
+
+ mov edx, dword[SEV_ES_WORK_AREA_ENC_MASK + 4]
+ jmp GetSevCBitMaskAbove31Exit
+
+NoCbitValue:
+ xor edx, edx
+
+GetSevCBitMaskAbove31Exit:
+ OneTimeCallRet GetSevCBitMaskAbove31
+
; Check if Secure Encrypted Virtualization (SEV) features are enabled.
;
; Register usage is tight in this routine, so multiple calls for the
@@ -249,32 +336,6 @@ SevExit:

OneTimeCallRet CheckSevFeatures

-; Check if Secure Encrypted Virtualization - Encrypted State (SEV-ES) feature
-; is enabled.
-;
-; Modified: EAX
-;
-; If SEV-ES is enabled then EAX will be non-zero.
-; If SEV-ES is disabled then EAX will be zero.
-;
-IsSevEsEnabled:
- xor eax, eax
-
- ; During CheckSevFeatures, the WORK_AREA_GUEST_TYPE is set
- ; to 1 if SEV is enabled.
- cmp byte[WORK_AREA_GUEST_TYPE], 1
- jne SevEsDisabled
-
- ; During CheckSevFeatures, the SEV_ES_WORK_AREA was set to 1 if
- ; SEV-ES is enabled.
- cmp byte[SEV_ES_WORK_AREA], 1
- jne SevEsDisabled
-
- mov eax, 1
-
-SevEsDisabled:
- OneTimeCallRet IsSevEsEnabled
-
; Start of #VC exception handling routines
;

diff --git a/OvmfPkg/ResetVector/Ia32/PageTables64.asm b/OvmfPkg/ResetVector/Ia32/PageTables64.asm
index f688909f1c7d..0e8ba4dde534 100644
--- a/OvmfPkg/ResetVector/Ia32/PageTables64.asm
+++ b/OvmfPkg/ResetVector/Ia32/PageTables64.asm
@@ -46,16 +46,13 @@ SetCr3ForPageTables64:
; work area when detected.
mov byte[WORK_AREA_GUEST_TYPE], 0

+ ; Check whether the SEV is active and populate the SevEsWorkArea
OneTimeCall CheckSevFeatures
- xor edx, edx
- test eax, eax
- jz SevNotActive

- ; If SEV is enabled, C-bit is always above 31
- sub eax, 32
- bts edx, eax
-
-SevNotActive:
+ ; If SEV is enabled, the C-bit position is always above 31.
+ ; The mask will be saved in the EDX and applied during the
+ ; the page table build below.
+ OneTimeCall GetSevCBitMaskAbove31

;
; For OVMF, build some initial page tables at
@@ -105,44 +102,8 @@ pageTableEntriesLoop:
mov [(ecx * 8 + PT_ADDR (0x2000 - 8)) + 4], edx
loop pageTableEntriesLoop

- OneTimeCall IsSevEsEnabled
- test eax, eax
- jz SetCr3
-
- ;
- ; The initial GHCB will live at GHCB_BASE and needs to be un-encrypted.
- ; This requires the 2MB page for this range be broken down into 512 4KB
- ; pages. All will be marked encrypted, except for the GHCB.
- ;
- mov ecx, (GHCB_BASE >> 21)
- mov eax, GHCB_PT_ADDR + PAGE_PDP_ATTR
- mov [ecx * 8 + PT_ADDR (0x2000)], eax
-
- ;
- ; Page Table Entries (512 * 4KB entries => 2MB)
- ;
- mov ecx, 512
-pageTableEntries4kLoop:
- mov eax, ecx
- dec eax
- shl eax, 12
- add eax, GHCB_BASE & 0xFFE0_0000
- add eax, PAGE_4K_PDE_ATTR
- mov [ecx * 8 + GHCB_PT_ADDR - 8], eax
- mov [(ecx * 8 + GHCB_PT_ADDR - 8) + 4], edx
- loop pageTableEntries4kLoop
-
- ;
- ; Clear the encryption bit from the GHCB entry
- ;
- mov ecx, (GHCB_BASE & 0x1F_FFFF) >> 12
- mov [ecx * 8 + GHCB_PT_ADDR + 4], strict dword 0
-
- mov ecx, GHCB_SIZE / 4
- xor eax, eax
-clearGhcbMemoryLoop:
- mov dword[ecx * 4 + GHCB_BASE - 4], eax
- loop clearGhcbMemoryLoop
+ ; Clear the C-bit from the GHCB page if the SEV-ES is enabled.
+ OneTimeCall SevClearPageEncMaskFromGHCBPage

SetCr3:
;
--
2.17.1


[PATCH v2 2/3] OvmfPkg/ResetVector: update SEV support to use new work area format

Brijesh Singh
 

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

Update the SEV support to switch to using the newer work area format.

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
OvmfPkg/ResetVector/ResetVector.inf | 1 +
OvmfPkg/Sec/SecMain.inf | 2 ++
OvmfPkg/Sec/SecMain.c | 32 ++++++++++++++++++++++-
OvmfPkg/ResetVector/Ia32/AmdSev.asm | 8 ++++++
OvmfPkg/ResetVector/Ia32/PageTables64.asm | 4 +++
OvmfPkg/ResetVector/ResetVector.nasmb | 1 +
6 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/ResetVector/ResetVector.inf b/OvmfPkg/ResetVector/ResetVector.inf
index d028c92d8cfa..6ec9cca40c3a 100644
--- a/OvmfPkg/ResetVector/ResetVector.inf
+++ b/OvmfPkg/ResetVector/ResetVector.inf
@@ -34,6 +34,7 @@ [BuildOptions]
*_*_X64_NASMB_FLAGS = -I$(WORKSPACE)/UefiCpuPkg/ResetVector/Vtf0/

[Pcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbSize
diff --git a/OvmfPkg/Sec/SecMain.inf b/OvmfPkg/Sec/SecMain.inf
index 7f78dcee2772..b650345770f2 100644
--- a/OvmfPkg/Sec/SecMain.inf
+++ b/OvmfPkg/Sec/SecMain.inf
@@ -56,6 +56,7 @@ [Ppis]
gEfiTemporaryRamSupportPpiGuid # PPI ALWAYS_PRODUCED

[Pcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
@@ -70,6 +71,7 @@ [Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdGuidedExtractHandlerTableSize
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDecompressionScratchEnd
gEfiMdeModulePkgTokenSpaceGuid.PcdInitValueInTempStack
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader

[FeaturePcd]
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire
diff --git a/OvmfPkg/Sec/SecMain.c b/OvmfPkg/Sec/SecMain.c
index 9db67e17b2aa..27a1a4af0e4a 100644
--- a/OvmfPkg/Sec/SecMain.c
+++ b/OvmfPkg/Sec/SecMain.c
@@ -807,6 +807,36 @@ SevEsProtocolCheck (
Ghcb->GhcbUsage = GHCB_STANDARD_USAGE;
}

+/**
+ Determine if the SEV is active.
+
+ During the early booting, GuestType is set in the work area. Verify that it
+ is an SEV guest.
+
+ @retval TRUE SEV is enabled
+ @retval FALSE SEV is not enabled
+
+**/
+STATIC
+BOOLEAN
+IsSevGuest (
+ VOID
+ )
+{
+ OVMF_WORK_AREA *WorkArea;
+
+ //
+ // Ensure that the size of the Confidential Computing work area header
+ // is same as what is provided through a fixed PCD.
+ //
+ ASSERT ((UINTN) FixedPcdGet32 (PcdOvmfConfidentialComputingWorkAreaHeader) ==
+ sizeof(CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER));
+
+ WorkArea = (OVMF_WORK_AREA *) FixedPcdGet32 (PcdOvmfWorkAreaBase);
+
+ return ((WorkArea != NULL) && (WorkArea->Header.GuestType == GUEST_TYPE_AMD_SEV));
+}
+
/**
Determine if SEV-ES is active.

@@ -828,7 +858,7 @@ SevEsIsEnabled (

SevEsWorkArea = (SEC_SEV_ES_WORK_AREA *) FixedPcdGet32 (PcdSevEsWorkAreaBase);

- return ((SevEsWorkArea != NULL) && (SevEsWorkArea->SevEsEnabled != 0));
+ return (((IsSevGuest()) && SevEsWorkArea != NULL) && (SevEsWorkArea->SevEsEnabled != 0));
}

VOID
diff --git a/OvmfPkg/ResetVector/Ia32/AmdSev.asm b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
index aa95d06eaddb..87d81b01e263 100644
--- a/OvmfPkg/ResetVector/Ia32/AmdSev.asm
+++ b/OvmfPkg/ResetVector/Ia32/AmdSev.asm
@@ -171,6 +171,9 @@ CheckSevFeatures:
bt eax, 0
jnc NoSev

+ ; Set the work area header to indicate that the SEV is enabled
+ mov byte[WORK_AREA_GUEST_TYPE], 1
+
; Check for SEV-ES memory encryption feature:
; CPUID Fn8000_001F[EAX] - Bit 3
; CPUID raises a #VC exception if running as an SEV-ES guest
@@ -257,6 +260,11 @@ SevExit:
IsSevEsEnabled:
xor eax, eax

+ ; During CheckSevFeatures, the WORK_AREA_GUEST_TYPE is set
+ ; to 1 if SEV is enabled.
+ cmp byte[WORK_AREA_GUEST_TYPE], 1
+ jne SevEsDisabled
+
; During CheckSevFeatures, the SEV_ES_WORK_AREA was set to 1 if
; SEV-ES is enabled.
cmp byte[SEV_ES_WORK_AREA], 1
diff --git a/OvmfPkg/ResetVector/Ia32/PageTables64.asm b/OvmfPkg/ResetVector/Ia32/PageTables64.asm
index eacdb69ddb9f..f688909f1c7d 100644
--- a/OvmfPkg/ResetVector/Ia32/PageTables64.asm
+++ b/OvmfPkg/ResetVector/Ia32/PageTables64.asm
@@ -42,6 +42,10 @@ BITS 32
;
SetCr3ForPageTables64:

+ ; Clear the WorkArea header. The SEV probe routines will populate the
+ ; work area when detected.
+ mov byte[WORK_AREA_GUEST_TYPE], 0
+
OneTimeCall CheckSevFeatures
xor edx, edx
test eax, eax
diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb
index acec46a32450..d1d800c56745 100644
--- a/OvmfPkg/ResetVector/ResetVector.nasmb
+++ b/OvmfPkg/ResetVector/ResetVector.nasmb
@@ -72,6 +72,7 @@
%define GHCB_PT_ADDR (FixedPcdGet32 (PcdOvmfSecGhcbPageTableBase))
%define GHCB_BASE (FixedPcdGet32 (PcdOvmfSecGhcbBase))
%define GHCB_SIZE (FixedPcdGet32 (PcdOvmfSecGhcbSize))
+ %define WORK_AREA_GUEST_TYPE (FixedPcdGet32 (PcdOvmfWorkAreaBase))
%define SEV_ES_WORK_AREA (FixedPcdGet32 (PcdSevEsWorkAreaBase))
%define SEV_ES_WORK_AREA_RDRAND (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 8)
%define SEV_ES_WORK_AREA_ENC_MASK (FixedPcdGet32 (PcdSevEsWorkAreaBase) + 16)
--
2.17.1


[PATCH v2 1/3] OvmfPkg: introduce a common work area

Brijesh Singh
 

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

Both the TDX and SEV support needs to reserve a page in MEMFD as a work
area. The page will contain meta data specific to the guest type.
Currently, the SEV-ES support reserves a page in MEMFD
(PcdSevEsWorkArea) for the work area. This page can be reused as a TDX
work area when Intel TDX is enabled.

Based on the discussion [1], it was agreed to rename the SevEsWorkArea
to the OvmfWorkArea, and add a header that can be used to indicate the
work area type.

[1] https://edk2.groups.io/g/devel/message/78262?p=,,,20,0,0,0::\
created,0,SNP,20,2,0,84476064

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
OvmfPkg/OvmfPkg.dec | 12 ++++
OvmfPkg/OvmfPkgX64.fdf | 9 ++-
OvmfPkg/PlatformPei/PlatformPei.inf | 4 +-
OvmfPkg/Include/Library/MemEncryptSevLib.h | 21 +------
OvmfPkg/Include/WorkArea.h | 67 ++++++++++++++++++++++
OvmfPkg/PlatformPei/MemDetect.c | 32 +++++------
OvmfPkg/OvmfPkgDefines.fdf.inc | 6 ++
7 files changed, 111 insertions(+), 40 deletions(-)
create mode 100644 OvmfPkg/Include/WorkArea.h

diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec
index 2ab27f0c73c2..550a58ebcd81 100644
--- a/OvmfPkg/OvmfPkg.dec
+++ b/OvmfPkg/OvmfPkg.dec
@@ -330,6 +330,18 @@ [PcdsFixedAtBuild]
gUefiOvmfPkgTokenSpaceGuid.PcdQemuHashTableBase|0x0|UINT32|0x47
gUefiOvmfPkgTokenSpaceGuid.PcdQemuHashTableSize|0x0|UINT32|0x48

+ ## The base address and size of the work area used during the SEC
+ # phase by the SEV and TDX supports.
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase|0|UINT32|0x49
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize|0|UINT32|0x50
+
+ ## The work area contains a fixed size header in the Include/WorkArea.h.
+ # The size of this header is used early boot, and is provided through
+ # a fixed PCD. It need to be kept in sync with any changes to the
+ # header definition.
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader|0|UINT32|0x51
+
+
[PcdsDynamic, PcdsDynamicEx]
gUefiOvmfPkgTokenSpaceGuid.PcdEmuVariableEvent|0|UINT64|2
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashVariablesEnable|FALSE|BOOLEAN|0x10
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 5fa8c0895808..23936242e74a 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -83,7 +83,7 @@ [FD.MEMFD]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbSize

0x00B000|0x001000
-gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase|gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize
+gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize

0x00C000|0x001000
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupSize
@@ -99,6 +99,13 @@ [FD.MEMFD]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
FV = DXEFV

+##########################################################################################
+# Set the SEV-ES specific work area PCDs
+#
+SET gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase = $(MEMFD_BASE_ADDRESS) + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader
+SET gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize - gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader
+##########################################################################################
+
################################################################################

[FV.SECFV]
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
index 89d1f7636870..67eb7aa7166b 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -116,8 +116,8 @@ [FixedPcd]
gEmbeddedTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecGhcbBackupSize
- gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase
- gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaSize
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
+ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaSize

[FeaturePcd]
gUefiOvmfPkgTokenSpaceGuid.PcdCsmEnable
diff --git a/OvmfPkg/Include/Library/MemEncryptSevLib.h b/OvmfPkg/Include/Library/MemEncryptSevLib.h
index 76d06c206c8b..adc490e466ec 100644
--- a/OvmfPkg/Include/Library/MemEncryptSevLib.h
+++ b/OvmfPkg/Include/Library/MemEncryptSevLib.h
@@ -12,6 +12,7 @@
#define _MEM_ENCRYPT_SEV_LIB_H_

#include <Base.h>
+#include <WorkArea.h>

//
// Define the maximum number of #VCs allowed (e.g. the level of nesting
@@ -36,26 +37,6 @@ typedef struct {
VOID *GhcbBackupPages;
} SEV_ES_PER_CPU_DATA;

-//
-// Internal structure for holding SEV-ES information needed during SEC phase
-// and valid only during SEC phase and early PEI during platform
-// initialization.
-//
-// This structure is also used by assembler files:
-// OvmfPkg/ResetVector/ResetVector.nasmb
-// OvmfPkg/ResetVector/Ia32/PageTables64.asm
-// OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
-// any changes must stay in sync with its usage.
-//
-typedef struct _SEC_SEV_ES_WORK_AREA {
- UINT8 SevEsEnabled;
- UINT8 Reserved1[7];
-
- UINT64 RandomData;
-
- UINT64 EncryptionMask;
-} SEC_SEV_ES_WORK_AREA;
-
//
// Memory encryption address range states.
//
diff --git a/OvmfPkg/Include/WorkArea.h b/OvmfPkg/Include/WorkArea.h
new file mode 100644
index 000000000000..c16030e3ac0a
--- /dev/null
+++ b/OvmfPkg/Include/WorkArea.h
@@ -0,0 +1,67 @@
+/** @file
+
+ Work Area structure definition
+
+ Copyright (c) 2021, AMD Inc.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef __OVMF_WORK_AREA_H__
+#define __OVMF_WORK_AREA_H__
+
+//
+// Guest type for the work area
+//
+typedef enum {
+ GUEST_TYPE_NON_ENCRYPTED,
+ GUEST_TYPE_AMD_SEV,
+ GUEST_TYPE_INTEL_TDX,
+
+} GUEST_TYPE;
+
+//
+// Confidential computing work area header definition. Any change
+// to the structure need to be kept in sync with the
+// PcdOvmfConfidentialComputingWorkAreaHeader.
+//
+typedef struct _CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER {
+ UINT8 GuestType;
+ UINT8 Reserved1[3];
+} CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER;
+
+//
+// Internal structure for holding SEV-ES information needed during SEC phase
+// and valid only during SEC phase and early PEI during platform
+// initialization.
+//
+// This structure is also used by assembler files:
+// OvmfPkg/ResetVector/ResetVector.nasmb
+// OvmfPkg/ResetVector/Ia32/PageTables64.asm
+// OvmfPkg/ResetVector/Ia32/Flat32ToFlat64.asm
+// any changes must stay in sync with its usage.
+//
+typedef struct _SEC_SEV_ES_WORK_AREA {
+ UINT8 SevEsEnabled;
+ UINT8 Reserved1[7];
+
+ UINT64 RandomData;
+
+ UINT64 EncryptionMask;
+} SEC_SEV_ES_WORK_AREA;
+
+//
+// The SEV work area definition.
+//
+typedef struct _SEV_WORK_AREA {
+ CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;
+
+ SEC_SEV_ES_WORK_AREA SevEsWorkArea;
+} SEV_WORK_AREA;
+
+typedef union {
+ CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER Header;
+ SEV_WORK_AREA SevWorkArea;
+} OVMF_WORK_AREA;
+
+#endif
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c
index 2deec128f464..4c53b0fdf2fe 100644
--- a/OvmfPkg/PlatformPei/MemDetect.c
+++ b/OvmfPkg/PlatformPei/MemDetect.c
@@ -939,23 +939,21 @@ InitializeRamRegions (
}

#ifdef MDE_CPU_X64
- if (MemEncryptSevEsIsEnabled ()) {
- //
- // If SEV-ES is enabled, reserve the SEV-ES work area.
- //
- // Since this memory range will be used by the Reset Vector on S3
- // resume, it must be reserved as ACPI NVS.
- //
- // If S3 is unsupported, then various drivers might still write to the
- // work area. We ought to prevent DXE from serving allocation requests
- // such that they would overlap the work area.
- //
- BuildMemoryAllocationHob (
- (EFI_PHYSICAL_ADDRESS)(UINTN) FixedPcdGet32 (PcdSevEsWorkAreaBase),
- (UINT64)(UINTN) FixedPcdGet32 (PcdSevEsWorkAreaSize),
- mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData
- );
- }
+ //
+ // Reserve the work area.
+ //
+ // Since this memory range will be used by the Reset Vector on S3
+ // resume, it must be reserved as ACPI NVS.
+ //
+ // If S3 is unsupported, then various drivers might still write to the
+ // work area. We ought to prevent DXE from serving allocation requests
+ // such that they would overlap the work area.
+ //
+ BuildMemoryAllocationHob (
+ (EFI_PHYSICAL_ADDRESS)(UINTN) FixedPcdGet32 (PcdOvmfWorkAreaBase),
+ (UINT64)(UINTN) FixedPcdGet32 (PcdOvmfWorkAreaSize),
+ mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData
+ );
#endif
}
}
diff --git a/OvmfPkg/OvmfPkgDefines.fdf.inc b/OvmfPkg/OvmfPkgDefines.fdf.inc
index 35fd454b97ab..3b5e45253916 100644
--- a/OvmfPkg/OvmfPkgDefines.fdf.inc
+++ b/OvmfPkg/OvmfPkgDefines.fdf.inc
@@ -82,6 +82,12 @@
SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwSpareBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize = $(VARS_SPARE_SIZE)

+# The OVMF WorkArea contains a fixed size header followed by the actual data.
+# The size of header is accessed through a fixed PCD in the reset vector code.
+# The value need to be kept in sync with the any changes to the Confidential
+# Computing Work Area header defined in the Include/WorkArea.h
+SET gUefiOvmfPkgTokenSpaceGuid.PcdOvmfConfidentialComputingWorkAreaHeader = 4
+
!if $(SMM_REQUIRE) == TRUE
SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageVariableBase
SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase = gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFlashNvStorageFtwWorkingBase
--
2.17.1


[PATCH v2 0/3] reuse the SevEsWork area

Brijesh Singh
 

Based on the discussion on the mailing list, we agreed that instead
of wasting extra page in the MEMFD, we can reuse the SevEsWorkArea
buffer for the TDX. To avoid any confusion, lets introduce a OvmfWorkArea
that will contains 32 bytes of header followed by the actual workarea.

While at it, move the code to clear the GHCB page from PageTable build
to AmdSev.asm.

I have used the existing TDX BZ for it because the request came
during the TDX patch review. if anyone have concern please let me know
and I will happily create a new BZ.

Full tree is at: https://github.com/AMDESE/ovmf/tree/sev-new-work-area

Brijesh Singh (3):
OvmfPkg: introduce a common work area
OvmfPkg/ResetVector: update SEV support to use new work area format
OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm

Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>

Changes since v1:
- address Jiewen's feedback.

Brijesh Singh (3):
OvmfPkg: introduce a common work area
OvmfPkg/ResetVector: update SEV support to use new work area format
OvmfPkg/ResetVector: move the GHCB page setup in AmdSev.asm

OvmfPkg/OvmfPkg.dec | 12 +++
OvmfPkg/OvmfPkgX64.fdf | 9 +-
OvmfPkg/PlatformPei/PlatformPei.inf | 4 +-
OvmfPkg/ResetVector/ResetVector.inf | 1 +
OvmfPkg/Sec/SecMain.inf | 2 +
OvmfPkg/Include/Library/MemEncryptSevLib.h | 21 +---
OvmfPkg/Include/WorkArea.h | 67 +++++++++++++
OvmfPkg/PlatformPei/MemDetect.c | 32 +++---
OvmfPkg/Sec/SecMain.c | 32 +++++-
OvmfPkg/OvmfPkgDefines.fdf.inc | 6 ++
OvmfPkg/ResetVector/Ia32/AmdSev.asm | 111 +++++++++++++++++----
OvmfPkg/ResetVector/Ia32/PageTables64.asm | 57 ++---------
OvmfPkg/ResetVector/ResetVector.nasmb | 1 +
13 files changed, 247 insertions(+), 108 deletions(-)
create mode 100644 OvmfPkg/Include/WorkArea.h

--
2.17.1


Re: [edk2-platforms] [PATCH] IpmiFeaturePkg: Fix standalone package build

Nate DeSimone
 

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nate DeSimone
Sent: Thursday, August 5, 2021 11:28 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; KARPAGAVINAYAGAM, MANICKAVASAKAM <manickavasakamk@ami.com>
Subject: [edk2-devel] [edk2-platforms] [PATCH] IpmiFeaturePkg: Fix standalone package build

Building the IpmiFeaturePkg standalone
(not as part of a platform build) currently fails because the IpmiPlatformHookLib was added but the reference to the NULL implementation of that LibraryClass was miseed.

Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Manickavasakam Karpagavinayagam <manickavasakamk@ami.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
.../OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 1 +
1 file changed, 1 insertion(+)

diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
index 05a7d4f0af..a6eccb428b 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeat
+++ ure.dsc
@@ -48,6 +48,7 @@
# IPMI Feature Package
#####################################
IpmiCommandLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf
+
+ IpmiPlatformHookLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPla
+ tformHookLibNull/IpmiPlatformHookLibNull.inf

[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
#######################################
--
2.27.0.windows.1


Re: [edk2-platforms] [PATCH] IpmiFeaturePkg: Fix standalone package build

Michael D Kinney
 

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

Mike

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nate DeSimone
Sent: Thursday, August 5, 2021 11:28 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; KARPAGAVINAYAGAM, MANICKAVASAKAM
<manickavasakamk@ami.com>
Subject: [edk2-devel] [edk2-platforms] [PATCH] IpmiFeaturePkg: Fix standalone package build

Building the IpmiFeaturePkg standalone
(not as part of a platform build) currently
fails because the IpmiPlatformHookLib was added
but the reference to the NULL implementation of
that LibraryClass was miseed.

Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Manickavasakam Karpagavinayagam <manickavasakamk@ami.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
.../OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 1 +
1 file changed, 1 insertion(+)

diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
index 05a7d4f0af..a6eccb428b 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
@@ -48,6 +48,7 @@
# IPMI Feature Package
#####################################
IpmiCommandLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf
+ IpmiPlatformHookLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf

[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
#######################################
--
2.27.0.windows.1





Re: [Patch 0/3] Ext4Pkg: Add Ext4Pkg

Michael D Kinney
 

Hi Pedro,

1) Ext4Pkg/Ext4Dxe/Ext4Dxe.inf:

* To be consistent with other drivers, BASE_NAME should be changed from Ext4 to Ext4Dxe.
* For proper dependency checking in incremental builds, please add the .h files to the [Sources] section

Ext4Disk.h
Ext4Dxe.h

2) There are a number of code style issues that need to be addressed. Can you fix those for V2?

3) I did a quick pass to find the IA32 NOOPT VS2019 issues. With the following changes, I can get it to build. Do not know if I introduced any functional changes by mistake.

diff --git a/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c b/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
index 10a82d40a0..f2db93f02c 100644
--- a/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
+++ b/Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
@@ -61,7 +61,7 @@ Ext4ReadInode (
Partition,
Inode,
Partition->InodeSize,
- Ext4BlockToByteOffset (Partition, InodeTableStart) + InodeOffset * Partition->InodeSize
+ Ext4BlockToByteOffset (Partition, InodeTableStart) + MultU64x32 (InodeOffset, Partition->InodeSize)
);

if (EFI_ERROR (Status)) {
diff --git a/Features/Ext4Pkg/Ext4Dxe/DiskUtil.c b/Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
index 1cafdd64cd..65109809c0 100644
--- a/Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
+++ b/Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
@@ -45,7 +45,7 @@ Ext4ReadBlocks (
IN EXT4_BLOCK_NR BlockNumber
)
{
- return Ext4ReadDiskIo (Partition, Buffer, NumberBlocks * Partition->BlockSize, BlockNumber * Partition->BlockSize);
+ return Ext4ReadDiskIo (Partition, Buffer, NumberBlocks * Partition->BlockSize, MultU64x32 (BlockNumber, Partition->BlockSize));
}

/**
diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h b/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
index d790e70be1..8aa584df14 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
+++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
@@ -445,6 +445,6 @@ typedef struct {
typedef UINT64 EXT4_BLOCK_NR;
typedef UINT32 EXT4_INO_NR;

-#define EXT4_INODE_SIZE(ino) (((UINT64)ino->i_size_hi << 32) | ino->i_size_lo)
+#define EXT4_INODE_SIZE(ino) (LShiftU64 (ino->i_size_hi, 32) | ino->i_size_lo)

#endif
diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
index f6875c919e..a055a139e1 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
+++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
@@ -244,7 +244,7 @@ Ext4MakeBlockNumberFromHalfs (
)
{
// High might have garbage if it's not a 64 bit filesystem
- return Ext4Is64Bit (Partition) ? Low | ((UINT64)High << 32) : Low;
+ return Ext4Is64Bit (Partition) ? (Low | LShiftU64 (High, 32)) : Low;
}

/**
@@ -297,7 +297,7 @@ Ext4BlockToByteOffset (
IN EXT4_BLOCK_NR Block
)
{
- return Partition->BlockSize * Block;
+ return MultU64x32 (Block, Partition->BlockSize);
}

/**
@@ -333,7 +333,7 @@ Ext4InodeSize (
CONST EXT4_INODE *Inode
)
{
- return ((UINT64)Inode->i_size_hi << 32) | Inode->i_size_lo;
+ return (LShiftU64 (Inode->i_size_hi, 32) | Inode->i_size_lo);
}

/**
diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
index 102b12d613..fc0185285e 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
+++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
@@ -111,6 +111,8 @@ [Sources]
Collation.c
Crc32c.c
Crc16.c
+ Ext4Disk.h
+ Ext4Dxe.h

[Packages]
MdePkg/MdePkg.dec
diff --git a/Features/Ext4Pkg/Ext4Dxe/Extents.c b/Features/Ext4Pkg/Ext4Dxe/Extents.c
index db4bf5aa3f..8c9b4a4c75 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Extents.c
+++ b/Features/Ext4Pkg/Ext4Dxe/Extents.c
@@ -210,7 +210,7 @@ Ext4ExtentIdxLeafBlock (
IN EXT4_EXTENT_INDEX *Index
)
{
- return ((UINT64)Index->ei_leaf_hi << 32) | Index->ei_leaf_lo;
+ return LShiftU64(Index->ei_leaf_hi, 32) | Index->ei_leaf_lo;
}

STATIC UINTN GetExtentRequests = 0;
diff --git a/Features/Ext4Pkg/Ext4Dxe/File.c b/Features/Ext4Pkg/Ext4Dxe/File.c
index 10dda64b16..71d36d1990 100644
--- a/Features/Ext4Pkg/Ext4Dxe/File.c
+++ b/Features/Ext4Pkg/Ext4Dxe/File.c
@@ -487,8 +487,8 @@ Ext4GetFilesystemInfo (
Info->BlockSize = Part->BlockSize;
Info->Size = NeededLength;
Info->ReadOnly = Part->ReadOnly;
- Info->VolumeSize = TotalBlocks * Part->BlockSize;
- Info->FreeSpace = FreeBlocks * Part->BlockSize;
+ Info->VolumeSize = MultU64x32 (TotalBlocks, Part->BlockSize);
+ Info->FreeSpace = MultU64x32 (FreeBlocks, Part->BlockSize);

if (VolumeName != NULL) {
StrCpyS (Info->VolumeLabel, VolNameLength + 1, VolumeName);
diff --git a/Features/Ext4Pkg/Ext4Dxe/Inode.c b/Features/Ext4Pkg/Ext4Dxe/Inode.c
index 304bf0c4a9..2a9f534d7e 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Inode.c
+++ b/Features/Ext4Pkg/Ext4Dxe/Inode.c
@@ -154,7 +154,7 @@ Ext4Read (
UINT64 ExtentOffset;
UINTN ExtentMayRead;

- ExtentStartBytes = (((UINT64)Extent.ee_start_hi << 32) | Extent.ee_start_lo) * Partition->BlockSize;
+ ExtentStartBytes = MultU64x32 (LShiftU64 (Extent.ee_start_hi, 32) | Extent.ee_start_lo, Partition->BlockSize);
ExtentLengthBytes = Extent.ee_len * Partition->BlockSize;
ExtentLogicalBytes = (UINT64)Extent.ee_block * Partition->BlockSize;
ExtentOffset = CurrentSeek - ExtentLogicalBytes;
@@ -276,17 +276,17 @@ Ext4FilePhysicalSpace (
Blocks = File->Inode->i_blocks;

if(HugeFile) {
- Blocks |= ((UINT64)File->Inode->i_osd2.data_linux.l_i_blocks_high) << 32;
+ Blocks |= LShiftU64 (File->Inode->i_osd2.data_linux.l_i_blocks_high, 32);

// If HUGE_FILE is enabled and EXT4_HUGE_FILE_FL is set in the inode's flags, each unit
// in i_blocks corresponds to an actual filesystem block
if(File->Inode->i_flags & EXT4_HUGE_FILE_FL) {
- return Blocks * File->Partition->BlockSize;
+ return MultU64x32 (Blocks, File->Partition->BlockSize);
}
}

// Else, each i_blocks unit corresponds to 512 bytes
- return Blocks * 512;
+ return MultU64x32 (Blocks, 512);
}

// Copied from EmbeddedPkg at my mentor's request.
@@ -368,7 +368,7 @@ EpochToEfiTime (
UINT32 Nanoseconds = 0; \
\
if (Ext4InodeHasField (Inode, Field ## _extra)) { \
- SecondsEpoch |= ((UINT64)(Inode->Field ## _extra & EXT4_EXTRA_TIMESTAMP_MASK)) << 32; \
+ SecondsEpoch |= LShiftU64 ((UINT64)(Inode->Field ## _extra & EXT4_EXTRA_TIMESTAMP_MASK), 32); \
Nanoseconds = Inode->Field ## _extra >> 2; \
} \
EpochToEfiTime ((UINTN)SecondsEpoch, Time); \
diff --git a/Features/Ext4Pkg/Ext4Dxe/Superblock.c b/Features/Ext4Pkg/Ext4Dxe/Superblock.c
index 18d8295a1f..88d01b62a8 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Superblock.c
+++ b/Features/Ext4Pkg/Ext4Dxe/Superblock.c
@@ -161,7 +161,7 @@ Ext4OpenSuperblock (

DEBUG ((EFI_D_INFO, "Read only = %u\n", Partition->ReadOnly));

- Partition->BlockSize = 1024 << Sb->s_log_block_size;
+ Partition->BlockSize = (UINT32)LShiftU64 (1024, Sb->s_log_block_size);

// The size of a block group can also be calculated as 8 * Partition->BlockSize
if(Sb->s_blocks_per_group != 8 * Partition->BlockSize) {
@@ -195,7 +195,7 @@ Ext4OpenSuperblock (
}

NrBlocks = (UINTN)DivU64x32Remainder (
- Partition->NumberBlockGroups * Partition->DescSize,
+ MultU64x32 (Partition->NumberBlockGroups, Partition->DescSize),
Partition->BlockSize,
&NrBlocksRem
);
diff --git a/Features/Ext4Pkg/Ext4Pkg.dsc b/Features/Ext4Pkg/Ext4Pkg.dsc
index 62cb4e69cf..57f279a4d9 100644
--- a/Features/Ext4Pkg/Ext4Pkg.dsc
+++ b/Features/Ext4Pkg/Ext4Pkg.dsc
@@ -20,6 +20,8 @@ [Defines]
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT

+!include MdePkg/MdeLibs.dsc.inc
+
[BuildOptions]
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES




Thanks,

Mike

-----Original Message-----
From: Pedro Falcato <pedro.falcato@gmail.com>
Sent: Friday, July 30, 2021 9:17 AM
To: devel@edk2.groups.io
Cc: Pedro Falcato <pedro.falcato@gmail.com>; Leif Lindholm <leif@nuviainc.com>; Kinney, Michael D
<michael.d.kinney@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>
Subject: [Patch 0/3] Ext4Pkg: Add Ext4Pkg

This patch-set adds Ext4Pkg, a package designed to hold various drivers and
utilities related to the EXT4 filesystem.

Right now, it holds a single read-only UEFI EXT4 driver (Ext4Dxe), which consumes the
DISK_IO, BLOCK_IO and DISK_IO2 protocols and produce EFI_FILE_PROTOCOL and
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL; this driver allows the mounting of EXT4 partitions and
the reading of their contents.

Relevant RFC discussion, which includes a more in-depth walkthrough of EXT4 internals and
driver limitations is available at https://edk2.groups.io/g/devel/topic/84368561.

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>

Pedro Falcato (3):
Ext4Pkg: Add Ext4Pkg.dec and Ext4Pkg.uni.
Ext4Pkg: Add Ext4Dxe driver.
Ext4Pkg: Add .DSC file.

Features/Ext4Pkg/Ext4Dxe/BlockGroup.c | 208 ++++++
Features/Ext4Pkg/Ext4Dxe/Collation.c | 157 +++++
Features/Ext4Pkg/Ext4Dxe/Crc16.c | 75 ++
Features/Ext4Pkg/Ext4Dxe/Crc32c.c | 84 +++
Features/Ext4Pkg/Ext4Dxe/Directory.c | 492 ++++++++++++++
Features/Ext4Pkg/Ext4Dxe/DiskUtil.c | 83 +++
Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h | 450 ++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c | 454 +++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h | 942 ++++++++++++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf | 147 ++++
Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.uni | 15 +
Features/Ext4Pkg/Ext4Dxe/Extents.c | 616 +++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/File.c | 583 ++++++++++++++++
Features/Ext4Pkg/Ext4Dxe/Inode.c | 468 +++++++++++++
Features/Ext4Pkg/Ext4Dxe/Partition.c | 120 ++++
Features/Ext4Pkg/Ext4Dxe/Superblock.c | 257 +++++++
Features/Ext4Pkg/Ext4Pkg.dec | 17 +
Features/Ext4Pkg/Ext4Pkg.dsc | 68 ++
Features/Ext4Pkg/Ext4Pkg.uni | 14 +
19 files changed, 5250 insertions(+)
create mode 100644 Features/Ext4Pkg/Ext4Dxe/BlockGroup.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Collation.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Crc16.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Crc32c.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Directory.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/DiskUtil.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.inf
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.uni
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Extents.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/File.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Inode.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Partition.c
create mode 100644 Features/Ext4Pkg/Ext4Dxe/Superblock.c
create mode 100644 Features/Ext4Pkg/Ext4Pkg.dec
create mode 100644 Features/Ext4Pkg/Ext4Pkg.dsc
create mode 100644 Features/Ext4Pkg/Ext4Pkg.uni

--
2.32.0


[edk2-platforms] [PATCH] IpmiFeaturePkg: Fix standalone package build

Nate DeSimone
 

Building the IpmiFeaturePkg standalone
(not as part of a platform build) currently
fails because the IpmiPlatformHookLib was added
but the reference to the NULL implementation of
that LibraryClass was miseed.

Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Manickavasakam Karpagavinayagam <manickavasakamk@ami.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
.../OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc | 1 +
1 file changed, 1 insertion(+)

diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
index 05a7d4f0af..a6eccb428b 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
@@ -48,6 +48,7 @@
# IPMI Feature Package
#####################################
IpmiCommandLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf
+ IpmiPlatformHookLib|OutOfBandManagement/IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf

[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
#######################################
--
2.27.0.windows.1

5341 - 5360 of 84031