Re: [edk2-devel] CryptoPkg OpensslLib TLSv1.3 support

2024-05-20 Thread Li, Yi
No, Tls1.3 is not supported yet: 
https://github.com/tianocore/edk2/blob/7142e648416ff5d3eac6c6d607874805f5de0ca8/CryptoPkg/Library/OpensslLib/OpensslGen/include/openssl/configuration-ec.h#L271-L273

We have a BZ to track it but afaik no dedicated folk working on it.
https://bugzilla.tianocore.org/show_bug.cgi?id=2424

Regards,
Yi

From: devel@edk2.groups.io  On Behalf Of eddie wang
Sent: Tuesday, May 21, 2024 11:39 AM
To: devel@edk2.groups.io
Subject: [edk2-devel] CryptoPkg OpensslLib TLSv1.3 support

Hi all,
I have a question about the OpenSSL library in CryptoPkg. Does tlsv1.3 support 
exist in the current OpensslLib? If not, is there a way to make TLSV1.3 support 
possible?
Many thanks.

BR,
Eddie



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




[edk2-devel] CryptoPkg OpensslLib TLSv1.3 support

2024-05-20 Thread eddie wang
Hi all,
I have a question about the OpenSSL library in CryptoPkg. Does tlsv1.3 support 
exist in the current OpensslLib? If not, is there a way to make TLSV1.3 support 
possible?
Many thanks.

BR,
Eddie


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119096): https://edk2.groups.io/g/devel/message/119096
Mute This Topic: https://groups.io/mt/106217831/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 1/1] CodeQL: Update from 2.16.1 to 2.17.3

2024-05-20 Thread Michael D Kinney
Merged.  https://github.com/tianocore/edk2/pull/5667


Mike

> -Original Message-
> From: Michael Kubacki 
> Sent: Monday, May 20, 2024 6:41 PM
> To: Kinney, Michael D ; devel@edk2.groups.io;
> Andrew Fish ; Leif Lindholm ;
> Liming Gao 
> Cc: Feng, Bob C ; Joey Vagedes
> ; Rebecca Cran ; Sean Brogan
> ; Chen, Christine 
> Subject: Re: [PATCH v1 1/1] CodeQL: Update from 2.16.1 to 2.17.3
> 
> Just wanted to send a reminder that I recommend
> https://github.com/tianocore/edk2/pull/5667 be merged to unblock CI for
> those that are currently trying to test changes.
> 
> Thanks,
> Michael
> 
> On 5/17/2024 8:10 PM, Kinney, Michael D wrote:
> > Approved. I agree there is no impact to FW.
> >
> > Mike
> >
> >> -Original Message-
> >> From: Michael Kubacki 
> >> Sent: Friday, May 17, 2024 4:28 PM
> >> To: Kinney, Michael D ; devel@edk2.groups.io;
> >> Andrew Fish ; Leif Lindholm ;
> >> Liming Gao 
> >> Cc: Feng, Bob C ; Joey Vagedes
> >> ; Rebecca Cran ; Sean Brogan
> >> ; Chen, Christine 
> >> Subject: Re: [PATCH v1 1/1] CodeQL: Update from 2.16.1 to 2.17.3
> >>
> >> Forgot about the hard freeze.
> >>
> >> Added remaining stewards to consider merging this. It has no impact on
> >> firmware but is needed to unblock an immediate issue in CI where the
> >> CodeQL queries being fetched are newer and incompatible with the CodeQL
> >> CLI being used.
> >>
> >> As I mentioned in the release notes, I will follow up in the future for
> >> a change that should be able to lock the CodeQL query versions against
> >> the CLI version.
> >>
> >> Thanks,
> >> Michael
> >>
> >> On 5/17/2024 7:20 PM, Michael Kubacki wrote:
> >>> To ensure CI is unblocked, I am going to add the push tag now.
> >>>
> >>> On 5/17/2024 6:31 PM, Michael Kubacki wrote:
>  Thanks Mike. Are you okay with me completing the PR now?
> 
>  On 5/17/2024 5:31 PM, Kinney, Michael D wrote:
> > Reviewed-by: Michael D Kinney 
> >
> >> -Original Message-
> >> From: mikub...@linux.microsoft.com 
> >> Sent: Friday, May 17, 2024 2:09 PM
> >> To: devel@edk2.groups.io
> >> Cc: Feng, Bob C ; Joey Vagedes
> >> ; Liming Gao ;
> >> Kinney,
> >> Michael D ; Rebecca Cran
> >> ;
> >> Sean Brogan ; Chen, Christine
> >> 
> >> Subject: [PATCH v1 1/1] CodeQL: Update from 2.16.1 to 2.17.3
> >>
> >> From: Michael Kubacki 
> >>
> >> This fixes an issue where the CodeQL queries currently fetched in the
> >> pipeline are incompatible with the current executable used.
> >>
> >> Update to pick up functional and security fixes. See the following
> >> comparison for detailed differences:
> >>
> >> https://github.com/github/codeql-cli-
> binaries/compare/v2.16.1...v2.17.3
> >>
> >> Cc: Bob Feng 
> >> Cc: Joey Vagedes 
> >> Cc: Liming Gao 
> >> Cc: Michael D Kinney 
> >> Cc: Rebecca Cran 
> >> Cc: Sean Brogan 
> >> Cc: Yuwei Chen 
> >> Signed-off-by: Michael Kubacki 
> >> ---
> >>
> >> Notes:
> >>   This change fixes an immediate compatibility issue between
> >>   the latest queries being pulled and the CodeQL CLI being
> >>   used.
> >>
> >>   A follow up change will attempt to lock queries against a
> >>   compatibile version to prevent queries from pulling ahead
> >>   to incompatible versions in the future.
> >>
> >>   ---
> >>
> >>   This change was tested in edk2 CI:
> >>
> >>   https://github.com/tianocore/edk2/pull/5667
> >>
> >>    BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml | 6 +++---
> >>    BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml   | 6 +++---
> >>    BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml | 6 +++---
> >>    3 files changed, 9 insertions(+), 9 deletions(-)
> >>
> >> diff --git a/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
> >> b/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
> >> index 5ec56c6bf06f..dbc9c2ba0290 100644
> >> --- a/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
> >> +++ b/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
> >> @@ -16,9 +16,9 @@
> >>      "scope": "codeql-ext-dep",
> >>      "type": "web",
> >>      "name": "codeql_cli",
> >> -  "source": "https://github.com/github/codeql-cli-
> >> binaries/releases/download/v2.16.1/codeql.zip",
> >> -  "version": "2.16.1",
> >> -  "sha256":
> >> "86a98f6ebb8fd49efadf367f3275c438669fcb8426962c33415129aad8e093e6",
> >> +  "source": "https://github.com/github/codeql-cli-
> >> binaries/releases/download/v2.17.3/codeql.zip",
> >> +  "version": "2.17.3",
> >> +  "sha256":
> >> "e5ac1d87ab38e405c9af5db234a338b10dffabc98a648903f1664dd2a566dfd5",
> >>      "compression_type": "zip",
> >>      "internal_path": "/codeql/",
> >>      "flags": ["set_shell_var", ],
> >> diff --git 

Re: [edk2-devel] [PATCH v1 1/1] CodeQL: Update from 2.16.1 to 2.17.3

2024-05-20 Thread Michael Kubacki
Just wanted to send a reminder that I recommend 
https://github.com/tianocore/edk2/pull/5667 be merged to unblock CI for 
those that are currently trying to test changes.


Thanks,
Michael

On 5/17/2024 8:10 PM, Kinney, Michael D wrote:

Approved. I agree there is no impact to FW.

Mike


-Original Message-
From: Michael Kubacki 
Sent: Friday, May 17, 2024 4:28 PM
To: Kinney, Michael D ; devel@edk2.groups.io;
Andrew Fish ; Leif Lindholm ;
Liming Gao 
Cc: Feng, Bob C ; Joey Vagedes
; Rebecca Cran ; Sean Brogan
; Chen, Christine 
Subject: Re: [PATCH v1 1/1] CodeQL: Update from 2.16.1 to 2.17.3

Forgot about the hard freeze.

Added remaining stewards to consider merging this. It has no impact on
firmware but is needed to unblock an immediate issue in CI where the
CodeQL queries being fetched are newer and incompatible with the CodeQL
CLI being used.

As I mentioned in the release notes, I will follow up in the future for
a change that should be able to lock the CodeQL query versions against
the CLI version.

Thanks,
Michael

On 5/17/2024 7:20 PM, Michael Kubacki wrote:

To ensure CI is unblocked, I am going to add the push tag now.

On 5/17/2024 6:31 PM, Michael Kubacki wrote:

Thanks Mike. Are you okay with me completing the PR now?

On 5/17/2024 5:31 PM, Kinney, Michael D wrote:

Reviewed-by: Michael D Kinney 


-Original Message-
From: mikub...@linux.microsoft.com 
Sent: Friday, May 17, 2024 2:09 PM
To: devel@edk2.groups.io
Cc: Feng, Bob C ; Joey Vagedes
; Liming Gao ;
Kinney,
Michael D ; Rebecca Cran
;
Sean Brogan ; Chen, Christine

Subject: [PATCH v1 1/1] CodeQL: Update from 2.16.1 to 2.17.3

From: Michael Kubacki 

This fixes an issue where the CodeQL queries currently fetched in the
pipeline are incompatible with the current executable used.

Update to pick up functional and security fixes. See the following
comparison for detailed differences:

https://github.com/github/codeql-cli-binaries/compare/v2.16.1...v2.17.3

Cc: Bob Feng 
Cc: Joey Vagedes 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Sean Brogan 
Cc: Yuwei Chen 
Signed-off-by: Michael Kubacki 
---

Notes:
  This change fixes an immediate compatibility issue between
  the latest queries being pulled and the CodeQL CLI being
  used.

  A follow up change will attempt to lock queries against a
  compatibile version to prevent queries from pulling ahead
  to incompatible versions in the future.

  ---

  This change was tested in edk2 CI:

  https://github.com/tianocore/edk2/pull/5667

   BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml | 6 +++---
   BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml   | 6 +++---
   BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml | 6 +++---
   3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
b/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
index 5ec56c6bf06f..dbc9c2ba0290 100644
--- a/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
+++ b/BaseTools/Plugin/CodeQL/codeqlcli_ext_dep.yaml
@@ -16,9 +16,9 @@
     "scope": "codeql-ext-dep",
     "type": "web",
     "name": "codeql_cli",
