* [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access
@ 2021-03-26 7:23 Dandan Bi
2021-03-26 7:23 ` [patch V3 01/29] MdePkg: Add RegisterFilterLib class and NULL instance Dandan Bi
` (29 more replies)
0 siblings, 30 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel
Cc: Michael D Kinney, Sean Brogan, Bret Barkelew, Leif Lindholm,
Ard Biesheuvel, Laszlo Ersek, Jiewen Yao, Jian J Wang,
Sami Mujawar, Alexei Fedorov, Andrew Fish, Ray Ni, Chasel Chiu,
Nate DeSimone, Star Zeng, Zhichao Gao, Hao A Wu, Maurice Ma,
Guo Dong, Benjamin You, Eric Dong, Maciej Rabeda, Jiaxin Wu,
Siyuan Fu, Jordan Justen, Supreeth Venkatesh, Abner Chang,
Nickle Wang, Liming Gao, Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
RFC: https://edk2.groups.io/g/devel/message/72530
Branch for this change: https://github.com/dandanbi/edk2/tree/RegisterFilterLibV3
Patch 1 is to add RegisterFilterLib Library Class in edk2 to filter/trace port IO/MMIO/MSR access and add a RegisterFilterLibNull instance.
Patch 2 is to add the MdeLibs.dsc.inc file to MdePkg for some default libraries provided by MdePkg and add RegisterFilterLib into it as the first version of MdeLibs.dsc.inc.
Last 2 patches are to update APIs in IoLib and BaseLib to filter/trace port IO/MMIO/MSR access.
Remaining patches are to update related dsc files to consume MdeLibs.dsc.inc for RegisterFilterLib.
Will submit patch 1 and 2 firstly.
And then update related dsc files in edk2 and edk2platform repo to consume MdeLibs.dsc.inc for RegisterFilterLib.
At last will submit the patches to update IoLib and BaseLib to filter/trace port IO/MMIO/MSR access.
--
V3:
1. Don't assume Library instances in MdeLibs.dsc.inc are must in common [LibraryClasses] section.
Can specify different [LibraryClasses] section for the libary instances in MdeLibs.dsc.inc.
2. Update plaftom dsc to consume the MdeLibs.dsc outside the [LibraryClasses] section.
3. Pick up the R-B for patch 1, patch 28, patch 29.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Dandan Bi (29):
MdePkg: Add RegisterFilterLib class and NULL instance
MdePkg: Add MdeLibs.dsc.inc file to MdePkg
ArmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
ArmPlatformPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
ArmVirtPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
CryptoPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
DynamicTablesPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
EmbeddedPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
EmulatorPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
FatPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
FmpDevicePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
IntelFsp2Pkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
IntelFsp2WrapperPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
MdeModulePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
MdePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
NetworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
OvmfPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
PcAtChipsetPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
RedfishPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
SecurityPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
ShellPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
SignedCapsulePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
SourceLevelDebugPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
StandaloneMmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
UefiCpuPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
UefiPayloadPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
UnitTestFrameworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
MdePkg/IoLib: Filter/trace port IO/MMIO access
MdePkg/Baseib: Filter/trace MSR access for IA32/X64
ArmPkg/ArmPkg.dsc | 2 +
ArmPlatformPkg/ArmPlatformPkg.dsc | 2 +
ArmVirtPkg/ArmVirt.dsc.inc | 4 +-
CryptoPkg/CryptoPkg.dsc | 5 +-
DynamicTablesPkg/DynamicTablesPkg.dsc | 2 +
EmbeddedPkg/EmbeddedPkg.dsc | 5 +-
EmulatorPkg/EmulatorPkg.dsc | 4 +-
FatPkg/FatPkg.dsc | 4 +-
FmpDevicePkg/FmpDevicePkg.dsc | 4 +-
IntelFsp2Pkg/IntelFsp2Pkg.dsc | 4 +-
IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc | 2 +
IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 4 +-
MdeModulePkg/MdeModulePkg.dsc | 4 +-
MdePkg/Include/Library/RegisterFilterLib.h | 243 ++++++++++++++++
.../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 3 +-
.../BaseIoLibIntrinsicArmVirt.inf | 3 +-
.../BaseIoLibIntrinsicInternal.h | 3 +-
.../BaseIoLibIntrinsicSev.inf | 3 +-
MdePkg/Library/BaseIoLibIntrinsic/IoLib.c | 95 ++++--
.../Library/BaseIoLibIntrinsic/IoLibArmVirt.c | 82 +++++-
MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c | 58 +++-
MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c | 81 ++++--
MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c | 74 ++++-
MdePkg/Library/BaseLib/BaseLib.inf | 5 +-
MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c | 38 ++-
MdePkg/Library/BaseLib/Ia32/ReadMsr64.c | 38 ++-
MdePkg/Library/BaseLib/Ia32/WriteMsr64.c | 22 +-
MdePkg/Library/BaseLib/X64/GccInlinePriv.c | 43 ++-
MdePkg/Library/BaseLib/X64/ReadMsr64.c | 15 +-
MdePkg/Library/BaseLib/X64/WriteMsr64.c | 13 +-
.../RegisterFilterLibNull.c | 271 ++++++++++++++++++
.../RegisterFilterLibNull.inf | 23 ++
.../RegisterFilterLibNull.uni | 13 +
MdePkg/MdeLibs.dsc.inc | 15 +
MdePkg/MdePkg.dec | 7 +-
MdePkg/MdePkg.dsc | 6 +-
NetworkPkg/NetworkPkg.dsc | 4 +-
OvmfPkg/AmdSev/AmdSevX64.dsc | 5 +-
OvmfPkg/Bhyve/BhyveX64.dsc | 5 +-
OvmfPkg/OvmfPkgIa32.dsc | 5 +-
OvmfPkg/OvmfPkgIa32X64.dsc | 5 +-
OvmfPkg/OvmfPkgX64.dsc | 5 +-
OvmfPkg/OvmfXen.dsc | 5 +-
PcAtChipsetPkg/PcAtChipsetPkg.dsc | 4 +-
RedfishPkg/RedfishPkg.dsc | 4 +-
SecurityPkg/SecurityPkg.dsc | 4 +-
ShellPkg/ShellPkg.dsc | 4 +-
SignedCapsulePkg/SignedCapsulePkg.dsc | 4 +-
SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 4 +-
StandaloneMmPkg/StandaloneMmPkg.dsc | 5 +-
UefiCpuPkg/UefiCpuPkg.dsc | 4 +-
UefiPayloadPkg/UefiPayloadPkg.dsc | 5 +-
.../UnitTestFrameworkPkgTarget.dsc.inc | 4 +-
53 files changed, 1131 insertions(+), 145 deletions(-)
create mode 100644 MdePkg/Include/Library/RegisterFilterLib.h
create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.c
create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.uni
create mode 100644 MdePkg/MdeLibs.dsc.inc
--
2.18.0.windows.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* [patch V3 01/29] MdePkg: Add RegisterFilterLib class and NULL instance
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 02/29] MdePkg: Add MdeLibs.dsc.inc file to MdePkg Dandan Bi
` (28 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
1. Add a new library class (RegisterFilterLib) to filter
and trace port IO/MMIO/MSR access.
2. Add a NULL instance (RegisterFilterLibNull) can be used
to keep current behavior.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Abner Chang <abner.chang@hpe.com>
---
MdePkg/Include/Library/RegisterFilterLib.h | 243 ++++++++++++++++
.../RegisterFilterLibNull.c | 271 ++++++++++++++++++
.../RegisterFilterLibNull.inf | 23 ++
.../RegisterFilterLibNull.uni | 13 +
MdePkg/MdePkg.dec | 7 +-
MdePkg/MdePkg.dsc | 4 +-
6 files changed, 559 insertions(+), 2 deletions(-)
create mode 100644 MdePkg/Include/Library/RegisterFilterLib.h
create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.c
create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.uni
diff --git a/MdePkg/Include/Library/RegisterFilterLib.h b/MdePkg/Include/Library/RegisterFilterLib.h
new file mode 100644
index 0000000000..c4402da7d8
--- /dev/null
+++ b/MdePkg/Include/Library/RegisterFilterLib.h
@@ -0,0 +1,243 @@
+/** @file
+ Public include file for the Port IO/MMIO/MSR RegisterFilterLib.
+
+Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef REGISTER_FILTER_LIB_H_
+#define REGISTER_FILTER_LIB_H_
+
+typedef enum {
+ FilterWidth8,
+ FilterWidth16,
+ FilterWidth32,
+ FilterWidth64
+} FILTER_IO_WIDTH;
+
+/**
+ Filter IO read operation before read IO port.
+ It is used to filter IO read operation.
+
+ It will return the flag to decide whether require read real IO port.
+ It can be used for emulation environment.
+
+ @param[in] Width Signifies the width of the I/O operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Buffer The destination buffer to store the results.
+
+ @retval TRUE Need to excute the IO read.
+ @retval FALSE Skip the IO read.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeIoRead (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN OUT VOID *Buffer
+ );
+
+/**
+ Trace IO read operation after read IO port.
+ It is used to trace IO operation.
+
+ @param[in] Width Signifies the width of the I/O operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Buffer The destination buffer to store the results.
+
+**/
+VOID
+EFIAPI
+FilterAfterIoRead (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ );
+/**
+ Filter IO Write operation before wirte IO port.
+ It is used to filter IO operation.
+
+ It will return the flag to decide whether require read write IO port.
+ It can be used for emulation environment.
+
+ @param[in] Width Signifies the width of the I/O operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Buffer The source buffer from which to BeforeWrite data.
+
+ @retval TRUE Need to excute the IO write.
+ @retval FALSE Skip the IO write.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeIoWrite (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ );
+
+ /**
+ Trace IO Write operation after wirte IO port.
+ It is used to trace IO operation.
+
+ @param[in] Width Signifies the width of the I/O operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Buffer The source buffer from which to BeforeWrite data.
+
+**/
+VOID
+EFIAPI
+FilterAfterIoWrite (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ );
+
+/**
+ Filter memory IO before Read operation.
+
+ It will return the flag to decide whether require read real MMIO.
+ It can be used for emulation environment.
+
+ @param[in] Width Signifies the width of the memory I/O operation.
+ @param[in] Address The base address of the memory I/O operation.
+ @param[in] Buffer The destination buffer to store the results.
+
+ @retval TRUE Need to excute the MMIO read.
+ @retval FALSE Skip the MMIO read.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeMmIoRead (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN OUT VOID *Buffer
+ );
+
+/**
+ Tracer memory IO after read operation
+
+ @param[in] Width Signifies the width of the memory I/O operation.
+ @param[in] Address The base address of the memory I/O operation.
+ @param[in] Buffer The destination buffer to store the results.
+
+**/
+VOID
+EFIAPI
+FilterAfterMmIoRead (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ );
+
+/**
+ Filter memory IO before write operation
+
+ It will return the flag to decide whether require wirte real MMIO.
+ It can be used for emulation environment.
+
+ @param[in] Width Signifies the width of the memory I/O operation.
+ @param[in] Address The base address of the memory I/O operation.
+ @param[in] Buffer The source buffer from which to BeforeWrite data.
+
+ @retval TRUE Need to excute the MMIO write.
+ @retval FALSE Skip the MMIO write.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeMmIoWrite (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ );
+
+/**
+ Tracer memory IO after write operation
+
+ @param[in] Width Signifies the width of the memory I/O operation.
+ @param[in] Address The base address of the memory I/O operation.
+ @param[in] Buffer The source buffer from which to BeforeWrite data.
+
+**/
+VOID
+EFIAPI
+FilterAfterMmIoWrite (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ );
+
+/**
+ Filter MSR before read operation.
+
+ It will return the flag to decide whether require read real MSR.
+ It can be used for emulation environment.
+
+ @param Index The 8-bit Machine Specific Register index to BeforeWrite.
+ @param Value The 64-bit value to BeforeRead from the Machine Specific Register.
+
+ @retval TRUE Need to excute the MSR read.
+ @retval FALSE Skip the MSR read.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeMsrRead (
+ IN UINT32 Index,
+ IN OUT UINT64 *Value
+ );
+
+/**
+ Trace MSR after read operation
+
+ @param Index The 8-bit Machine Specific Register index to BeforeWrite.
+ @param Value The 64-bit value to BeforeRead from the Machine Specific Register.
+
+**/
+VOID
+EFIAPI
+FilterAfterMsrRead (
+ IN UINT32 Index,
+ IN UINT64 *Value
+ );
+
+/**
+ Filter MSR before write operation
+
+ It will return the flag to decide whether require write real MSR.
+ It can be used for emulation environment.
+
+ @param Index The 8-bit Machine Specific Register index to BeforeWrite.
+ @param Value The 64-bit value to BeforeWrite to the Machine Specific Register.
+
+ @retval TRUE Need to excute the MSR write.
+ @retval FALSE Skip the MSR write.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeMsrWrite (
+ IN UINT32 Index,
+ IN UINT64 *Value
+ );
+
+/**
+ Trace MSR after write operation
+
+ @param Index The 8-bit Machine Specific Register index to BeforeWrite.
+ @param Value The 64-bit value to BeforeWrite to the Machine Specific Register.
+
+**/
+VOID
+EFIAPI
+FilterAfterMsrWrite (
+ IN UINT32 Index,
+ IN UINT64 *Value
+ );
+
+#endif // REGISTER_FILTER_LIB_H_
diff --git a/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.c b/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.c
new file mode 100644
index 0000000000..7150f1ed5f
--- /dev/null
+++ b/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.c
@@ -0,0 +1,271 @@
+/** @file
+ Null instance of RegisterFilterLib.
+
+ Copyright (c) 2021 Intel Corporation. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/RegisterFilterLib.h>
+
+/**
+ Filter IO read operation before read IO port.
+ It is used to filter IO read operation.
+
+ It will return the flag to decide whether require read real IO port.
+ It can be used for emulation environment.
+
+ @param[in] Width Signifies the width of the I/O operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in,out] Buffer The destination buffer to store the results.
+
+ @retval TRUE Need to excute the IO read.
+ @retval FALSE Skip the IO read.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeIoRead (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN OUT VOID *Buffer
+ )
+{
+ return TRUE;
+}
+
+/**
+ Trace IO read operation after read IO port.
+ It is used to trace IO operation.
+
+ @param[in] Width Signifies the width of the I/O operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Buffer The destination buffer to store the results.
+
+**/
+VOID
+EFIAPI
+FilterAfterIoRead (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ )
+{
+ return;
+}
+
+/**
+ Filter IO Write operation before wirte IO port.
+ It is used to filter IO operation.
+
+ It will return the flag to decide whether require read write IO port.
+ It can be used for emulation environment.
+
+ @param[in] Width Signifies the width of the I/O operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Buffer The source buffer from which to write data.
+
+ @retval TRUE Need to excute the IO write.
+ @retval FALSE Skip the IO write.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeIoWrite (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ )
+{
+ return TRUE;
+}
+
+ /**
+ Trace IO Write operation after wirte IO port.
+ It is used to trace IO operation.
+
+ @param[in] Width Signifies the width of the I/O operation.
+ @param[in] Address The base address of the I/O operation.
+ @param[in] Buffer The source buffer from which to Write data.
+
+**/
+VOID
+EFIAPI
+FilterAfterIoWrite (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ )
+{
+ return;
+}
+
+/**
+ Filter memory IO before Read operation.
+
+ It will return the flag to decide whether require read real MMIO.
+ It can be used for emulation environment.
+
+ @param[in] Width Signifies the width of the memory I/O operation.
+ @param[in] Address The base address of the memory I/O operation.
+ @param[in,out] Buffer The destination buffer to store the results.
+
+ @retval TRUE Need to excute the MMIO read.
+ @retval FALSE Skip the MMIO read.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeMmIoRead (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN OUT VOID *Buffer
+ )
+{
+ return TRUE;
+}
+
+/**
+ Tracer memory IO after read operation.
+
+ @param[in] Width Signifies the width of the memory I/O operation.
+ @param[in] Address The base address of the memory I/O operation.
+ @param[in] Buffer The destination buffer to store the results.
+
+**/
+VOID
+EFIAPI
+FilterAfterMmIoRead (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ )
+{
+ return;
+}
+
+/**
+ Filter memory IO before write operation.
+
+ It will return the flag to decide whether require wirte real MMIO.
+ It can be used for emulation environment.
+
+ @param[in] Width Signifies the width of the memory I/O operation.
+ @param[in] Address The base address of the memory I/O operation.
+ @param[in] Buffer The source buffer from which to write data.
+
+ @retval TRUE Need to excute the MMIO write.
+ @retval FALSE Skip the MMIO write.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeMmIoWrite (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ )
+{
+ return TRUE;
+}
+
+/**
+ Tracer memory IO after write operation.
+
+ @param[in] Width Signifies the width of the memory I/O operation.
+ @param[in] Address The base address of the memory I/O operation.
+ @param[in] Buffer The source buffer from which to write data.
+
+**/
+VOID
+EFIAPI
+FilterAfterMmIoWrite (
+ IN FILTER_IO_WIDTH Width,
+ IN UINTN Address,
+ IN VOID *Buffer
+ )
+{
+ return;
+}
+
+/**
+ Filter MSR before read operation.
+
+ It will return the flag to decide whether require read real MSR.
+ It can be used for emulation environment.
+
+ @param Index The Register index of the MSR.
+ @param Value Point to the data will be read from the MSR.
+
+ @retval TRUE Need to excute the MSR read.
+ @retval FALSE Skip the MSR read.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeMsrRead (
+ IN UINT32 Index,
+ IN OUT UINT64 *Value
+ )
+{
+ return TRUE;
+}
+
+/**
+ Trace MSR after read operation.
+
+ @param Index The Register index of the MSR.
+ @param Value Point to the data has been be read from the MSR.
+
+**/
+VOID
+EFIAPI
+FilterAfterMsrRead (
+ IN UINT32 Index,
+ IN UINT64 *Value
+ )
+{
+ return;
+}
+
+/**
+ Filter MSR before write operation.
+
+ It will return the flag to decide whether require write real MSR.
+ It can be used for emulation environment.
+
+ @param Index The Register index of the MSR.
+ @param Value Point to the data want to be written to the MSR.
+
+ @retval TRUE Need to excute the MSR write.
+ @retval FALSE Skip the MSR write.
+
+**/
+BOOLEAN
+EFIAPI
+FilterBeforeMsrWrite (
+ IN UINT32 Index,
+ IN UINT64 *Value
+ )
+{
+ return TRUE;
+}
+
+/**
+ Trace MSR after write operation.
+
+ @param Index The Register index of the MSR.
+ @param Value Point to the data has been be written to the MSR.
+
+**/
+VOID
+EFIAPI
+FilterAfterMsrWrite (
+ IN UINT32 Index,
+ IN UINT64 *Value
+ )
+{
+ return;
+}
+
diff --git a/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf b/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
new file mode 100644
index 0000000000..a7fc7497ed
--- /dev/null
+++ b/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
@@ -0,0 +1,23 @@
+## @file
+# Null instance of RegisterFilterLib.
+#
+# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = FilterLibNull
+ MODULE_UNI_FILE = FilterLibNull.uni
+ FILE_GUID = 9F555194-A410-4AD6-B3FC-53F6E10FA793
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = RegisterFilterLib
+
+[Sources]
+ RegisterFilterLibNull.c
+
+[Packages]
+ MdePkg/MdePkg.dec
diff --git a/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.uni b/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.uni
new file mode 100644
index 0000000000..ed64c7e63d
--- /dev/null
+++ b/MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.uni
@@ -0,0 +1,13 @@
+// /** @file
+// Null instance of RegisterFilterLib.
+//
+// Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT #language en-US "Null instance of RegisterFilterLib."
+#string STR_MODULE_DESCRIPTION #language en-US "Null instance of RegisterFilterLib."
+
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 1d2637acc2..65de5c4052 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -2,11 +2,11 @@
# This Package provides all definitions, library classes and libraries instances.
#
# It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
# EFI1.10/UEFI2.7/PI1.7 and some Industry Standards.
#
-# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -260,10 +260,15 @@ [LibraryClasses]
## @libraryclass This library provides an interface to request non-MMRAM pages to be mapped
# or unblocked from inside MM environment.
#
MmUnblockMemoryLib|Include/Library/MmUnblockMemoryLib.h
+ ## @libraryclass This library provides interfances to filter and trace port IO/MMIO/MSR access.
+ #
+ #
+ RegisterFilterLib|Include/Library/RegisterFilterLib.h
+
[LibraryClasses.IA32, LibraryClasses.X64]
## @libraryclass Abstracts both S/W SMI generation and detection.
##
SmmLib|Include/Library/SmmLib.h
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 79629e3f93..be89e28eef 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -1,9 +1,9 @@
## @file
# EFI/PI MdePkg Package
#
-# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -125,10 +125,12 @@ [Components]
MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf
MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
+ MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
+
[Components.IA32, Components.X64, Components.ARM, Components.AARCH64]
#
# Add UEFI Target Based Unit Tests
#
MdePkg/Test/UnitTest/Library/BaseLib/BaseLibUnitTestsUefi.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 02/29] MdePkg: Add MdeLibs.dsc.inc file to MdePkg
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
2021-03-26 7:23 ` [patch V3 01/29] MdePkg: Add RegisterFilterLib class and NULL instance Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 03/29] ArmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib Dandan Bi
` (27 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Laszlo Ersek
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc is added for some default libraries provided by MdePkg.
Platform can include MdeLibs.dsc.inc file to avoid some potential
incompatible changes to platform dsc file in future.
Only add RegisterFilterLib into it as the first version of MdeLibs.dsc.inc.
Can update and maintain MdeLibs.dsc.inc gradually later.
"MdeLibs.dsc.inc" for the [LibraryClasses*] section(s)
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdePkg/MdeLibs.dsc.inc | 15 +++++++++++++++
1 file changed, 15 insertions(+)
create mode 100644 MdePkg/MdeLibs.dsc.inc
diff --git a/MdePkg/MdeLibs.dsc.inc b/MdePkg/MdeLibs.dsc.inc
new file mode 100644
index 0000000000..3c70daf87a
--- /dev/null
+++ b/MdePkg/MdeLibs.dsc.inc
@@ -0,0 +1,15 @@
+## @file
+# Mde DSC include file for [LibraryClasses*] section of all Architectures.
+#
+# This file can be included to the [LibraryClasses*] section(s) of a platform DSC file
+# by using "!include MdePkg/MdeLibs.dsc.inc" to specify the library instances
+# of some EDKII basic/common library classes.
+#
+# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[LibraryClasses]
+ RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 03/29] ArmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
2021-03-26 7:23 ` [patch V3 01/29] MdePkg: Add RegisterFilterLib class and NULL instance Dandan Bi
2021-03-26 7:23 ` [patch V3 02/29] MdePkg: Add MdeLibs.dsc.inc file to MdePkg Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 04/29] ArmPlatformPkg: " Dandan Bi
` (26 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Leif Lindholm, Ard Biesheuvel
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
ArmPkg/ArmPkg.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 7194eb2d3c..47de38076a 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -30,10 +30,12 @@ [BuildOptions]
*_*_*_CC_FLAGS = -DDISABLE_NEW_DEPRECATED_INTERFACES
[PcdsFixedAtBuild]
gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses.common]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 04/29] ArmPlatformPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (2 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 03/29] ArmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 05/29] ArmVirtPkg: " Dandan Bi
` (25 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Leif Lindholm, Ard Biesheuvel
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
ArmPlatformPkg/ArmPlatformPkg.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc
index 88fe1247c0..661a4cea22 100644
--- a/ArmPlatformPkg/ArmPlatformPkg.dsc
+++ b/ArmPlatformPkg/ArmPlatformPkg.dsc
@@ -31,10 +31,12 @@ [BuildOptions]
[PcdsFixedAtBuild]
gArmTokenSpaceGuid.PcdFdBaseAddress|0x0
gArmTokenSpaceGuid.PcdFdSize|0x1000
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses.common]
ArmGicArchLib|ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf
ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 05/29] ArmVirtPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (3 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 04/29] ArmPlatformPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 06/29] CryptoPkg: " Dandan Bi
` (24 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Laszlo Ersek, Ard Biesheuvel, Leif Lindholm
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
ArmVirtPkg/ArmVirt.dsc.inc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
index d9abadbe70..52582c7890 100644
--- a/ArmVirtPkg/ArmVirt.dsc.inc
+++ b/ArmVirtPkg/ArmVirt.dsc.inc
@@ -1,9 +1,9 @@
#
# Copyright (c) 2011-2015, ARM Limited. All rights reserved.
# Copyright (c) 2014, Linaro Limited. All rights reserved.
-# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#
@@ -32,10 +32,12 @@ [BuildOptions.common.EDKII.DXE_CORE,BuildOptions.common.EDKII.DXE_DRIVER,BuildOp
[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
GCC:*_*_ARM_DLINK_FLAGS = -z common-page-size=0x1000
GCC:*_*_AARCH64_DLINK_FLAGS = -z common-page-size=0x10000
RVCT:*_*_ARM_DLINK_FLAGS = --scatter $(EDK_TOOLS_PATH)/Scripts/Rvct-Align4K.sct
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses.common]
!if $(TARGET) == RELEASE
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
!else
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 06/29] CryptoPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (4 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 05/29] ArmVirtPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 07/29] DynamicTablesPkg: " Dandan Bi
` (23 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Jiewen Yao, Jian J Wang, Xiaoyu Lu, Guomin Jiang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Xiaoyu Lu <xiaoyux.lu@intel.com>
Cc: Guomin Jiang <guomin.jiang@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
CryptoPkg/CryptoPkg.dsc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 55383f2722..f6498c18dc 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -1,10 +1,10 @@
## @file
# Cryptographic Library Package for UEFI Security Implementation.
# PEIM, DXE Driver, and SMM Driver with all crypto services enabled.
#
-# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -48,10 +48,13 @@ [Defines]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 07/29] DynamicTablesPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (5 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 06/29] CryptoPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 08/29] EmbeddedPkg: " Dandan Bi
` (22 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Sami Mujawar, Alexei Fedorov
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
DynamicTablesPkg/DynamicTablesPkg.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/DynamicTablesPkg/DynamicTablesPkg.dsc b/DynamicTablesPkg/DynamicTablesPkg.dsc
index 0232bda459..33b2a84c9d 100644
--- a/DynamicTablesPkg/DynamicTablesPkg.dsc
+++ b/DynamicTablesPkg/DynamicTablesPkg.dsc
@@ -18,10 +18,12 @@ [Defines]
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
!include DynamicTables.dsc.inc
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 08/29] EmbeddedPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (6 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 07/29] DynamicTablesPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 09/29] EmulatorPkg: " Dandan Bi
` (21 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Leif Lindholm, Ard Biesheuvel
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
EmbeddedPkg/EmbeddedPkg.dsc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/EmbeddedPkg/EmbeddedPkg.dsc b/EmbeddedPkg/EmbeddedPkg.dsc
index 8e83e50c3e..c41864e8a5 100644
--- a/EmbeddedPkg/EmbeddedPkg.dsc
+++ b/EmbeddedPkg/EmbeddedPkg.dsc
@@ -1,10 +1,10 @@
#/** @file
# Embedded Package
#
#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2012-2015, ARM Ltd. All rights reserved.<BR>
# Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -38,10 +38,13 @@ [SkuIds]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses.common]
# DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 09/29] EmulatorPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (7 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 08/29] EmbeddedPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 10/29] FatPkg: " Dandan Bi
` (20 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Andrew Fish, Ray Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
EmulatorPkg/EmulatorPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index a7ded49000..20e5468398 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -2,11 +2,11 @@
# UEFI/PI Emulation Platform with UEFI HII interface supported.
#
# The Emulation Platform can be used to debug individual modules, prior to creating
# a real platform. This also provides an example for how an DSC is created.
#
-# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.<BR>
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -42,10 +42,12 @@ [Defines]
DEFINE REDFISH_ENABLE = FALSE
[SkuIds]
0|DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
#
# Entry point
#
PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 10/29] FatPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (8 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 09/29] EmulatorPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 11/29] FmpDevicePkg: " Dandan Bi
` (19 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Ray Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
FatPkg/FatPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/FatPkg/FatPkg.dsc b/FatPkg/FatPkg.dsc
index d86256068b..4ddb5c3e00 100644
--- a/FatPkg/FatPkg.dsc
+++ b/FatPkg/FatPkg.dsc
@@ -1,11 +1,11 @@
## @file
# Build Binary Enhanced Fat Driver Modules.
#
# This Platform file is used to generate the Binary Fat Drivers
# for EDK II Prime release.
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -25,10 +25,12 @@ [BuildOptions]
INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
MSFT:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
#
# Entry Point Libraries
#
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 11/29] FmpDevicePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (9 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 10/29] FatPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 12/29] IntelFsp2Pkg: " Dandan Bi
` (18 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Liming Gao, Michael D Kinney
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
FmpDevicePkg/FmpDevicePkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/FmpDevicePkg/FmpDevicePkg.dsc b/FmpDevicePkg/FmpDevicePkg.dsc
index cfeadd8330..b420f52a08 100644
--- a/FmpDevicePkg/FmpDevicePkg.dsc
+++ b/FmpDevicePkg/FmpDevicePkg.dsc
@@ -5,11 +5,11 @@
# instance that supports the update of firmware storage devices using UEFI
# Capsules. The behavior of the Firmware Management Protocol instance is
# customized using libraries and PCDs.
#
# Copyright (c) Microsoft Corporation.<BR>
-# Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -36,10 +36,12 @@ [Defines]
#
DEFINE DEVICE_FMP_STORAGE_ACCESS_ENABLE = TRUE
!include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 12/29] IntelFsp2Pkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (10 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 11/29] FmpDevicePkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 13/29] IntelFsp2WrapperPkg: " Dandan Bi
` (17 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Nate DeSimone, Star Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
IntelFsp2Pkg/IntelFsp2Pkg.dsc | 4 +++-
IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc | 2 ++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/IntelFsp2Pkg/IntelFsp2Pkg.dsc b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
index 309411630d..c1414f7e75 100644
--- a/IntelFsp2Pkg/IntelFsp2Pkg.dsc
+++ b/IntelFsp2Pkg/IntelFsp2Pkg.dsc
@@ -1,9 +1,9 @@
## @file
# Provides driver and definitions to build fsp.
#
-# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
@@ -14,10 +14,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/IntelFsp2Pkg
SUPPORTED_ARCHITECTURES = IA32
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
diff --git a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
index bc4912313a..961576c9a7 100644
--- a/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
+++ b/IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc
@@ -70,10 +70,12 @@ [SkuIds]
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 13/29] IntelFsp2WrapperPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (11 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 12/29] IntelFsp2Pkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 8:11 ` Chiu, Chasel
2021-03-26 7:23 ` [patch V3 14/29] MdeModulePkg: " Dandan Bi
` (16 subsequent siblings)
29 siblings, 1 reply; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Chasel Chiu, Nate DeSimone, Star Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
index 738342b69b..21e089000e 100644
--- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
+++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
@@ -1,9 +1,9 @@
## @file
# Provides drivers and definitions to support fsp in EDKII bios.
#
-# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
[Defines]
@@ -14,10 +14,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/IntelFsp2WrapperPkg
SUPPORTED_ARCHITECTURES = IA32|X64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 14/29] MdeModulePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (12 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 13/29] IntelFsp2WrapperPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 15/29] MdePkg: " Dandan Bi
` (15 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang, Hao A Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdeModulePkg/MdeModulePkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index 9272da89a9..132fb36d95 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -1,10 +1,10 @@
## @file
# EFI/PI Reference Module Package for All Architectures
#
# (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
-# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -17,10 +17,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/MdeModule
SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64|RISCV64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
#
# Entry point
#
PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 15/29] MdePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (13 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 14/29] MdeModulePkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 16/29] NetworkPkg: " Dandan Bi
` (14 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdePkg/MdePkg.dsc | 2 ++
1 file changed, 2 insertions(+)
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index be89e28eef..d363419006 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -19,10 +19,12 @@ [Defines]
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
!include UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+!include MdePkg/MdeLibs.dsc.inc
+
[PcdsFeatureFlag]
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|TRUE
[PcdsFixedAtBuild]
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 16/29] NetworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (14 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 15/29] MdePkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 17/29] OvmfPkg: " Dandan Bi
` (13 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Maciej Rabeda, Jiaxin Wu, Siyuan Fu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
NetworkPkg/NetworkPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index 531da841e9..5e6619ad85 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -1,10 +1,10 @@
## @file
# UEFI 2.4 Network Module Package for All Architectures
#
# (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
-# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -18,10 +18,12 @@ [Defines]
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
DEFINE NETWORK_ISCSI_ENABLE = TRUE
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 17/29] OvmfPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (15 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 16/29] NetworkPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 18/29] PcAtChipsetPkg: " Dandan Bi
` (12 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Laszlo Ersek, Ard Biesheuvel, Jordan Justen
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
OvmfPkg/AmdSev/AmdSevX64.dsc | 5 ++++-
OvmfPkg/Bhyve/BhyveX64.dsc | 5 ++++-
OvmfPkg/OvmfPkgIa32.dsc | 5 ++++-
OvmfPkg/OvmfPkgIa32X64.dsc | 5 ++++-
OvmfPkg/OvmfPkgX64.dsc | 5 ++++-
OvmfPkg/OvmfXen.dsc | 5 ++++-
6 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index 65c42284d9..10fa71ac86 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -1,11 +1,11 @@
## @file
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform for SEV secure
# virtual machine remote attestation and secret injection
#
# Copyright (c) 2020 James Bottomley, IBM Corporation.
-# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -111,10 +111,13 @@ [SkuIds]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc
index 4a1cdf5aca..b34c3309b1 100644
--- a/OvmfPkg/Bhyve/BhyveX64.dsc
+++ b/OvmfPkg/Bhyve/BhyveX64.dsc
@@ -1,8 +1,8 @@
#
# Copyright (c) 2020, Rebecca Cran <rebecca@bsdio.com>
-# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) 2014, Pluribus Networks, Inc.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -111,10 +111,13 @@ [SkuIds]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLibBhyve.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 1eaf3e99c6..28db30a638 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -1,9 +1,9 @@
## @file
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform
#
-# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -115,10 +115,13 @@ [SkuIds]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 4a5a430147..6a39484194 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -1,9 +1,9 @@
## @file
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform
#
-# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -119,10 +119,13 @@ [SkuIds]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index d4d601b444..ffbca03f50 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -1,9 +1,9 @@
## @file
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform
#
-# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -119,10 +119,13 @@ [SkuIds]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 507029404f..e72511c503 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -1,9 +1,9 @@
## @file
# EFI/Framework Open Virtual Machine Firmware (OVMF) platform
#
-# Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) 2019, Citrix Systems, Inc.
# Copyright (c) Microsoft Corporation.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -109,10 +109,13 @@ [SkuIds]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 18/29] PcAtChipsetPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (16 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 17/29] OvmfPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 19/29] RedfishPkg: " Dandan Bi
` (11 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Ray Ni
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
PcAtChipsetPkg/PcAtChipsetPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dsc b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
index 3d1fb816f5..451e60ddc8 100644
--- a/PcAtChipsetPkg/PcAtChipsetPkg.dsc
+++ b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
@@ -1,9 +1,9 @@
## @file
# PC/AT Chipset Package
#
-# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, AMD Incorporated. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -16,10 +16,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/PcAtChipset
SUPPORTED_ARCHITECTURES = IA32|X64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 19/29] RedfishPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (17 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 18/29] PcAtChipsetPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 20/29] SecurityPkg: " Dandan Bi
` (10 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Abner Chang, Nickle Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Abner Chang <abner.chang@hpe.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
RedfishPkg/RedfishPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index e0052290b5..16139146ff 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -1,9 +1,9 @@
## @file
# Redfish Package
#
-# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -16,10 +16,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/RedfishPkg
SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 20/29] SecurityPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (18 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 19/29] RedfishPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 21/29] ShellPkg: " Dandan Bi
` (9 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Jiewen Yao, Jian J Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
SecurityPkg/SecurityPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index a77665518b..12ccd16349 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -1,9 +1,9 @@
## @file
# Security Module Package for All Architectures.
#
-# Copyright (c) 2009 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2015-2020 Hewlett Packard Enterprise Development LP<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -15,10 +15,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/SecurityPkg
SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64|RISCV64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 21/29] ShellPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (19 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 20/29] SecurityPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 22/29] SignedCapsulePkg: " Dandan Bi
` (8 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Ray Ni, Zhichao Gao
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
ShellPkg/ShellPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc
index a8b6de3342..6f0d092931 100644
--- a/ShellPkg/ShellPkg.dsc
+++ b/ShellPkg/ShellPkg.dsc
@@ -1,9 +1,9 @@
## @file
# Shell Package
#
-# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018 - 2020, Arm Limited. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -17,10 +17,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/Shell
SUPPORTED_ARCHITECTURES = IA32|X64|EBC|ARM|AARCH64|RISCV64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses.common]
UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibOptionalDevicePathProtocol.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 22/29] SignedCapsulePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (20 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 21/29] ShellPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 23/29] SourceLevelDebugPkg: " Dandan Bi
` (7 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Jian J Wang
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
SignedCapsulePkg/SignedCapsulePkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc b/SignedCapsulePkg/SignedCapsulePkg.dsc
index c5080ec1dd..2152d3d156 100644
--- a/SignedCapsulePkg/SignedCapsulePkg.dsc
+++ b/SignedCapsulePkg/SignedCapsulePkg.dsc
@@ -1,9 +1,9 @@
## @file
# This package provides EDKII capsule related support.
#
-# Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2016 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -15,10 +15,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/SignedCapsulePkg
SUPPORTED_ARCHITECTURES = AARCH64|ARM|IA32|X64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
#
# Entry point
#
PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 23/29] SourceLevelDebugPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (21 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 22/29] SignedCapsulePkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 24/29] StandaloneMmPkg: " Dandan Bi
` (6 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Hao A Wu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Hao A Wu <hao.a.wu@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
index 20eb10ba07..eba64a7b78 100644
--- a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
+++ b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
@@ -1,9 +1,9 @@
## @file
# Source Level Debug Package.
#
-# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2020, AMD Incorporated. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -21,10 +21,12 @@ [Defines]
OUTPUT_DIRECTORY = Build/SourceLevelDebugPkg
SUPPORTED_ARCHITECTURES = IA32|X64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses.common]
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 24/29] StandaloneMmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (22 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 23/29] SourceLevelDebugPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 25/29] UefiCpuPkg: " Dandan Bi
` (5 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Ard Biesheuvel, Sami Mujawar, Jiewen Yao, Supreeth Venkatesh
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
StandaloneMmPkg/StandaloneMmPkg.dsc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 73f3f0f6b1..0c45df95e2 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -1,9 +1,9 @@
## @file
# Standalone MM Platform.
#
-# Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.<BR>
# Copyright (C) Microsoft Corporation<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -30,10 +30,13 @@ [Defines]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
#
# Basic
#
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 25/29] UefiCpuPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (23 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 24/29] StandaloneMmPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 26/29] UefiPayloadPkg: " Dandan Bi
` (4 subsequent siblings)
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Eric Dong, Ray Ni, Laszlo Ersek, Rahul Kumar
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
UefiCpuPkg/UefiCpuPkg.dsc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
index 7db419471d..98c4c53465 100644
--- a/UefiCpuPkg/UefiCpuPkg.dsc
+++ b/UefiCpuPkg/UefiCpuPkg.dsc
@@ -1,9 +1,9 @@
## @file
# UefiCpuPkg Package
#
-# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -19,10 +19,12 @@ [Defines]
#
# External libraries to build package
#
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 26/29] UefiPayloadPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (24 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 25/29] UefiCpuPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 14:39 ` Guo Dong
2021-03-26 7:23 ` [patch V3 27/29] UnitTestFrameworkPkg: " Dandan Bi
` (3 subsequent siblings)
29 siblings, 1 reply; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Maurice Ma, Guo Dong, Benjamin You
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Guo Dong <guo.dong@intel.com>
Cc: Benjamin You <benjamin.you@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
UefiPayloadPkg/UefiPayloadPkg.dsc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
index 23edd163e9..e3b017858e 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
@@ -1,11 +1,11 @@
## @file
# Bootloader Payload Package
#
# Provides drivers and definitions to create uefi payload for bootloaders.
#
-# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
@@ -111,10 +111,13 @@ [SkuIds]
################################################################################
#
# Library Class section - list of all Library Classes needed by this Platform.
#
################################################################################
+
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
#
# Entry point
#
DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 27/29] UnitTestFrameworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (25 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 26/29] UefiPayloadPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 16:35 ` Michael D Kinney
2021-03-26 7:23 ` [patch V3 28/29] MdePkg/IoLib: Filter/trace port IO/MMIO access Dandan Bi
` (2 subsequent siblings)
29 siblings, 1 reply; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Michael D Kinney, Sean Brogan, Bret Barkelew
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
MdeLibs.dsc.inc was added for some basic/default library
instances provided by MdePkg and RegisterFilterLibNull Library
was also added into it as the first version of MdeLibs.dsc.inc.
So update platform dsc to consume MdeLibs.dsc.inc for
RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
index 8adf690098..68ad37e989 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
@@ -1,13 +1,15 @@
## @file
# UnitTestFrameworkPkg DSC include file for target based test DSC
#
-# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
+!include MdePkg/MdeLibs.dsc.inc
+
[LibraryClasses]
#
# Entry point
#
PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 28/29] MdePkg/IoLib: Filter/trace port IO/MMIO access
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (26 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 27/29] UnitTestFrameworkPkg: " Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:23 ` [patch V3 29/29] MdePkg/Baseib: Filter/trace MSR access for IA32/X64 Dandan Bi
2021-03-26 7:57 ` [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Ard Biesheuvel
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
---
.../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 3 +-
.../BaseIoLibIntrinsicArmVirt.inf | 3 +-
.../BaseIoLibIntrinsicInternal.h | 3 +-
.../BaseIoLibIntrinsicSev.inf | 3 +-
MdePkg/Library/BaseIoLibIntrinsic/IoLib.c | 95 ++++++++++++++-----
.../Library/BaseIoLibIntrinsic/IoLibArmVirt.c | 82 ++++++++++++++--
MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c | 58 +++++++++--
MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c | 81 ++++++++++++----
MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c | 74 +++++++++++++--
9 files changed, 329 insertions(+), 73 deletions(-)
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
index 690b95d440..97eeada065 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
@@ -5,11 +5,11 @@
# for IA-32 and x64. On IPF, I/O port requests are translated into MMIO requests.
# MMIO requests are forwarded directly to memory. For EBC, I/O port requests
# ASSERT(). For ARM, AARCH64 and RISCV64, this I/O library only provides non I/O
# read and write.
#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
# Portions Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -64,6 +64,7 @@ [Packages]
MdePkg/MdePkg.dec
[LibraryClasses]
DebugLib
BaseLib
+ RegisterFilterLib
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf
index ad68f841fb..cea6857926 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf
+++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicArmVirt.inf
@@ -1,9 +1,9 @@
## @file
# Instance of I/O Library using KVM/ARM safe assembler routines
#
-# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
# Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -42,5 +42,6 @@ [Packages]
MdePkg/MdePkg.dec
[LibraryClasses]
DebugLib
BaseLib
+ RegisterFilterLib
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h
index 1aae45fa8a..79b2eb3e7b 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h
+++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicInternal.h
@@ -1,11 +1,11 @@
/** @file
Common header file shared by all source files.
This file includes package header files, dependent library classes.
- Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#ifndef __BASEIOLIB_INTRINSIC_INTERNAL_H_
#define __BASEIOLIB_INTRINSIC_INTERNAL_H_
@@ -15,7 +15,8 @@
#include <Base.h>
#include <Library/IoLib.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
+#include <Library/RegisterFilterLib.h>
#endif
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
index 86a07e60f8..34f9d1d106 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
+++ b/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
@@ -2,11 +2,11 @@
# Instance of I/O Library using compiler intrinsics.
#
# I/O Library that uses compiler intrinsics to perform IN and OUT instructions
# for IA-32 and x64.
#
-# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -47,6 +47,7 @@ [Packages]
MdePkg/MdePkg.dec
[LibraryClasses]
DebugLib
BaseLib
+ RegisterFilterLib
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLib.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLib.c
index a6bbc92546..d0d7044f09 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/IoLib.c
+++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLib.c
@@ -1,9 +1,9 @@
/** @file
Common I/O Library routines.
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "BaseIoLibIntrinsicInternal.h"
@@ -80,14 +80,19 @@ EFIAPI
MmioRead8 (
IN UINTN Address
)
{
UINT8 Value;
+ BOOLEAN Flag;
- MemoryFence ();
- Value = *(volatile UINT8*)Address;
- MemoryFence ();
+ Flag = FilterBeforeMmIoRead (FilterWidth8, Address, &Value);
+ if (Flag) {
+ MemoryFence ();
+ Value = *(volatile UINT8*)Address;
+ MemoryFence ();
+ }
+ FilterAfterMmIoRead (FilterWidth8, Address, &Value);
return Value;
}
/**
@@ -110,13 +115,19 @@ EFIAPI
MmioWrite8 (
IN UINTN Address,
IN UINT8 Value
)
{
- MemoryFence ();
- *(volatile UINT8*)Address = Value;
- MemoryFence ();
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMmIoWrite (FilterWidth8, Address, &Value);
+ if (Flag) {
+ MemoryFence ();
+ *(volatile UINT8*)Address = Value;
+ MemoryFence ();
+ }
+ FilterAfterMmIoWrite (FilterWidth8, Address, &Value);
return Value;
}
/**
@@ -139,16 +150,20 @@ EFIAPI
MmioRead16 (
IN UINTN Address
)
{
UINT16 Value;
+ BOOLEAN Flag;
ASSERT ((Address & 1) == 0);
-
- MemoryFence ();
- Value = *(volatile UINT16*)Address;
- MemoryFence ();
+ Flag = FilterBeforeMmIoRead (FilterWidth16, Address, &Value);
+ if (Flag) {
+ MemoryFence ();
+ Value = *(volatile UINT16*)Address;
+ MemoryFence ();
+ }
+ FilterAfterMmIoRead (FilterWidth16, Address, &Value);
return Value;
}
/**
@@ -172,15 +187,21 @@ EFIAPI
MmioWrite16 (
IN UINTN Address,
IN UINT16 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 1) == 0);
- MemoryFence ();
- *(volatile UINT16*)Address = Value;
- MemoryFence ();
+ Flag = FilterBeforeMmIoWrite (FilterWidth16, Address, &Value);
+ if (Flag) {
+ MemoryFence ();
+ *(volatile UINT16*)Address = Value;
+ MemoryFence ();
+ }
+ FilterAfterMmIoWrite (FilterWidth16, Address, &Value);
return Value;
}
/**
@@ -203,16 +224,21 @@ EFIAPI
MmioRead32 (
IN UINTN Address
)
{
UINT32 Value;
+ BOOLEAN Flag;
ASSERT ((Address & 3) == 0);
- MemoryFence ();
- Value = *(volatile UINT32*)Address;
- MemoryFence ();
+ Flag = FilterBeforeMmIoRead (FilterWidth32, Address, &Value);
+ if (Flag) {
+ MemoryFence ();
+ Value = *(volatile UINT32*)Address;
+ MemoryFence ();
+ }
+ FilterAfterMmIoRead (FilterWidth32, Address, &Value);
return Value;
}
/**
@@ -236,15 +262,21 @@ EFIAPI
MmioWrite32 (
IN UINTN Address,
IN UINT32 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 3) == 0);
- MemoryFence ();
- *(volatile UINT32*)Address = Value;
- MemoryFence ();
+ Flag = FilterBeforeMmIoWrite (FilterWidth32, Address, &Value);
+ if (Flag) {
+ MemoryFence ();
+ *(volatile UINT32*)Address = Value;
+ MemoryFence ();
+ }
+ FilterAfterMmIoWrite (FilterWidth32, Address, &Value);
return Value;
}
/**
@@ -267,16 +299,21 @@ EFIAPI
MmioRead64 (
IN UINTN Address
)
{
UINT64 Value;
+ BOOLEAN Flag;
ASSERT ((Address & 7) == 0);
- MemoryFence ();
- Value = *(volatile UINT64*)Address;
- MemoryFence ();
+ Flag = FilterBeforeMmIoRead (FilterWidth64, Address, &Value);
+ if (Flag) {
+ MemoryFence ();
+ Value = *(volatile UINT64*)Address;
+ MemoryFence ();
+ }
+ FilterAfterMmIoRead (FilterWidth64, Address, &Value);
return Value;
}
/**
@@ -298,14 +335,20 @@ EFIAPI
MmioWrite64 (
IN UINTN Address,
IN UINT64 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 7) == 0);
- MemoryFence ();
- *(volatile UINT64*)Address = Value;
- MemoryFence ();
+ Flag = FilterBeforeMmIoWrite (FilterWidth64, Address, &Value);
+ if (Flag) {
+ MemoryFence ();
+ *(volatile UINT64*)Address = Value;
+ MemoryFence ();
+ }
+ FilterAfterMmIoWrite (FilterWidth64, Address, &Value);
return Value;
}
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibArmVirt.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibArmVirt.c
index 9715705ee0..6140840769 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibArmVirt.c
+++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibArmVirt.c
@@ -1,9 +1,9 @@
/** @file
I/O Library for ARM.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
Copyright (c) 2018, Linaro, Ltd. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -544,11 +544,20 @@ UINT8
EFIAPI
MmioRead8 (
IN UINTN Address
)
{
- return MmioRead8Internal (Address);
+ UINT8 Value;
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMmIoRead (FilterWidth8, Address, &Value);
+ if (Flag) {
+ Value = MmioRead8Internal (Address);
+ }
+ FilterAfterMmIoRead (FilterWidth8, Address, &Value);
+
+ return Value;
}
/**
Writes an 8-bit MMIO register.
@@ -567,11 +576,18 @@ EFIAPI
MmioWrite8 (
IN UINTN Address,
IN UINT8 Value
)
{
- MmioWrite8Internal (Address, Value);
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMmIoWrite (FilterWidth8, Address, &Value);
+ if (Flag) {
+ MmioWrite8Internal (Address, Value);
+ }
+ FilterAfterMmIoWrite (FilterWidth8, Address, &Value);
+
return Value;
}
/**
Reads a 16-bit MMIO register.
@@ -591,13 +607,22 @@ UINT16
EFIAPI
MmioRead16 (
IN UINTN Address
)
{
+ BOOLEAN Flag;
+ UINT16 Value;
+
ASSERT ((Address & 1) == 0);
- return MmioRead16Internal (Address);
+ Flag = FilterBeforeMmIoRead (FilterWidth16, Address, &Value);
+ if (Flag) {
+ Value = MmioRead16Internal (Address);
+ }
+ FilterAfterMmIoRead (FilterWidth16, Address, &Value);
+
+ return Value;
}
/**
Writes a 16-bit MMIO register.
@@ -616,13 +641,20 @@ EFIAPI
MmioWrite16 (
IN UINTN Address,
IN UINT16 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 1) == 0);
- MmioWrite16Internal (Address, Value);
+ Flag = FilterBeforeMmIoWrite (FilterWidth16, Address, &Value);
+ if (Flag) {
+ MmioWrite16Internal (Address, Value);
+ }
+ FilterAfterMmIoWrite (FilterWidth16, Address, &Value);
+
return Value;
}
/**
Reads a 32-bit MMIO register.
@@ -642,13 +674,22 @@ UINT32
EFIAPI
MmioRead32 (
IN UINTN Address
)
{
+ BOOLEAN Flag;
+ UINT32 Value;
+
ASSERT ((Address & 3) == 0);
- return MmioRead32Internal (Address);
+ Flag = FilterBeforeMmIoRead (FilterWidth32, Address, &Value);
+ if (Flag) {
+ Value = MmioRead32Internal (Address);
+ }
+ FilterAfterMmIoRead (FilterWidth32, Address, &Value);
+
+ return Value;
}
/**
Writes a 32-bit MMIO register.
@@ -667,13 +708,20 @@ EFIAPI
MmioWrite32 (
IN UINTN Address,
IN UINT32 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 3) == 0);
- MmioWrite32Internal (Address, Value);
+ Flag = FilterBeforeMmIoWrite (FilterWidth32, Address, &Value);
+ if (Flag) {
+ MmioWrite32Internal (Address, Value);
+ }
+ FilterAfterMmIoWrite (FilterWidth32, Address, &Value);
+
return Value;
}
/**
Reads a 64-bit MMIO register.
@@ -693,13 +741,22 @@ UINT64
EFIAPI
MmioRead64 (
IN UINTN Address
)
{
+ BOOLEAN Flag;
+ UINT64 Value;
+
ASSERT ((Address & 7) == 0);
- return MmioRead64Internal (Address);
+ Flag = FilterBeforeMmIoRead (FilterWidth64, Address, &Value);
+ if (Flag) {
+ Value = MmioRead64Internal (Address);
+ }
+ FilterAfterMmIoRead (FilterWidth64, Address, &Value);
+
+ return Value;
}
/**
Writes a 64-bit MMIO register.
@@ -718,10 +775,17 @@ EFIAPI
MmioWrite64 (
IN UINTN Address,
IN UINT64 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 7) == 0);
- MmioWrite64Internal (Address, Value);
+ Flag = FilterBeforeMmIoWrite (FilterWidth64, Address, &Value);
+ if (Flag) {
+ MmioWrite64Internal (Address, Value);
+ }
+ FilterAfterMmIoWrite (FilterWidth64, Address, &Value);
+
return Value;
}
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
index b3a1a20256..ecf9ed6191 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
+++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c
@@ -8,11 +8,11 @@
with EFIAPI assembler.
We don't advocate putting compiler specifics in libraries or drivers but there
is no other way to make this work.
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -37,12 +37,18 @@ EFIAPI
IoRead8 (
IN UINTN Port
)
{
UINT8 Data;
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeIoRead (FilterWidth8, Port, &Data);
+ if (Flag) {
+ __asm__ __volatile__ ("inb %w1,%b0" : "=a" (Data) : "d" ((UINT16)Port));
+ }
+ FilterAfterIoRead (FilterWidth8, Port, &Data);
- __asm__ __volatile__ ("inb %w1,%b0" : "=a" (Data) : "d" ((UINT16)Port));
return Data;
}
/**
Writes an 8-bit I/O port.
@@ -64,11 +70,18 @@ EFIAPI
IoWrite8 (
IN UINTN Port,
IN UINT8 Value
)
{
- __asm__ __volatile__ ("outb %b0,%w1" : : "a" (Value), "d" ((UINT16)Port));
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeIoWrite (FilterWidth8, Port, &Value);
+ if (Flag) {
+ __asm__ __volatile__ ("outb %b0,%w1" : : "a" (Value), "d" ((UINT16)Port));
+ }
+ FilterAfterIoWrite (FilterWidth8, Port, &Value);
+
return Value;;
}
/**
Reads a 16-bit I/O port.
@@ -90,13 +103,20 @@ EFIAPI
IoRead16 (
IN UINTN Port
)
{
UINT16 Data;
+ BOOLEAN Flag;
ASSERT ((Port & 1) == 0);
- __asm__ __volatile__ ("inw %w1,%w0" : "=a" (Data) : "d" ((UINT16)Port));
+
+ Flag = FilterBeforeIoRead (FilterWidth16, Port, &Data);
+ if (Flag) {
+ __asm__ __volatile__ ("inw %w1,%w0" : "=a" (Data) : "d" ((UINT16)Port));
+ }
+ FilterAfterIoRead (FilterWidth16, Port, &Data);
+
return Data;
}
/**
Writes a 16-bit I/O port.
@@ -119,12 +139,21 @@ EFIAPI
IoWrite16 (
IN UINTN Port,
IN UINT16 Value
)
{
+
+ BOOLEAN Flag;
+
ASSERT ((Port & 1) == 0);
- __asm__ __volatile__ ("outw %w0,%w1" : : "a" (Value), "d" ((UINT16)Port));
+
+ Flag = FilterBeforeIoWrite (FilterWidth16, Port, &Value);
+ if (Flag) {
+ __asm__ __volatile__ ("outw %w0,%w1" : : "a" (Value), "d" ((UINT16)Port));
+ }
+ FilterAfterIoWrite (FilterWidth16, Port, &Value);
+
return Value;;
}
/**
Reads a 32-bit I/O port.
@@ -146,13 +175,20 @@ EFIAPI
IoRead32 (
IN UINTN Port
)
{
UINT32 Data;
+ BOOLEAN Flag;
ASSERT ((Port & 3) == 0);
- __asm__ __volatile__ ("inl %w1,%0" : "=a" (Data) : "d" ((UINT16)Port));
+
+ Flag = FilterBeforeIoRead (FilterWidth32, Port, &Data);
+ if (Flag) {
+ __asm__ __volatile__ ("inl %w1,%0" : "=a" (Data) : "d" ((UINT16)Port));
+ }
+ FilterAfterIoRead (FilterWidth32, Port, &Data);
+
return Data;
}
/**
Writes a 32-bit I/O port.
@@ -175,10 +211,18 @@ EFIAPI
IoWrite32 (
IN UINTN Port,
IN UINT32 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Port & 3) == 0);
- __asm__ __volatile__ ("outl %0,%w1" : : "a" (Value), "d" ((UINT16)Port));
+
+ Flag = FilterBeforeIoWrite (FilterWidth32, Port, &Value);
+ if (Flag) {
+ __asm__ __volatile__ ("outl %0,%w1" : : "a" (Value), "d" ((UINT16)Port));
+ }
+ FilterAfterIoWrite (FilterWidth32, Port, &Value);
+
return Value;
}
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c
index 769dddfce2..d2bc5f527c 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c
+++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c
@@ -6,11 +6,11 @@
overhead.
We don't advocate putting compiler specifics in libraries or drivers but there
is no other way to make this work.
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -64,14 +64,20 @@ EFIAPI
IoRead8 (
IN UINTN Port
)
{
UINT8 Value;
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeIoRead (FilterWidth8, Port, &Value);
+ if (Flag) {
+ _ReadWriteBarrier ();
+ Value = (UINT8)_inp ((UINT16)Port);
+ _ReadWriteBarrier ();
+ }
+ FilterAfterIoRead (FilterWidth8, Port, &Value);
- _ReadWriteBarrier ();
- Value = (UINT8)_inp ((UINT16)Port);
- _ReadWriteBarrier ();
return Value;
}
/**
Writes an 8-bit I/O port.
@@ -93,13 +99,20 @@ EFIAPI
IoWrite8 (
IN UINTN Port,
IN UINT8 Value
)
{
- _ReadWriteBarrier ();
- (UINT8)_outp ((UINT16)Port, Value);
- _ReadWriteBarrier ();
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeIoWrite(FilterWidth8, Port, &Value);
+ if (Flag) {
+ _ReadWriteBarrier ();
+ (UINT8)_outp ((UINT16)Port, Value);
+ _ReadWriteBarrier ();
+ }
+ FilterAfterIoWrite (FilterWidth8, Port, &Value);
+
return Value;
}
/**
Reads a 16-bit I/O port.
@@ -121,15 +134,22 @@ EFIAPI
IoRead16 (
IN UINTN Port
)
{
UINT16 Value;
+ BOOLEAN Flag;
ASSERT ((Port & 1) == 0);
- _ReadWriteBarrier ();
- Value = _inpw ((UINT16)Port);
- _ReadWriteBarrier ();
+
+ Flag = FilterBeforeIoRead (FilterWidth16, Port, &Value);
+ if (Flag) {
+ _ReadWriteBarrier ();
+ Value = _inpw ((UINT16)Port);
+ _ReadWriteBarrier ();
+ }
+ FilterBeforeIoRead (FilterWidth16, Port, &Value);
+
return Value;
}
/**
Writes a 16-bit I/O port.
@@ -152,14 +172,22 @@ EFIAPI
IoWrite16 (
IN UINTN Port,
IN UINT16 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Port & 1) == 0);
- _ReadWriteBarrier ();
- _outpw ((UINT16)Port, Value);
- _ReadWriteBarrier ();
+
+ Flag = FilterBeforeIoWrite(FilterWidth16, Port, &Value);
+ if (Flag) {
+ _ReadWriteBarrier ();
+ _outpw ((UINT16)Port, Value);
+ _ReadWriteBarrier ();
+ }
+ FilterAfterIoWrite (FilterWidth16, Port, &Value);
+
return Value;
}
/**
Reads a 32-bit I/O port.
@@ -181,15 +209,22 @@ EFIAPI
IoRead32 (
IN UINTN Port
)
{
UINT32 Value;
+ BOOLEAN Flag;
ASSERT ((Port & 3) == 0);
- _ReadWriteBarrier ();
- Value = _inpd ((UINT16)Port);
- _ReadWriteBarrier ();
+
+ Flag = FilterBeforeIoRead(FilterWidth32, Port, &Value);
+ if (Flag) {
+ _ReadWriteBarrier ();
+ Value = _inpd ((UINT16)Port);
+ _ReadWriteBarrier ();
+ }
+ FilterAfterIoRead (FilterWidth32, Port, &Value);
+
return Value;
}
/**
Writes a 32-bit I/O port.
@@ -212,11 +247,19 @@ EFIAPI
IoWrite32 (
IN UINTN Port,
IN UINT32 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Port & 3) == 0);
- _ReadWriteBarrier ();
- _outpd ((UINT16)Port, Value);
- _ReadWriteBarrier ();
+
+ Flag = FilterBeforeIoWrite(FilterWidth32, Port, &Value);
+ if (Flag) {
+ _ReadWriteBarrier ();
+ _outpd ((UINT16)Port, Value);
+ _ReadWriteBarrier ();
+ }
+ FilterAfterIoWrite (FilterWidth32, Port, &Value);
+
return Value;
}
diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c b/MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c
index a107136a74..937d6c5a55 100644
--- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c
+++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c
@@ -1,10 +1,10 @@
/** @file
I/O library for non I/O read and write access (memory map I/O read and
write only) architecture, such as ARM and RISC-V processor.
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -406,12 +406,18 @@ EFIAPI
MmioRead8 (
IN UINTN Address
)
{
UINT8 Value;
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMmIoRead (FilterWidth8, Address, &Value);
+ if (Flag {
+ Value = *(volatile UINT8*)Address;
+ }
+ FilterAfterMmIoRead (FilterWidth8, Address, &Value);
- Value = *(volatile UINT8*)Address;
return Value;
}
/**
Writes an 8-bit MMIO register.
@@ -431,11 +437,18 @@ EFIAPI
MmioWrite8 (
IN UINTN Address,
IN UINT8 Value
)
{
- *(volatile UINT8*)Address = Value;
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMmIoWrite (FilterWidth8, Address, &Value);
+ if (Flag {
+ *(volatile UINT8*)Address = Value;
+ }
+ FilterAfterMmIoWrite (FilterWidth8, Address, &Value);
+
return Value;
}
/**
Reads a 16-bit MMIO register.
@@ -456,13 +469,20 @@ EFIAPI
MmioRead16 (
IN UINTN Address
)
{
UINT16 Value;
+ BOOLEAN Flag;
ASSERT ((Address & 1) == 0);
- Value = *(volatile UINT16*)Address;
+
+ Flag = FilterBeforeMmIoRead (FilterWidth16, Address, &Value);
+ if (Flag {
+ Value = *(volatile UINT16*)Address;
+ }
+ FilterAfterMmIoRead (FilterWidth16, Address, &Value);
+
return Value;
}
/**
Writes a 16-bit MMIO register.
@@ -482,12 +502,20 @@ EFIAPI
MmioWrite16 (
IN UINTN Address,
IN UINT16 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 1) == 0);
- *(volatile UINT16*)Address = Value;
+
+ Flag = FilterBeforeMmIoWrite (FilterWidth16, Address, &Value);
+ if (Flag {
+ *(volatile UINT16*)Address = Value;
+ }
+ FilterAfterMmIoWrite (FilterWidth16, Address, &Value);
+
return Value;
}
/**
Reads a 32-bit MMIO register.
@@ -508,13 +536,20 @@ EFIAPI
MmioRead32 (
IN UINTN Address
)
{
UINT32 Value;
+ BOOLEAN Flag;
ASSERT ((Address & 3) == 0);
- Value = *(volatile UINT32*)Address;
+
+ Flag = FilterBeforeMmIoRead (FilterWidth32, Address, &Value);
+ if (Flag {
+ Value = *(volatile UINT32*)Address;
+ }
+ FilterAfterMmIoRead (FilterWidth32, Address, &Value);
+
return Value;
}
/**
Writes a 32-bit MMIO register.
@@ -534,12 +569,20 @@ EFIAPI
MmioWrite32 (
IN UINTN Address,
IN UINT32 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 3) == 0);
+
+ Flag = FilterBeforeMmIoWrite (FilterWidth32, Address, &Value);
+ if (Flag {
*(volatile UINT32*)Address = Value;
+ }
+ FilterAfterMmIoWrite (FilterWidth32, Address, &Value);
+
return Value;
}
/**
Reads a 64-bit MMIO register.
@@ -560,13 +603,20 @@ EFIAPI
MmioRead64 (
IN UINTN Address
)
{
UINT64 Value;
+ BOOLEAN Flag;
ASSERT ((Address & 7) == 0);
- Value = *(volatile UINT64*)Address;
+
+ Flag = FilterBeforeMmIoRead (FilterWidth64, Address, &Value);
+ if (Flag {
+ Value = *(volatile UINT64*)Address;
+ }
+ FilterAfterMmIoRead (FilterWidth64, Address, &Value);
+
return Value;
}
/**
Writes a 64-bit MMIO register.
@@ -586,10 +636,18 @@ EFIAPI
MmioWrite64 (
IN UINTN Address,
IN UINT64 Value
)
{
+ BOOLEAN Flag;
+
ASSERT ((Address & 7) == 0);
- *(volatile UINT64*)Address = Value;
+
+ Flag = FilterBeforeMmIoWrite (FilterWidth64, Address, &Value);
+ if (Flag {
+ *(volatile UINT64*)Address = Value;
+ }
+ FilterAfterMmIoWrite (FilterWidth64, Address, &Value);
+
return Value;
}
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* [patch V3 29/29] MdePkg/Baseib: Filter/trace MSR access for IA32/X64
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (27 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 28/29] MdePkg/IoLib: Filter/trace port IO/MMIO access Dandan Bi
@ 2021-03-26 7:23 ` Dandan Bi
2021-03-26 7:57 ` [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Ard Biesheuvel
29 siblings, 0 replies; 34+ messages in thread
From: Dandan Bi @ 2021-03-26 7:23 UTC (permalink / raw)
To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
---
MdePkg/Library/BaseLib/BaseLib.inf | 5 ++-
MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c | 38 +++++++++++-------
MdePkg/Library/BaseLib/Ia32/ReadMsr64.c | 38 ++++++++++++++++--
MdePkg/Library/BaseLib/Ia32/WriteMsr64.c | 22 +++++++----
MdePkg/Library/BaseLib/X64/GccInlinePriv.c | 43 ++++++++++++++-------
MdePkg/Library/BaseLib/X64/ReadMsr64.c | 15 ++++++-
MdePkg/Library/BaseLib/X64/WriteMsr64.c | 13 ++++++-
7 files changed, 130 insertions(+), 44 deletions(-)
diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf
index 3b85c56c3c..58e29cc7af 100644
--- a/MdePkg/Library/BaseLib/BaseLib.inf
+++ b/MdePkg/Library/BaseLib/BaseLib.inf
@@ -1,9 +1,9 @@
## @file
# Base Library implementation.
#
-# Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
# Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -409,10 +409,13 @@ [Packages]
[LibraryClasses]
PcdLib
DebugLib
BaseMemoryLib
+[LibraryClasses.X64, LibraryClasses.IA32]
+ RegisterFilterLib
+
[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength ## SOMETIMES_CONSUMES
gEfiMdePkgTokenSpaceGuid.PcdControlFlowEnforcementPropertyMask ## SOMETIMES_CONSUMES
diff --git a/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c b/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c
index 30aa63243b..40e8c08beb 100644
--- a/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c
+++ b/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c
@@ -1,17 +1,18 @@
/** @file
GCC inline implementation of BaseLib processor specific functions that use
privlidged instructions.
- Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "BaseLibInternals.h"
+#include <Library/RegisterFilterLib.h>
/**
Enables CPU interrupts.
Enables CPU interrupts.
@@ -61,16 +62,21 @@ EFIAPI
AsmReadMsr64 (
IN UINT32 Index
)
{
UINT64 Data;
-
- __asm__ __volatile__ (
- "rdmsr"
- : "=A" (Data) // %0
- : "c" (Index) // %1
- );
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMsrRead (Index, &Data);
+ if (Flag) {
+ __asm__ __volatile__ (
+ "rdmsr"
+ : "=A" (Data) // %0
+ : "c" (Index) // %1
+ );
+ }
+ FilterAfterMsrRead (Index, &Data);
return Data;
}
/**
@@ -95,16 +101,22 @@ EFIAPI
AsmWriteMsr64 (
IN UINT32 Index,
IN UINT64 Value
)
{
- __asm__ __volatile__ (
- "wrmsr"
- :
- : "c" (Index),
- "A" (Value)
- );
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMsrWrite (Index, &Value);
+ if (Flag) {
+ __asm__ __volatile__ (
+ "wrmsr"
+ :
+ : "c" (Index),
+ "A" (Value)
+ );
+ }
+ FilterAfterMsrWrite (Index, &Value);
return Value;
}
/**
diff --git a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c b/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
index 6d2394b1a3..afe3aa5bdc 100644
--- a/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
+++ b/MdePkg/Library/BaseLib/Ia32/ReadMsr64.c
@@ -1,15 +1,15 @@
/** @file
AsmReadMsr64 function
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-
+#include <Library/RegisterFilterLib.h>
/**
Returns a 64-bit Machine Specific Register(MSR).
Reads and returns the 64-bit MSR specified by Index. No parameter checking is
@@ -22,16 +22,46 @@
@return The value of the MSR identified by Index.
**/
UINT64
-EFIAPI
-AsmReadMsr64 (
+AsmReadMsr64Internal (
IN UINT32 Index
)
{
_asm {
mov ecx, Index
rdmsr
}
}
+/**
+ Returns a 64-bit Machine Specific Register(MSR).
+
+ Reads and returns the 64-bit MSR specified by Index. No parameter checking is
+ performed on Index, and some Index values may cause CPU exceptions. The
+ caller must either guarantee that Index is valid, or the caller must set up
+ exception handlers to catch the exceptions. This function is only available
+ on IA-32 and x64.
+
+ @param Index The 32-bit MSR index to read.
+
+ @return The value of the MSR identified by Index.
+
+**/
+UINT64
+EFIAPI
+AsmReadMsr64 (
+ IN UINT32 Index
+ )
+{
+ UINT64 Value;
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMsrRead (Index, &Value);
+ if (Flag) {
+ Value = AsmReadMsr64Internal (Index);
+ }
+ FilterAfterMsrRead (Index, &Value);
+
+ return Value;
+}
diff --git a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c b/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
index badf1d8e58..ba0cf3f74c 100644
--- a/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
+++ b/MdePkg/Library/BaseLib/Ia32/WriteMsr64.c
@@ -1,15 +1,15 @@
/** @file
AsmWriteMsr64 function
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
-
+#include <Library/RegisterFilterLib.h>
/**
Writes a 64-bit value to a Machine Specific Register(MSR), and returns the
value.
@@ -31,13 +31,21 @@ EFIAPI
AsmWriteMsr64 (
IN UINT32 Index,
IN UINT64 Value
)
{
- _asm {
- mov edx, dword ptr [Value + 4]
- mov eax, dword ptr [Value + 0]
- mov ecx, Index
- wrmsr
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMsrWrite (Index, &Value);
+ if (Flag) {
+ _asm {
+ mov edx, dword ptr [Value + 4]
+ mov eax, dword ptr [Value + 0]
+ mov ecx, Index
+ wrmsr
+ }
}
+ FilterAfterMsrWrite (Index, &Value);
+
+ return Value;
}
diff --git a/MdePkg/Library/BaseLib/X64/GccInlinePriv.c b/MdePkg/Library/BaseLib/X64/GccInlinePriv.c
index 98be19b3c7..e4920f2116 100644
--- a/MdePkg/Library/BaseLib/X64/GccInlinePriv.c
+++ b/MdePkg/Library/BaseLib/X64/GccInlinePriv.c
@@ -1,17 +1,18 @@
/** @file
GCC inline implementation of BaseLib processor specific functions that use
privlidged instructions.
- Copyright (c) 2006 - 2020, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "BaseLibInternals.h"
+#include <Library/RegisterFilterLib.h>
/**
Enables CPU interrupts.
Enables CPU interrupts.
@@ -62,17 +63,24 @@ AsmReadMsr64 (
IN UINT32 Index
)
{
UINT32 LowData;
UINT32 HighData;
-
- __asm__ __volatile__ (
- "rdmsr"
- : "=a" (LowData), // %0
- "=d" (HighData) // %1
- : "c" (Index) // %2
- );
+ UINT64 Value;
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMsrRead (Index, &Value);
+ if (Flag) {
+ __asm__ __volatile__ (
+ "rdmsr"
+ : "=a" (LowData), // %0
+ "=d" (HighData) // %1
+ : "c" (Index) // %2
+ );
+ Value = (((UINT64)HighData) << 32) | LowData;
+ }
+ FilterAfterMsrRead (Index, &Value);
return (((UINT64)HighData) << 32) | LowData;
}
/**
@@ -99,21 +107,26 @@ AsmWriteMsr64 (
IN UINT64 Value
)
{
UINT32 LowData;
UINT32 HighData;
+ BOOLEAN Flag;
LowData = (UINT32)(Value);
HighData = (UINT32)(Value >> 32);
- __asm__ __volatile__ (
- "wrmsr"
- :
- : "c" (Index),
- "a" (LowData),
- "d" (HighData)
- );
+ Flag = FilterBeforeMsrWrite (Index, &Value);
+ if (Flag) {
+ __asm__ __volatile__ (
+ "wrmsr"
+ :
+ : "c" (Index),
+ "a" (LowData),
+ "d" (HighData)
+ );
+ }
+ FilterAfterMsrWrite (Index, &Value);
return Value;
}
/**
diff --git a/MdePkg/Library/BaseLib/X64/ReadMsr64.c b/MdePkg/Library/BaseLib/X64/ReadMsr64.c
index 5ee7ca53f3..36a349432c 100644
--- a/MdePkg/Library/BaseLib/X64/ReadMsr64.c
+++ b/MdePkg/Library/BaseLib/X64/ReadMsr64.c
@@ -1,17 +1,19 @@
/** @file
CpuBreakpoint function.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
/**
Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
**/
+#include <Library/RegisterFilterLib.h>
+
unsigned __int64 __readmsr (int register);
#pragma intrinsic(__readmsr)
/**
@@ -26,8 +28,17 @@ UINT64
EFIAPI
AsmReadMsr64 (
IN UINT32 Index
)
{
- return __readmsr (Index);
+ UINT64 Value;
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMsrRead (Index, &Value);
+ if (Flag) {
+ Value = __readmsr (Index);
+ }
+ FilterAfterMsrRead (Index, &Value);
+
+ return Value;
}
diff --git a/MdePkg/Library/BaseLib/X64/WriteMsr64.c b/MdePkg/Library/BaseLib/X64/WriteMsr64.c
index 98c5458d8a..bb030832c4 100644
--- a/MdePkg/Library/BaseLib/X64/WriteMsr64.c
+++ b/MdePkg/Library/BaseLib/X64/WriteMsr64.c
@@ -1,17 +1,19 @@
/** @file
CpuBreakpoint function.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
/**
Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
**/
+#include <Library/RegisterFilterLib.h>
+
void __writemsr (unsigned long Register, unsigned __int64 Value);
#pragma intrinsic(__writemsr)
/**
@@ -28,9 +30,16 @@ EFIAPI
AsmWriteMsr64 (
IN UINT32 Index,
IN UINT64 Value
)
{
- __writemsr (Index, Value);
+ BOOLEAN Flag;
+
+ Flag = FilterBeforeMsrWrite (Index, &Value);
+ if (Flag) {
+ __writemsr (Index, Value);
+ }
+ FilterAfterMsrWrite (Index, &Value);
+
return Value;
}
--
2.18.0.windows.1
^ permalink raw reply related [flat|nested] 34+ messages in thread
* Re: [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
` (28 preceding siblings ...)
2021-03-26 7:23 ` [patch V3 29/29] MdePkg/Baseib: Filter/trace MSR access for IA32/X64 Dandan Bi
@ 2021-03-26 7:57 ` Ard Biesheuvel
29 siblings, 0 replies; 34+ messages in thread
From: Ard Biesheuvel @ 2021-03-26 7:57 UTC (permalink / raw)
To: Dandan Bi
Cc: devel, Michael D Kinney, Sean Brogan, Bret Barkelew,
Leif Lindholm, Ard Biesheuvel, Laszlo Ersek, Jiewen Yao,
Jian J Wang, Sami Mujawar, Alexei Fedorov, Andrew Fish, Ray Ni,
Chasel Chiu, Nate DeSimone, Star Zeng, Zhichao Gao, Hao A Wu,
Maurice Ma, Guo Dong, Benjamin You, Eric Dong, Maciej Rabeda,
Jiaxin Wu, Siyuan Fu, Jordan Justen, Supreeth Venkatesh,
Abner Chang, Nickle Wang, Liming Gao, Zhiguang Liu
On Fri, 26 Mar 2021 at 08:24, Dandan Bi <dandan.bi@intel.com> wrote:
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
> RFC: https://edk2.groups.io/g/devel/message/72530
> Branch for this change: https://github.com/dandanbi/edk2/tree/RegisterFilterLibV3
>
> Patch 1 is to add RegisterFilterLib Library Class in edk2 to filter/trace port IO/MMIO/MSR access and add a RegisterFilterLibNull instance.
> Patch 2 is to add the MdeLibs.dsc.inc file to MdePkg for some default libraries provided by MdePkg and add RegisterFilterLib into it as the first version of MdeLibs.dsc.inc.
> Last 2 patches are to update APIs in IoLib and BaseLib to filter/trace port IO/MMIO/MSR access.
> Remaining patches are to update related dsc files to consume MdeLibs.dsc.inc for RegisterFilterLib.
> Will submit patch 1 and 2 firstly.
> And then update related dsc files in edk2 and edk2platform repo to consume MdeLibs.dsc.inc for RegisterFilterLib.
> At last will submit the patches to update IoLib and BaseLib to filter/trace port IO/MMIO/MSR access.
> --
> V3:
> 1. Don't assume Library instances in MdeLibs.dsc.inc are must in common [LibraryClasses] section.
> Can specify different [LibraryClasses] section for the libary instances in MdeLibs.dsc.inc.
> 2. Update plaftom dsc to consume the MdeLibs.dsc outside the [LibraryClasses] section.
> 3. Pick up the R-B for patch 1, patch 28, patch 29.
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Sami Mujawar <Sami.Mujawar@arm.com>
> Cc: Alexei Fedorov <Alexei.Fedorov@arm.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Cc: Zhichao Gao <zhichao.gao@intel.com>
> Cc: Hao A Wu <hao.a.wu@intel.com>
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com>
> Cc: Jiaxin Wu <jiaxin.wu@intel.com>
> Cc: Siyuan Fu <siyuan.fu@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Supreeth Venkatesh <supreeth.venkatesh@arm.com>
> Cc: Abner Chang <abner.chang@hpe.com>
> Cc: Nickle Wang <nickle.wang@hpe.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
>
> Dandan Bi (29):
> MdePkg: Add RegisterFilterLib class and NULL instance
> MdePkg: Add MdeLibs.dsc.inc file to MdePkg
> ArmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> ArmPlatformPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> ArmVirtPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> CryptoPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> DynamicTablesPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> EmbeddedPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> EmulatorPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> FatPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> FmpDevicePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> IntelFsp2Pkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> IntelFsp2WrapperPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> MdeModulePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> MdePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> NetworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> OvmfPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> PcAtChipsetPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> RedfishPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> SecurityPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> ShellPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> SignedCapsulePkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> SourceLevelDebugPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> StandaloneMmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> UefiCpuPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> UefiPayloadPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> UnitTestFrameworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
> MdePkg/IoLib: Filter/trace port IO/MMIO access
> MdePkg/Baseib: Filter/trace MSR access for IA32/X64
>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
> ArmPkg/ArmPkg.dsc | 2 +
> ArmPlatformPkg/ArmPlatformPkg.dsc | 2 +
> ArmVirtPkg/ArmVirt.dsc.inc | 4 +-
> CryptoPkg/CryptoPkg.dsc | 5 +-
> DynamicTablesPkg/DynamicTablesPkg.dsc | 2 +
> EmbeddedPkg/EmbeddedPkg.dsc | 5 +-
> EmulatorPkg/EmulatorPkg.dsc | 4 +-
> FatPkg/FatPkg.dsc | 4 +-
> FmpDevicePkg/FmpDevicePkg.dsc | 4 +-
> IntelFsp2Pkg/IntelFsp2Pkg.dsc | 4 +-
> IntelFsp2Pkg/Tools/Tests/QemuFspPkg.dsc | 2 +
> IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 4 +-
> MdeModulePkg/MdeModulePkg.dsc | 4 +-
> MdePkg/Include/Library/RegisterFilterLib.h | 243 ++++++++++++++++
> .../BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 3 +-
> .../BaseIoLibIntrinsicArmVirt.inf | 3 +-
> .../BaseIoLibIntrinsicInternal.h | 3 +-
> .../BaseIoLibIntrinsicSev.inf | 3 +-
> MdePkg/Library/BaseIoLibIntrinsic/IoLib.c | 95 ++++--
> .../Library/BaseIoLibIntrinsic/IoLibArmVirt.c | 82 +++++-
> MdePkg/Library/BaseIoLibIntrinsic/IoLibGcc.c | 58 +++-
> MdePkg/Library/BaseIoLibIntrinsic/IoLibMsc.c | 81 ++++--
> MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c | 74 ++++-
> MdePkg/Library/BaseLib/BaseLib.inf | 5 +-
> MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c | 38 ++-
> MdePkg/Library/BaseLib/Ia32/ReadMsr64.c | 38 ++-
> MdePkg/Library/BaseLib/Ia32/WriteMsr64.c | 22 +-
> MdePkg/Library/BaseLib/X64/GccInlinePriv.c | 43 ++-
> MdePkg/Library/BaseLib/X64/ReadMsr64.c | 15 +-
> MdePkg/Library/BaseLib/X64/WriteMsr64.c | 13 +-
> .../RegisterFilterLibNull.c | 271 ++++++++++++++++++
> .../RegisterFilterLibNull.inf | 23 ++
> .../RegisterFilterLibNull.uni | 13 +
> MdePkg/MdeLibs.dsc.inc | 15 +
> MdePkg/MdePkg.dec | 7 +-
> MdePkg/MdePkg.dsc | 6 +-
> NetworkPkg/NetworkPkg.dsc | 4 +-
> OvmfPkg/AmdSev/AmdSevX64.dsc | 5 +-
> OvmfPkg/Bhyve/BhyveX64.dsc | 5 +-
> OvmfPkg/OvmfPkgIa32.dsc | 5 +-
> OvmfPkg/OvmfPkgIa32X64.dsc | 5 +-
> OvmfPkg/OvmfPkgX64.dsc | 5 +-
> OvmfPkg/OvmfXen.dsc | 5 +-
> PcAtChipsetPkg/PcAtChipsetPkg.dsc | 4 +-
> RedfishPkg/RedfishPkg.dsc | 4 +-
> SecurityPkg/SecurityPkg.dsc | 4 +-
> ShellPkg/ShellPkg.dsc | 4 +-
> SignedCapsulePkg/SignedCapsulePkg.dsc | 4 +-
> SourceLevelDebugPkg/SourceLevelDebugPkg.dsc | 4 +-
> StandaloneMmPkg/StandaloneMmPkg.dsc | 5 +-
> UefiCpuPkg/UefiCpuPkg.dsc | 4 +-
> UefiPayloadPkg/UefiPayloadPkg.dsc | 5 +-
> .../UnitTestFrameworkPkgTarget.dsc.inc | 4 +-
> 53 files changed, 1131 insertions(+), 145 deletions(-)
> create mode 100644 MdePkg/Include/Library/RegisterFilterLib.h
> create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.c
> create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
> create mode 100644 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.uni
> create mode 100644 MdePkg/MdeLibs.dsc.inc
>
> --
> 2.18.0.windows.1
>
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [patch V3 13/29] IntelFsp2WrapperPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 ` [patch V3 13/29] IntelFsp2WrapperPkg: " Dandan Bi
@ 2021-03-26 8:11 ` Chiu, Chasel
0 siblings, 0 replies; 34+ messages in thread
From: Chiu, Chasel @ 2021-03-26 8:11 UTC (permalink / raw)
To: Bi, Dandan, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L, Zeng, Star
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
> -----Original Message-----
> From: Bi, Dandan <dandan.bi@intel.com>
> Sent: Friday, March 26, 2021 3:24 PM
> To: devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Zeng, Star <star.zeng@intel.com>
> Subject: [patch V3 13/29] IntelFsp2WrapperPkg: Consume MdeLibs.dsc.inc for
> RegisterFilterLib
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
>
> MdeLibs.dsc.inc was added for some basic/default library instances provided by
> MdePkg and RegisterFilterLibNull Library was also added into it as the first
> version of MdeLibs.dsc.inc.
>
> So update platform dsc to consume MdeLibs.dsc.inc for RegisterFilterLibNull
> which will be consumed by IoLib and BaseLib.
>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Star Zeng <star.zeng@intel.com>
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
> IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> index 738342b69b..21e089000e 100644
> --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dsc
> @@ -1,9 +1,9 @@
> ## @file
> # Provides drivers and definitions to support fsp in EDKII bios.
> #
> -# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2014 - 2021, Intel Corporation. All rights
> +reserved.<BR>
> # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
>
> [Defines]
> @@ -14,10 +14,12 @@ [Defines]
> OUTPUT_DIRECTORY = Build/IntelFsp2WrapperPkg
> SUPPORTED_ARCHITECTURES = IA32|X64
> BUILD_TARGETS = DEBUG|RELEASE|NOOPT
> SKUID_IDENTIFIER = DEFAULT
>
> +!include MdePkg/MdeLibs.dsc.inc
> +
> [LibraryClasses]
> BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
> BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> --
> 2.18.0.windows.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [patch V3 26/29] UefiPayloadPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 ` [patch V3 26/29] UefiPayloadPkg: " Dandan Bi
@ 2021-03-26 14:39 ` Guo Dong
0 siblings, 0 replies; 34+ messages in thread
From: Guo Dong @ 2021-03-26 14:39 UTC (permalink / raw)
To: Bi, Dandan, devel@edk2.groups.io; +Cc: Ma, Maurice, You, Benjamin
Reviewed-by: Guo Dong <guo.dong@intel.com>
> -----Original Message-----
> From: Bi, Dandan <dandan.bi@intel.com>
> Sent: Friday, March 26, 2021 12:24 AM
> To: devel@edk2.groups.io
> Cc: Ma, Maurice <maurice.ma@intel.com>; Dong, Guo
> <guo.dong@intel.com>; You, Benjamin <benjamin.you@intel.com>
> Subject: [patch V3 26/29] UefiPayloadPkg: Consume MdeLibs.dsc.inc for
> RegisterFilterLib
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
>
> MdeLibs.dsc.inc was added for some basic/default library
> instances provided by MdePkg and RegisterFilterLibNull Library
> was also added into it as the first version of MdeLibs.dsc.inc.
>
> So update platform dsc to consume MdeLibs.dsc.inc for
> RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
>
> Cc: Maurice Ma <maurice.ma@intel.com>
> Cc: Guo Dong <guo.dong@intel.com>
> Cc: Benjamin You <benjamin.you@intel.com>
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
> UefiPayloadPkg/UefiPayloadPkg.dsc | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc
> b/UefiPayloadPkg/UefiPayloadPkg.dsc
> index 23edd163e9..e3b017858e 100644
> --- a/UefiPayloadPkg/UefiPayloadPkg.dsc
> +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc
> @@ -1,11 +1,11 @@
> ## @file
> # Bootloader Payload Package
> #
> # Provides drivers and definitions to create uefi payload for bootloaders.
> #
> -# Copyright (c) 2014 - 2020, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.<BR>
> # Copyright (c) Microsoft Corporation.
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #
> ##
>
> @@ -111,10 +111,13 @@ [SkuIds]
>
> ##########################################################
> ######################
> #
> # Library Class section - list of all Library Classes needed by this Platform.
> #
>
> ##########################################################
> ######################
> +
> +!include MdePkg/MdeLibs.dsc.inc
> +
> [LibraryClasses]
> #
> # Entry point
> #
>
> DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint
> .inf
> --
> 2.18.0.windows.1
^ permalink raw reply [flat|nested] 34+ messages in thread
* Re: [patch V3 27/29] UnitTestFrameworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
2021-03-26 7:23 ` [patch V3 27/29] UnitTestFrameworkPkg: " Dandan Bi
@ 2021-03-26 16:35 ` Michael D Kinney
0 siblings, 0 replies; 34+ messages in thread
From: Michael D Kinney @ 2021-03-26 16:35 UTC (permalink / raw)
To: Bi, Dandan, devel@edk2.groups.io, Kinney, Michael D
Cc: Sean Brogan, Bret Barkelew
Dandan,
I am not sure if one dsc.inc file should include another dsc.inc file.
If a package/platform DSC file has a dependency on other packages to build,
then that DSC file can include the dsc.inc files from those dependent packages.
This limits the dsc.inc include depth is 1. Nesting includes of dsc.inc files
increases complexity.
Thanks,
Mike
> -----Original Message-----
> From: Bi, Dandan <dandan.bi@intel.com>
> Sent: Friday, March 26, 2021 12:24 AM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew
> <Bret.Barkelew@microsoft.com>
> Subject: [patch V3 27/29] UnitTestFrameworkPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3246
>
> MdeLibs.dsc.inc was added for some basic/default library
> instances provided by MdePkg and RegisterFilterLibNull Library
> was also added into it as the first version of MdeLibs.dsc.inc.
>
> So update platform dsc to consume MdeLibs.dsc.inc for
> RegisterFilterLibNull which will be consumed by IoLib and BaseLib.
>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
> ---
> UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
> b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
> index 8adf690098..68ad37e989 100644
> --- a/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
> +++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkgTarget.dsc.inc
> @@ -1,13 +1,15 @@
> ## @file
> # UnitTestFrameworkPkg DSC include file for target based test DSC
> #
> -# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
> # SPDX-License-Identifier: BSD-2-Clause-Patent
> #
> ##
>
> +!include MdePkg/MdeLibs.dsc.inc
> +
> [LibraryClasses]
> #
> # Entry point
> #
> PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
> --
> 2.18.0.windows.1
^ permalink raw reply [flat|nested] 34+ messages in thread
end of thread, other threads:[~2021-03-26 16:35 UTC | newest]
Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-26 7:23 [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Dandan Bi
2021-03-26 7:23 ` [patch V3 01/29] MdePkg: Add RegisterFilterLib class and NULL instance Dandan Bi
2021-03-26 7:23 ` [patch V3 02/29] MdePkg: Add MdeLibs.dsc.inc file to MdePkg Dandan Bi
2021-03-26 7:23 ` [patch V3 03/29] ArmPkg: Consume MdeLibs.dsc.inc for RegisterFilterLib Dandan Bi
2021-03-26 7:23 ` [patch V3 04/29] ArmPlatformPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 05/29] ArmVirtPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 06/29] CryptoPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 07/29] DynamicTablesPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 08/29] EmbeddedPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 09/29] EmulatorPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 10/29] FatPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 11/29] FmpDevicePkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 12/29] IntelFsp2Pkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 13/29] IntelFsp2WrapperPkg: " Dandan Bi
2021-03-26 8:11 ` Chiu, Chasel
2021-03-26 7:23 ` [patch V3 14/29] MdeModulePkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 15/29] MdePkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 16/29] NetworkPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 17/29] OvmfPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 18/29] PcAtChipsetPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 19/29] RedfishPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 20/29] SecurityPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 21/29] ShellPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 22/29] SignedCapsulePkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 23/29] SourceLevelDebugPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 24/29] StandaloneMmPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 25/29] UefiCpuPkg: " Dandan Bi
2021-03-26 7:23 ` [patch V3 26/29] UefiPayloadPkg: " Dandan Bi
2021-03-26 14:39 ` Guo Dong
2021-03-26 7:23 ` [patch V3 27/29] UnitTestFrameworkPkg: " Dandan Bi
2021-03-26 16:35 ` Michael D Kinney
2021-03-26 7:23 ` [patch V3 28/29] MdePkg/IoLib: Filter/trace port IO/MMIO access Dandan Bi
2021-03-26 7:23 ` [patch V3 29/29] MdePkg/Baseib: Filter/trace MSR access for IA32/X64 Dandan Bi
2021-03-26 7:57 ` [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox