Re: [edk2-devel] RFC: SetVariable callbacks

2023-10-19 Thread Nhi Pham via groups.io

Hi Girish,

I missed your reply. Sorry if I chime in very late, and you started to 
develop toward option 1. There are some cases that we can leverage your 
work here.


Please see inline...

On 9/21/2023 10:58 PM, Girish Mahadevan wrote:

Hello Nhi,

On 9/21/2023 1:41 AM, Nhi Pham via groups.io wrote:

External email: Use caution opening links or attachments


Can we write a DXE_RUNTIME driver to override the pointers of UEFI
Runtime Get/SetVariable() services? Then, we can add platform specific
or custom implementation before/after calling the original
Get/SetVariable()?



Thanks for the suggestion. This doesn't work for us, we need the 
notifications in StMM, also we'd prefer to get these callbacks from
VariableServiceSetVariable() itself after the basic checks for the set 
var are done (similar to how VarCheckLib is called)


That makes sense. Thanks!



Best Regards
Girish


Regards,
Nhi

On 9/21/2023 3:27 AM, Girish Mahadevan via groups.io wrote:

Hello

We have a requirement to monitor setVariable calls, we'd like to get a
callback before and after the variable update.

Similar to VarCheckLib, except that VarCheckLib's set callbacks are
called after endOfDxe.

We were thinking of doing something like:

===

--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c
@@ -2853,6 +2853,11 @@ VariableServiceSetVariable (
  return Status;
    }

+  Status = VarPreSetVariableCallback (VariableName, VendorGuid,
Attributes, PayloadSize, (VOID *)((UINTN)Data + DataSize - PayloadSize),
mRequestSource);^M
+  if (EFI_ERROR (Status)) {^M
+    return Status;^M
+  }^M
+^M
    AcquireLockOnlyAtBootTime
(>VariableGlobal.VariableServicesLock);

    //
@@ -2917,6 +2922,8 @@ Done:
    InterlockedDecrement
(>VariableGlobal.ReentrantState);
    ReleaseLockOnlyAtBootTime
(>VariableGlobal.VariableServicesLock);

+  Status = VarPostSetVariableCallback (VariableName, VendorGuid,
Attributes, PayloadSize, (VOID *)((UINTN)Data + DataSize - PayloadSize),
mRequestSource);^M
+^M

==


We were thinking of 4 options:
1. A new Library, platforms can include the Null implementation if they
don't need this.
2. A new protocol that is called from the Variable driver (similar to
the Fvb protocol, we let the Smm/Dxe Variable drivers get this protocol)


This option seems to be able to accommodate more scenarios. For example, 
a platform wants to hook their platform specific implementation based on 
the RT Get/Set Variable services. The feature can reuse the UEFI RT 
service as an interface for Operating System to communicate with UEFI or 
StandaloneMM.


Regards,
Nhi


3. Expand the existing VarCheckLib to include these new callbacks.
(which can be called before end of dxe)
4. Something we don't know about (please let us know)

We are leaning toward option 1. Let us know your thoughts.

Best Regards
Girish














-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109822): https://edk2.groups.io/g/devel/message/109822
Mute This Topic: https://groups.io/mt/101487036/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH V2] Maintainers.txt: Stop to be reviewer of several modules

2023-10-19 Thread Guo, Gua
Reviewed-by: Gua Guo 

From: Kinney, Michael D 
Sent: Friday, October 20, 2023 8:56:26 AM
To: devel@edk2.groups.io ; Ni, Ray 
Cc: Gao, Zhichao ; Wu, Hao A ; Liu, 
Zhiguang ; Guo, Gua ; Kinney, 
Michael D 
Subject: RE: [edk2-devel] [PATCH V2] Maintainers.txt: Stop to be reviewer of 
several modules