-  "source": "https://github.com/github/codeql-cli-
binaries/releases/download/v2.16.1/codeql.zip",
-  "version": "2.16.1",
-  "sha256":
"86a98f6ebb8fd49efadf367f3275c438669fcb8426962c33415129aad8e093e6",
+  "source": "https://github.com/github/codeql-cli-
binaries/releases/download/v2.17.3/codeql.zip",
+  "version": "2.17.3",
+  "sha256":
"e5ac1d87ab38e405c9af5db234a338b10dffabc98a648903f1664dd2a566dfd5",
     "compression_type": "zip",
     "internal_path": "/codeql/",
     "flags": ["set_shell_var", ],
diff --git a/BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml
b/BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml
index 5b4a919f1de4..536322f2b331 100644
--- a/BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml
+++ b/BaseTools/Plugin/CodeQL/codeqlcli_linux_ext_dep.yaml
@@ -14,9 +14,9 @@
     "scope": "codeql-linux-ext-dep",
     "type": "web",
     "name": "codeql_linux_cli",
-  "source": "https://github.com/github/codeql-cli-
binaries/releases/download/v2.16.1/codeql-linux64.zip",
-  "version": "2.16.1",
-  "sha256":
"40dbb6c0c4064bd14601a02e60c61661fdc0271469f90eb91a2e7d51d4cbc171",
+  "source": "https://github.com/github/codeql-cli-
binaries/releases/download/v2.17.3/codeql-linux64.zip",
+  "version": "2.17.3",
+  "sha256":
"9fba000c4b821534d354bc16821aa066fdb1304446226ea449870e64a8ad3c7a",
     "compression_type": "zip",
     "internal_path": "/codeql/",
     "flags": ["set_shell_var", ],
diff --git a/BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml
b/BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml
index c0c018c9538f..93a81ffd5020 100644
--- a/BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml
+++ b/BaseTools/Plugin/CodeQL/codeqlcli_windows_ext_dep.yaml
@@ -14,9 +14,9 @@
     "scope": "codeql-windows-ext-dep",
     "type": "web",
     "name": "codeql_windows_cli",
-  

[edk2-devel] PR Process Wiki Updates

2024-05-20 Thread Michael Kubacki
In preparation for the transition to a pull request (PR) contribution 
process, I've updated the TianoCore wiki.


- Current official TianoCore wiki: 
https://github.com/tianocore/tianocore.github.io/wiki/


- My fork with proposed changes: 
https://github.com/makubacki/tianocore.github.io/wiki


- A PR that shows a diff of the changes: 
https://github.com/makubacki/tianocore.github.io/pull/2


This was presented in the TianoCore Tools & CI meeting today. I captured 
feedback from the meeting as PR comments. The actionable items currently 
there will be completed by Thursday, 5/23 this week.


Please feel free to let me know if you have any feedback.

Thanks,
Michael


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




[edk2-devel] Now: Tools, CI, Code base construction meeting series - Monday, May 20, 2024 #cal-notice

2024-05-20 Thread Group Notification
*Tools, CI, Code base construction meeting series*

*When:*
Monday, May 20, 2024
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZDI2ZDg4NmMtMjI1My00MzI5LWFmYjAtMGQyNjUzNTBjZGYw%40thread.v2/0?context=%7b%22Tid%22%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%2223af6561-6e1c-450d-b917-d9d674eb3cb6%22%7d

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

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119092): https://edk2.groups.io/g/devel/message/119092
Mute This Topic: https://groups.io/mt/106214741/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: Tools, CI, Code base construction meeting series - Monday, May 20, 2024 #cal-reminder

2024-05-20 Thread Group Notification
*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, May 20, 2024
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZDI2ZDg4NmMtMjI1My00MzI5LWFmYjAtMGQyNjUzNTBjZGYw%40thread.v2/0?context=%7b%22Tid%22%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%2223af6561-6e1c-450d-b917-d9d674eb3cb6%22%7d

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

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to discuss build, 
CI, tools, and other related topics. If you are interested, have ideas/opinions 
please join us. These meetings will be Monday 4:30pm Pacific Time on Microsoft 
Teams.

MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614

Anyone is welcome to join.

* tianocore/edk2: EDK II (github.com)
* tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP module 
(github.com) https://github.com/tianocore/edk2-basetools
* tianocore/edk2-pytool-extensions: Extensions to the edk2 build system 
allowing for a more robust and plugin based build system and tool execution 
environment (github.com) https://github.com/tianocore/edk2-pytool-extensions
* tianocore/edk2-pytool-library: Python library package that supports UEFI 
development (github.com) https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119091): https://edk2.groups.io/g/devel/message/119091
Mute This Topic: https://groups.io/mt/106194775/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] Event: Tools, CI, Code base construction meeting series - Monday, May 20, 2024 #cal-reminder

2024-05-20 Thread Sean
FYI - Since PRs are targeted to be enabled on Friday may 24th we will 
host this meeting today to close/align on any concerns.


Look forward to seeing everyone there.

thanks

Sean




On 5/19/2024 4:30 PM, Group Notification wrote:


*Reminder: Tools, CI, Code base construction meeting series*

*When:*
Monday, May 20, 2024
4:30pm to 5:30pm
(UTC-07:00) America/Los Angeles

*Where:*
https://teams.microsoft.com/l/meetup-join/19%3ameeting_ZDI2ZDg4NmMtMjI1My00MzI5LWFmYjAtMGQyNjUzNTBjZGYw%40thread.v2/0?context=%7b%22Tid%22%3a%2272f988bf-86f1-41af-91ab-2d7cd011db47%22%2c%22Oid%22%3a%2223af6561-6e1c-450d-b917-d9d674eb3cb6%22%7d 



View Event 

*Description:*

TianoCore community,

Microsoft and Intel will be hosting a series of open meetings to 
discuss build, CI, tools, and other related topics. If you are 
interested, have ideas/opinions please join us. These meetings will be 
Monday 4:30pm Pacific Time on Microsoft Teams.


MS Teams Link in following discussion: * 
https://github.com/tianocore/edk2/discussions/2614


Anyone is welcome to join.

  * tianocore/edk2: EDK II (github.com)
  * tianocore/edk2-basetools: EDK II BaseTools Python tools as a PIP
module (github.com) https://github.com/tianocore/edk2-basetools
  * tianocore/edk2-pytool-extensions: Extensions to the edk2 build
system allowing for a more robust and plugin based build system
and tool execution environment (github.com)
https://github.com/tianocore/edk2-pytool-extensions
  * tianocore/edk2-pytool-library: Python library package that
supports UEFI development (github.com)
https://github.com/tianocore/edk2-pytool-library

MS Teams Browser Clients * 
https://docs.microsoft.com/en-us/microsoftteams/get-clients?tabs=Windows#browser-client






-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119090): https://edk2.groups.io/g/devel/message/119090
Mute This Topic: https://groups.io/mt/106194775/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 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-20 Thread Sean
I can't find patch 1 in the series in my email so putting a few comments 
here.  I really hope this patch series can wait for PRs so code comments 
can more easily be correlated with code change.


Looking at your PR with commit: Allocate Varaible cache buffer in PEI by 
td36 · Pull Request #5607 · tianocore/edk2 (github.com) 



A few comments for now.

Variable is spelled incorrectly in commit message.

I would really prefer to not mix PCDs and Hobs.  It is really confusing 
what has to be turned on and set to what to get the different 
behaviors.  For a hob producer it is OK to take that info from PCDs but 
lets not mix in the consumer code PCDs and hob data.  The HOB definition 
should not reference a PCD and a HOB definition should not be focused on 
producer/consumer but on the data.


The existence of a hob is also a good indicator that a feature is used 
so you may not need to have "enable" PCDs anymore.


