From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web10.9541.1616745471259663933 for ; Fri, 26 Mar 2021 00:57:51 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MEZQBmzz; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E14661A32 for ; Fri, 26 Mar 2021 07:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616745469; bh=3cBhwITxlVsA0SYZk7Lsp9jy6VXrjPOugmjxEGgSiH4=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MEZQBmzzzleQfFevPGpwnCVVbzQp08TbTdtwQlZK0sqDRYn6LY5fwydWxoBk9g7ms sy7kuU3G+LXEt1EWz1cH3fzMBUVaCPme/97Ib2Pb6IV6u3eiSleIsJQeyD8tHiPcxq jaQ23Fd0hEM99GYiF+7wrwecNnDQ0k/Z8w8PABIRJ5/PBWwUWZap7nuerm5/Wwt6UA 2YGbDhaPLBexDmsMExSZu84Lt5oObkp7jWDm2PVQO0fgqbUatyKMbf4TYVFo9aDOCV xPKidfzNfW8s94NOU4uHMkz2pAgL3/okRfARmo+8TEmyruMisqny0aYYTBMtyYRZ+r OBKGK7oQStwhQ== Received: by mail-ot1-f48.google.com with SMTP id 68-20020a9d0f4a0000b02901b663e6258dso4421156ott.13 for ; Fri, 26 Mar 2021 00:57:49 -0700 (PDT) X-Gm-Message-State: AOAM533M9ZgydlKiiZgknh44xAufIy3o547yC2Uwq1saSkOhBZFCNbVL QM2GwpWoTBBA11rURlar5og93o2nDqvKLBrt6SM= X-Google-Smtp-Source: ABdhPJwWHYydpMjCA4zAC/uwtEhhh/TS+v4ifCwP6MvYJ/jzHL7uHb0b0Dh54njn4FsZ45YitisQ8enmvaDwjKRJFeo= X-Received: by 2002:a9d:600a:: with SMTP id h10mr10256961otj.90.1616745468697; Fri, 26 Mar 2021 00:57:48 -0700 (PDT) MIME-Version: 1.0 References: <20210326072346.4212-1-dandan.bi@intel.com> In-Reply-To: <20210326072346.4212-1-dandan.bi@intel.com> From: "Ard Biesheuvel" Date: Fri, 26 Mar 2021 08:57:37 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [patch V3 00/29] Add a new library class RegisterFilterLib in edk2 to filter/trace port IO/MMIO/MSR access To: Dandan Bi Cc: devel@edk2.groups.io, 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 Content-Type: text/plain; charset="UTF-8" On Fri, 26 Mar 2021 at 08:24, Dandan Bi 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 > Cc: Sean Brogan > Cc: Bret Barkelew > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Laszlo Ersek > Cc: Jiewen Yao > Cc: Jian J Wang > Cc: Sami Mujawar > Cc: Alexei Fedorov > Cc: Andrew Fish > Cc: Ray Ni > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Star Zeng > Cc: Zhichao Gao > Cc: Hao A Wu > Cc: Maurice Ma > Cc: Guo Dong > Cc: Benjamin You > Cc: Eric Dong > Cc: Maciej Rabeda > Cc: Jiaxin Wu > Cc: Siyuan Fu > Cc: Jordan Justen > Cc: Supreeth Venkatesh > Cc: Abner Chang > Cc: Nickle Wang > Cc: Liming Gao > Cc: Zhiguang Liu > > 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 > 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 >