Reviewed-by: Michael D Kinney 

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ni, Ray
> Sent: Monday, June 12, 2023 11:36 PM
> To: devel@edk2.groups.io
> Cc: Gao, Zhichao ; Wu, Hao A
> ; Liu, Zhiguang ; Guo, Gua
> 
> Subject: [edk2-devel] [PATCH V2] Maintainers.txt: Stop to be reviewer
> of several modules
>
> Remove my name from reviewer list of following modules:
> * MdeModulePkg: Console and Graphics modules
> * MdeModulePkg: Reset modules
> * MdeModulePkg: Serial modules
> * MdeModulePkg: Universal Payload definitions
>
> Signed-off-by: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Hao A Wu 
> Cc: Zhiguang Liu 
> Cc: Gua Guo 
> ---
>  Maintainers.txt | 4 
>  1 file changed, 4 deletions(-)
>
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 42e40dced3..a523fb41c1 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -294,7 +294,6 @@ F: MdeModulePkg/Library/BaseBmpSupportLib/
>  F: MdeModulePkg/Library/FrameBufferBltLib/
>
>  F: MdeModulePkg/Universal/Console/
>
>  R: Zhichao Gao  [ZhichaoGao]
>
> -R: Ray Ni  [niruiyu]
>
>
>
>  MdeModulePkg: Core services (PEI, DXE and Runtime) modules
>
>  F: MdeModulePkg/*Mem*/
>
> @@ -398,12 +397,10 @@ MdeModulePkg: Reset modules
>  F: MdeModulePkg/*Reset*/
>
>  F: MdeModulePkg/Include/*Reset*.h
>
>  R: Zhichao Gao  [ZhichaoGao]
>
> -R: Ray Ni  [niruiyu]
>
>
>
>  MdeModulePkg: Serial modules
>
>  F: MdeModulePkg/*Serial*/
>
>  F: MdeModulePkg/Include/*SerialPort*.h
>
> -R: Ray Ni  [niruiyu]
>
>  R: Zhichao Gao  [ZhichaoGao]
>
>
>
>  MdeModulePkg: SMBIOS modules
>
> @@ -426,7 +423,6 @@ R: Liming Gao  [lgao4]
>  MdeModulePkg: Universal Payload definitions
>
>  F: MdeModulePkg/Include/UniversalPayload/
>
>  R: Zhiguang Liu  [LiuZhiguang001]
>
> -R: Ray Ni  [niruiyu]
>
>  R: Gua Guo  [gguo11837463]
>
>
>
>  MdeModulePkg: Trace Hub debug message related library instance
>
> --
> 2.37.2.windows.2
>
>
>
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#106051):
> https://edk2.groups.io/g/devel/message/106051
> Mute This Topic: https://groups.io/mt/99500362/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe:
> https://edk2.groups.io/g/devel/leave/3603567/1643496/1659866329/xyzzy
> [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109821): https://edk2.groups.io/g/devel/message/109821
Mute This Topic: https://groups.io/mt/99500362/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Event: TianoCore Community Meeting - APAC/NAMO - Thursday, October 19, 2023 #cal-reminder

2023-10-19 Thread Group Notification
*Reminder: TianoCore Community Meeting - APAC/NAMO*

*When:*
Thursday, October 19, 2023
7:30pm to 8:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d

*Organizer:* Michael Kinney

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=2043510 )

*Description:*



Microsoft Teams meeting

*Join on your computer or mobile app*

Click here to join the meeting ( 
https://teams.microsoft.com/l/meetup-join/19%3ameeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 )

Meeting ID: 283 318 374 436
Passcode: 633zLo

Download Teams ( https://www.microsoft.com/en-us/microsoft-teams/download-app ) 
| Join on the web ( https://www.microsoft.com/microsoft-teams/join-a-meeting )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 119 493 012 8

Alternate VTC instructions ( 
https://conf.intel.com/teams/?conf=1194930128=teams=conf.intel.com=test_call
 )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=6e4ce4c4-1242-431b-9a51-92cd01a5df3c=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_Y2M1NDE3ODYtN2M3Yy00MDMxLTk3OWYtMTlkNjhlNWFlMjA2@thread.v2=0=en-US
 )




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109820): https://edk2.groups.io/g/devel/message/109820
Mute This Topic: https://groups.io/mt/102053192/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v3 0/7] Use CodeQL CLI

2023-10-19 Thread Michael Kubacki
A reminder to review this series. It's been on the mailing list for a 
few weeks now.


Thanks,
Michael

On 10/17/2023 9:04 PM, Michael Kubacki wrote:

From: Michael Kubacki 

CodeQL currently runs via the codeql-analysis.yml GitHub workflow
which uses the github/codeql-action/init@v2 action (pre-build)
and the github/codeql-action/analyze@v2 action (post-build) to
setup the CodeQL environment and extract results.

This infrastructure is removed in preparation for a new design that
will directly run the CodeQL CLI as part of the build. This will
allow CodeQL to be run locally as part of the normal build process
with results that match 1:1 with CI builds.

The CodeQL CLI design is automatically driven by a set of CodeQL
plugins:

   1. `CodeQlBuildPlugin` - Used to produce a CodeQL database from a
   build.
   2. `CodeQlAnalyzePlugin` - Used to analyze a CodeQL database.

This approach offers the following advantages:

   1. Provides exactly the same results locally as on a CI server.
   2. Integrates very well into IDEs such as VS Code.
   3. Very simple to use - just use normal Stuart update and build
  commands.
   4. Very simple to understand - minimally wraps the official CodeQL
  CLI.
   5. Very simple to integrate - works like any other Stuart build
  plugin.
   6. Portable - not tied to Azure DevOps specific, GitHub specific,
  or other host infrastructure.
   7. Versioned - the query and filters are versioned in source
  control so easy to find and track.

The appropriate CodeQL CLI is downloaded for the host OS by passing
the `--codeql` argument to the update command.

   `stuart_update -c .pytool/CISettings.py --codeql`

After that, CodeQL can be run in a build by similarly passing the
`--codeql` argument to the build command. For example:

   `stuart_ci_build -c .pytool/CISettings.py --codeql`

Going forward, CI will simply use those commands in CodeQL builds
to get results instead of the CodeQL GitHub actions.

When `--codeql` is specified in the build command, each package will
contain two main artifacts in the Build directory.

   1. The CodeQL database for the package
   2. The CodeQL SARIF (result) file for the package

The CodeQL database (1) can be used to run queries against without
rebuilding any code. The SARIF result file (2) is the result of
running enabled queries against the database.

SARIF stands for Static Analysis Results Interchange Format and it
is an industry standard format for output from static analysis tools.

https://sarifweb.azurewebsites.net/

The SARIF file can be opened with any standard SARIF file viewer
such as this one for VS Code:

https://marketplace.visualstudio.com/items?itemName=MS-SarifVSCode.sarif-viewer

That includes the ability to jump directly to issues in the source
code file with relevant code highlighted and suggestions included.

This means that after simply adding `--codeql` to the normal build
commands, a database will be present for future querying and a SARIF
result file will be present to allow the developer to immediately
start fixing issues.

More details about the location of these and usage is in the
BaseTools/Plugin/CodeQL/Readme.md included in this patch series.

The CI process pushes the SARIF file to GitHub Code Scanning so the
results are generated exactly the same way they are locally.

All build logs and the SARIF file for each package are uploaded to
the GitHub action run as artifacts. If a CodeQL issue is found, a
developer can download the SARIF file directly from the GitHub action
run to fix the problem without needing to rebuild locally.

An example run of these changes showing the packages built and output
logs and SARIF files is available here:

https://github.com/tianocore/edk2/actions/runs/6317077528

The series enables a new set of CodeQL queries that helps find useful
issues in the codebase. So, new CodeQL results will appear in the edk2
GitHub Code Scanning area after the change. It is expected that the
community will work together to prioritize and resolve issues to improve
the quality of the codebase.

V3 Changes:

1. Add a "Resolution Guidelines" section to the CodeQL plugin readme
file based on feedback in the October 16, 2023 Tianocore Tools &
CI meeting to capture some notes useful in solving issues in the
file.

V2 Changes:

1. Enable CodeQL audit mode. This is because a new patch also enables
queries that will result in unresolved issues so audit mode is needed
for the build to succeed.
2. Enable new CodeQL queries. This will enable new CodeQL queries so the
issues are easier to find and track.

Links and refernces:

   - CodeQL Overview:
 https://codeql.github.com/docs/codeql-overview/
   - CodeQL open-source queries:
 https://github.com/github/codeql
   - CodeQL CLI:
 https://docs.github.com/en/code-security/codeql-cli#codeql-cli
   - SARIF Specification and Information:
 https://sarifweb.azurewebsites.net/

Cc: Bob Feng 
Cc: Liming Gao 
Cc: 

Re: [edk2-devel] [PATCH V2] Maintainers.txt: Stop to be reviewer of several modules

2023-10-19 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ni, Ray
> Sent: Monday, June 12, 2023 11:36 PM
> To: devel@edk2.groups.io
> Cc: Gao, Zhichao ; Wu, Hao A
> ; Liu, Zhiguang ; Guo, Gua
> 
> Subject: [edk2-devel] [PATCH V2] Maintainers.txt: Stop to be reviewer
> of several modules
> 
> Remove my name from reviewer list of following modules:
> * MdeModulePkg: Console and Graphics modules
> * MdeModulePkg: Reset modules
> * MdeModulePkg: Serial modules
> * MdeModulePkg: Universal Payload definitions
> 
> Signed-off-by: Ray Ni 
> Cc: Zhichao Gao 
> Cc: Hao A Wu 
> Cc: Zhiguang Liu 
> Cc: Gua Guo 
> ---
>  Maintainers.txt | 4 
>  1 file changed, 4 deletions(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 42e40dced3..a523fb41c1 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -294,7 +294,6 @@ F: MdeModulePkg/Library/BaseBmpSupportLib/
>  F: MdeModulePkg/Library/FrameBufferBltLib/
> 
>  F: MdeModulePkg/Universal/Console/
> 
>  R: Zhichao Gao  [ZhichaoGao]
> 
> -R: Ray Ni  [niruiyu]
> 
> 
> 
>  MdeModulePkg: Core services (PEI, DXE and Runtime) modules
> 
>  F: MdeModulePkg/*Mem*/
> 
> @@ -398,12 +397,10 @@ MdeModulePkg: Reset modules
>  F: MdeModulePkg/*Reset*/
> 
>  F: MdeModulePkg/Include/*Reset*.h
> 
>  R: Zhichao Gao  [ZhichaoGao]
> 
> -R: Ray Ni  [niruiyu]
> 
> 
> 
>  MdeModulePkg: Serial modules
> 
>  F: MdeModulePkg/*Serial*/
> 
>  F: MdeModulePkg/Include/*SerialPort*.h
> 
> -R: Ray Ni  [niruiyu]
> 
>  R: Zhichao Gao  [ZhichaoGao]
> 
> 
> 
>  MdeModulePkg: SMBIOS modules
> 
> @@ -426,7 +423,6 @@ R: Liming Gao  [lgao4]
>  MdeModulePkg: Universal Payload definitions
> 
>  F: MdeModulePkg/Include/UniversalPayload/
> 
>  R: Zhiguang Liu  [LiuZhiguang001]
> 
> -R: Ray Ni  [niruiyu]
> 
>  R: Gua Guo  [gguo11837463]
> 
> 
> 
>  MdeModulePkg: Trace Hub debug message related library instance
> 
> --
> 2.37.2.windows.2
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#106051):
> https://edk2.groups.io/g/devel/message/106051
> Mute This Topic: https://groups.io/mt/99500362/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe:
> https://edk2.groups.io/g/devel/leave/3603567/1643496/1659866329/xyzzy
> [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109818): https://edk2.groups.io/g/devel/message/109818
Mute This Topic: https://groups.io/mt/99500362/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCHv2 2/2] MdePkg/Test: Add DevicePathLib host test module

2023-10-19 Thread Michael D Kinney
Merged: https://github.com/tianocore/edk2/pull/4865

Mike

> -Original Message-
> From: Kinney, Michael D 
> Sent: Friday, October 13, 2023 9:55 AM
> To: Albecki, Mateusz ; devel@edk2.groups.io
> Cc: Gao, Liming ; Liu, Zhiguang
> ; Kinney, Michael D
> 
> Subject: RE: [PATCHv2 2/2] MdePkg/Test: Add DevicePathLib host test
> module
> 
> Reviewed-by: Michael D Kinney 
> 
> > -Original Message-
> > From: Albecki, Mateusz 
> > Sent: Wednesday, September 27, 2023 8:51 AM
> > To: devel@edk2.groups.io
> > Cc: Albecki, Mateusz ; Kinney, Michael D
> > ; Gao, Liming
> ;
> > Liu, Zhiguang 
> > Subject: [PATCHv2 2/2] MdePkg/Test: Add DevicePathLib host test
> module
> >
> > This commit adds host-based unit tests for device path lib.
> >
> >
> >
> > Cc: Michael D Kinney 
> >
> > Cc: Liming Gao 
> >
> > Cc: Zhiguang Liu 
> >
> >
> >
> > Signed-off-by: Mateusz Albecki 
> >
> > ---
> >
> >  MdePkg/MdePkg.ci.yaml |   5 +-
> >
> >  MdePkg/Test/MdePkgHostTest.dsc|   2 +
> >
> >  .../Library/DevicePathLib/TestDevicePathLib.c | 638
> > ++
> >
> >  .../Library/DevicePathLib/TestDevicePathLib.h |  26 +
> >
> >  .../DevicePathLib/TestDevicePathLibHost.inf   |  33 +
> >
> >  .../TestDevicePathStringConversions.c | 370 ++
> >
> >  6 files changed, 1073 insertions(+), 1 deletion(-)
> >
> >  create mode 100644
> > MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c
> >
> >  create mode 100644
> > MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.h
> >
> >  create mode 100644
> > MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLibHost.inf
> >
> >  create mode 100644
> >
> MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathStringConvers
> > ions.c
> >
> >
> >
> > diff --git a/MdePkg/MdePkg.ci.yaml b/MdePkg/MdePkg.ci.yaml
> >
> > index c3faf4913d..45f4fb537b 100644
> >
> > --- a/MdePkg/MdePkg.ci.yaml
> >
> > +++ b/MdePkg/MdePkg.ci.yaml
> >
> > @@ -74,7 +74,10 @@
> >
> >
> > "Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.c",
> >
> >  "Library/BaseFdtLib",
> >
> >  "Library/MipiSysTLib/mipi_syst.h",
> >
> > -"Include/Register/Amd/SmramSaveStateMap.h"
> >
> > +"Include/Register/Amd/SmramSaveStateMap.h",
> >
> > +
> > "Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c",
> >
> > +
> > "Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.h",
> >
> > +
> >
> "Test/UnitTest/Library/DevicePathLib/TestDevicePathStringConversions.c
> > "
> >
> >  ]
> >
> >  },
> >
> >  ## options defined ci/Plugin/CompilerPlugin
> >
> > diff --git a/MdePkg/Test/MdePkgHostTest.dsc
> > b/MdePkg/Test/MdePkgHostTest.dsc
> >
> > index 529ea69024..b92b564d43 100644
> >
> > --- a/MdePkg/Test/MdePkgHostTest.dsc
> >
> > +++ b/MdePkg/Test/MdePkgHostTest.dsc
> >
> > @@ -21,6 +21,7 @@
> >
> >
> >
> >  [LibraryClasses]
> >
> >SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
> >
> > +
> >
> DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibBase.i
> > nf
> >
> >
> >
> >  [Components]
> >
> >#
> >
> > @@ -29,6 +30,7 @@
> >
> >
> >
> MdePkg/Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLibHost.inf
> >
> >MdePkg/Test/UnitTest/Library/BaseLib/BaseLibUnitTestsHost.inf
> >
> >
> >
> MdePkg/Test/GoogleTest/Library/BaseSafeIntLib/GoogleTestBaseSafeIntLib
> > .inf
> >
> > +
> > MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLibHost.inf
> >
> >
> >
> >#
> >
> ># Build HOST_APPLICATION Libraries
> >
> > diff --git
> > a/MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c
> > b/MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c
> >
> > new file mode 100644
> >
> > index 00..687497278c
> >
> > --- /dev/null
> >
> > +++ b/MdePkg/Test/UnitTest/Library/DevicePathLib/TestDevicePathLib.c
> >
> > @@ -0,0 +1,638 @@
> >
> > +/** @file
> >
> > +  UEFI OS based application for unit testing the DevicePathLib.
> >
> > +
> >
> > +  Copyright (c) 2023, Intel Corporation. All rights reserved.
> >
> > +  SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > +**/
> >
> > +
> >
> > +#include "TestDevicePathLib.h"
> >
> > +
> >
> > +#define UNIT_TEST_NAME "DevicePathLib Unit Test Application"
> >
> > +#define UNIT_TEST_VERSION  "0.1"
> >
> > +
> >
> > +typedef struct {
> >
> > +  ACPI_HID_DEVICE_PATHAcpiPath;
> >
> > +  PCI_DEVICE_PATH PciPathRootPort;
> >
> > +  PCI_DEVICE_PATH PciPathEndPoint;
> >
> > +  USB_DEVICE_PATH UsbPath;
> >
> > +  EFI_DEVICE_PATH_PROTOCOLEnd;
> >
> > +} TEST_COMPLEX_DEVICE_PATH;
> >
> > +
> >
> > +GLOBAL_REMOVE_IF_UNREFERENCED TEST_COMPLEX_DEVICE_PATH
> > mComplexDevicePath = {
> >
> > +  { // ACPI device path with root bridge EISA_PNP_ID
> >
> > +{
> >
> > +  ACPI_DEVICE_PATH,
> >
> > +  ACPI_DP,
> >
> > +  {
> >
> > +(UINT8)(sizeof (ACPI_HID_DEVICE_PATH)),
> >
> > +(UINT8)((sizeof (ACPI_HID_DEVICE_PATH)) 

Re: [edk2-devel] [PATCH v5 2/2] OvmfPkg/RiscVVirt: Override for RV CPU Features

2023-10-19 Thread Laszlo Ersek
On 10/19/23 16:37, Dhaval Sharma wrote:
> It was introduced in 2.39 it seems.

Hm, then the macros should still be added please; RHEL9/EPEL9 only offer
binutils 2.38.

> GCC 12 onwards contains this
> binutils version as per my understanding.

No, gcc doesn't "contain" binutils. They are separate packages, and
their versions are not tightly locked together.

> This version was released
> quite long back. I can double check by submitting it through edk2 CI to
> ensure it works. Current CI version is already GCC 12.

It's the binutils version that matters for this.

(And even if CI has gcc-12, I'd still ask for the macros, because RHEL9
/ EPEL9 don't seem to have a new enough binutils.)

Thanks
Laszlo

> 
> On Thu, Oct 19, 2023 at 5:47 PM Laszlo Ersek  > wrote:
> 
> On 10/19/23 11:22, Laszlo Ersek wrote:
> > On 10/19/23 08:48, Dhaval Sharma wrote:
> 
> >> (11) I agree that we should use symbolic names rather than
> >> magic constants, but raw encodings of machine instructions don't
> belong
> >> into a
> >>      C header file. [Dhaval] This bytecode was introduced
> thinking what
> >> if all compilers do not support it. but given the default compiler in
> >> edk2 GCC 12 supports it
> >>      we can eliminate this byte encoding completely to make it
> easy and
> >> simple to consume for others.
> >
> > To be honest, I can't determine the minimum expected gcc version for
> > edk2. "BaseTools/Conf/tools_def.template" states a minimum version for
> > NASM, for example, but I can't find a similar gcc requirement there.
> >
> > gcc-12 does work for me personally, because my riscv cross-compiler is
> > "riscv64-linux-gnu-gcc (GCC) 12.1.1 20220507 (Red Hat Cross
> 12.1.1-1)".
> >
> > If the CI environment that builds these patches also provides gcc-12+,
> > then I figure you should be set.
> 
> Wait, for the assembly language source files, what matters is the
> binutils version, not the gcc version. Mine is "GNU assembler version
> 2.38-3.el9" (from "binutils-riscv64-linux-gnu-2.38-3.el9.x86_64").
> 
> Is that sufficient for the instuctions in question?
> 
> (More generally -- what version does our CI env expect / provide?)
> 
> Thanks
> Laszlo
> 
> 
> 
> -- 
> Thanks!
> =D



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109816): https://edk2.groups.io/g/devel/message/109816
Mute This Topic: https://groups.io/mt/102016149/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Now: TianoCore Community Meeting EMEA/NAMO - Thursday, October 19, 2023 #cal-notice

2023-10-19 Thread Group Notification
*TianoCore Community Meeting EMEA/NAMO*

*When:*
Thursday, October 19, 2023
8:00am to 9:00am
(UTC-07:00) America/Los Angeles

*Where:*
Microsoft Teams meeting Join on your computer or mobile app Click here to join 
the meeting Meeting ID: 226 323 011 029 Passcode: hMRCj6 Download Teams | Join 
on the web Join with a video conferencing device te...@conf.intel.com Video 
Conference ID: 112 716 814 3 Alternate VTC instructions Learn More | Meeting 
options

*Organizer:* Michael Kinney

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=2043512 )

*Description:*



Microsoft Teams meeting

*Join on your computer or mobile app*

Click here to join the meeting ( 
https://teams.microsoft.com/l/meetup-join/19%3ameeting_MTAyZGJhNjMtYzQ4Mi00MTUxLWFlMWMtOGU0MWNlZDk4NjY5%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 )

Meeting ID: 226 323 011 029
Passcode: hMRCj6

Download Teams ( https://www.microsoft.com/en-us/microsoft-teams/download-app ) 
| Join on the web ( https://www.microsoft.com/microsoft-teams/join-a-meeting )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 112 716 814 3

Alternate VTC instructions ( 
https://conf.intel.com/teams/?conf=1127168143=teams=conf.intel.com=test_call
 )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=6e4ce4c4-1242-431b-9a51-92cd01a5df3c=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_MTAyZGJhNjMtYzQ4Mi00MTUxLWFlMWMtOGU0MWNlZDk4NjY5@thread.v2=0=en-US
 )




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109815): https://edk2.groups.io/g/devel/message/109815
Mute This Topic: https://groups.io/mt/102061635/21656
Mute #cal-notice:https://edk2.groups.io/g/devel/mutehashtag/cal-notice
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Event: TianoCore Community Meeting EMEA/NAMO - Thursday, October 19, 2023 #cal-reminder

2023-10-19 Thread Group Notification
*Reminder: TianoCore Community Meeting EMEA/NAMO*

*When:*
Thursday, October 19, 2023
8:00am to 9:00am
(UTC-07:00) America/Los Angeles

*Where:*
Microsoft Teams meeting Join on your computer or mobile app Click here to join 
the meeting Meeting ID: 226 323 011 029 Passcode: hMRCj6 Download Teams | Join 
on the web Join with a video conferencing device te...@conf.intel.com Video 
Conference ID: 112 716 814 3 Alternate VTC instructions Learn More | Meeting 
options

*Organizer:* Michael Kinney

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=2043512 )

*Description:*



Microsoft Teams meeting

*Join on your computer or mobile app*

Click here to join the meeting ( 
https://teams.microsoft.com/l/meetup-join/19%3ameeting_MTAyZGJhNjMtYzQ4Mi00MTUxLWFlMWMtOGU0MWNlZDk4NjY5%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%226e4ce4c4-1242-431b-9a51-92cd01a5df3c%22%7d
 )

Meeting ID: 226 323 011 029
Passcode: hMRCj6

Download Teams ( https://www.microsoft.com/en-us/microsoft-teams/download-app ) 
| Join on the web ( https://www.microsoft.com/microsoft-teams/join-a-meeting )

*Join with a video conferencing device*

te...@conf.intel.com

Video Conference ID: 112 716 814 3

Alternate VTC instructions ( 
https://conf.intel.com/teams/?conf=1127168143=teams=conf.intel.com=test_call
 )

Learn More ( https://aka.ms/JoinTeamsMeeting ) | Meeting options ( 
https://teams.microsoft.com/meetingOptions/?organizerId=6e4ce4c4-1242-431b-9a51-92cd01a5df3c=46c98d88-e344-4ed4-8496-4ed7712e255d=19_meeting_MTAyZGJhNjMtYzQ4Mi00MTUxLWFlMWMtOGU0MWNlZDk4NjY5@thread.v2=0=en-US
 )




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109814): https://edk2.groups.io/g/devel/message/109814
Mute This Topic: https://groups.io/mt/102040653/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v5 2/2] OvmfPkg/RiscVVirt: Override for RV CPU Features

2023-10-19 Thread Dhaval Sharma
It was introduced in 2.39 it seems. GCC 12 onwards contains this binutils
version as per my understanding. This version was released quite long back.
I can double check by submitting it through edk2 CI to ensure it works.
Current CI version is already GCC 12.

On Thu, Oct 19, 2023 at 5:47 PM Laszlo Ersek  wrote:

> On 10/19/23 11:22, Laszlo Ersek wrote:
> > On 10/19/23 08:48, Dhaval Sharma wrote:
>
> >> (11) I agree that we should use symbolic names rather than
> >> magic constants, but raw encodings of machine instructions don't belong
> >> into a
> >>  C header file. [Dhaval] This bytecode was introduced thinking what
> >> if all compilers do not support it. but given the default compiler in
> >> edk2 GCC 12 supports it
> >>  we can eliminate this byte encoding completely to make it easy and
> >> simple to consume for others.
> >
> > To be honest, I can't determine the minimum expected gcc version for
> > edk2. "BaseTools/Conf/tools_def.template" states a minimum version for
> > NASM, for example, but I can't find a similar gcc requirement there.
> >
> > gcc-12 does work for me personally, because my riscv cross-compiler is
> > "riscv64-linux-gnu-gcc (GCC) 12.1.1 20220507 (Red Hat Cross 12.1.1-1)".
> >
> > If the CI environment that builds these patches also provides gcc-12+,
> > then I figure you should be set.
>
> Wait, for the assembly language source files, what matters is the
> binutils version, not the gcc version. Mine is "GNU assembler version
> 2.38-3.el9" (from "binutils-riscv64-linux-gnu-2.38-3.el9.x86_64").
>
> Is that sufficient for the instuctions in question?
>
> (More generally -- what version does our CI env expect / provide?)
>
> Thanks
> Laszlo
>
>

-- 
Thanks!
=D


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109813): https://edk2.groups.io/g/devel/message/109813
Mute This Topic: https://groups.io/mt/102016149/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH edk2-platforms v5 7/7] Sophgo/SG2042Pkg: Add platform readme and document.

2023-10-19 Thread 蔡雨晴


在 2023-10-18 20:11:17,"Laszlo Ersek"  写道:
>On 10/18/23 13:21, 蔡雨晴 wrote:
>> Hi Laszlo,
>> 
>> Thank you for your comments. I will commit a new patch to add the
>> maintainers to the "Maintainers.txt" file in the root directory of the
>> edk2-platforms project.
>> 
>> Please let us know if you have more suggestions.
>
>I do have one, but it's not specifically for this patch set, but for all
>future edk2(-platforms) patches you may post -- please add "--stat=1000
>--stat-graph-width=20" to your git-format-patch command line.
>Edk2(-platforms) use(s) long pathnames, and so the cumulative diffstat
>tends to be truncated, and on the left side at that. That fact makes it
>hard to see the extent of a patchset. If you add these options, then the
>cumulative diffstat is going to be just as wide as it needs to be -- no
>truncation, and no needless padding.

>
>The "BaseTools/Scripts/SetupGit.py" utility creates a git-format-patch
>alias called "fp" that includes these options.

>


Hi Laszlo,

I will make sure to include the "--stat=1000 --stat-graph-width=20" options in 
my git-format-patch command line for all future edk2(-platforms) patches. This 
will help provide a more comprehensive and readable diffstat. 

BTW, I will read your guide carefully and refer to it. 
Thank you again!

Yuqing Cai


>BTW I could help Ard out by pushing this patch set (well, v4, with the 
>>Maintainers.txt fix), I'm just not clear when a patch set counts as 
>>"sufficiently reviewed" for edk2-platforms. > >Laszlo > >> >> Thanks, >> 
>Yuqing Cai >> >> >> >> >> >> At 2023-10-18 17:47:04, "Laszlo Ersek" 
> wrote: >>>On 10/13/23 05:03, caiyuqing...@163.com wrote: 
> diff --git a/Platform/Sophgo/Maintainers.md 
>b/Platform/Sophgo/Maintainers.md  new file mode 100644  index 
>..4cb32c359a31  --- /dev/null  +++ 
>b/Platform/Sophgo/Maintainers.md  @@ -0,0 +1,105 @@  +##Project Name: 
>EDK2 Sophgo SG2042  +  +##Maintainers:  +1. dahogn - 
>dah...@hotmail.com  +2. caiyuqing379 -   +3. 
>meng-cz - mengcz1...@gmail.com  +4. USER0FISH -  
> + >>> >>>This "Platform/Sophgo/Maintainers.md" file / format is useless 
>with >>>edk2's "BaseTools/Scripts/GetMaintainer.py" utility. For that utility 
>to >>>work, you need to add the maintainers to the "Maintainers.txt" file in 
the edk2-platforms project root dir (... as well). >>> >>>Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109809): https://edk2.groups.io/g/devel/message/109809
Mute This Topic: https://groups.io/mt/101944473/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/1] Maintainers.txt: Add maintainers for Sophgo platform

2023-10-19 Thread caiyuqing_hz
From: caiyuqing379 

This "Platform/Sophgo/Maintainers.md" file format is useless with
edk2's "BaseTools/Scripts/GetMaintainer.py" utility, so delete this
file. Add add the maintainers to the "Maintainers.txt" file.

Cc: dahogn 
Cc: meng-cz 
Cc: USER0FISH 
Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Laszlo Ersek 
Signed-off-by: caiyuqing379 
---
 Maintainers.txt|   9 ++
 Platform/Sophgo/Maintainers.md | 105 
 2 files changed, 9 insertions(+), 105 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index 78f24cbb7d76..48c730854609 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -424,3 +424,12 @@ M: Leif Lindholm 
 R: Peng Xie 
 R: Ling Jia 
 R: Yiqi Shu 
+
+Sophgo platforms and silicon
+F: Platform/Sophgo/
+F: Silicon/Sophgo/SG2042Pkg/
+M: Sunil V L 
+R: dahogn 
+R: meng-cz 
+R: caiyuqing379 
+R: USER0FISH 
diff --git a/Platform/Sophgo/Maintainers.md b/Platform/Sophgo/Maintainers.md
deleted file mode 100644
index a2f0bda65850..
--- a/Platform/Sophgo/Maintainers.md
+++ /dev/null
@@ -1,105 +0,0 @@
-##Project Name: EDK2 Sophgo SG2042
-
-##Maintainers:
-1. dahogn - dah...@hotmail.com
-2. caiyuqing379 - 
-3. meng-cz - mengcz1...@gmail.com
-4. USER0FISH - 
-
-##Contact Information:
-- Academy of Intelligent Innovation, Shandong University, China.P.R.
-- Email:  dah...@hotmail.com
-- Website: http://www.aii.sdu.edu.cn/
-
-##Contributing Guidelines:
-Thank you for your interest in contributing to our project! We welcome 
contributions from the community, whether it's bug reports,feature requests, or 
code contributions. Your help is essential to the growth and improvement of the 
project. Here are some guidelines to help you get started:
-###Reporting Issues
-If you come across any bugs, have feature requests, or encounter any issues 
while using the project, please follow these steps to report them:
-1. Create a new issue in our Issue Tracker.
-2. Provide a clear and detailed description of the issue, including steps to 
produce and information about your operating environment.
-3. If possible, include screenshots or relevant code snippets to help us 
better understand nd address the issue.
-
-We will review your issue promptly and provide updates on its resolution.
-###Submitting Code
-If you have improvements to the codebase or new features to add, we encourage 
you to follow these steps:
-1. Fork the project on GitHub to create your copy.
-2. Create a new branch for your development and make your code changes on that 
branch.
-3. Before submitting the code, make sure it adheres to the project's coding 
standards and passes any existing tests.
-4. Provide a clear commit message that describes your changes and the purpose 
of your code contributions.
-5. Push your code changes to your forked repository and open a Pull Request 
(PR) to our GitHub repository.
-
-Our team will review your PR, and we may request changes or discuss 
improvements with you before merging your code.
-###Notes
-- Please try to keep your code changes concise and focused on the specific 
issue or feature you are addressing.
-- Before submitting, ensure that your code passes all existing tests and does 
not introduce any new issues.
-- For significant changes or new feature implementations, it's advisable to 
start by discussing them in the Issue Tracker to align with the project's 
direction.
-###License
-By contributing code to this project, you agree to license your contributions 
under the project's existing license BSD-2-Clause-Patent.
-
-##Code of Conduct:
-###Our Pledge
-We as members, contributors, and leaders pledge to make participation in our 
community a harassment-free experience for everyone, regardless of age, body 
size, visible or invisible disability, ethnicity, sex characteristics, gender 
identity and expression, level of experience, education, socio-economic status, 
nationality, personal appearance, race, caste, color, religion, or sexual 
identity and orientation.
-
-We pledge to act and interact in ways that contribute to an open, welcoming, 
diverse, inclusive, and healthy community.
-
-###Our Standards
-Examples of behavior that contributes to a positive environment for our 
community include:
-
--  Demonstrating empathy and kindness toward other people
--  Being respectful of differing opinions, viewpoints, and experiences
--  Giving and gracefully accepting constructive feedback
--  Accepting responsibility and apologizing to those affected by our mistakes, 
and learning from the experience
--  Focusing on what is best not just for us as individuals, but for the 
overall community
-
-Examples of unacceptable behavior include:
-
--  The use of sexualized language or imagery, and sexual attention or advances 
of any kind
--  Trolling, insulting or derogatory comments, and personal or political 
attacks
--  Public or private harassment
--  Publishing others’ private information, such as a physical or email 
address, without their explicit 

Re: [edk2-devel] [PATCH 1/1] Maintainers.txt: Update maintainers list

2023-10-19 Thread Attar, AbdulLateef (Abdul Lateef) via groups.io
[AMD Official Use Only - General]

Acked-by: Abdul Lateef Attar 

-Original Message-
From: Chang, Abner 
Sent: Thursday, October 19, 2023 11:13 AM
To: devel@edk2.groups.io
Cc: Andrew Fish ; Leif Lindholm ; 
Michael D Kinney ; Attar, AbdulLateef (Abdul 
Lateef) ; Nickle Wang ; Jian J 
Wang ; Liming Gao ; Zhiguang 
Liu ; Eric Dong ; Ray Ni 
; Rahul Kumar ; Gerd Hoffmann 

Subject: [PATCH 1/1] Maintainers.txt: Update maintainers list

From: Abner Chang 

- Add two entries of MdePkg and MdeModulePkg for
  manageability modules and files.
- Add one entry of UefiCpuPkg AMD related files.

Signed-off-by: Abner Chang 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Eric Dong 
Cc: Ray Ni 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 
---
 Maintainers.txt | 21 +
 1 file changed, 21 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt index 1a7525b1b4c..4bec19832f4 
100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -443,6 +443,13 @@ F: MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h
 M: Richard Ho  [richardho]
 R: Rebecca Cran  [bcran]

+MdeModulePkg: Manageability modules
+F: MdeModulePkg/Include/*Ipmi*.*
+F: MdeModulePkg/Library/*Ipmi*.*
+M: Abner Chang  [changab]
+R: Abdul Lateef Attar  [abdattar]
+R: Nickle Wang  [nicklela]
+
 MdePkg
 F: MdePkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/MdePkg
@@ -468,6 +475,14 @@ R: Gua Guo  [gguo11837463]
 R: Chasel Chiu  [ChaselChiu]
 R: James Lu  [jameslu8]

+MdePkg: Manageability industryStandard standard C header files
+F: MdePkg/Include/IndustryStandard/*Ipmi*.h
+F: MdePkg/Include/IndustryStandard/*Mctp*.h
+F: MdePkg/Include/IndustryStandard/*Pldm*.h
+M: Abner Chang  [changab]
+R: Abdul Lateef Attar  [abdattar]
+R: Nickle Wang  [nicklela]
+
 NetworkPkg
 F: NetworkPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg
@@ -657,6 +672,12 @@ F: UefiCpuPkg/ResetVector/
 R: Debkumar De  [dde01]
 R: Catharine West  [catharine-intl]

+UefiCpuPkg: AMD related files
+F: UefiCpuPkg/Library/MmSaveStateLib/*Amd*.*
+F: UefiCpuPkg/Library/SmmCpuFeaturesLib/*Amd*.*
+M: Abdul Lateef Attar  [abdattar]
+R: Abner Chang  [changab]
+
 UefiPayloadPkg
 F: UefiPayloadPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/UefiPayloadPkg
--
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109810): https://edk2.groups.io/g/devel/message/109810
Mute This Topic: https://groups.io/mt/102055114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 0/1] Add new entry in Maintainers.txt for Sophgo platform

2023-10-19 Thread caiyuqing_hz
From: caiyuqing379 

Add maintainers for Sophgo platform in edk2-platforms project.

Cc: dahogn 
Cc: meng-cz 
Cc: USER0FISH 
Cc: Sunil V L 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Laszlo Ersek 
Signed-off-by: caiyuqing379 

caiyuqing379 (1):
  Maintainers.txt: Add maintainers for Sophgo platform

 Maintainers.txt|   9 ++
 Platform/Sophgo/Maintainers.md | 105 
 2 files changed, 9 insertions(+), 105 deletions(-)
 delete mode 100644 Platform/Sophgo/Maintainers.md

--
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109811): https://edk2.groups.io/g/devel/message/109811
Mute This Topic: https://groups.io/mt/102060866/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] OvmfPkg/VirtioFsDxe: tolerate opening an abs. pathname rel. to a reg. file

2023-10-19 Thread Laszlo Ersek
On 10/19/23 15:50, Pedro Falcato wrote:
> On Wed, Oct 18, 2023 at 6:24 PM Laszlo Ersek  wrote:
>>
>> Referring to a file relative to a regular file makes no sense (or at least
>> it cannot be implemented consistently with how a file is referred to
>> relative to a directory). VirtioFsSimpleFileOpen() has enforced this
>> strictly since the beginning, and a few months ago I reported USWG Mantis
>> ticket #2367 [1] too, for clearing up the related confusion in the UEFI
>> spec.
>>
>> Unfortunately, the shim boot loader contains such a bug [2] [3]. I don't
>> believe the shim bug is ever going to be fixed. We can however relax the
>> check in VirtioFsSimpleFileOpen() a bit: if the pathname that's being
>> opened relative to a regular file is absolute, then the base file is going
>> to be ignored anyway, so we can let the caller's bug slide. This happens
>> to make shim work.
>>
>> Why this matters: UEFI-bootable Linux installer ISOs tend to come with
>> shim and grub in the embedded (ElTorito) FAT image (ESP). Sometimes you
>> want to build upstream shim/grub binaries, but boot the same ISO
>> otherwise. The fastest way for overriding the ESP for this purpose is to
>> copy its original contents to a virtio filesystem, then overwrite the shim
>> and grub binaries from the host side. Note that this is different from
>> direct-booting a kernel (via fw_cfg); the point is to check whether the
>> just-built shim and grub are able to boot the rest of the ISO.
>>
>> [1] https://mantis.uefi.org/mantis/view.php?id=2367
>> [2] https://bugzilla.redhat.com/show_bug.cgi?id=1966973
>> [3] https://github.com/rhboot/shim/issues/382
>>
>> Cc: Ard Biesheuvel 
>> Cc: Gerd Hoffmann 
>> Cc: Jiewen Yao 
>> Cc: Jordan Justen 
>> Signed-off-by: Laszlo Ersek 
>> ---
>>
>> Notes:
>> context:-U4
>>
>>  OvmfPkg/VirtioFsDxe/SimpleFsOpen.c | 17 ++---
>>  1 file changed, 14 insertions(+), 3 deletions(-)
>>
>> diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c 
>> b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
>> index a13d4f6a1e2d..2ecf3d6c2325 100644
>> --- a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
>> +++ b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
>> @@ -394,22 +394,33 @@ VirtioFsSimpleFileOpen (
>>
>>//
>>// Referring to a file relative to a regular file makes no sense (or at 
>> least
>>// it cannot be implemented consistently with how a file is referred to
>> -  // relative to a directory).
>> +  // relative to a directory). See USWG Mantis ticket #2367.
>>//
>>if (!VirtioFsFile->IsDirectory) {
>> +BOOLEAN  BugCompat;
>> +
>> +//
>> +// Tolerate this bug in the caller if FileName is absolute. If FileName 
>> is
>> +// absolute, then VirtioFsAppendPath() below will disregard
>> +// VirtioFsFile->CanonicalPathname.
>> +//
>> +BugCompat = (FileName[0] == L'\\');
>> +
>>  DEBUG ((
>> -  DEBUG_ERROR,
>> +  BugCompat ? DEBUG_WARN : DEBUG_ERROR,
>>("%a: Label=\"%s\" CanonicalPathname=\"%a\" FileName=\"%s\": "
>> "nonsensical request to open a file or directory relative to a 
>> regular "
>> "file\n"),
>>__func__,
>>VirtioFs->Label,
>>VirtioFsFile->CanonicalPathname,
>>FileName
>>));
>> -return EFI_INVALID_PARAMETER;
>> +if (!BugCompat) {
>> +  return EFI_INVALID_PARAMETER;
>> +}
>>}
>>
>>//
>>// Allocate the new VIRTIO_FS_FILE object.
>>
> 
> Aww, you should've CC'd me.

Ouch! I'm sorry. I've grown to (quite mechanically) consult
$EDK_TOOLS_PATH/Scripts/GetMaintainer.py for the Cc list :(

> Anyway, retroactive
> Acked-by: Pedro Falcato 

Thank you! (I've pushed the patch already, so can't record your A-b on
it, but the mailing list will preserve it at least.)

> 
> If this is the new pseudo-sanctioned behavior for filesystem drivers,
> I'll make sure to do the same adjustments for Ext4Dxe.
> 

I think that would be useful.

(Of course I don't "insist" that you share my opinion on whether this
new behavior is for bug compatibility with the UEFI spec and shim (which
I think it is), or because it is the right/intuitive thing to do (which
I don't think it is) -- just feel entirely free to word the Ext4Pkg
comments and commit message as you see fit! ... And I probably don't
even have to state this, but let me just state it anyway. :) )

Cheers
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109808): https://edk2.groups.io/g/devel/message/109808
Mute This Topic: https://groups.io/mt/102044004/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 1/1] Maintainers.txt: Add maintainers for Sophgo platform

2023-10-19 Thread Laszlo Ersek
On 10/19/23 15:48, caiyuqing...@163.com wrote:
> From: caiyuqing379 
> 
> This "Platform/Sophgo/Maintainers.md" file format is useless with
> edk2's "BaseTools/Scripts/GetMaintainer.py" utility, so delete this
> file. Add add the maintainers to the "Maintainers.txt" file.
> 
> Cc: dahogn 
> Cc: meng-cz 
> Cc: USER0FISH 
> Cc: Sunil V L 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Laszlo Ersek 
> Signed-off-by: caiyuqing379 
> ---
>  Maintainers.txt|   9 ++
>  Platform/Sophgo/Maintainers.md | 105 
>  2 files changed, 9 insertions(+), 105 deletions(-)

Acked-by: Laszlo Ersek 




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109807): https://edk2.groups.io/g/devel/message/109807
Mute This Topic: https://groups.io/mt/102060744/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] Request for access for edk2-staging branch creation

2023-10-19 Thread Maciej Czajkowski
Hello,

I would like to request for a write access to edk2-staging repository to create 
a new branch for DeviceSimPkg. Its goal is to provide an environment to write 
OS-executable tests for code that interacts directly with devices.

Regards,
Maciej Czajkowski
-
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial 
Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | 
Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z 
dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach 
handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i 
moze zawierac informacje poufne. W razie przypadkowego otrzymania tej 
wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; 
jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient(s). If you are not the intended recipient, please 
contact the sender and delete all copies; any review or distribution by others 
is strictly prohibited.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109806): https://edk2.groups.io/g/devel/message/109806
Mute This Topic: https://groups.io/mt/102060345/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] OvmfPkg/VirtioFsDxe: tolerate opening an abs. pathname rel. to a reg. file

2023-10-19 Thread Pedro Falcato
On Wed, Oct 18, 2023 at 6:24 PM Laszlo Ersek  wrote:
>
> Referring to a file relative to a regular file makes no sense (or at least
> it cannot be implemented consistently with how a file is referred to
> relative to a directory). VirtioFsSimpleFileOpen() has enforced this
> strictly since the beginning, and a few months ago I reported USWG Mantis
> ticket #2367 [1] too, for clearing up the related confusion in the UEFI
> spec.
>
> Unfortunately, the shim boot loader contains such a bug [2] [3]. I don't
> believe the shim bug is ever going to be fixed. We can however relax the
> check in VirtioFsSimpleFileOpen() a bit: if the pathname that's being
> opened relative to a regular file is absolute, then the base file is going
> to be ignored anyway, so we can let the caller's bug slide. This happens
> to make shim work.
>
> Why this matters: UEFI-bootable Linux installer ISOs tend to come with
> shim and grub in the embedded (ElTorito) FAT image (ESP). Sometimes you
> want to build upstream shim/grub binaries, but boot the same ISO
> otherwise. The fastest way for overriding the ESP for this purpose is to
> copy its original contents to a virtio filesystem, then overwrite the shim
> and grub binaries from the host side. Note that this is different from
> direct-booting a kernel (via fw_cfg); the point is to check whether the
> just-built shim and grub are able to boot the rest of the ISO.
>
> [1] https://mantis.uefi.org/mantis/view.php?id=2367
> [2] https://bugzilla.redhat.com/show_bug.cgi?id=1966973
> [3] https://github.com/rhboot/shim/issues/382
>
> Cc: Ard Biesheuvel 
> Cc: Gerd Hoffmann 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Signed-off-by: Laszlo Ersek 
> ---
>
> Notes:
> context:-U4
>
>  OvmfPkg/VirtioFsDxe/SimpleFsOpen.c | 17 ++---
>  1 file changed, 14 insertions(+), 3 deletions(-)
>
> diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c 
> b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
> index a13d4f6a1e2d..2ecf3d6c2325 100644
> --- a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
> +++ b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
> @@ -394,22 +394,33 @@ VirtioFsSimpleFileOpen (
>
>//
>// Referring to a file relative to a regular file makes no sense (or at 
> least
>// it cannot be implemented consistently with how a file is referred to
> -  // relative to a directory).
> +  // relative to a directory). See USWG Mantis ticket #2367.
>//
>if (!VirtioFsFile->IsDirectory) {
> +BOOLEAN  BugCompat;
> +
> +//
> +// Tolerate this bug in the caller if FileName is absolute. If FileName 
> is
> +// absolute, then VirtioFsAppendPath() below will disregard
> +// VirtioFsFile->CanonicalPathname.
> +//
> +BugCompat = (FileName[0] == L'\\');
> +
>  DEBUG ((
> -  DEBUG_ERROR,
> +  BugCompat ? DEBUG_WARN : DEBUG_ERROR,
>("%a: Label=\"%s\" CanonicalPathname=\"%a\" FileName=\"%s\": "
> "nonsensical request to open a file or directory relative to a 
> regular "
> "file\n"),
>__func__,
>VirtioFs->Label,
>VirtioFsFile->CanonicalPathname,
>FileName
>));
> -return EFI_INVALID_PARAMETER;
> +if (!BugCompat) {
> +  return EFI_INVALID_PARAMETER;
> +}
>}
>
>//
>// Allocate the new VIRTIO_FS_FILE object.
>

Aww, you should've CC'd me.
Anyway, retroactive
Acked-by: Pedro Falcato 

If this is the new pseudo-sanctioned behavior for filesystem drivers,
I'll make sure to do the same adjustments for Ext4Dxe.

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109805): https://edk2.groups.io/g/devel/message/109805
Mute This Topic: https://groups.io/mt/102044004/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] OvmfPkg/VirtioFsDxe: tolerate opening an abs. pathname rel. to a reg. file

2023-10-19 Thread Laszlo Ersek
On 10/19/23 08:28, Gerd Hoffmann wrote:
> On Wed, Oct 18, 2023 at 07:24:34PM +0200, Laszlo Ersek wrote:
>> Referring to a file relative to a regular file makes no sense (or at least
>> it cannot be implemented consistently with how a file is referred to
>> relative to a directory). VirtioFsSimpleFileOpen() has enforced this
>> strictly since the beginning, and a few months ago I reported USWG Mantis
>> ticket #2367 [1] too, for clearing up the related confusion in the UEFI
>> spec.
>>
>> Unfortunately, the shim boot loader contains such a bug [2] [3]. I don't
>> believe the shim bug is ever going to be fixed. We can however relax the
>> check in VirtioFsSimpleFileOpen() a bit: if the pathname that's being
>> opened relative to a regular file is absolute, then the base file is going
>> to be ignored anyway, so we can let the caller's bug slide. This happens
>> to make shim work.
>>
>> Why this matters: UEFI-bootable Linux installer ISOs tend to come with
>> shim and grub in the embedded (ElTorito) FAT image (ESP). Sometimes you
>> want to build upstream shim/grub binaries, but boot the same ISO
>> otherwise. The fastest way for overriding the ESP for this purpose is to
>> copy its original contents to a virtio filesystem, then overwrite the shim
>> and grub binaries from the host side. Note that this is different from
>> direct-booting a kernel (via fw_cfg); the point is to check whether the
>> just-built shim and grub are able to boot the rest of the ISO.
>>
>> [1] https://mantis.uefi.org/mantis/view.php?id=2367
>> [2] https://bugzilla.redhat.com/show_bug.cgi?id=1966973
>> [3] https://github.com/rhboot/shim/issues/382
>>
>> Cc: Ard Biesheuvel 
>> Cc: Gerd Hoffmann 
>> Cc: Jiewen Yao 
>> Cc: Jordan Justen 
>> Signed-off-by: Laszlo Ersek 
> 
> Reviewed-by: Gerd Hoffmann 
> Tested-by: Gerd Hoffmann 

Merged via ; commit
8abbf6d87e68.

Thanks!
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109804): https://edk2.groups.io/g/devel/message/109804
Mute This Topic: https://groups.io/mt/102044004/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 6/6] StarFive/JH7110Pkg: Add JH7110 Silicon Package

2023-10-19 Thread Sunil V L
Hi John,
On Thu, Oct 19, 2023 at 10:59:21AM +0800, John Chew wrote:
> From: mindachen1987 
> 
The patch should have commit message more than one liner. Same comment
for PATCH 1/6 and 2/6.

Also, there should be a patch in the series to add maintainer entry for
your platform.

> Cc: Sunil V L 
> Co-authored-by: John Chew 
> Signed-off-by: mindachen1987 
> ---
>  Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h | 24 +++
>  Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec | 45 
> 
>  2 files changed, 69 insertions(+)
> 
> diff --git a/Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h 
> b/Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h
> new file mode 100644
> index ..b6875f6aa82b
> --- /dev/null
> +++ b/Silicon/StarFive/JH7110Pkg/Include/IndustryStandard/JH7110.h
> @@ -0,0 +1,24 @@
> +/** @file
> + *
> + *  Copyright (c) 2023, StarFive Technology Co., Ltd. All rights 
> reserved.
> + *
> + *  SPDX-License-Identifier: BSD-2-Clause-Patent
> + *
> + **/
> +
> +#ifndef JH7110_H__
> +#define JH7110_H__
> +
> +// #define JH7110_SOC_REGISTERS   (FixedPcdGet64 
> (PcdJH7110RegistersAddress))
> +// #define JH7110_SOC_REGISTER_LENGTH 0x0200
> +
Could you remove these commented code?

Thanks,
Sunil

> +/* Generic PCI addresses */
> +#define PCIE_TOP_OF_MEM_WIN   (FixedPcdGet64 (PcdJH7110PciBusMmioAdr))
> +#define PCIE_CPU_MMIO_WINDOW  (FixedPcdGet64 (PcdJH7110PciCpuMmioAdr))
> +#define PCIE_BRIDGE_MMIO_LEN  (FixedPcdGet32 (PcdJH7110PciBusMmioLen))
> +
> +/* PCI root bridge control registers location */
> +#define PCIE_REG_BASE (FixedPcdGet64 (PcdJH7110PciRegBase))
> +#define PCIE_CONFIG_BASE  (FixedPcdGet64 (PcdJH7110PciConfigRegBase))
> +
> +#endif /* JH7110_H__ */
> diff --git a/Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec 
> b/Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec
> new file mode 100644
> index ..438557a15500
> --- /dev/null
> +++ b/Silicon/StarFive/JH7110Pkg/JH7110Pkg.dec
> @@ -0,0 +1,45 @@
> +## @file
> +#
> +#  Copyright (c) 2023, StarFive Technology Co., Ltd. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  DEC_SPECIFICATION  = 0x0001001A
> +  PACKAGE_NAME   = JH7110Pkg
> +  PACKAGE_GUID   = D4B585C5-EBCA-4779-B974-05A3CF2F10C4
> +  PACKAGE_VERSION= 1.0
> +
> +[Includes]
> +  Include
> +
> +[Guids]
> +  gJH7110TokenSpaceGuid = {0x44045e56, 0x7056, 0x4be6, {0x88, 0xc0, 0x49, 
> 0x0c, 0x67, 0x90, 0x2f, 0xba}}
> +
> +[PcdsFixedAtBuild.common]
> +# Memory map
> +  gJH7110TokenSpaceGuid.PcdJH7110FlashVarOffset|0x0|UINT32|0x0001
> +
> +# PCIe
> +  gJH7110TokenSpaceGuid.PcdJH7110RegistersAddress|0|UINT32|0x0002
> +  gJH7110TokenSpaceGuid.PcdJH7110PciRegBase|0x2b00|UINT64|0x0003
> +  gJH7110TokenSpaceGuid.PcdJH7110PciBusMmioAdr|0x0|UINT64|0x0004
> +  gJH7110TokenSpaceGuid.PcdJH7110PciBusMmioLen|0x0|UINT32|0x0005
> +  gJH7110TokenSpaceGuid.PcdJH7110PciCpuMmioAdr|0x0|UINT64|0x0006
> +  
> gJH7110TokenSpaceGuid.PcdJH7110PciConfigRegBase|0x94000|UINT64|0x0007
> +
> +# SPI
> +  gJH7110TokenSpaceGuid.PcdSpiFlashRegBase|0|UINT32|0x1008
> +  gJH7110TokenSpaceGuid.PcdSpiFlashAhbBase|0|UINT64|0x1009
> +  gJH7110TokenSpaceGuid.PcdSpiFlashFifoWidth|0|UINT8|0x1010
> +  gJH7110TokenSpaceGuid.PcdSpiFlashRefClkHz|0|UINT32|0x1011
> +  gJH7110TokenSpaceGuid.PcdSpiFlashTshslNs|0|UINT32|0x1012
> +  gJH7110TokenSpaceGuid.PcdSpiFlashTsd2dNs|0|UINT32|0x113
> +  gJH7110TokenSpaceGuid.PcdSpiFlashTchshNs|0|UINT32|0x114
> +  gJH7110TokenSpaceGuid.PcdSpiFlashTslchNs|0|UINT32|0x115
> +
> +[Protocols]
> +  gJH7110SpiMasterProtocolGuid = { 0xA33C46E0, 0x4FB6, 0x4AA3, { 0x8E, 0x66, 
> 0x00, 0x06, 0x9F, 0x3A, 0x11, 0x81 }}
> +  gJH7110SpiFlashProtocolGuid  = { 0x5ECECDF6, 0x81DA, 0x4E10, { 0x9D, 0x4B, 
> 0x26, 0x65, 0x8C, 0x03, 0xAB, 0xBC }}
> -- 
> 2.34.1
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109803): https://edk2.groups.io/g/devel/message/109803
Mute This Topic: https://groups.io/mt/102053687/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v5 2/2] OvmfPkg/RiscVVirt: Override for RV CPU Features