Please don't include other header files in public header files 
(especially for super common headers like PiPei.h.  i know over the last 
few years this practice has become more common but it just creates pain 
when debugging build errors.  The trade off is not worth it.


Hobs really shouldn't use UINTN sizes.  Since hobs helps transfer config 
state across phases where the size of UINTN may be different this causes 
problems.


Hobs used for cross phase sharing shouldn't have pointers for the reason.

Better and more complete comments on the different field members would 
be helpful.  I assume the "Buffer" fields are physical addresses and the 
"Pages" are number of 4K pages.   I would suggest EFI_PHYSICAL_ADDRESS 
for addresses and UINT64 for lengths.


More details on what the three cache's are would be helpful or at least 
reference the feature of the cache they are supporting.


This hob definition file isn't perfect and I believe some of the comment 
in the file header belong in different places, it is at least a good 
template for a hob definition.


edk2/MdeModulePkg/Include/Guid/VariableFlashInfo.h at 
284dbac43da752ee34825c8b3f6f9e8281cb5a19 · tianocore/edk2 (github.com) 




Thanks

Sean



On 5/17/2024 2:49 AM, duntan wrote:

This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used 
to store the address and size of the buffer that will be used for variable 
runtime service when the PcdEnableVariableRuntimeCache is TRUE.
In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei 
will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate the 
needed buffer for different type variable runtime cache and build the HOB.
Then VariableSmmRuntimeDxe driver will consume 
gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime cache 
related content. The code to allocate and unblock the runtime cache buffer in 
VariableSmmRuntimeDxe is also removed in this patc set.

PR for review:https://github.com/tianocore/edk2/pull/5607

Cc: Ray Ni
Cc: Liming Gao
Cc: Jiaxin Wu
Cc: Ard Biesheuvel
Cc: Leif Lindholm
Cc: Sami Mujawar
Cc: Gerd Hoffmann
Cc: Andrew Fish
Cc: Jiewen Yao

Dun Tan (9):
   MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid
   ArmVirtPkg: Add MmUnblockMemoryLib in DSC
   EmulatorPkg: Add MmUnblockMemoryLib in DSC
   OvmfPkg: Add MmUnblockMemoryLib in DSC
   MdeModulePkg:Create gEdkiiVariableRuntimeCacheInfoHobGuid
   MdeModulePkg:Remove unnecessary global variable
   MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid
   MdeModulePkg: Refine InitVariableCache()
   MdeModulePkg:Add global variable mVariableRtCacheInfo

  ArmVirtPkg/ArmVirtCloudHv.dsc|   2 ++
  EmulatorPkg/EmulatorPkg.dsc  |   1 +
  MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h |  65 
+
  MdeModulePkg/MdeModulePkg.dec|   3 +++
  MdeModulePkg/Universal/Variable/Pei/Variable.c   | 298 
+-
  MdeModulePkg/Universal/Variable/Pei/Variable.h   |   3 +++
  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf  |   8 
+++-
  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c   | 293 

Re: [edk2-devel] [PATCH ovmf v3 4/5] UefiCpuPkg: Add AMD SEV-ES features support

2024-05-20 Thread Lendacky, Thomas via groups.io

On 5/2/24 09:34, Alexey Kardashevskiy wrote:

CONFIDENTIAL_COMPUTING_GUEST_ATTR is not a simple SEV level anymore
and includes a feature mask since a previous commit.

This fixes AmdMemEncryptionAttrCheck to check the level and feature
correctly and adds DebugSwap support.

Since the actual feature flag is not set yet, this should cause
no behavioural change.

Cc: Gerd Hoffmann 
Cc: Jiaxin Wu 
Cc: Rahul Kumar 
Cc: Ray Ni 
Cc: Tom Lendacky 
Signed-off-by: Alexey Kardashevskiy 


Reviewed-by: Tom Lendacky 


---
  UefiCpuPkg/Library/MpInitLib/MpLib.c | 12 +---
  1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c 
b/UefiCpuPkg/Library/MpInitLib/MpLib.c
index d7244565029d..52fddfb7e571 100644
--- a/UefiCpuPkg/Library/MpInitLib/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c
@@ -3178,19 +3178,25 @@ AmdMemEncryptionAttrCheck (
IN  CONFIDENTIAL_COMPUTING_GUEST_ATTR  Attr
)
  {
+  UINT64  CurrentLevel;
+
+  CurrentLevel = CurrentAttr & CCAttrTypeMask;
+
switch (Attr) {
  case CCAttrAmdSev:
//
// SEV is automatically enabled if SEV-ES or SEV-SNP is active.
//
-  return CurrentAttr >= CCAttrAmdSev;
+  return CurrentLevel >= CCAttrAmdSev;
  case CCAttrAmdSevEs:
//
// SEV-ES is automatically enabled if SEV-SNP is active.
//
-  return CurrentAttr >= CCAttrAmdSevEs;
+  return CurrentLevel >= CCAttrAmdSevEs;
  case CCAttrAmdSevSnp:
-  return CurrentAttr == CCAttrAmdSevSnp;
+  return CurrentLevel == CCAttrAmdSevSnp;
+case CCAttrFeatureAmdSevDebugSwap:
+  return !!(CurrentAttr & CCAttrFeatureAmdSevDebugSwap);
  default:
return FALSE;
}



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




Re: [edk2-devel] [PATCH ovmf v3 3/5] OvmfPkg: Add AMD SEV-ES DebugSwap feature support

2024-05-20 Thread Lendacky, Thomas via groups.io

On 5/2/24 09:34, Alexey Kardashevskiy wrote:

The SEV-ES DebugSwap feature enables type B swaping of debug registers
on #VMEXIT and makes #DB and DR7 intercepts unnecessary and unwanted.

When DebugSwap is enabled, this stops booting if #VC for #DB or
DB7 read/write occurs as this signals unwanted interaction from the HV.

This adds new API which uses SEV-ES working area in PEI and SEC.

This does not change the existing behavour for DXE just yet but soon.


This changes the SEC/PEI behavior while not changing DXE, which means 
two different behaviors. I wonder if the SEC and PEI changes that access 
the MSR value, should be part of the final patch that enables it for all 
stages. And in this patch, just have the SEC and PEI versions of 
MemEncryptSevEsDebugSwapIsEnabled() return FALSE for now.


Thanks,
Tom



Cc: Ard Biesheuvel 
Cc: Erdem Aktas 
Cc: Gerd Hoffmann 
Cc: Jiewen Yao 
Cc: Michael Roth 
Cc: Min Xu 
Cc: Tom Lendacky 
Signed-off-by: Alexey Kardashevskiy 
---
  OvmfPkg/Include/Library/MemEncryptSevLib.h | 12 
+
  OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c | 27 
+---
  OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c | 19 
++
  OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c | 19 
++
  OvmfPkg/Library/CcExitLib/CcExitVcHandler.c|  8 ++
  5 files changed, 82 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/Include/Library/MemEncryptSevLib.h 
b/OvmfPkg/Include/Library/MemEncryptSevLib.h
index 4fa9c0d70083..0fa86aecc38c 100644
--- a/OvmfPkg/Include/Library/MemEncryptSevLib.h
+++ b/OvmfPkg/Include/Library/MemEncryptSevLib.h
@@ -166,6 +166,18 @@ MemEncryptSevGetEncryptionMask (
VOID
);
  
+/**

+  Returns a boolean to indicate whether DebugSwap is enabled.
+
+  @retval TRUE   DebugSwap is enabled
+  @retval FALSE  DebugSwap is not enabled
+**/
+BOOLEAN
+EFIAPI
+MemEncryptSevEsDebugSwapIsEnabled (
+  VOID
+  );
+
  /**
Returns the encryption state of the specified virtual address range.
  
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c

index 4aba0075b9e2..ebc4c9bb5d06 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
@@ -40,19 +40,25 @@ AmdMemEncryptionAttrCheck (
IN  CONFIDENTIAL_COMPUTING_GUEST_ATTR  Attr
)
  {
+  UINT64  CurrentLevel;
+
+  CurrentLevel = CurrentAttr & CCAttrTypeMask;
+
switch (Attr) {
  case CCAttrAmdSev:
//
// SEV is automatically enabled if SEV-ES or SEV-SNP is active.
//
-  return CurrentAttr >= CCAttrAmdSev;
+  return CurrentLevel >= CCAttrAmdSev;
  case CCAttrAmdSevEs:
//
// SEV-ES is automatically enabled if SEV-SNP is active.
//
-  return CurrentAttr >= CCAttrAmdSevEs;
+  return CurrentLevel >= CCAttrAmdSevEs;
  case CCAttrAmdSevSnp:
-  return CurrentAttr == CCAttrAmdSevSnp;
+  return CurrentLevel == CCAttrAmdSevSnp;
+case CCAttrFeatureAmdSevDebugSwap:
+  return !!(CurrentAttr & CCAttrFeatureAmdSevDebugSwap);
  default:
return FALSE;
}
@@ -159,3 +165,18 @@ MemEncryptSevGetEncryptionMask (
  
return mSevEncryptionMask;

  }
+
+/**
+  Returns a boolean to indicate whether DebugSwap is enabled.
+
+  @retval TRUE   DebugSwap is enabled
+  @retval FALSE  DebugSwap is not enabled
+**/
+BOOLEAN
+EFIAPI
+MemEncryptSevEsDebugSwapIsEnabled (
+  VOID
+  )
+{
+  return ConfidentialComputingGuestHas (CCAttrFeatureAmdSevDebugSwap);
+}
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c 
b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
index 41d1246a5b31..e2ebc8afcaee 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
@@ -141,3 +141,22 @@ MemEncryptSevGetEncryptionMask (
  
return SevEsWorkArea->EncryptionMask;

  }
+
+/**
+  Returns a boolean to indicate whether DebugSwap is enabled.
+
+  @retval TRUE   DebugSwap is enabled
+  @retval FALSE  DebugSwap is not enabled
+**/
+BOOLEAN
+EFIAPI
+MemEncryptSevEsDebugSwapIsEnabled (
+  VOID
+  )
+{
+  MSR_SEV_STATUS_REGISTER  Msr;
+
+  Msr.Uint32 = InternalMemEncryptSevStatus ();
+
+  return Msr.Bits.DebugSwap ? TRUE : FALSE;
+}
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c 
b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c
index 27148c7e337a..0e82dc85b299 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c
@@ -142,6 +142,25 @@ MemEncryptSevGetEncryptionMask (
return SevEsWorkArea->EncryptionMask;
 

Re: [edk2-devel] [PATCH ovmf v3 2/5] MdePkg: Add AMD SEV features to PcdConfidentialComputingGuestAttr

2024-05-20 Thread Lendacky, Thomas via groups.io

On 5/2/24 09:34, Alexey Kardashevskiy wrote:

PcdConfidentialComputingGuestAttr so far only contained an SEV mode bit
but there are more other features which do not translate to levels
such as DebugSwap or SecureTsc.

This adds the features mask and the DebugSwap feature bit to a PCD.

Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Zhiguang Liu 
Cc: Tom Lendacky 
Signed-off-by: Alexey Kardashevskiy 


One nit below, otherwise:

Reviewed-by: Tom Lendacky 


---
Changes:
v2:
* expanded features mask
* added type mask
---
  MdePkg/Include/ConfidentialComputingGuestAttr.h | 15 +--
  1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/ConfidentialComputingGuestAttr.h 
b/MdePkg/Include/ConfidentialComputingGuestAttr.h
index 44e6df800207..c3a3dfb393f0 100644
--- a/MdePkg/Include/ConfidentialComputingGuestAttr.h
+++ b/MdePkg/Include/ConfidentialComputingGuestAttr.h
@@ -29,9 +29,20 @@ typedef enum {
  
/* The guest is running with Intel TDX memory encryption enabled. */

CCAttrIntelTdx = 0x200,
+
+  CCAttrTypeMask = 0x,
+
+  /* Features */
+
+  /* The AMD SEV-ES DebugSwap feature is enabled in SEV_STATUS */
+  CCAttrFeatureAmdSevDebugSwap = 0x0001,


Should this be CCAttrFeatureAmdSevEsDebugSwap? Otherwise, maybe just 
make it CCAttrFeatureAmdDebugSwap.


Thanks,
Tom


+
+  CCAttrFeatureMask = 0x,
  } CONFIDENTIAL_COMPUTING_GUEST_ATTR;
  
-#define CC_GUEST_IS_TDX(x)  ((x) == CCAttrIntelTdx)

-#define CC_GUEST_IS_SEV(x)  ((x) == CCAttrAmdSev || (x) == CCAttrAmdSevEs || 
(x) == CCAttrAmdSevSnp)
+#define _CC_GUEST_IS_TDX(x)  ((x) == CCAttrIntelTdx)
+#define CC_GUEST_IS_TDX(x)   _CC_GUEST_IS_TDX((x) & CCAttrTypeMask)
+#define _CC_GUEST_IS_SEV(x)  ((x) == CCAttrAmdSev || (x) == CCAttrAmdSevEs || 
(x) == CCAttrAmdSevSnp)
+#define CC_GUEST_IS_SEV(x)   _CC_GUEST_IS_SEV((x) & CCAttrTypeMask)
  
  #endif



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




Re: [edk2-devel] [PATCH ovmf v3 1/5] MdePkg/Register/Amd: Define all bits from MSR_SEV_STATUS_REGISTER

2024-05-20 Thread Lendacky, Thomas via groups.io

On 5/2/24 09:34, Alexey Kardashevskiy wrote:

For now we need DebugSwap but others are likely to be needed too.

Cc: Tom Lendacky 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Zhiguang Liu 
Signed-off-by: Alexey Kardashevskiy 


A recent APM has defined a few more and has slightly different naming 
(see below). If you have to submit another version it might be good to 
update them. Otherwise:


Reviewed-by: Tom Lendacky 


---
  MdePkg/Include/Register/Amd/Fam17Msr.h | 63 ++--
  1 file changed, 59 insertions(+), 4 deletions(-)

diff --git a/MdePkg/Include/Register/Amd/Fam17Msr.h 
b/MdePkg/Include/Register/Amd/Fam17Msr.h
index f2d5ccb39dc7..bce51a66517f 100644
--- a/MdePkg/Include/Register/Amd/Fam17Msr.h
+++ b/MdePkg/Include/Register/Amd/Fam17Msr.h
@@ -126,19 +126,74 @@ typedef union {
  ///
  /// [Bit 0] Secure Encrypted Virtualization (Sev) is enabled
  ///
-UINT32SevBit: 1;
+UINT32SevBit  : 1;
  
  ///

  /// [Bit 1] Secure Encrypted Virtualization Encrypted State (SevEs) is 
enabled
  ///
-UINT32SevEsBit  : 1;
+UINT32SevEsBit: 1;
  
  ///

  /// [Bit 2] Secure Nested Paging (SevSnp) is enabled
  ///
-UINT32SevSnpBit : 1;
+UINT32SevSnpBit   : 1;
  
-UINT32Reserved2 : 29;

+///
+/// [Bit 3] The guest was run with the Virtual TOM feature enabled in 
SEV_FEATURES[1]
+///
+UINT32vTOM_Enabled: 1;


The APM has this as vTOM and the PPR as VirtualTOM, so can probably 
remove the _Enabled.



+
+///
+/// [Bit 4] The guest was run with the ReflectVC feature enabled in 
SEV_FEATURES[2]
+///
+UINT32ReflectVC   : 1;
+
+///
+/// [Bit 5] The guest was run with the Restricted Injection feature 
enabled in SEV_FEATURES[3]
+///
+UINT32RestrictedInjection : 1;
+
+///
+/// [Bit 6] The guest was run with the Alternate Injection feature enabled 
in SEV_FEATURES[4]
+///
+UINT32AlternateInjection  : 1;
+
+///
+/// [Bit 7] This guest was run with debug register swapping enabled in 
SEV_FEATURES[5]
+///
+UINT32DebugSwap   : 1;


The APM has this as DebugVirtualization and the PPR as DebugSwapSupport.


+
+///
+/// [Bit 8]  This guest was run with the PreventHostIBS feature enabled in 
SEV_FEATURES[6]
+///
+UINT32PreventHostIBS  : 1;
+
+///
+/// [Bit 9] The guest was run with the BTB isolation feature enabled in 
SEV_FEATURES[7]
+///
+UINT32SNPBTBIsolation : 1;


The APM has this as BTBIsolation, while the PPR has it as you do.


+
+///
+/// [Bit 10]
+///
+UINT32Reserved0   : 1;
+
+///
+/// [Bit 11] The guest was run with the Secure TSC feature enabled in 
SEV_FEATURES[9]
+///
+UINT32SecureTsc   : 1;
+
+///
+/// [Bits 12 13 14 15]
+///
+UINT32Reserved1   : 4;
+
+///
+/// [Bit 16] The guest was run with the VMSA Register Protection feature 
enabled in SEV_FEATURES[14]
+///
+UINT32VmsaRegProt_Enabled : 1;


The APM has this VmsaRegProt, so can probably drop the _Enabled.


+
+UINT32Reserved2   : 15;
} Bits;
///
/// All bit fields as a 32-bit value



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




Re: [edk2-devel] [PATCH] MdePkg:Update UEFI version to 2.10

2024-05-20 Thread Michael D Kinney
Have you verified that every feature from 2.10 is in edk2?

That includes both the include file content as well as all the 
Library/module implementations.

A platform can always update this version value in their tables
if the platform is using a subset of features that are all 2.10
conformant.

Thanks,

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Li, Walon
> Sent: Sunday, May 19, 2024 7:49 PM
> To: devel@edk2.groups.io
> Cc: Lin2, Derek ; Li, Walon ;
> gaolim...@byosoft.com.cn
> Subject: [edk2-devel] [PATCH] MdePkg:Update UEFI version to 2.10
> 
> Follow UEFI specification 2.10 to update system table revision.
> ---
>  MdePkg/Include/Uefi/UefiSpec.h | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h
> index 79fc8c72ca..5cabb196b7 100644
> --- a/MdePkg/Include/Uefi/UefiSpec.h
> +++ b/MdePkg/Include/Uefi/UefiSpec.h
> @@ -1,8 +1,8 @@
>  /** @file
> 
>Include file that supports UEFI.
> 
> 
> 
> -  This include file must contain things defined in the UEFI 2.7
> specification.
> 
> -  If a code construct is defined in the UEFI 2.7 specification it must be
> included
> 
> +  This include file must contain things defined in the UEFI 2.10
> specification.
> 
> +  If a code construct is defined in the UEFI 2.10 specification it must be
> included
> 
>by this include file.
> 
> 
> 
>  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
> 
> @@ -1840,6 +1840,8 @@ EFI_STATUS
>  // EFI Runtime Services Table
> 
>  //
> 
>  #define EFI_SYSTEM_TABLE_SIGNATURE  SIGNATURE_64 ('I','B','I','
> ','S','Y','S','T')
> 
> +#define EFI_2_100_SYSTEM_TABLE_REVISION ((2 << 16) | (100))
> 
> +#define EFI_2_90_SYSTEM_TABLE_REVISION  ((2 << 16) | (90))
> 
>  #define EFI_2_80_SYSTEM_TABLE_REVISION  ((2 << 16) | (80))
> 
>  #define EFI_2_70_SYSTEM_TABLE_REVISION  ((2 << 16) | (70))
> 
>  #define EFI_2_60_SYSTEM_TABLE_REVISION  ((2 << 16) | (60))
> 
> @@ -1852,7 +1854,7 @@ EFI_STATUS
>  #define EFI_2_00_SYSTEM_TABLE_REVISION  ((2 << 16) | (00))
> 
>  #define EFI_1_10_SYSTEM_TABLE_REVISION  ((1 << 16) | (10))
> 
>  #define EFI_1_02_SYSTEM_TABLE_REVISION  ((1 << 16) | (02))
> 
> -#define EFI_SYSTEM_TABLE_REVISION   EFI_2_70_SYSTEM_TABLE_REVISION
> 
> +#define EFI_SYSTEM_TABLE_REVISION   EFI_2_100_SYSTEM_TABLE_REVISION
> 
>  #define EFI_SPECIFICATION_VERSION   EFI_SYSTEM_TABLE_REVISION
> 
> 
> 
>  #define EFI_RUNTIME_SERVICES_SIGNATURE  SIGNATURE_64
> ('R','U','N','T','S','E','R','V')
> 
> --
> 2.23.0.windows.1
> 
> 
> 
> -=-=-=-=-=-=
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#119071): https://edk2.groups.io/g/devel/message/119071
> Mute This Topic: https://groups.io/mt/106197340/1643496
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [michael.d.kin...@intel.com]
> -=-=-=-=-=-=
> 



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




Re: [edk2-devel] [edk2-platforms RESEND v2 3/5] AmdMinBoardPkg: Implement BoardInitLib for PEI phase

2024-05-20 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Monday, May 20, 2024 9:50 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [edk2-platforms RESEND v2 3/5] AmdMinBoardPkg: Implement
> BoardInitLib for PEI phase
>
> PeiBoardInitPreMemLib library provides board-specific
> initialization functions for the PEI phase.
>
> Cc: Abner Chang 
> Cc: Paul Grimes 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec |   8 +
>  .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc |   5 +
>  .../PeiBoardInitPreMemLib/AmdMemoryInfoHob.h  |  50 
>  .../PeiBoardInitPreMemLib.c   | 229 ++
>  .../PeiBoardInitPreMemLib.inf |  45 
>  .../PeiBoardInitPreMemLib/PeiMemoryInit.c | 198 +++
>  .../PeiBoardInitPreMemLib/PeiMemoryInit.h |  50 
>  7 files changed, 585 insertions(+)
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMem
> oryInfoHob.h
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardI
> nitPreMemLib.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardI
> nitPreMemLib.inf
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemor
> yInit.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemor
> yInit.h
>
> diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> index 03d1d77c34..98768af210 100644
> --- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> +++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> @@ -19,6 +19,10 @@
>
>  [Guids]
>gAmdMinBoardPkgTokenSpaceGuid  = {0xd4d23d79, 0x73bf, 0x460a, {0xa1,
> 0xc7, 0x85, 0xa3, 0xca, 0x71, 0xb9, 0x4c}}
> +  gAmdMemoryInfoHobGuid  = { 0x1bce3d14, 0xa5fe, 0x4a0b, { 0x9a,
> 0x8d, 0x69, 0xca, 0x5d, 0x98, 0x38, 0xd3}}
> +
> +[Ppis]
> +  gAmdMemoryInfoHobPpiGuid   = { 0xba16e587, 0x1d66, 0x41b7, { 0x9b,
> 0x52, 0xca, 0x4f, 0x2c, 0xad, 0x0d, 0xc8}}
>
>  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>#
> @@ -41,3 +45,7 @@
>gAmdMinBoardPkgTokenSpaceGuid.PcdAmdFlashFvAdvancedSecuritySize
> |0x|UINT32|0x1008
>gAmdMinBoardPkgTokenSpaceGuid.PcdAmdFlashFvAdvancedSecurityOffset
> |0x|UINT32|0x1009
>
> +  # SMRAM size
> +  # Holds the SMRAM area size, which is reserved for SMRAM operation
> +  # default value 128MB
> +  gAmdMinBoardPkgTokenSpaceGuid.PcdAmdSmramAreaSize
> |0x0800|UINT64|0x2100
> diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> index be33089a45..7e356a2a67 100644
> --- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> +++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> @@ -22,6 +22,9 @@
>MinPlatformPkg/MinPlatformPkg.dec
>UefiCpuPkg/UefiCpuPkg.dec
>
> +[PcdsDynamicDefault]
> +  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x1000
> +
>  [LibraryClasses]
>SpcrDeviceLib|AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
>ReportFvLib|AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
> @@ -38,6 +41,7 @@
>
>  [LibraryClasses.common.PEIM]
>
> SetCacheMtrrLib|AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLi
> b.inf
> +
> BoardInitLib|AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInit
> PreMemLib.inf
>
>  [Components]
>AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
> @@ -45,6 +49,7 @@
>  [Components.IA32]
>AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
>AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
> +
> AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.in
> f
>
>  [Components.X64]
>AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
> diff --git
> a/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMe
> moryInfoHob.h
> b/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMe
> moryInfoHob.h
> new file mode 100644
> index 00..b596b3bdf3
> --- /dev/null
> +++
> b/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMe
> moryInfoHob.h
> @@ -0,0 +1,50 @@
> +/** @file
> +  Defines AMD memory info hob.
> +
> +  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef AMD_MEMORY_INFO_HOB_H_
> +#define AMD_MEMORY_INFO_HOB_H_
> +
> +#pragma pack (push, 1)
> +
> +/// Memory descriptor structure for each memory range
> +typedef struct {
> +  UINT64Base;   ///< Base address of memory rang
> +  UINT64Size;   ///< Size of memory rang
> +  UINT32Attribute;  ///< Attribute of memory rang
> +  UINT32Reserved;  

[edk2-devel] [edk2-platforms RESEND v2 3/5] AmdMinBoardPkg: Implement BoardInitLib for PEI phase

2024-05-20 Thread Abdul Lateef Attar via groups.io
PeiBoardInitPreMemLib library provides board-specific
initialization functions for the PEI phase.

Cc: Abner Chang 
Cc: Paul Grimes 
Signed-off-by: Abdul Lateef Attar 
---
 .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec |   8 +
 .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc |   5 +
 .../PeiBoardInitPreMemLib/AmdMemoryInfoHob.h  |  50 
 .../PeiBoardInitPreMemLib.c   | 229 ++
 .../PeiBoardInitPreMemLib.inf |  45 
 .../PeiBoardInitPreMemLib/PeiMemoryInit.c | 198 +++
 .../PeiBoardInitPreMemLib/PeiMemoryInit.h |  50 
 7 files changed, 585 insertions(+)
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemoryInit.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemoryInit.h

diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec 
b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
index 03d1d77c34..98768af210 100644
--- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
+++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
@@ -19,6 +19,10 @@
 
 [Guids]
   gAmdMinBoardPkgTokenSpaceGuid  = {0xd4d23d79, 0x73bf, 0x460a, {0xa1, 0xc7, 
0x85, 0xa3, 0xca, 0x71, 0xb9, 0x4c}}
+  gAmdMemoryInfoHobGuid  = { 0x1bce3d14, 0xa5fe, 0x4a0b, { 0x9a, 0x8d, 
0x69, 0xca, 0x5d, 0x98, 0x38, 0xd3}}
+
+[Ppis]
+  gAmdMemoryInfoHobPpiGuid   = { 0xba16e587, 0x1d66, 0x41b7, { 0x9b, 0x52, 
0xca, 0x4f, 0x2c, 0xad, 0x0d, 0xc8}}
 
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   #
@@ -41,3 +45,7 @@
   gAmdMinBoardPkgTokenSpaceGuid.PcdAmdFlashFvAdvancedSecuritySize
|0x|UINT32|0x1008
   gAmdMinBoardPkgTokenSpaceGuid.PcdAmdFlashFvAdvancedSecurityOffset  
|0x|UINT32|0x1009
 
+  # SMRAM size
+  # Holds the SMRAM area size, which is reserved for SMRAM operation
+  # default value 128MB
+  gAmdMinBoardPkgTokenSpaceGuid.PcdAmdSmramAreaSize  
|0x0800|UINT64|0x2100
diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc 
b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
index be33089a45..7e356a2a67 100644
--- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
+++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
@@ -22,6 +22,9 @@
   MinPlatformPkg/MinPlatformPkg.dec
   UefiCpuPkg/UefiCpuPkg.dec
 
+[PcdsDynamicDefault]
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x1000
+
 [LibraryClasses]
   SpcrDeviceLib|AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
   ReportFvLib|AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
@@ -38,6 +41,7 @@
 
 [LibraryClasses.common.PEIM]
   SetCacheMtrrLib|AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
+  
BoardInitLib|AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
 
 [Components]
   AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
@@ -45,6 +49,7 @@
 [Components.IA32]
   AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
   AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
+  AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
 
 [Components.X64]
   AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
diff --git 
a/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h 
b/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h
new file mode 100644
index 00..b596b3bdf3
--- /dev/null
+++ 
b/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h
@@ -0,0 +1,50 @@
+/** @file
+  Defines AMD memory info hob.
+
+  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef AMD_MEMORY_INFO_HOB_H_
+#define AMD_MEMORY_INFO_HOB_H_
+
+#pragma pack (push, 1)
+
+/// Memory descriptor structure for each memory range
+typedef struct {
+  UINT64Base;   ///< Base address of memory rang
+  UINT64Size;   ///< Size of memory rang
+  UINT32Attribute;  ///< Attribute of memory rang
+  UINT32Reserved;   ///< For alignment purpose
+} AMD_MEMORY_RANGE_DESCRIPTOR;
+
+/// Memory info HOB structure
+typedef struct  {
+  UINT32 Version;   ///< Version of HOB 
structure
+  BOOLEANReserved1;
+  UINT16 Reserved2;
+  BOOLEANReserved3;
+  UINT8  Reserved4;
+  BOOLEANReserved5;
+  UINT32 Reserved6;
+  UINT32 Reserved7;
+  UINT32 NumberOfDescriptor;///< Number of 

Re: [edk2-devel] [edk2-platforms] AmdPlatformPkg: Adds SmbiosCommonDxe driver

2024-05-20 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Already reviewed internally.
Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Monday, May 20, 2024 6:24 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [edk2-platforms] AmdPlatformPkg: Adds SmbiosCommonDxe driver
>
> Adds SMBIOS common driver which generates various
> tables for AMD platforms.
>
> Cc: Abner Chang 
> Cc: Paul Grimes 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dec |  63 -
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc |   3 +-
>  .../SmbiosCommonDxe/DefaultLomDevicePath.c| 130 ++
>  .../Universal/SmbiosCommonDxe/SmbiosCommon.h  | 210
> 
>  .../SmbiosCommonDxe/SmbiosCommonDxe.inf   |  76 ++
>  .../SmbiosCommonDxe/SmbiosCommonEntryPoint.c  | 148 +++
>  .../Type11OemStringsFunction.c|  91 +++
>  .../Type12SystemCfgOptionsFunction.c  |  90 +++
>  .../Type13BiosLanguageInfoFunction.c  | 146 +++
>  .../Type38IpmiDeviceInformation.c |  70 ++
>  .../Type41OnboardDevExtInfoFunction.c | 237 ++
>  .../Type8PortConnectorInfoFunction.c  | 133 ++
>  .../Type9SystemSlotInfoFunction.c |  94 +++
>  13 files changed, 1489 insertions(+), 2 deletions(-)
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/DefaultLom
> DevicePath.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCom
> mon.h
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCom
> monDxe.inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCom
> monEntryPoint.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type11Oem
> StringsFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type12Syste
> mCfgOptionsFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type13BiosL
> anguageInfoFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type38Ipmi
> DeviceInformation.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type41Onb
> oardDevExtInfoFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type8PortC
> onnectorInfoFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type9Syste
> mSlotInfoFunction.c
>
> diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> index 83f57f6d0a..787dac4cca 100644
> --- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> +++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> @@ -8,7 +8,7 @@
>  #
>  ##
>
> -[Defines]
> +[Defines]
>DEC_SPECIFICATION = 1.27
>PACKAGE_NAME  = AmdPlatformPkg
>PACKAGE_GUID  = 2CB1238B-18E2-4837-B714-9DAB2B30A3C2
> @@ -42,3 +42,64 @@
># 3 - BT
># 4 - SSIF
>
> gAmdPlatformPkgTokenSpaceGuid.PcdIpmiInterfaceType|0|UINT8|0x00020
> 001
> +
> +  #
> +  # This PCD is mapped to AMD SMBIOS type 8 record structure
> +  #
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType8Number|0|UINT8|0
> x00020002
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType8|{0x0}|SMBIOS_PO
> RT_CONNECTOR_RECORD_ARRAY|0x00020003 {
> +  
> +Pcd/SmbiosPcd.h
> +  
> +AmdPlatformPkg/AmdPlatformPkg.dec
> +MdePkg/MdePkg.dec
> +MdeModulePkg/MdeModulePkg.dec
> +  }
> +
> +  #
> +  # This PCD is mapped to AMD SMBIOS type 41 record structure
> +  #
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType41Number|0|UINT8|
> 0x00020004
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType41|{0x0}|SMBIOS_O
> NBOARD_DEV_EXT_INFO_ARRAY|0x00020005 {
> +  
> +Pcd/SmbiosPcd.h
> +  
> +AmdPlatformPkg/AmdPlatformPkg.dec
> +MdePkg/MdePkg.dec
> +MdeModulePkg/MdeModulePkg.dec
> +  }
> +
> +  #
> +  # These PCDs are mapped to AMD SMBIOS type 9 record structure
> +  #
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1|
> {0x0}|MISC_SLOT_CHARACTERISTICS1|0x00020009 {
> +  
> +IndustryStandard/SmBios.h
> +  }
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> CharacteristicsUnknown|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> Provides50Volts|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> Provides33Volts|1
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> SharedSlot|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> PcCard16Supported|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> CardBusSupported|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> ZoomVideoSupported|0
> +
> 

[edk2-devel] [edk2-platforms] AmdPlatformPkg: Adds SmbiosCommonDxe driver

2024-05-20 Thread Abdul Lateef Attar via groups.io
Adds SMBIOS common driver which generates various
tables for AMD platforms.

Cc: Abner Chang 
Cc: Paul Grimes 
Signed-off-by: Abdul Lateef Attar 
---
 .../AMD/AmdPlatformPkg/AmdPlatformPkg.dec |  63 -
 .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc |   3 +-
 .../SmbiosCommonDxe/DefaultLomDevicePath.c| 130 ++
 .../Universal/SmbiosCommonDxe/SmbiosCommon.h  | 210 
 .../SmbiosCommonDxe/SmbiosCommonDxe.inf   |  76 ++
 .../SmbiosCommonDxe/SmbiosCommonEntryPoint.c  | 148 +++
 .../Type11OemStringsFunction.c|  91 +++
 .../Type12SystemCfgOptionsFunction.c  |  90 +++
 .../Type13BiosLanguageInfoFunction.c  | 146 +++
 .../Type38IpmiDeviceInformation.c |  70 ++
 .../Type41OnboardDevExtInfoFunction.c | 237 ++
 .../Type8PortConnectorInfoFunction.c  | 133 ++
 .../Type9SystemSlotInfoFunction.c |  94 +++
 13 files changed, 1489 insertions(+), 2 deletions(-)
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/DefaultLomDevicePath.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCommon.h
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCommonDxe.inf
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCommonEntryPoint.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type11OemStringsFunction.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type12SystemCfgOptionsFunction.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type13BiosLanguageInfoFunction.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type38IpmiDeviceInformation.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type41OnboardDevExtInfoFunction.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type8PortConnectorInfoFunction.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type9SystemSlotInfoFunction.c

diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec 
b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
index 83f57f6d0a..787dac4cca 100644
--- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
+++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
@@ -8,7 +8,7 @@
 #
 ##
 
-[Defines]
+[Defines] 
   DEC_SPECIFICATION = 1.27
   PACKAGE_NAME  = AmdPlatformPkg
   PACKAGE_GUID  = 2CB1238B-18E2-4837-B714-9DAB2B30A3C2
@@ -42,3 +42,64 @@
   # 3 - BT
   # 4 - SSIF
   gAmdPlatformPkgTokenSpaceGuid.PcdIpmiInterfaceType|0|UINT8|0x00020001
+
+  #
+  # This PCD is mapped to AMD SMBIOS type 8 record structure
+  #
+  gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType8Number|0|UINT8|0x00020002
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType8|{0x0}|SMBIOS_PORT_CONNECTOR_RECORD_ARRAY|0x00020003
 {
+  
+Pcd/SmbiosPcd.h
+  
+AmdPlatformPkg/AmdPlatformPkg.dec
+MdePkg/MdePkg.dec
+MdeModulePkg/MdeModulePkg.dec
+  }
+
+  #
+  # This PCD is mapped to AMD SMBIOS type 41 record structure
+  #
+  gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType41Number|0|UINT8|0x00020004
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType41|{0x0}|SMBIOS_ONBOARD_DEV_EXT_INFO_ARRAY|0x00020005
 {
+  
+Pcd/SmbiosPcd.h
+  
+AmdPlatformPkg/AmdPlatformPkg.dec
+MdePkg/MdePkg.dec
+MdeModulePkg/MdeModulePkg.dec
+  }
+
+  #
+  # These PCDs are mapped to AMD SMBIOS type 9 record structure
+  #
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1|{0x0}|MISC_SLOT_CHARACTERISTICS1|0x00020009
 {
+  
+IndustryStandard/SmBios.h
+  }
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.CharacteristicsUnknown|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.Provides50Volts|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.Provides33Volts|1
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.SharedSlot|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.PcCard16Supported|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.CardBusSupported|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.ZoomVideoSupported|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.ModemRingResumeSupported|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics2|{0x0}|MISC_SLOT_CHARACTERISTICS2|0x0002000A
 {
+  
+IndustryStandard/SmBios.h
+  }
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics2.PmeSignalSupported|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics2.HotPlugDevicesSupported|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics2.SmbusSignalSupported|0
+  
gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics2.BifurcationSupported|1
+  

[edk2-devel] [edk2-platforms PATCH v2 3/5] AmdMinBoardPkg: Implement BoardInitLib for PEI phase

2024-05-20 Thread Abdul Lateef Attar via groups.io
PeiBoardInitPreMemLib library provides board-specific
initialization functions for the PEI phase.

Cc: Abner Chang 
Cc: Paul Grimes 
Signed-off-by: Abdul Lateef Attar 
---
 .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec |   8 +
 .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc |   5 +
 .../PeiBoardInitPreMemLib/AmdMemoryInfoHob.h  |  50 
 .../PeiBoardInitPreMemLib.c   | 229 ++
 .../PeiBoardInitPreMemLib.inf |  45 
 .../PeiBoardInitPreMemLib/PeiMemoryInit.c | 198 +++
 .../PeiBoardInitPreMemLib/PeiMemoryInit.h |  50 
 7 files changed, 585 insertions(+)
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemoryInit.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemoryInit.h

diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec 
b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
index 03d1d77c34..98768af210 100644
--- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
+++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
@@ -19,6 +19,10 @@
 
 [Guids]
   gAmdMinBoardPkgTokenSpaceGuid  = {0xd4d23d79, 0x73bf, 0x460a, {0xa1, 0xc7, 
0x85, 0xa3, 0xca, 0x71, 0xb9, 0x4c}}
+  gAmdMemoryInfoHobGuid  = { 0x1bce3d14, 0xa5fe, 0x4a0b, { 0x9a, 0x8d, 
0x69, 0xca, 0x5d, 0x98, 0x38, 0xd3}}
+
+[Ppis]
+  gAmdMemoryInfoHobPpiGuid   = { 0xba16e587, 0x1d66, 0x41b7, { 0x9b, 0x52, 
0xca, 0x4f, 0x2c, 0xad, 0x0d, 0xc8}}
 
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   #
@@ -41,3 +45,7 @@
   gAmdMinBoardPkgTokenSpaceGuid.PcdAmdFlashFvAdvancedSecuritySize
|0x|UINT32|0x1008
   gAmdMinBoardPkgTokenSpaceGuid.PcdAmdFlashFvAdvancedSecurityOffset  
|0x|UINT32|0x1009
 
+  # SMRAM size
+  # Holds the SMRAM area size, which is reserved for SMRAM operation
+  # default value 128MB
+  gAmdMinBoardPkgTokenSpaceGuid.PcdAmdSmramAreaSize  
|0x0800|UINT64|0x2100
diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc 
b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
index be33089a45..7e356a2a67 100644
--- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
+++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
@@ -22,6 +22,9 @@
   MinPlatformPkg/MinPlatformPkg.dec
   UefiCpuPkg/UefiCpuPkg.dec
 
+[PcdsDynamicDefault]
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x1000
+
 [LibraryClasses]
   SpcrDeviceLib|AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
   ReportFvLib|AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
@@ -38,6 +41,7 @@
 
 [LibraryClasses.common.PEIM]
   SetCacheMtrrLib|AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
+  
BoardInitLib|AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
 
 [Components]
   AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
@@ -45,6 +49,7 @@
 [Components.IA32]
   AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
   AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
+  AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
 
 [Components.X64]
   AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
diff --git 
a/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h 
b/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h
new file mode 100644
index 00..b596b3bdf3
--- /dev/null
+++ 
b/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h
@@ -0,0 +1,50 @@
+/** @file
+  Defines AMD memory info hob.
+
+  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef AMD_MEMORY_INFO_HOB_H_
+#define AMD_MEMORY_INFO_HOB_H_
+
+#pragma pack (push, 1)
+
+/// Memory descriptor structure for each memory range
+typedef struct {
+  UINT64Base;   ///< Base address of memory rang
+  UINT64Size;   ///< Size of memory rang
+  UINT32Attribute;  ///< Attribute of memory rang
+  UINT32Reserved;   ///< For alignment purpose
+} AMD_MEMORY_RANGE_DESCRIPTOR;
+
+/// Memory info HOB structure
+typedef struct  {
+  UINT32 Version;   ///< Version of HOB 
structure
+  BOOLEANReserved1;
+  UINT16 Reserved2;
+  BOOLEANReserved3;
+  UINT8  Reserved4;
+  BOOLEANReserved5;
+  UINT32 Reserved6;
+  UINT32 Reserved7;
+  UINT32 NumberOfDescriptor;///< Number of 

[edk2-devel] [edk2-platforms PATCH v2 0/5] Adds AMD board independent drivers/modules

2024-05-20 Thread Abdul Lateef Attar via groups.io
PR: https://github.com/tianocore/edk2-platforms/pull/144

V2 delta changes:
  Updated the "AmdMinBoardPkg: Implement BoardInitLib for PEI phase" PATCH
  with correct .dec and .dsc file.

Cc: Paul Grimes 
Cc: Abner Chang 

Abdul Lateef Attar (5):
  AmdMinBoardPkg: Uncrustify PciHotPlug module
  AmdMinBoardPkg/Library: Uncrustify the Library module
  AmdMinBoardPkg: Implement BoardInitLib for PEI phase
  AmdMinBoardPkg: Implement BoardInitLib for DXE phase
  AmdMinBoardPkg: Implements BoardBdsHookLib library

 .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec |   18 +
 .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc |   13 +-
 .../Include/Library/AmdBoardBdsHookLib.h  |  130 ++
 .../Library/BoardBdsHookLib/BoardBdsHook.h|  242 +++
 .../Library/BoardBdsHookLib/BoardBdsHookLib.c | 1712 +
 .../BoardBdsHookLib/BoardBdsHookLib.inf   |  105 +
 .../Library/BoardBdsHookLib/BoardBootOption.c |  754 
 .../Library/BoardBdsHookLib/BoardMemoryTest.c |   83 +
 .../Library/DxeBoardInitLib/DxeBoardInitLib.c |  253 +++
 .../DxeBoardInitLib/DxeBoardInitLib.inf   |   51 +
 .../DxeBoardInitLib/DxeBoardInitLibInternal.c |  306 +++
 .../DxeBoardInitLib/DxeBoardInitLibInternal.h |  159 ++
 .../DxeBoardInitLib/MadtAcpiTablePatch.c  |  243 +++
 .../PeiBoardInitPreMemLib/AmdMemoryInfoHob.h  |   50 +
 .../PeiBoardInitPreMemLib.c   |  229 +++
 .../PeiBoardInitPreMemLib.inf |   45 +
 .../PeiBoardInitPreMemLib/PeiMemoryInit.c |  198 ++
 .../PeiBoardInitPreMemLib/PeiMemoryInit.h |   50 +
 .../Library/PeiReportFvLib/PeiReportFvLib.c   |   12 +-
 .../Library/SetCacheMtrrLib/SetCacheMtrrLib.c |3 +-
 .../PciHotPlug/PciHotPlugInit.c   |4 +-
 .../PciHotPlug/PciHotPlugInit.inf |5 +-
 22 files changed, 4658 insertions(+), 7 deletions(-)
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Include/Library/AmdBoardBdsHookLib.h
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHook.h
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBootOption.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardMemoryTest.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLib.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLib.inf
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLibInternal.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLibInternal.h
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/MadtAcpiTablePatch.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMemoryInfoHob.h
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemoryInit.c
 create mode 100644 
Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemoryInit.h

-- 
2.34.1



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




Re: [edk2-devel] [PATCH 02/18] OvmfPkg: Save MTRR by lockbox in CpuS3DataDxe

2024-05-20 Thread Ard Biesheuvel
On Fri, 10 May 2024 at 12:08, Dun Tan  wrote:
>
> Save MTRR by lockbox in CpuS3DataDxe. In S3 boot,
> The MTRR setting will be restored in S3Resume.c
> in following patches. Then S3Resume.c will wakeup
> all APs to load the MTRR setting. This can avoid
> waking up APs in CpuS3.c.
>
> Signed-off-by: Dun Tan 
> Cc: Ard Biesheuvel 
> Cc: Jiewen Yao 
> Cc: Gerd Hoffmann 
> Cc: Ray Ni 
> Cc: Jiaxin Wu 

Reviewed-by: Ard Biesheuvel 


> ---
>  OvmfPkg/CpuS3DataDxe/CpuS3Data.c  | 11 +++
>  OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf |  2 ++
>  2 files changed, 13 insertions(+)
>
> diff --git a/OvmfPkg/CpuS3DataDxe/CpuS3Data.c 
> b/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> index 289048b75d..d1aba32842 100644
> --- a/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> +++ b/OvmfPkg/CpuS3DataDxe/CpuS3Data.c
> @@ -26,6 +26,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -130,6 +131,16 @@ CpuS3DataOnEndOfDxe (
>DEBUG ((DEBUG_VERBOSE, "%a\n", __func__));
>MtrrGetAllMtrrs (>MtrrTable);
>
> +  //
> +  // Save MTRR in lockbox
> +  //
> +  Status = SaveLockBox (
> + ,
> + >MtrrTable,
> + sizeof (MTRR_SETTINGS)
> + );
> +  ASSERT_EFI_ERROR (Status);
> +
>//
>// Close event, so it will not be invoked again.
>//
> diff --git a/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf 
> b/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> index 228d5ae1b2..f5032a9222 100644
> --- a/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> +++ b/OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf
> @@ -46,9 +46,11 @@
>MtrrLib
>UefiBootServicesTableLib
>UefiDriverEntryPoint
> +  LockBoxLib
>
>  [Guids]
>gEfiEndOfDxeEventGroupGuid ## CONSUMES   ## Event
> +  gEdkiiS3MtrrSettingGuid
>
>  [Protocols]
>gEfiMpServiceProtocolGuid  ## CONSUMES
> --
> 2.31.1.windows.1
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119077): https://edk2.groups.io/g/devel/message/119077
Mute This Topic: https://groups.io/mt/106018122/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: Update VMM Hob list check to support new resource attributes

2024-05-20 Thread Du Lin
Thanks for the review and approval. Could you please help merge this patch to 
the upstream? A pull request has been created for this patch: 
https://github.com/tianocore/edk2/pull/5644. Thanks.


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




Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-20 Thread duntan
Hi Liming,

I haven't created a Bugzilla for this change.
Is a bugzila needed for this patch set? I can create one if needed.

Thanks,
Dun

-Original Message-
From: gaoliming  
Sent: Monday, May 20, 2024 9:41 AM
To: devel@edk2.groups.io; Tan, Dun 
Cc: Ni, Ray ; Wu, Jiaxin ; 'Ard 
Biesheuvel' ; 'Leif Lindholm' 
; 'Sami Mujawar' ; 'Gerd 
Hoffmann' ; 'Andrew Fish' ; Yao, Jiewen 

Subject: 回复: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime 
cache buffer in PEI

Dun:
  Is there a Bugzilla for this change?

Thanks
Liming
> -邮件原件-
> 发件人: devel@edk2.groups.io  代表 duntan
> 发送时间: 2024年5月17日 17:49
> 收件人: devel@edk2.groups.io
> 抄送: Ray Ni ; Liming Gao ; 
> Jiaxin Wu ; Ard Biesheuvel
;
> Leif Lindholm ; Sami Mujawar 
> ; Gerd Hoffmann ; Andrew Fish 
> ; Jiewen Yao 
> 主题: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime 
> cache buffer in PEI
> 
> This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB 
> is used to store the address and size of the buffer that will be used 
> for
variable
> runtime service when the PcdEnableVariableRuntimeCache is TRUE.
> In following patches, when PcdEnableVariableRuntimeCache is TRUE,
VariablePei
> will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate 
> the
needed
> buffer for different type variable runtime cache and build the HOB.
> Then VariableSmmRuntimeDxe driver will consume 
> gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable 
> runtime
cache
> related content. The code to allocate and unblock the runtime cache 
> buffer
in
> VariableSmmRuntimeDxe is also removed in this patc set.
> 
> PR for review: https://github.com/tianocore/edk2/pull/5607
> 
> Cc: Ray Ni 
> Cc: Liming Gao 
> Cc: Jiaxin Wu 
> Cc: Ard Biesheuvel 
> Cc: Leif Lindholm 
> Cc: Sami Mujawar 
> Cc: Gerd Hoffmann 
> Cc: Andrew Fish 
> Cc: Jiewen Yao 
> 
> Dun Tan (9):
>   MdeModulePkg:Add new gEdkiiVariableRuntimeCacheInfoHobGuid
>   ArmVirtPkg: Add MmUnblockMemoryLib in DSC
>   EmulatorPkg: Add MmUnblockMemoryLib in DSC
>   OvmfPkg: Add MmUnblockMemoryLib in DSC
>   MdeModulePkg:Create gEdkiiVariableRuntimeCacheInfoHobGuid
>   MdeModulePkg:Remove unnecessary global variable
>   MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid
>   MdeModulePkg: Refine InitVariableCache()
>   MdeModulePkg:Add global variable mVariableRtCacheInfo
> 
>  ArmVirtPkg/ArmVirtCloudHv.dsc
> |   2 ++
>  EmulatorPkg/EmulatorPkg.dsc
> |   1 +
>  MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h
> |  65
> +
> 
>  MdeModulePkg/MdeModulePkg.dec
> |   3 +++
>  MdeModulePkg/Universal/Variable/Pei/Variable.c   |
> 298
> +
> +
> +
> +
> +-
>  MdeModulePkg/Universal/Variable/Pei/Variable.h   |
> 3 +++
>  MdeModulePkg/Universal/Variable/Pei/VariablePei.inf  |
> 8 +++-
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
> | 293
> +
> +
>
++--
++
-
> --
>  MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf 
> |
> 5 +++--
>  OvmfPkg/OvmfPkgIa32X64.dsc
> |   2 +-
>  10 files changed, 506 insertions(+), 174 deletions(-)  create mode 
> 100644 MdeModulePkg/Include/Guid/VariableRuntimeCacheInfo.h
> 
> --
> 2.31.1.windows.1
> 
> 
> 
> 
> 





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




Re: [edk2-devel] [PATCH 7/9] MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid

2024-05-20 Thread Ni, Ray
Kun,
Good to know that you have no concerns on the patch. The patch set aims to 
finalize the unblock memory regions before standalone MM env is launched.
The PeiNotifyPpi() can still notify the PPI callback when the PPI has been 
installed already.

Thanks,
Ray

From: Kun Qin 
Sent: Saturday, May 18, 2024 1:09
To: Ni, Ray ; Tan, Dun ; 
devel@edk2.groups.io 
Cc: Liming Gao ; Sean Brogan 

Subject: RE: [PATCH 7/9] MdeModulePkg:Consume 
gEdkiiVariableRuntimeCacheInfoHobGuid


Hi Ray & Dun,



Thanks for adding me to the patch. I think the proposed solution should work. 
One question, which is actually on the hob creator patch 
(https://edk2.groups.io/g/devel/message/119022), is that I understand the hob 
creation depends on “gEfiPeiMemoryDiscoveredPpiGuid”, but does this routine 
still run properly if variable PEIM is loaded much later than memory discovered?



Regards,

Kun



From: Ni, Ray 
Sent: Friday, May 17, 2024 5:10 AM
To: Tan, Dun ; devel@edk2.groups.io
Cc: Liming Gao ; Kun Qin ; 
Sean Brogan 
Subject: [EXTERNAL] Re: [PATCH 7/9] MdeModulePkg:Consume 
gEdkiiVariableRuntimeCacheInfoHobGuid



Reviewed-by: Ray Ni mailto:ray...@intel.com>>



Thanks,

Ray



From: Tan, Dun mailto:dun@intel.com>>
Sent: Friday, May 17, 2024 17:49
To: devel@edk2.groups.io 
mailto:devel@edk2.groups.io>>
Cc: Ni, Ray mailto:ray...@intel.com>>; Liming Gao 
mailto:gaolim...@byosoft.com.cn>>
Subject: [PATCH 7/9] MdeModulePkg:Consume gEdkiiVariableRuntimeCacheInfoHobGuid



Consume gEdkiiVariableRuntimeCacheInfoHobGuid in

VariableSmmRuntimeDxe driver to initialize the following

variable cache related buffer:
  *mVariableRuntimeHobCacheBuffer
  *mVariableRuntimeNvCacheBuffer
  *mVariableRuntimeVolatileCacheBuffer
  *mVariableRuntimeCachePendingUpdate
  *mVariableRuntimeCacheReadLock
  *mHobFlushComplete

The code to to allocate
and unblock the buffer for
different type cache in VariableSmmRuntimeDxe is also
removed in this commit.

Signed-off-by: Dun Tan mailto:dun@intel.com>>
Cc: Ray Ni mailto:ray...@intel.com>>
Cc: Liming Gao mailto:gaolim...@byosoft.com.cn>>

Cc: Jiaxin Wu mailto:jiaxin...@intel.com>>
---
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c   | 120 
+---
 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.inf |   5 
+++--
 2 files changed, 52 insertions(+), 73 deletions(-)

diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c 
b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
index 8b42ae7d72..68a249c5ac 100644
--- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
+++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmmRuntimeDxe.c
@@ -35,10 +35,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 
 #include 
-#include 
+#include 

 #include 
 #include 
+#include 

 #include "PrivilegePolymorphic.h"
 #include "VariableParsing.h"
@@ -56,10 +57,10 @@ VARIABLE_STORE_HEADER   
*mVariableRuntimeVolatileCacheBuffer = NULL;
 UINTN   mVariableBufferSize;
 UINTN   mVariableRuntimeHobCacheBufferSize;
 UINTN   mVariableBufferPayloadSize;
-BOOLEAN mVariableRuntimeCachePendingUpdate;
-BOOLEAN mVariableRuntimeCacheReadLock;
+BOOLEAN *mVariableRuntimeCachePendingUpdate;
+BOOLEAN *mVariableRuntimeCacheReadLock;
 BOOLEAN mVariableAuthFormat;
-BOOLEAN mHobFlushComplete;
+BOOLEAN *mHobFlushComplete;
 EFI_LOCKmVariableServicesLock;
 EDKII_VARIABLE_LOCK_PROTOCOLmVariableLock;
 EDKII_VAR_CHECK_PROTOCOLmVarCheck;
@@ -180,27 +181,6 @@ InitVariableCache (

   *TotalVariableCacheSize = ALIGN_VALUE (*TotalVariableCacheSize, sizeof 
(UINT32));

-  //
-  // Allocate NV Storage Cache and initialize it to all 1's (like an erased FV)
-  //
-  *VariableCacheBuffer =  (VARIABLE_STORE_HEADER *)AllocateRuntimePages (
- EFI_SIZE_TO_PAGES 
(*TotalVariableCacheSize)
- );
-  if (*VariableCacheBuffer == NULL) {
-return EFI_OUT_OF_RESOURCES;
-  }
-
-  //
-  // Request to unblock the newly allocated cache region to be accessible from 
inside MM
-  //
-  Status = MmUnblockMemoryRequest (
- (EFI_PHYSICAL_ADDRESS)(UINTN)*VariableCacheBuffer,
- EFI_SIZE_TO_PAGES (*TotalVariableCacheSize)
- );
-  if ((Status != EFI_UNSUPPORTED) && EFI_ERROR (Status)) {
-return Status;
-  }
-
   VariableCacheStorePtr = *VariableCacheBuffer;
   SetMem32 ((VOID *)VariableCacheStorePtr, *TotalVariableCacheSize, 

Re: [edk2-devel] [Patch V2 00/18] Remove some S3 related code in CpuS3.c of smm cpu driver

2024-05-20 Thread Ni, Ray
Following 3 patches still require the Reviewed-by from package maintainers of 
MdeModulePkg and OvmfPkg.
  MdeModulePkg: Add gEdkiiS3MtrrSettingGuid
  OvmfPkg: Save MTRR by lockbox in CpuS3DataDxe
  MdeModulePkg:Remove MpService2Ppi field in SMM_S3_RESUME_STATE

The patch set is a good move to simplify the X86 CPU SMM driver by removing 
most of S3 related logics.
I hope it can be merged next week when the stable tag freeze ends in the end of 
this week.

Thanks,
Ray

From: Tan, Dun 
Sent: Friday, May 17, 2024 17:45
To: devel@edk2.groups.io 
Cc: Liming Gao ; Wu, Jiaxin ; 
Ni, Ray ; Ard Biesheuvel ; Yao, 
Jiewen ; Gerd Hoffmann ; Kumar, Rahul 
R 
Subject: [Patch V2 00/18] Remove some S3 related code in CpuS3.c of smm cpu 
driver

Comparing to V1 patchs set, the V2 patch set only adjusts the commits ordering 
and modifies copy right year in some files.
This patch set is to remove some S3 related code in CpuS3.c of smm cpu driver. 
It contain commits to:
1) S3 MTRRs operation:
>   MdeModulePkg: Add gEdkiiS3MtrrSettingGuid
>   OvmfPkg: Save MTRR by lockbox in CpuS3DataDxe
>   UefiCpuPkg: Add locbox lib instance in DSC
>   UefiCpuPkg: Save MTRR by lockbox in CpuS3DataDxe
>   UefiCpuPkg: LoadMtrrData for all cpu in S3Resume
>   UefiCpuPkg: Remove code to load mtrr setting

2) AP page table unavailiable issue fix:
>   UefiCpuPkg: Disable PG in IA32 ApLoopCode

3) Register table cleanup:
>   UefiCpuPkg:Set PcdCpuFeaturesInitOnS3Resume to TRUE
>   UefiCpuPkg: Remove code to set register table

4)  S3 ApHltLoopCode Operation:
>   UefiCpuPkg:Abstract some DxeMpLib code to function
>   UefiCpuPkg:Move some code in DxeMpLib to common place
>   UefiCpuPkg: Install gEdkiiEndOfS3ResumeGuid in S3Resume
>   UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib
>   UefiCpuPkg:Remove code to handle APIC setting and Interrupt
>   UefiCpuPkg:Rremove code to wakeup AP and relocate ap
>   UefiCpuPkg: Remove the duplicated mpservice locate
>   MdeModulePkg: remove MpService2Ppi field in SMM_S3_RESUME_STATE

5)  Remove code to get AcpiCpuData:
>   UefiCpuPkg: Remove GetAcpiCpuData() in CpuS3.c

With this patch set, CpuS3.c in smm CPU driver can be simplified.
The whole patch set has been reviewed-by Ray.
PR for review: https://github.com/tianocore/edk2/pull/5606

Cc: Liming Gao 
Cc: Jiaxin Wu 
Cc: Ray Ni 
Cc: Ard Biesheuvel 
Cc: Jiewen Yao 
Cc: Gerd Hoffmann 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 

Dun Tan (18):
  MdeModulePkg: Add gEdkiiS3MtrrSettingGuid
  OvmfPkg: Save MTRR by lockbox in CpuS3DataDxe
  UefiCpuPkg: Add locbox lib instance in DSC
  UefiCpuPkg: Save MTRR by lockbox in CpuS3DataDxe
  UefiCpuPkg: LoadMtrrData for all cpu in S3Resume
  UefiCpuPkg: Remove code to load mtrr setting
  UefiCpuPkg:Set PcdCpuFeaturesInitOnS3Resume to TRUE
  UefiCpuPkg: Remove code to set register table
  UefiCpuPkg: Disable PG in IA32 ApLoopCode
  UefiCpuPkg:Abstract some DxeMpLib code to function
  UefiCpuPkg:Move some code in DxeMpLib to common place
  UefiCpuPkg: Install gEdkiiEndOfS3ResumeGuid in S3Resume
  UefiCpuPkg:Relocate AP to new safe buffer in PeiMpLib
  UefiCpuPkg:Remove code to handle APIC setting and Interrupt
  UefiCpuPkg:Remove code to wakeup AP and relocate ap
  UefiCpuPkg: Remove unneeded MpService2Ppi assignment
  MdeModulePkg:Remove MpService2Ppi field in SMM_S3_RESUME_STATE
  UefiCpuPkg: Remove GetAcpiCpuData() in CpuS3.c

 MdeModulePkg/Include/Guid/AcpiS3Context.h   |   3 +--
 MdeModulePkg/MdeModulePkg.dec   |   5 -
 OvmfPkg/CpuS3DataDxe/CpuS3Data.c|  13 -
 OvmfPkg/CpuS3DataDxe/CpuS3DataDxe.inf   |   4 +++-
 UefiCpuPkg/CpuS3DataDxe/CpuS3Data.c |  13 -
 UefiCpuPkg/CpuS3DataDxe/CpuS3DataDxe.inf|   4 +++-
 UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 183 
-
 UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm  |   6 +-
 UefiCpuPkg/Library/MpInitLib/MpLib.c| 144 
+++-
 UefiCpuPkg/Library/MpInitLib/MpLib.h|  56 
+++--
 UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf   |   6 +-
 UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 154 
+-
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c   | 993 
+--
 

Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime cache buffer in PEI

2024-05-20 Thread Ni, Ray
I remember ARM platform could have a PEI-less design so that SEC directly 
invokes DXE.

So I can imagine that a SEC logic to create the VARIABLE_RUNTIME_CACHE_INFO HOB.

Then it comes to how to calculate the size before bios boots.
I think it's doable.
There are 3 caches. Volatile cache size is hardcode by a PCD. NV cache size can 
equal to the bios NV variable region size. HOB cache size can be calculated by:

  1.
collect all default values in IFR/VFR
  2.
convert the default variable to auth/non-auth type depending on the BIOS NV 
variable region format.

Both steps can be performed in bios-build phase. There is no runtime 
information needed.

Thanks,
Ray

From: Nhi Pham 
Sent: Monday, May 20, 2024 9:01
To: devel@edk2.groups.io ; Tan, Dun 
Cc: Ni, Ray ; Liming Gao ; Wu, 
Jiaxin ; Ard Biesheuvel ; Leif 
Lindholm ; Sami Mujawar ; Gerd 
Hoffmann ; Andrew Fish ; Yao, Jiewen 

Subject: Re: [edk2-devel] [PATCH 0/9] Allocate and unblock variable runtime 
cache buffer in PEI

On 5/17/2024 4:49 PM, duntan via groups.io wrote:
> This patch set defines a new VARIABLE_RUNTIME_CACHE_INFO HOB. The HOB is used 
> to store the address and size of the buffer that will be used for variable 
> runtime service when the PcdEnableVariableRuntimeCache is TRUE.
> In following patches, when PcdEnableVariableRuntimeCache is TRUE, VariablePei 
> will install a callback of gEfiPeiMemoryDiscoveredPpiGuid to allocate the 
> needed buffer for different type variable runtime cache and build the HOB.
> Then VariableSmmRuntimeDxe driver will consume 
> gEdkiiVariableRuntimeCacheInfoHobGuid to initialize the variable runtime 
> cache related content. The code to allocate and unblock the runtime cache 
> buffer in VariableSmmRuntimeDxe is also removed in this patc set.
>
> PR for review: https://github.com/tianocore/edk2/pull/5607

Per design, SMM or StandaloneMM needs to access these runtime cache
buffers for cache coherency. I'm not sure how to implement the
MmUnblockMemoryLib for ARM to dynamically request mapping of the
non-secure runtime cache buffers in StandaloneMM (Secure World). Is it
possible to have these runtime buffers allocated statically with
predefined PCD at build time. On ARM, they can also define the buffers
in device tree (manifest)?

Thanks,
Nhi


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