2023-10-19 Thread Laszlo Ersek
On 10/19/23 11:22, Laszlo Ersek wrote:
> On 10/19/23 08:48, Dhaval Sharma wrote:

>> (11) I agree that we should use symbolic names rather than
>> magic constants, but raw encodings of machine instructions don't belong
>> into a
>>      C header file. [Dhaval] This bytecode was introduced thinking what
>> if all compilers do not support it. but given the default compiler in
>> edk2 GCC 12 supports it
>>      we can eliminate this byte encoding completely to make it easy and
>> simple to consume for others.
> 
> To be honest, I can't determine the minimum expected gcc version for
> edk2. "BaseTools/Conf/tools_def.template" states a minimum version for
> NASM, for example, but I can't find a similar gcc requirement there.
> 
> gcc-12 does work for me personally, because my riscv cross-compiler is
> "riscv64-linux-gnu-gcc (GCC) 12.1.1 20220507 (Red Hat Cross 12.1.1-1)".
> 
> If the CI environment that builds these patches also provides gcc-12+,
> then I figure you should be set.

Wait, for the assembly language source files, what matters is the
binutils version, not the gcc version. Mine is "GNU assembler version
2.38-3.el9" (from "binutils-riscv64-linux-gnu-2.38-3.el9.x86_64").

Is that sufficient for the instuctions in question?

(More generally -- what version does our CI env expect / provide?)

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109802): https://edk2.groups.io/g/devel/message/109802
Mute This Topic: https://groups.io/mt/102016149/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 5/6] StarFive/JH7110Pkg: Implement boot services memory allocation driver

2023-10-19 Thread Sunil V L
On Thu, Oct 19, 2023 at 10:59:20AM +0800, John Chew wrote:
> Some DXE drivers such as MMC's DMA can only work with 32-bit addressing.
> So, EfiBootServicesData need to set within 32-bit range only.
> 
> This is achieved by setting all EfiConventionalMemory to
> EfiBootServicesData before any memory allocations in the early stage of
> DXE.
> 
Hi John,

I think this is a fragile workaround. Why not MMC driver allocate 32-bit
memory using EFI API?

Thanks,
Sunil


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109801): https://edk2.groups.io/g/devel/message/109801
Mute This Topic: https://groups.io/mt/102053685/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 4/6] StarFive/JH7110Pkg: Add PlatformBootManagerLib library

2023-10-19 Thread Sunil V L
Hi John,

On Thu, Oct 19, 2023 at 10:59:19AM +0800, John Chew wrote:
> From: JohnChew 
> 
> For JH7110 with graphic console
>
This commit message needs to be improved. From the code, I can't find
why this library needs to be copied for your platform. Why not migrate
and use the library in ArmPkg to MdePkg?

> Cc: Sunil V L 
> Co-authored-by: Yong Li 
> Signed-off-by: John Chew 
> ---
>  Silicon/StarFive/JH7110Pkg/Library/PlatformBootManagerLib/PlatformBm.c   
> | 1014 
>  Silicon/StarFive/JH7110Pkg/Library/PlatformBootManagerLib/PlatformBm.h   
> |   46 +
>  
> Silicon/StarFive/JH7110Pkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
>  |   71 ++
>  3 files changed, 1131 insertions(+)
> 
> diff --git 
> a/Silicon/StarFive/JH7110Pkg/Library/PlatformBootManagerLib/PlatformBm.c 
> b/Silicon/StarFive/JH7110Pkg/Library/PlatformBootManagerLib/PlatformBm.c
> new file mode 100755
> index ..b58d2c7cbcd5
> --- /dev/null
> +++ b/Silicon/StarFive/JH7110Pkg/Library/PlatformBootManagerLib/PlatformBm.c
> @@ -0,0 +1,1014 @@
> +/** @file
> +*  Implementation for PlatformBootManagerLib library class interfaces.
> +*
> +*  Copyright (C) 2015-2016, Red Hat, Inc.
> +*  Copyright (c) 2014, ARM Ltd. All rights reserved.
> +*  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
> +*  Copyright (c) 2023, StarFive Technology Co., Ltd. All rights reserved.
> +*
> +*  SPDX-License-Identifier: BSD-2-Clause-Patent
> +*
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "PlatformBm.h"
> +
> +#define DP_NODE_LEN(Type)  { (UINT8)sizeof (Type), (UINT8)(sizeof (Type) >> 
> 8) }
> +
> +#define VERSION_STRING_PREFIX  L"RISC-V EDK2 firmware version "
> +
> +#pragma pack (1)
> +typedef struct {
> +  VENDOR_DEVICE_PATHSerialDxe;
> +  UART_DEVICE_PATH  Uart;
> +  VENDOR_DEFINED_DEVICE_PATHTermType;
> +  EFI_DEVICE_PATH_PROTOCOL  End;
> +} PLATFORM_SERIAL_CONSOLE;
> +#pragma pack ()
> +
> +STATIC PLATFORM_SERIAL_CONSOLE  mSerialConsole = {
> +  //
> +  // VENDOR_DEVICE_PATH SerialDxe
> +  //
> +  {
> +{ HARDWARE_DEVICE_PATH,  HW_VENDOR_DP, DP_NODE_LEN (VENDOR_DEVICE_PATH) 
> },
> +EDKII_SERIAL_PORT_LIB_VENDOR_GUID
> +  },
> +
> +  //
> +  // UART_DEVICE_PATH Uart
> +  //
> +  {
> +{ MESSAGING_DEVICE_PATH, MSG_UART_DP,  DP_NODE_LEN (UART_DEVICE_PATH)   
> },
> +0,  // Reserved
> +FixedPcdGet64 (PcdUartDefaultBaudRate), // BaudRate
> +FixedPcdGet8 (PcdUartDefaultDataBits),  // DataBits
> +FixedPcdGet8 (PcdUartDefaultParity),// Parity
> +FixedPcdGet8 (PcdUartDefaultStopBits)   // StopBits
> +  },
> +
> +  //
> +  // VENDOR_DEFINED_DEVICE_PATH TermType
> +  //
> +  {
> +{
> +  MESSAGING_DEVICE_PATH, MSG_VENDOR_DP,
> +  DP_NODE_LEN (VENDOR_DEFINED_DEVICE_PATH)
> +}
> +//
> +// Guid to be filled in dynamically
> +//
> +  },
> +
> +  //
> +  // EFI_DEVICE_PATH_PROTOCOL End
> +  //
> +  {
> +END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> +DP_NODE_LEN (EFI_DEVICE_PATH_PROTOCOL)
> +  }
> +};
> +
> +#pragma pack (1)
> +typedef struct {
> +  USB_CLASS_DEVICE_PATH   Keyboard;
> +  EFI_DEVICE_PATH_PROTOCOLEnd;
> +} PLATFORM_USB_KEYBOARD;
> +#pragma pack ()
> +
> +STATIC PLATFORM_USB_KEYBOARD  mUsbKeyboard = {
> +  //
> +  // USB_CLASS_DEVICE_PATH Keyboard
> +  //
> +  {
> +{
> +  MESSAGING_DEVICE_PATH, MSG_USB_CLASS_DP,
> +  DP_NODE_LEN (USB_CLASS_DEVICE_PATH)
> +},
> +0x, // VendorId: any
> +0x, // ProductId: any
> +3,  // DeviceClass: HID
> +1,  // DeviceSubClass: boot
> +1   // DeviceProtocol: keyboard
> +  },
> +
> +  //
> +  // EFI_DEVICE_PATH_PROTOCOL End
> +  //
> +  {
> +END_DEVICE_PATH_TYPE, END_ENTIRE_DEVICE_PATH_SUBTYPE,
> +DP_NODE_LEN (EFI_DEVICE_PATH_PROTOCOL)
> +  }
> +};
> +
> +/**
> +  Check if the handle satisfies a particular condition.
> +
> +  @param[in] Handle  The handle to check.
> +  @param[in] ReportText  A caller-allocated string passed in for reporting
> + purposes. It must never be NULL.
> +
> +  @retval TRUE   The condition is satisfied.
> +  @retval FALSE  Otherwise. This includes the case when the condition could 
> not
> + be fully evaluated due to an error.
> +**/
> +typedef
> +BOOLEAN
> +(EFIAPI *FILTER_FUNCTION)(
> +  IN EFI_HANDLE   Handle,
> +  IN CONST CHAR16 *ReportText
> +  );
> +
> +/**
> +  Process a handle.
> +
> +  @param[in] Handle  The handle to process.
> +  @param[in] ReportText  A caller-allocated string passed in for reporting
> + purposes. It must never be NULL.
> +**/
> +typedef
> +VOID
> +(EFIAPI 

Re: [edk2-devel] [PATCH v1 0/6] Patches for JH7110 SoC platform

2023-10-19 Thread Sunil V L
On Thu, Oct 19, 2023 at 10:57:30AM +0800, John Chew wrote:
> In this patches it include all the platform specific drivers/protocol
> that is being use for JH7110 SoC platform. All the drivers includes:
> 1. PCIE driver for NVME and USB (GT710 graphic in progress)
> 2. QSPI Flash driver for efi variable
> 3. FVB driver for efi variable
> 4. Boot service memory allocation driver
> 5. Platform boot manager for graphical console display
> 
> Reference branch: 
> https://github.com/johnchewyy/edkii-platforms/tree/vf2_jh7110_devel_upstream
> 
> Cc: Sunil V L 
> Cc: Li Yong 
> 
Hi John,

Please copy Leif and Mike for all patches. They are the maintainers for
overall edk2-platforms repo [1].

Also, I recommend to follow Laszlo's documentation [2] regarding
formatting patches.

[1] - 
https://github.com/tianocore/edk2-platforms/blob/master/Maintainers.txt#L68
[2] - 
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo%27s-unkempt-git-guide-for-edk2-contributors-and-maintainers

Thanks,
Sunil


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109799): https://edk2.groups.io/g/devel/message/109799
Mute This Topic: https://groups.io/mt/102053672/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] Question about OvmfPackage cxl emulation support

2023-10-19 Thread Laszlo Ersek
On 10/19/23 03:51, Yoshinoya wrote:
> Hi,
> I findd qemu supports cxl emulation, but it uses seabios as virtual
> machine firmware.
> 
> Does UEFI OvmfPackage have a plan to support CXL device enumeration and
> declaration?

I expect MdeModulePkg would have to add some generic CXL device driver,
which we could perhaps include in OVMF.

Some register definitions were added to core edk2 under
, but I can't
easily find any CXL driver.

Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109798): https://edk2.groups.io/g/devel/message/109798
Mute This Topic: https://groups.io/mt/102052612/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v5 2/2] OvmfPkg/RiscVVirt: Override for RV CPU Features

2023-10-19 Thread Laszlo Ersek
On 10/19/23 08:48, Dhaval Sharma wrote:
> Hi Laszlo,
> Thanks a lot for your feedback. I have modified my next patchset
> addressing most of the comments. Summary below. But *before I submit the
> final version* I wanted to seek clarification on a few things mentioned
> below with [Dhaval]. Current PR I am planning to
> submit: https://github.com/tianocore/edk2/pull/4928
> 
> 
> I am summarizing all comments for better readability:
> (1) Split into four separate patches, in v6.                     
>  *Done*.- with some comments below
>     1a. Fix previous error from earlier patch that had declaration
> outside baselib.h
>     1b. Renaming RiscVInvalidateDataCacheAsm() to
> RiscVInvalidateDataCacheAsmFence() etc.
>     1c. Adding the new cache maintenance operations to BaseLib,
> including the
>           new assembly instruction encodings.
>     1d. Updating BaseCacheMaintenanceLib (utilizing the new BaseLib
> primitives).
>     1e. I have added another one for RiscvVirt platform kind of an
> override as 5th patch.
> (2)  This belongs to v6 patch#4, because only BaseCacheMaintenanceLib
> needs the PCD.        *Done*
> (3)  "CMO" should be expanded as "cache management operations".       *Done*
> (4)  The whole PCD is insufficiently documented.      *Done*
> (5)  Accordingly, the default value of the PCD should be
> 0x.  *Done*
> (6)  The "MdePkg/MdePkg.uni" file should be kept in sync with dec.   
> *Done*.  [Dhaval] Is this used beyond setup options? For some PCDs I do
> not find an entry in uni.

This is best cleared with the MdePkg maintainers. Some packages don't
include *.uni files at all, but in those that do, my memories are that
we always keep the PCDs in sync between *.dec and *.uni. If I remember
correctly, the *.uni files are also used by the UEFI Packaging Tool
(UPT). I recommend modifying the UNI as well.

> (7)  Belongs to v6 patch#4. *Done*     
> (8)  Please consider appending the "## CONSUMES" hint. *Done*
> (9)  Belongs to v6 patch#3. *Done*
> (10) Belongs to v6 patch#3. *Done*
> (11) I agree that we should use symbolic names rather than
> magic constants, but raw encodings of machine instructions don't belong
> into a
>      C header file. [Dhaval] This bytecode was introduced thinking what
> if all compilers do not support it. but given the default compiler in
> edk2 GCC 12 supports it
>      we can eliminate this byte encoding completely to make it easy and
> simple to consume for others.

To be honest, I can't determine the minimum expected gcc version for
edk2. "BaseTools/Conf/tools_def.template" states a minimum version for
NASM, for example, but I can't find a similar gcc requirement there.

gcc-12 does work for me personally, because my riscv cross-compiler is
"riscv64-linux-gnu-gcc (GCC) 12.1.1 20220507 (Red Hat Cross 12.1.1-1)".

If the CI environment that builds these patches also provides gcc-12+,
then I figure you should be set.

> (12) Also, filing a feature request (about these instructions). As per
> (11) it is already available.
> (13) As stated above, these two interfaces don't belong here. *Done*
> (14) As stated above, these function declarations don't belong here. *Done*
> (15) I believe this un-indented comment will not pass ECC Check /
>      uncrustify. [Dhaval] I attach my stuart_build logs. I do not see
> specific errors.https://github.com/tianocore/edk2/pull/4928
>  Pull request all passed.
> Am I missing something?

Probably not.

We usually indent the function-top comment bodies by two spaces, but if
neither uncrustify nor ECC complain, then I won't insist.

Thanks
Laszlo

> (16-17-18) The name of the function suggests the return type should be
> BOOLEAN. *Done*
> (19) Should be STATIC, and should *not* be EFIAPI. (Not a public
> interface.) *Done*
> (20) This will definitely not pass uncrustify. If you are talking about
> bad indent seen on Ops and Length- it is fixed. *Done*
> (21) Logging this error for every cache line of the requested range does
> not seem useful. I suggest checking Op before the loop. *Done*
> (22) As stated above, the API renames -- together with the updated
> leading comments -- belong in v6 patch#2. *Done*
> (23) As stated above, the API renames -- together with the updated
> leading comments -- belong in v6 patch#2. *Done*
> (24) The DEBUG message seems bogus; invalidating the whole I-Cache *is*
> what is being requested here. *Done*
> (25-26) The *API* renames belong to v6 patch#2. & The new APIs, plus the
> *file* rename, belong to v6 patch#3. *Done*
> (27) Please use the assembler macros from point (11). Please see (11)
> (28-29-30-31) Please do not abbreviate RISC-V as "RV". It's incredibly
> confusing.  Inconsistent spelling in the patch subject: "RISCV CMO".
> ditto; should be RISC-V.ditto, should be PcdRiscVFeatureOverride *Done*
> (32-33) Total inconsistency, RV64_ versus RV_.  Should be
> RiscVIsCMOEnabled (upper case 

Re: [edk2-devel] [PATCH v5 2/2] OvmfPkg/RiscVVirt: Override for RV CPU Features

2023-10-19 Thread Dhaval Sharma
Hi Laszlo,
Thanks a lot for your feedback. I have modified my next patchset addressing
most of the comments. Summary below. But *before I submit the final
version* I wanted to seek clarification on a few things mentioned below
with [Dhaval]. Current PR I am planning to submit:
https://github.com/tianocore/edk2/pull/4928

I am summarizing all comments for better readability:
(1) Split into four separate patches, in v6.   *Done*.-
with some comments below
1a. Fix previous error from earlier patch that had declaration outside
baselib.h
1b. Renaming RiscVInvalidateDataCacheAsm() to
RiscVInvalidateDataCacheAsmFence() etc.
1c. Adding the new cache maintenance operations to BaseLib, including
the
  new assembly instruction encodings.
1d. Updating BaseCacheMaintenanceLib (utilizing the new BaseLib
primitives).
1e. I have added another one for RiscvVirt platform kind of an override
as 5th patch.
(2)  This belongs to v6 patch#4, because only BaseCacheMaintenanceLib needs
the PCD.*Done*
(3)  "CMO" should be expanded as "cache management operations".   *Done*
(4)  The whole PCD is insufficiently documented.  *Done*
(5)  Accordingly, the default value of the PCD should be
0x.  *Done*
(6)  The "MdePkg/MdePkg.uni" file should be kept in sync with dec.
*Done*.  [Dhaval] Is this used beyond setup options? For some PCDs I do not
find an entry in uni.
(7)  Belongs to v6 patch#4. *Done*
(8)  Please consider appending the "## CONSUMES" hint. *Done*
(9)  Belongs to v6 patch#3. *Done*
(10) Belongs to v6 patch#3. *Done*
(11) I agree that we should use symbolic names rather than magic constants,
but raw encodings of machine instructions don't belong into a
 C header file. [Dhaval] This bytecode was introduced thinking what if
all compilers do not support it. but given the default compiler in edk2 GCC
12 supports it
 we can eliminate this byte encoding completely to make it easy and
simple to consume for others.
(12) Also, filing a feature request (about these instructions). As per (11)
it is already available.
(13) As stated above, these two interfaces don't belong here. *Done*
(14) As stated above, these function declarations don't belong here. *Done*
(15) I believe this un-indented comment will not pass ECC Check /
 uncrustify. [Dhaval] I attach my stuart_build logs. I do not see
specific errors.https://github.com/tianocore/edk2/pull/4928 Pull request
all passed. Am I missing something?
(16-17-18) The name of the function suggests the return type should be
BOOLEAN. *Done*
(19) Should be STATIC, and should *not* be EFIAPI. (Not a public
interface.) *Done*
(20) This will definitely not pass uncrustify. If you are talking about bad
indent seen on Ops and Length- it is fixed. *Done*
(21) Logging this error for every cache line of the requested range does
not seem useful. I suggest checking Op before the loop. *Done*
(22) As stated above, the API renames -- together with the updated leading
comments -- belong in v6 patch#2. *Done*
(23) As stated above, the API renames -- together with the updated leading
comments -- belong in v6 patch#2. *Done*
(24) The DEBUG message seems bogus; invalidating the whole I-Cache *is*
what is being requested here. *Done*
(25-26) The *API* renames belong to v6 patch#2. & The new APIs, plus the
*file* rename, belong to v6 patch#3. *Done*
(27) Please use the assembler macros from point (11). Please see (11)
(28-29-30-31) Please do not abbreviate RISC-V as "RV". It's incredibly
confusing.  Inconsistent spelling in the patch subject: "RISCV CMO". ditto;
should be RISC-V.ditto, should be PcdRiscVFeatureOverride *Done*
(32-33) Total inconsistency, RV64_ versus RV_.  Should be RiscVIsCMOEnabled
(upper case V). *Done*

On Tue, Oct 17, 2023 at 8:09 PM Laszlo Ersek  wrote:

> On 10/17/23 14:17, Dhaval Sharma wrote:
> > This PCD provides a way for platform to override any
> > HW features that are default enabled by previous stages
> > of FW (like OpenSBI). For the case where previous/prev
> > stage has disabled the feature, this override is not
> > useful and its usage should be avoided.
> >
> > Ard Biesheuvel 
> > Jiewen Yao 
> > Jordan Justen 
> > Gerd Hoffmann 
> > Sunil V L 
> > Andrei Warkentin 
>
> (4) You forgot to prepend "Cc:".
>
> (5) The cover letter (0/2 email here) should contain all the Cc: tags
> from the patches' commit messages, so that whoever gets at least one
> patch CC'd from the series also get the cover letter for the series.
>
> Thanks
> Laszlo
>
> >
> > Signed-off-by: Dhaval Sharma 
> > ---
> >  OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc
> b/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc
> > index fe320525153f..8b5e010316ba 100644
> > --- a/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc
> > +++ b/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc
> > @@ -203,6 +203,8 @@ [PcdsFeatureFlag]
> >

Re: [edk2-devel] [PATCH] OvmfPkg/VirtioFsDxe: tolerate opening an abs. pathname rel. to a reg. file

2023-10-19 Thread Gerd Hoffmann
On Wed, Oct 18, 2023 at 07:24:34PM +0200, Laszlo Ersek wrote:
> Referring to a file relative to a regular file makes no sense (or at least
> it cannot be implemented consistently with how a file is referred to
> relative to a directory). VirtioFsSimpleFileOpen() has enforced this
> strictly since the beginning, and a few months ago I reported USWG Mantis
> ticket #2367 [1] too, for clearing up the related confusion in the UEFI
> spec.
> 
> Unfortunately, the shim boot loader contains such a bug [2] [3]. I don't
> believe the shim bug is ever going to be fixed. We can however relax the
> check in VirtioFsSimpleFileOpen() a bit: if the pathname that's being
> opened relative to a regular file is absolute, then the base file is going
> to be ignored anyway, so we can let the caller's bug slide. This happens
> to make shim work.
> 
> Why this matters: UEFI-bootable Linux installer ISOs tend to come with
> shim and grub in the embedded (ElTorito) FAT image (ESP). Sometimes you
> want to build upstream shim/grub binaries, but boot the same ISO
> otherwise. The fastest way for overriding the ESP for this purpose is to
> copy its original contents to a virtio filesystem, then overwrite the shim
> and grub binaries from the host side. Note that this is different from
> direct-booting a kernel (via fw_cfg); the point is to check whether the
> just-built shim and grub are able to boot the rest of the ISO.
> 
> [1] https://mantis.uefi.org/mantis/view.php?id=2367
> [2] https://bugzilla.redhat.com/show_bug.cgi?id=1966973
> [3] https://github.com/rhboot/shim/issues/382
> 
> Cc: Ard Biesheuvel 
> Cc: Gerd Hoffmann 
> Cc: Jiewen Yao 
> Cc: Jordan Justen 
> Signed-off-by: Laszlo Ersek 

Reviewed-by: Gerd Hoffmann 
Tested-by: Gerd Hoffmann 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109795): https://edk2.groups.io/g/devel/message/109795
Mute This Topic: https://groups.io/mt/102044004/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 1/1] Maintainers.txt: Update maintainers list

2023-10-19 Thread Nickle Wang via groups.io
Acked-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Thursday, October 19, 2023 1:43 PM
> To: devel@edk2.groups.io
> Cc: Andrew Fish ; Leif Lindholm ;
> Michael D Kinney ; Abdul Lateef Attar
> ; Nickle Wang ; Jian J
> Wang ; Liming Gao ;
> Zhiguang Liu ; Eric Dong ; Ray Ni
> ; Rahul Kumar ; Gerd Hoffmann
> 
> Subject: [PATCH 1/1] Maintainers.txt: Update maintainers list
>
> External email: Use caution opening links or attachments
>
>
> From: Abner Chang 
>
> - Add two entries of MdePkg and MdeModulePkg for
>   manageability modules and files.
> - Add one entry of UefiCpuPkg AMD related files.
>
> Signed-off-by: Abner Chang 
> Cc: Andrew Fish 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Abdul Lateef Attar 
> Cc: Nickle Wang 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Cc: Eric Dong 
> Cc: Ray Ni 
> Cc: Rahul Kumar 
> Cc: Gerd Hoffmann 
> ---
>  Maintainers.txt | 21 +
>  1 file changed, 21 insertions(+)
>
> diff --git a/Maintainers.txt b/Maintainers.txt index 1a7525b1b4c..4bec19832f4
> 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -443,6 +443,13 @@ F:
> MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h
>  M: Richard Ho  [richardho]
>  R: Rebecca Cran  [bcran]
>
> +MdeModulePkg: Manageability modules
> +F: MdeModulePkg/Include/*Ipmi*.*
> +F: MdeModulePkg/Library/*Ipmi*.*
> +M: Abner Chang  [changab]
> +R: Abdul Lateef Attar  [abdattar]
> +R: Nickle Wang  [nicklela]
> +
>  MdePkg
>  F: MdePkg/
>  W:
> https://github.co/
> m%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FMdePkg=05%7C01%7Cn
> icklew%40nvidia.com%7C19ae524dd28b4d2af5a108dbd0666ef6%7C43083d157
> 27340c1b7db39efd9ccc17a%7C0%7C0%7C638332910617920407%7CUnknown
> %7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL
> CJXVCI6Mn0%3D%7C3000%7C%7C%7C=ucUKG4eTnf%2BoX7c5gqIKEwaa
> sXxqGNpzexoUDfmajLQ%3D=0
> @@ -468,6 +475,14 @@ R: Gua Guo  [gguo11837463]
>  R: Chasel Chiu  [ChaselChiu]
>  R: James Lu  [jameslu8]
>
> +MdePkg: Manageability industryStandard standard C header files
> +F: MdePkg/Include/IndustryStandard/*Ipmi*.h
> +F: MdePkg/Include/IndustryStandard/*Mctp*.h
> +F: MdePkg/Include/IndustryStandard/*Pldm*.h
> +M: Abner Chang  [changab]
> +R: Abdul Lateef Attar  [abdattar]
> +R: Nickle Wang  [nicklela]
> +
>  NetworkPkg
>  F: NetworkPkg/
>  W:
> https://github.co/
> m%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FNetworkPkg=05%7C01
> %7Cnicklew%40nvidia.com%7C19ae524dd28b4d2af5a108dbd0666ef6%7C43083
> d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638332910617920407%7CUnkn
> own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha
> WwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=UbJX%2FCKOqxJx7BxejmzV
> oGEvj0jxi8snAYL%2F6FSgJR4%3D=0
> @@ -657,6 +672,12 @@ F: UefiCpuPkg/ResetVector/
>  R: Debkumar De  [dde01]
>  R: Catharine West  [catharine-intl]
>
> +UefiCpuPkg: AMD related files
> +F: UefiCpuPkg/Library/MmSaveStateLib/*Amd*.*
> +F: UefiCpuPkg/Library/SmmCpuFeaturesLib/*Amd*.*
> +M: Abdul Lateef Attar  [abdattar]
> +R: Abner Chang  [changab]
> +
>  UefiPayloadPkg
>  F: UefiPayloadPkg/
>  W:
> https://github.co/
> m%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FUefiPayloadPkg=05%7C
> 01%7Cnicklew%40nvidia.com%7C19ae524dd28b4d2af5a108dbd0666ef6%7C430
> 83d15727340c1b7db39efd9ccc17a%7C0%7C0%7C638332910617920407%7CUn
> known%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1h
> aWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C=jzgjQra0EsPmGv0wp1Tfpj
> LmtMW2ZuNi8MmDchI%2BIK0%3D=0
> --
> 2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109794): https://edk2.groups.io/g/devel/message/109794
Mute This Topic: https://groups.io/mt/102055114/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH V1 2/2] OvmfPkg/AcpiPlatformDxe: Check the status to ensure no error

2023-10-19 Thread sunceping
From: Ceping Sun 

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

The status of "AcpiProtocol->InstallAcpiTable" is overwritten
before it can be used, it is better to check it before overwriting.

Cc: Gerd Hoffmann 
Cc: Jiewen Yao 
Cc: Min Xu 
Signed-off-by: Ceping Sun 
---
 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c 
b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
index 24c22bb646ca..7e2adcaa82d3 100644
--- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
@@ -53,6 +53,11 @@ InstallCloudHvTablesTdx (
CurrentTable->Length,

);
+  if (EFI_ERROR (Status)) {
+ASSERT_EFI_ERROR (Status);
+return Status;
+  }
+
   for (UINTN i = 0; i < CurrentTable->Length; i++) {
 DEBUG ((DEBUG_INFO, " %x", *((UINT8 *)CurrentTable + i)));
   }
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109793): https://edk2.groups.io/g/devel/message/109793
Mute This Topic: https://groups.io/mt/102055425/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH V1 1/2] OvmfPkg/AcpiPlatformDxe: Avoid possible NULL pointer dereference

2023-10-19 Thread sunceping
From: Ceping Sun 

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

The function InstallCloudHvTablesTdx had an Assert when "DsdtTable == NULL",
but this comes into play only in DEBUG mode. In Release mode , there is
no handling if the pointer is NULL. To avoid the possible null pointer
dereference, it is better to handle it when the pointer is null.

Cc: Gerd Hoffmann 
Cc: Jiewen Yao 
Cc: Min Xu 
Signed-off-by: Ceping Sun 
---
 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c 
b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
index d3e73c155e8f..24c22bb646ca 100644
--- a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
+++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c
@@ -71,6 +71,7 @@ InstallCloudHvTablesTdx (
   if (DsdtTable == NULL) {
 DEBUG ((DEBUG_INFO, "%a: no DSDT found\n", __func__));
 ASSERT (FALSE);
+CpuDeadLoop ();
   }
 
   Status = AcpiProtocol->InstallAcpiTable (
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109792): https://edk2.groups.io/g/devel/message/109792
Mute This Topic: https://groups.io/mt/102055424/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH V1 0/2] OvmfPkg/AcpiPlatformDxe: Fix the coverity errors

2023-10-19 Thread sunceping
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4568

Coverity report 2 issues in OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c.

In the function InstallCloudHvTablesTdx, the pointer is already checked. 
  if (DsdtTable == NULL) {
DEBUG ((DEBUG_INFO, "%a: no DSDT found\n", __func__));
ASSERT (FALSE);
  }
But this comes into play only in DEBUG mode, in Release mode, that would be an 
error 
with dereferencing null pointer. Fix this by adding CpuDeadLoop() after assert. 

In addition, the status of "AcpiProtocol->InstallAcpiTable" is overwritten 
before
it can be used in the function, it is better to check it before overwriting.

code: https://github.com/sunceping/edk2/tree/fixcoverityerrors.v1

Cc: Gerd Hoffmann 
Cc: Jiewen Yao 
Cc: Min Xu 
Signed-off-by: Ceping Sun 

Ceping Sun (2):
  OvmfPkg/AcpiPlatformDxe: Avoid possible NULL pointer dereference
  OvmfPkg/AcpiPlatformDxe: Check the status to ensure no error

 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 6 ++
 1 file changed, 6 insertions(+)

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109791): https://edk2.groups.io/g/devel/message/109791
Mute This Topic: https://groups.io/mt/102055422/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-