Date   

[staging/edk2-redfish-client PATCH v2 0/2] RedfishClientPkg

Abner Chang
 

In V2: Correct EFI_PLATFORM_CONFIG_TO_REDFISH_PROTOCOL to
EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL in readme and diagrams.

In V1:
This is the first commit of RedfishClientPkg. Readme and diagrams
are created to delineate EDK2 Redfish Client implementation.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Nickle Wang <nickle.wang@...>
Cc: Liming Gao <gaoliming@...>
Cc: Andrew Fish <afish@...>
Cc: Leif Lindholm <leif@...>
Cc: Michael D Kinney <michael.d.kinney@...>

Abner Chang (2):
RedfishClientPkg: Initial commit
edk2: Update Maintainers.txt

RedfishClientPkg/Readme.md | 185 +++
Maintainers.txt | 5 +
.../Media/RedfishClientDriverStack.svg | 1068 +++++++++++++++++
3 files changed, 1258 insertions(+)
create mode 100644 RedfishClientPkg/Readme.md
create mode 100644 RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg

--
2.17.1


[staging/edk2-redfish-client PATCH v2 2/2] edk2: Update Maintainers.txt

Abner Chang
 

Add maintainer and reviewer to RedfishClinetPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Nickle Wang <nickle.wang@...>
Cc: Liming Gao <gaoliming@...>
Cc: Andrew Fish <afish@...>
Cc: Leif Lindholm <leif@...>
Cc: Michael D Kinney <michael.d.kinney@...>
---
Maintainers.txt | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index e9dda5c5ca..55068c9140 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -519,6 +519,11 @@ F: RedfishPkg/
M: Abner Chang <abner.chang@...>
R: Nickle Wang <nickle.wang@...>

+RedfishClientPkg: Redfish Client related modules
+F: RedfishClientPkg/
+M: Abner Chang <abner.chang@...>
+R: Nickle Wang <nickle.wang@...>
+
SecurityPkg
F: SecurityPkg/
W: https://github.com/tianocore/tianocore.github.io/wiki/SecurityPkg
--
2.17.1


Cancelled Event: TianoCore Bug Triage - APAC / NAMO - Tuesday, July 20, 2021 #cal-cancelled

devel@edk2.groups.io Calendar <noreply@...>
 

Cancelled: TianoCore Bug Triage - APAC / NAMO

This event has been cancelled.

When:
Tuesday, July 20, 2021
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d

Organizer: Liming Gao gaoliming@...

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 

________________________________________________________________________________

Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions

Or call in (audio only)

+1 916-245-6934,,77463821#   United States, Sacramento

Phone Conference ID: 774 638 21#

Find a local number | Reset PIN

Learn More | Meeting options


回复: [edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - 07/20/2021 #cal-reminder

gaoliming
 

Few new issues are supported. Let’s cancel the meeting.

 

3500

EDK2

Code

unassigned@...

UNCO

Add some debugger scripts to the edk2 repo

18:13:17

afish@...

3498

EDK2 Cod

Specific

unassigned@...

UNCO

EINJ updates for CXL

Mon 08:26

thanu.rangarajan@...

3497

EDK2 Cod

Specific

unassigned@...

UNCO

CXL CPER updates

Mon 07:32

thanu.rangarajan@...

3495

EDK2

Code

unassigned@...

UNCO

GetNextDevicePathInstance does not work correctly when Size parameter is NULL

Sun 19:18

davmac@...

3493

EDK2

Code

unassigned@...

UNCO

"PCI Express Gen 4" SlotID display information support is not added in ShellPkg

Thu 08:11

prarthanasv@...

3492

EDK2

Code

unassigned@...

UNCO

UefiCpuPkg: SecCoreNative without ResetVector

Wed 05:49

ashraf.ali.s@...

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 devel@edk2.groups.io Calendar
发送时间: 2021720 9:30
收件人: devel@edk2.groups.io
主题: [edk2-devel] Event: TianoCore Bug Triage - APAC / NAMO - 07/20/2021 #cal-reminder

 

Reminder: TianoCore Bug Triage - APAC / NAMO

When:
07/20/2021
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d

Organizer: Liming Gao gaoliming@...

View Event

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 

________________________________________________________________________________

Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions

Or call in (audio only)

+1 916-245-6934,,77463821#   United States, Sacramento

Phone Conference ID: 774 638 21#

Find a local number | Reset PIN

Learn More | Meeting options


Re: [Patch V2] NetworkPkg: Add HTTP Additional Event Notifications

Wu, Jiaxin
 

Reviewed-by: Jiaxin Wu <jiaxin.wu@...>



Thanks,
Jiaxin

-----Original Message-----
From: Luo, Heng <heng.luo@...>
Sent: Tuesday, July 20, 2021 10:18 AM
To: devel@edk2.groups.io
Cc: Maciej Rabeda <maciej.rabeda@...>; Wu, Jiaxin
<jiaxin.wu@...>; Fu, Siyuan <siyuan.fu@...>
Subject: [Patch V2] NetworkPkg: Add HTTP Additional Event Notifications

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

Add new EDKII_HTTP_CALLBACK_PROTOCOL in NetworkPkg,
Send HTTP Events via EDKII_HTTP_CALLBACK_PROTOCOL
when Dns/ConnectTcp/TlsConnectSession/InitSession
occurs.

Signed-off-by: Heng Luo <heng.luo@...>
Cc: Maciej Rabeda <maciej.rabeda@...>
Cc: Jiaxin Wu <jiaxin.wu@...>
Cc: Siyuan Fu <siyuan.fu@...>
---
NetworkPkg/HttpDxe/HttpDriver.h | 3 ++-
NetworkPkg/HttpDxe/HttpDxe.inf | 3 ++-
NetworkPkg/HttpDxe/HttpImpl.c | 4 +++-
NetworkPkg/HttpDxe/HttpProto.c | 58
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
NetworkPkg/HttpDxe/HttpProto.h | 15 ++++++++++++++-
NetworkPkg/Include/Protocol/HttpCallback.h | 85
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++
NetworkPkg/NetworkPkg.dec | 3 +++
7 files changed, 166 insertions(+), 5 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpDriver.h
b/NetworkPkg/HttpDxe/HttpDriver.h
index 5fe8c5b5e9..b701b80858 100644
--- a/NetworkPkg/HttpDxe/HttpDriver.h
+++ b/NetworkPkg/HttpDxe/HttpDriver.h
@@ -1,7 +1,7 @@
/** @file

The header files of the driver binding and service binding protocol for
HttpDxe driver.



- Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>

+ Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>

(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>



SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -47,6 +47,7 @@
#include <Protocol/Ip6Config.h>

#include <Protocol/Tls.h>

#include <Protocol/TlsConfig.h>

+#include <Protocol/HttpCallback.h>



#include <Guid/ImageAuthentication.h>

//

diff --git a/NetworkPkg/HttpDxe/HttpDxe.inf
b/NetworkPkg/HttpDxe/HttpDxe.inf
index 35fe31af18..23fb9ec394 100644
--- a/NetworkPkg/HttpDxe/HttpDxe.inf
+++ b/NetworkPkg/HttpDxe/HttpDxe.inf
@@ -1,7 +1,7 @@
## @file

# Implementation of EFI HTTP protocol interfaces.

#

-# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>

+# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>

#

# SPDX-License-Identifier: BSD-2-Clause-Patent

#

@@ -65,6 +65,7 @@
gEfiTlsServiceBindingProtocolGuid ## SOMETIMES_CONSUMES

gEfiTlsProtocolGuid ## SOMETIMES_CONSUMES

gEfiTlsConfigurationProtocolGuid ## SOMETIMES_CONSUMES

+ gEdkiiHttpCallbackProtocolGuid ## SOMETIMES_CONSUMES



[Guids]

gEfiTlsCaCertificateGuid ## SOMETIMES_CONSUMES ##
Variable:L"TlsCaCertificate"

diff --git a/NetworkPkg/HttpDxe/HttpImpl.c
b/NetworkPkg/HttpDxe/HttpImpl.c
index 5a6ecbc9d9..97f15d229f 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -1,7 +1,7 @@
/** @file

Implementation of EFI_HTTP_PROTOCOL protocol interfaces.



- Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>

+ Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>

(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>



SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -527,6 +527,7 @@ EfiHttpRequest (
} else {

Status = HttpDns6 (HttpInstance, HostNameStr, &HttpInstance-
RemoteIpv6Addr);
}

+ HttpNotify (HttpEventDns, Status);



FreePool (HostNameStr);

if (EFI_ERROR (Status)) {

@@ -588,6 +589,7 @@ EfiHttpRequest (
Configure || ReConfigure,

TlsConfigure

);

+ HttpNotify (HttpEventInitSession, Status);

if (EFI_ERROR (Status)) {

goto Error2;

}

diff --git a/NetworkPkg/HttpDxe/HttpProto.c
b/NetworkPkg/HttpDxe/HttpProto.c
index afc7db5a72..affa916bd6 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -1,7 +1,7 @@
/** @file

Miscellaneous routines for HttpDxe driver.



-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>

+Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>

(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -966,6 +966,7 @@ HttpCreateConnection (
HttpInstance->IsTcp4ConnDone = FALSE;

HttpInstance->Tcp4ConnToken.CompletionToken.Status =
EFI_NOT_READY;

Status = HttpInstance->Tcp4->Connect (HttpInstance->Tcp4,
&HttpInstance->Tcp4ConnToken);

+ HttpNotify (HttpEventConnectTcp, Status);

if (EFI_ERROR (Status)) {

DEBUG ((EFI_D_ERROR, "HttpCreateConnection: Tcp4->Connect()
= %r\n", Status));

return Status;

@@ -981,6 +982,7 @@ HttpCreateConnection (
HttpInstance->IsTcp6ConnDone = FALSE;

HttpInstance->Tcp6ConnToken.CompletionToken.Status =
EFI_NOT_READY;

Status = HttpInstance->Tcp6->Connect (HttpInstance->Tcp6,
&HttpInstance->Tcp6ConnToken);

+ HttpNotify (HttpEventConnectTcp, Status);

if (EFI_ERROR (Status)) {

DEBUG ((EFI_D_ERROR, "HttpCreateConnection: Tcp6->Connect()
= %r\n", Status));

return Status;

@@ -1277,6 +1279,7 @@ HttpConnectTcp4 (
}



Status = TlsConnectSession (HttpInstance, HttpInstance->TimeoutEvent);

+ HttpNotify (HttpEventTlsConnectSession, Status);



gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);



@@ -1369,6 +1372,7 @@ HttpConnectTcp6 (
}



Status = TlsConnectSession (HttpInstance, HttpInstance->TimeoutEvent);

+ HttpNotify (HttpEventTlsConnectSession, Status);



gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);



@@ -2195,3 +2199,55 @@ HttpTcpTokenCleanup (
}



}

+

+/**

+ Send Events via EDKII_HTTP_CALLBACK_PROTOCOL.

+

+ @param[in] Event The event that occurs in the current state.

+ @param[in] EventStatus The Status of Event, EFI_SUCCESS or other
errors.

+

+**/

+VOID

+HttpNotify (

+ IN EDKII_HTTP_CALLBACK_EVENT Event,

+ IN EFI_STATUS EventStatus

+ )

+{

+ EFI_STATUS Status;

+ EFI_HANDLE *Handles;

+ UINTN Index;

+ UINTN HandleCount;

+ EFI_HANDLE Handle;

+ EDKII_HTTP_CALLBACK_PROTOCOL *HttpCallback;

+

+ DEBUG ((DEBUG_INFO, "HttpNotify: Event - %d, EventStatus - %r\n",
Event, EventStatus));

+

+ Handles = NULL;

+ HandleCount = 0;

+ Status = gBS->LocateHandleBuffer (

+ ByProtocol,

+ &gEdkiiHttpCallbackProtocolGuid,

+ NULL,

+ &HandleCount,

+ &Handles

+ );

+ if (Status == EFI_SUCCESS) {

+ for (Index = 0; Index < HandleCount; Index++) {

+ Handle = Handles[Index];

+ Status = gBS->HandleProtocol (

+ Handle,

+ &gEdkiiHttpCallbackProtocolGuid,

+ (VOID **) &HttpCallback

+ );

+ if (Status == EFI_SUCCESS) {

+ DEBUG ((DEBUG_INFO, "HttpNotify: Notifying %p\n", HttpCallback));

+ HttpCallback->Callback (

+ HttpCallback,

+ Event,

+ EventStatus

+ );

+ }

+ }

+ FreePool (Handles);

+ }

+}

diff --git a/NetworkPkg/HttpDxe/HttpProto.h
b/NetworkPkg/HttpDxe/HttpProto.h
index 00ba26aca4..5b90a6b074 100644
--- a/NetworkPkg/HttpDxe/HttpProto.h
+++ b/NetworkPkg/HttpDxe/HttpProto.h
@@ -1,7 +1,7 @@
/** @file

The header files of miscellaneous routines for HttpDxe driver.



-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>

+Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>

(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>

SPDX-License-Identifier: BSD-2-Clause-Patent



@@ -609,4 +609,17 @@ HttpResponseWorker (
IN HTTP_TOKEN_WRAP *Wrap

);



+/**

+ Send Events via EDKII_HTTP_CALLBACK_PROTOCOL.

+

+ @param[in] Event The event that occurs in the current state.

+ @param[in] EventStatus The Status of Event, EFI_SUCCESS or other
errors.

+

+**/

+VOID

+HttpNotify (

+ IN EDKII_HTTP_CALLBACK_EVENT Event,

+ IN EFI_STATUS EventStatus

+ );

+

#endif

diff --git a/NetworkPkg/Include/Protocol/HttpCallback.h
b/NetworkPkg/Include/Protocol/HttpCallback.h
new file mode 100644
index 0000000000..d036a8a4be
--- /dev/null
+++ b/NetworkPkg/Include/Protocol/HttpCallback.h
@@ -0,0 +1,85 @@
+/** @file

+ This file defines the EDKII HTTP Callback Protocol interface.

+

+ Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+ SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#ifndef __EDKII_HTTP_CALLBACK_H__

+#define __EDKII_HTTP_CALLBACK_H__

+

+#define EDKII_HTTP_CALLBACK_PROTOCOL_GUID \

+ { \

+ 0x611114f1, 0xa37b, 0x4468, {0xa4, 0x36, 0x5b, 0xdd, 0xa1, 0x6a, 0xa2,
0x40} \

+ }

+

+typedef struct _EDKII_HTTP_CALLBACK_PROTOCOL
EDKII_HTTP_CALLBACK_PROTOCOL;

+

+///

+/// EDKII_HTTP_CALLBACK_EVENT

+///

+typedef enum {

+ ///

+ /// The Status of DNS Event to retrieve the host address.

+ /// EventStatus:

+ /// EFI_SUCCESS Operation succeeded.

+ /// EFI_OUT_OF_RESOURCES Failed to allocate needed resources.

+ /// EFI_DEVICE_ERROR An unexpected network error occurred.

+ /// Others Other errors as indicated.

+ ///

+ HttpEventDns,

+

+ ///

+ /// The Status of Event to initiate a nonblocking TCP connection request.

+ /// EventStatus:

+ /// EFI_SUCCESS The connection request is successfully initiated.

+ /// EFI_NOT_STARTED This EFI TCP Protocol instance has not been
configured.

+ /// EFI_DEVICE_ERROR An unexpected system or network error
occurred.

+ /// Others Other errors as indicated.

+ ///

+ HttpEventConnectTcp,

+

+ ///

+ /// The Status of Event to connect one TLS session by finishing the TLS
handshake process.

+ /// EventStatus:

+ /// EFI_SUCCESS The TLS session is established.

+ /// EFI_OUT_OF_RESOURCES Can't allocate memory resources.

+ /// EFI_ABORTED TLS session state is incorrect.

+ /// Others Other error as indicated.

+ ///

+ HttpEventTlsConnectSession,

+

+ ///

+ /// The Status of Event to initialize Http session

+ /// EventStatus:

+ /// EFI_SUCCESS The initialization of session is done.

+ /// Others Other error as indicated.

+ ///

+ HttpEventInitSession

+} EDKII_HTTP_CALLBACK_EVENT;

+

+/**

+ Callback function that is invoked when HTTP event occurs.

+

+ @param[in] This Pointer to the EDKII_HTTP_CALLBACK_PROTOCOL
instance.

+ @param[in] Event The event that occurs in the current state.

+ @param[in] EventStatus The Status of Event, EFI_SUCCESS or other
errors.

+**/

+typedef

+VOID

+(EFIAPI * EDKII_HTTP_CALLBACK) (

+ IN EDKII_HTTP_CALLBACK_PROTOCOL *This,

+ IN EDKII_HTTP_CALLBACK_EVENT Event,

+ IN EFI_STATUS EventStatus

+ );

+

+///

+/// EFI HTTP Callback Protocol is invoked when HTTP event occurs.

+///

+struct _EDKII_HTTP_CALLBACK_PROTOCOL {

+ EDKII_HTTP_CALLBACK Callback;

+};

+

+extern EFI_GUID gEdkiiHttpCallbackProtocolGuid;

+

+#endif

diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
index b81f10ef6e..0f9f7bb15e 100644
--- a/NetworkPkg/NetworkPkg.dec
+++ b/NetworkPkg/NetworkPkg.dec
@@ -88,6 +88,9 @@
## Include/Protocol/Dpc.h

gEfiDpcProtocolGuid = {0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb,
0x9f, 0xba, 0x61, 0x98, 0x6 }}



+ ## Include/Protocol/HttpCallback.h

+ gEdkiiHttpCallbackProtocolGuid = {0x611114f1, 0xa37b, 0x4468, {0xa4, 0x36,
0x5b, 0xdd, 0xa1, 0x6a, 0xa2, 0x40}}

+

[PcdsFixedAtBuild]

## The max attempt number will be created by iSCSI driver.

# @Prompt Max attempt number.

--
2.31.1.windows.1


Re: [staging/edk2-redfish-client PATCH 2/2] edk2: Update Maintainers.txt

Nickle Wang
 

Reviewed-by: Nickle Wang <nickle.wang@...>

Nickle

-----Original Message-----
From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Sent: Saturday, July 17, 2021 10:02 PM
To: devel@edk2.groups.io
Cc: Wang, Nickle (HPS SW) <nickle.wang@...>; Liming Gao <gaoliming@...>; Andrew Fish <afish@...>; Leif Lindholm <leif@...>; Michael D Kinney <michael.d.kinney@...>
Subject: [staging/edk2-redfish-client PATCH 2/2] edk2: Update Maintainers.txt

Add maintainer and reviewer to RedfishClinetPkg.

Signed-off-by: Abner Chang <abner.chang@...>
Cc: Nickle Wang <nickle.wang@...>
Cc: Liming Gao <gaoliming@...>
Cc: Andrew Fish <afish@...>
Cc: Leif Lindholm <leif@...>
Cc: Michael D Kinney <michael.d.kinney@...>
---
Maintainers.txt | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt index e9dda5c5ca..55068c9140 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -519,6 +519,11 @@ F: RedfishPkg/
M: Abner Chang <abner.chang@...>
R: Nickle Wang <nickle.wang@...>

+RedfishClientPkg: Redfish Client related modules
+F: RedfishClientPkg/
+M: Abner Chang <abner.chang@...>
+R: Nickle Wang <nickle.wang@...>
+
SecurityPkg
F: SecurityPkg/
W: https://github.com/tianocore/tianocore.github.io/wiki/SecurityPkg
--
2.17.1


Re: [staging/edk2-redfish-client PATCH 1/2] RedfishClientPkg: Initial commit

Nickle Wang
 

Hi Abner,

 

I see typo here:

 

struct _EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL {

  EDKII_REDFISH_PLATFORM_CONFIG_GET_VALUE             GetValue;

  EDKII_REDFISH_PLATFORM_CONFIG_SET_VALUE             SetValue;

  EDKII_REDFISH_PLATFORM_CONFIG_GET_CONFIG_LANG       GetConfigureLang;

  EDKII_REDFISH_PLATFORM_CONFIG_GET_SUPPORTED_SCHEMA  GetSupportedSchema;

};

 

It is EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL instead of EDKII_PLATFORM_CONFIG_TO_REDFISH_PROTOCOL. I update the description as below:

 

 

+### EDKII Redfish Platform Config Protocol ***[[6]](#[0])***

+EDKII Redfish Platform Config Protocol is an abstract driver that abstracts the platform

+configuration format and storage from EDK2 Redfish Feature driver. This protocol provides

+the interfaces to get and set platform configuration that format and the storage to store

+configuration are agnostic to the feature driver. The platform can provide its own EDKII

+Redfish Platform Config driver to access platform-specific configuration format and

+storage. On EDK2 open source, EDKII Redfish Platform Config Protocol accesses the

+platform configuration in EDK2 HII defined format.

+

+Below is the prototype of **EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL**,

+

+```C

+struct _EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL  {

+  EDKII_REDFISH_PLATFORM_CONFIG_GET_VALUE             GetValue;

+  EDKII_REDFISH_PLATFORM_CONFIG_SET_VALUE             SetValue;

+  EDKII_REDFISH_PLATFORM_CONFIG_GET_CONFIG_LANG       GetConfigureLang;

+  EDKII_REDFISH_PLATFORM_CONFIG_GET_SUPPORTED_SCHEMA  GetSupportedSchema;

+};

+```

+

+### Other instances of EDKII Redfish Platform Config Protocol ***[[7]](#[0])***

+For those Non-EDK2 HII-based platform configuration formats, the driver instance can

+provide its own implementation to get or set the platform configurations.

 

 

 

Thanks,

Nickle

 

-----Original Message-----
From: Chang, Abner (HPS SW/FW Technologist) <abner.chang@...>
Sent: Saturday, July 17, 2021 10:02 PM
To: devel@edk2.groups.io
Cc: Wang, Nickle (HPS SW) <nickle.wang@...>; Liming Gao <gaoliming@...>; Andrew Fish <afish@...>; Leif Lindholm <leif@...>; Michael D Kinney <michael.d.kinney@...>
Subject: [staging/edk2-redfish-client PATCH 1/2] RedfishClientPkg: Initial commit

 

Initial commit of architecture diagrams and Readme.md

 

Signed-off-by: Abner Chang <abner.chang@...>

Cc: Nickle Wang <nickle.wang@...>

Cc: Liming Gao <gaoliming@...>

Cc: Andrew Fish <afish@...>

Cc: Leif Lindholm <leif@...>

Cc: Michael D Kinney <michael.d.kinney@...>

---

RedfishClientPkg/Readme.md                    | 180 +++++

.../Media/RedfishClientDriverStack.svg        | 680 ++++++++++++++++++

2 files changed, 860 insertions(+)

create mode 100644 RedfishClientPkg/Readme.md

create mode 100644 RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg

 

diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md

new file mode 100644

index 0000000000..ce8c2f9409

--- /dev/null

+++ b/RedfishClientPkg/Readme.md

@@ -0,0 +1,180 @@

+# UEFI Redfish Client EDK2 Implementation

+

+## Introduction

+UEFI Redfish Client EDK2 solution is implemented base on

+[*EDK2 Redfish Foundation*](https://github.com/tianocore/edk2/blob/master/RedfishPkg/Readme.md),

+the implementation utilizes the EFI protocols provided by EDK2 Redfish

+Foundation to communicate with the Redfish service for creating, consuming, and

+updating the Redfish properties which are managed by firmware. This solution

+requests the instance of **EFI REST EX Protocol** through EFI Redfish Discover

+Protocol and interacts with Redfish service using **EFI REST EX Protocol** later

+on. The essential part of this implementation is to map the EDK2 HII options to

+the corresponding Redfish properties that are already defined in the standard

+Redfish schemas published by

+[*DMTF Redfish working group*](https://www.dmtf.org/standards/redfish).

+The advantage of this design is to strengthen the interoperability among the

+servers produced by different OEMs when configuring the platform through Redfish

+service. Using the properties defined in Redfish standard schema for configuring

+platform reduces the overhead of Redfish client tools to have different

+implementations in order to compliant with OEM servers. The solution also

+reduces OEM-defined proprietary BIOS Attributes that lead to the divergence of

+platform configuration namings in Redfish BIOS Attribute Registry, however,

+those different namings refer to the same platform functionality.

+

+## The Scope of UEFI Redfish Client EDK2 Implementation

+-  Platform Configurable settings

+

+This is the first stage of UEFI Redfish Client EDK2 Implementation. Associate

+Redfish property with HII option.

+

+- Provisioning of Firmware Managed Platform Redfish Resource

+

+The current design of UEFI Redfish Client EDK2 Implementation can already

+support the provisioning of firmware-owned platform Redfish resource, however,

+this requires addtional support on edk2 HII. Therefore, provisioning of

+firmware managed platform Redfish resource would be the second stage.

+

+Below are the block diagrams of UEFI Redfish Client EDK2 Implementation.

+

+## <a name="[0]">EDK2 Redfish Client Implementation Diagrams</a>

+![UEFI Redfish Client Implementation](https://github.com/changab/edk2-staging/blob/edk2-redfish-client/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg?raw=true)

+

+## EFI EDK2 Redfish Client Framework

+The functionality of each block in the diagrams are described in belwo sections,

+

+### EDK2 Redfish Foundation ***[[1]](#[0])***

+EDK2 Redfish Redfish Foundation provides the facilities of communicating with

+Redfish service. Such as the discovery of Redfish service, the credential to access

+Redfish service, *EFI REST EX Protocol* instance which is the transport layer to

+Redfish service, and so on. Please refer to

+[*EDK2 Redfish Foundation*](https://github.com/tianocore/edk2/blob/master/RedfishPkg/Readme.md).

+

+### Redfish Profile Simulator ***[[2]](#[0])***

+Redfish Profile Simulator is an

+[*open source project*](https://github.com/DMTF/Redfish-Profile-Simulator) on DMTF

+GitHub, which simulates the HTTP request methods (POST, PATCH, PUT, GET) on Redfish

+resource maintained by Redfish Profile Simulator. EDK2 open source uses this

+simulator for the use case when Redfish service has not been set up on the platform,

+or for the quick Redfish firmware feature development. We clone this project under

+RedfishClientPkg and maintain it by edk2 because this project has currently been

+using and updating rarely. That is easier for edk2 to add features to the simulator

+or modify the simulator to align with edk2 requirement on Redfish service, such as

+ETAG and HTTP POST support. <br>

+Another open source project of Redfish simulator is

+[*Redfish Interface Emulator*](https://github.com/DMTF/Redfish-Interface-Emulator),

+however, we don't pay much attention to this project because we have been dedicating

+to Redfish Profile Simulator since we started the UEFI Redfish EDK2 project.

+

+### EDK2 Redfish JSON Schema to C Structure Convertor ***[[3]](#[0])***

+This is the script auto-generated EDK2 drivers and libraries that provide the Redfish

+schema naming based JSON to C structure and vise versa converters. C structure is

+another representation of Redfish properties other than JSON and CSDL(XML). The higher

+layer Redfish client application can deal with C structure instead of using JSON

+library to manipulate Redfish properties. The script

+[*Redfish Schema C Struct Generator*](https://github.com/DMTF/Redfish-Schema-C-Struct-Generator)

+is still a private project on DMTF GitHub. Below is the reference of script

+auto-generated [*Redfish JSON C Struct Converter Lib*](https://github.com/changab/Redfish-JSON-C-Struct-Converter-Lib)

+libraries. The converters generated by the script are followed

+**EFI REST JSON Structure Protocol** defined in UEFI spec 2.8, section 29.7.3.

+

+### EDK2 Redfish Non-Collection ***[[4]](#[0])*** and Collection ***[[5]](#[0])*** Feature Drivers

+EDK2 Redfish feature driver is an intermediary driver that sits between **JSON Schema

+to C Structure converters** and **EFI Platform Configuration to Redfish Protocol**. The

+Redfish feature driver gets and sets the platform configuration and incorporates it with

+Redfish JSON schema C structure to manipulate Redfish JSON resources. Then applies the

+settings from Redfish service to platform configurations, or vise versa to update platform

+configurations to Redfish service. Both EDK2 Redfish Non-Collection and Collection Feature

+drivers are script auto-generated base on Redfish schema naming. The EDK2 Redfish

+Non-Collection feature driver manages the resource of specific Resdifsh resource type,

+while the EDK2 Redfish Collection feature driver manages the members which have the same

+resource type in collection resource (e.g the ComputerSystem resource and

+ComputerSystemCollection resource).

+

+### EFI Platform Config to Redfish Protocol ***[[6]](#[0])***

+EFI Platform Config to Redfish Protocol is an abstract driver that abstracts the platform

+configuration format and storage from EDK2 Redfish Feature driver. This protocol provides

+the interfaces to get and set platform configuration that format and the storage to store

+configuration are agnostic to the feature driver. The platform can provide its own EFI

+Platform Config to Redfish driver to access platform-specific configuration format and

+storage. On EDK2 open source, EFI Platform Config to Redfish Protocol accesses the

+platform configuration in EDK2 HII defined format.

+

+Below is the prototype of **EFI_PLATFORM_CONFIG_TO_REDFISH_PROTOCOL**,

+

+```C

+struct _EDKII_PLATFORM_CONFIG_TO_REDFISH_PROTOCOL {

+  EDKII_REDFISH_PLATFORM_CONFIG_GET_VALUE             GetValue;

+  EDKII_REDFISH_PLATFORM_CONFIG_SET_VALUE             SetValue;

+  EDKII_REDFISH_PLATFORM_CONFIG_GET_CONFIG_LANG       GetConfigureLang;

+  EDKII_REDFISH_PLATFORM_CONFIG_GET_SUPPORTED_SCHEMA  GetSupportedSchema;

+};

+```

+

+### Other instances of EFI Platform Config to Redfish Protocol ***[[7]](#[0])***

+For those Non-EDK2 HII-based platform configuration formats, the driver instance can

+provide its own implementation to get or set the platform configurations.

+

+### EDK2 HII VFR Form ***[[8]](#[0])***

+According to **UEFI spec 2.9 section 35.6 Form Browser Protocol**,

+**EFI_HII_REST_STYLE_FORMSET_GUID** is used on HII form to indicate that HII options

+declared in this form intend to interact with the REST architectural style. On edk2

+open source, the REST architectural style refers to the Redfish service. Besides

+**EFI_HII_REST_STYLE_FORMSET_GUID** is defined in the form scope,

+**EFI_IFR_FLAG_REST_STYLE** can be assigned to the HII options that indicate those

+options intend to interact with the REST service.

+

+### EDK2 HII UNI file ***[[9]](#[0])***

+x-uefi-redfish Configure Language is used in UNI file to associate HII option with

+the particular Redfish property. The Hii options interact with EDK2 Redfish Feature

+driver if the string of HII option is assigned with x-uefi-redfish Language as

+in below,

+

+```C

+x-uefi-redfish-$(NAMESPACE)

+where $(NAMESPACE) is the combination of Redfish ResourceTypeName and schema version.

+```

+For example, if the HII option is mapped to the property in Processor.v1_0_0.

+The x-uefi-redfish configure language is declared as below,

+```C

+x-uefi-redfish-Processor.v1_0_0

+```

+#### x-uefi-redfish Configure Language format:

+- The string declared with x-uefi-redfish configure language is a path to the property

+in Redfish resource

+- The root of path is the Redfish resource type indicated in x-uefi-redfish configure

+language

+- The path is relative to root of Redfish resource type, not related to Redfish service

+- root.

+

+#### Examples,

+```C

+Properties:

+

+#string STR_BOOT_SOURCE_OVERRIDE_ENABLED_PROMPT #language x_uefi_redfish_ComputerSystem.v1_0_0  "/Boot/BootSourceOverrideEnabled"

+#string STR_BOOT_SOURCE_OVERRIDE_MODE_PROMPT    #language x_uefi_redfish_ComputerSystem.v1_0_0  "/Boot/BootSourceOverrideMode"

+#string STR_BOOT_SOURCE_OVERRIDE_TARGET_PROMPT  #language x_uefi_redfish_ComputerSystem.v1_0_0  "/Boot/BootSourceOverrideTarget"

+```

+```C

+Properties in array object [NUM]:

+

+#string STR_BOOT_ORDER_1_PROMPT  #language x_uefi_redfish_ComputerSystem.v1_11_0  "/Boot/BootOrder/[1]/Boot0001"

+#string STR_BOOT_ORDER_2_PROMPT  #language x_uefi_redfish_ComputerSystem.v1_11_0  "/Boot/BootOrder/[2]/Boot0002"

+#string STR_BOOT_ORDER_3_PROMPT  #language x_uefi_redfish_ComputerSystem.v1_11_0  "/Boot/BootOrder/[3]/Boot0003"

+```

+```C

+Properties in collection object {NUM}:

+

+#string STR_MEMORY_1_BASE_MODULE_TYPE_PROMPT  #language x_uefi_redfish_Memory.v1_7_1  "/Memory/{1}/BaseModuleType"

+#string STR_MEMORY_2_BASE_MODULE_TYPE_PROMPT  #language x_uefi_redfish_Memory.v1_7_1  "/Memory/{2}/BaseModuleType"

+#string STR_MEMORY_3_BASE_MODULE_TYPE_PROMPT  #language x_uefi_redfish_Memory.v1_7_1  "/Memory/{3}/BaseModuleType"

+```

+

+### EDK2 Build Tool ***[[10]](#[0])***

+EDK2 Build is responsible to pull the necessary EDK2 Redfish JSON Schema to C Structure

+Convertors and EDK2 Redfish Feature drivers into edk2 build process according to the

+x-uefi-Redfish config language used in the HII VFR forms.

+

+## The Contributors

+Chang, Abner <abner.chang@...>\

+Wang, Nickle <nickle.wang@...>\

+Chen, Aaron <aaron.chen@...>

diff --git a/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg b/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg

new file mode 100644

index 0000000000..eb59eb9992

--- /dev/null

+++ b/RedfishClientPkg/Documents/Media/RedfishClientDriverStack.svg

@@ -0,0 +1,680 @@

+<?xml version="1.0" encoding="UTF-8" standalone="no"?>

+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

+<!-- Generated by Microsoft Visio, SVG Export RedfishClientDriverStack.svg Page-2 -->

+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events"

+        width="12.1281in" height="9.93872in" viewBox="0 0 873.222 715.588" xml:space="preserve" color-interpolation-filters="sRGB"

+        class="st68">

+    <style type="text/css">

+    <![CDATA[

+        .st1 {fill:#ffffff;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}

+        .st2 {fill:#ebf1df;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5}

+        .st3 {fill:#ff1a1a;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5}

+        .st4 {fill:#ffffff;font-family:Calibri;font-size:1.00001em;font-weight:bold}

+        .st5 {font-size:1em}

+        .st6 {fill:none;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}

+        .st7 {fill:#000000;font-family:Calibri;font-size:1.00001em;font-weight:bold}

+        .st8 {fill:#dbeef3;stroke:#d8d8d8;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5}

+        .st9 {fill:#ffffff;font-family:Calibri;font-size:1.08334em;font-weight:bold}

+        .st10 {visibility:visible}

+        .st11 {fill:none;filter:url(#filter_3.3333334922791);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.4}

+        .st12 {fill:none;stroke:#bfbfbf;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}

+        .st13 {fill:#000000;font-family:Arial;font-size:1.99999em;font-style:italic;font-weight:bold}

+        .st14 {marker-end:url(#mrkr2-45);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.9}

+        .st15 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.42986425339367}

+        .st16 {fill:#000000;stroke:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}

+        .st17 {fill:#ffffff;font-family:Arial;font-size:1.33333em;font-weight:bold}

+        .st18 {fill:#ffffff;stroke:#595959;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5}

+        .st19 {fill:#7f7f7f;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5}

+        .st20 {fill:#ffffff;font-family:Calibri;font-size:1.08334em}

+        .st21 {fill:#000000;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}

+        .st22 {fill:#000000;font-family:Calibri;font-size:0.833336em;font-weight:bold}

+        .st23 {marker-start:url(#mrkr10-112);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.25}

+        .st24 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.40983606557377}

+        .st25 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1}

+        .st26 {fill:#000000;fill-opacity:0.4;filter:url(#filter_3.3333334922791);stroke:#000000;stroke-dasharray:10.5,7.5;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.4}

+        .st27 {fill:#0070c0;stroke:#003f6c;stroke-dasharray:10.5,7.5;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5}

+        .st28 {fill:#000000;font-family:Calibri;font-size:1.00001em;font-style:italic;font-weight:bold}

+        .st29 {fill:#ffffff;stroke:#000000;stroke-dasharray:1.68,1.2;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}

+        .st30 {fill:#000000;font-family:Calibri;font-size:0.833336em}

+        .st31 {fill:#ffffff;stroke:#000000;stroke-dasharray:3.5,2.5;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.5}

+        .st32 {stroke:#7f7f7f;stroke-linecap:round;stroke-linejoin:round;stroke-width:4.5}

+        .st33 {fill:#000000;fill-opacity:0.38;filter:url(#filter_3.3333334922791);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.38}

+        .st34 {fill:#000000;fill-opacity:0.38;stroke:#000000;stroke-opacity:0.38;stroke-width:0.22935779816514}

+        .st35 {fill:#f2f2f2;stroke:#7f7f7f;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}

+        .st36 {fill:#7f7f7f;fill-opacity:1;stroke:#7f7f7f;stroke-opacity:1;stroke-width:0.22935779816514}

+        .st37 {fill:#d8d8d8;stroke:#7f7f7f;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}

+        .st38 {fill:#ffffff;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}

+        .st39 {fill:#000000;fill-opacity:0.4;filter:url(#filter_3.3333334922791);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.4}

+        .st40 {fill:#0070c0;stroke:#003f6c;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5}

+        .st41 {fill:#ffffff;stroke:#000000;stroke-dasharray:9.5,2.5,3.5,2.5;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.5}

+        .st42 {fill:#ffffff;stroke:#000000;stroke-dasharray:3.5,2.5,3.5,2.5,0,2.5;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.5}

+        .st43 {marker-end:url(#mrkr4-212);marker-start:url(#mrkr4-210);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:2.25}

+        .st44 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.47169811320755}

+        .st45 {fill:#ffffff;stroke:#7f7f7f;stroke-linecap:round;stroke-linejoin:round;stroke-width:1}

+        .st46 {fill:#000000;font-family:Calibri;font-size:1.16666em;font-style:italic;font-weight:bold}

+        .st47 {font-family:Arial;font-size:0.571431em;font-style:normal;font-weight:normal}

+        .st48 {font-family:Arial;font-size:0.571431em;font-style:normal}

+        .st49 {fill:#ea700d;font-family:Arial;font-size:0.571431em;font-style:normal}

+        .st50 {fill:#ffffff;stroke:#7f7f7f;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}

+        .st51 {fill:#d8d8d8;font-family:Calibri;font-size:0.833336em;font-style:italic;font-weight:bold}

+        .st52 {font-size:1.20001em;font-style:normal;font-weight:normal}

+        .st53 {font-size:1em;font-style:normal;font-weight:normal}

+        .st54 {fill:#f59d56;font-size:1em;font-style:normal;font-weight:normal}

+        .st55 {marker-end:url(#mrkr2-350);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:2}

+        .st56 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.44247787610619}

+        .st57 {marker-end:url(#mrkr2-383);marker-start:url(#mrkr2-381);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.75}

+        .st58 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.22935779816514}

+        .st59 {fill:#000000;font-family:Calibri;font-size:0.75em;font-style:italic;font-weight:bold}

+        .st60 {fill:#000000;font-family:Calibri;font-size:0.75em;font-weight:bold}

+        .st61 {fill:#0070c0;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.5}

+        .st62 {fill:#595959;stroke:none;stroke-linecap:butt;stroke-width:0.75}

+        .st63 {marker-start:url(#mrkr4-405);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.25}

+        .st64 {fill:#000000;fill-opacity:1;stroke:#000000;stroke-opacity:1;stroke-width:0.3315649867374}

+        .st65 {marker-end:url(#mrkr4-411);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.25}

+        .st66 {marker-end:url(#mrkr10-430);marker-start:url(#mrkr10-112);stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.25}

+        .st67 {stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:1.25}

+        .st68 {fill:none;fill-rule:evenodd;font-size:12px;overflow:visible;stroke-linecap:square;stroke-miterlimit:3}

+    ]]>

+    </style>

+

+    <defs id="Markers">

+        <g id="lend2">

+            <path d="M 1 1 L 0 0 L 1 -1 L 1 1 " style="stroke:none"/>

+        </g>

+        <marker id="mrkr2-45" class="st15" refX="-2.1368421052632" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend2" transform="scale(-2.3263157894737,-2.3263157894737) "/>

+        </marker>

+        <g id="lend10">

+            <path

+                    d="M 0 0.75 C -0.414214 0.75 -0.75 0.414214 -0.75 0 -0.75 -0.414214 -0.414214 -0.75 0 -0.75 0.414214 -0.75 0.75 -0.414214 0.75 0 0.75 0.414214 0.414214 0.75 0 0.75 Z "

+                    style="stroke:none"/>

+        </g>

+        <marker id="mrkr10-112" class="st24" refX="1.542" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend10" transform="scale(2.44) "/>

+        </marker>

+        <g id="lend42">

+            <path

+                    d="M 0 0.75 C -0.414214 0.75 -0.75 0.414214 -0.75 0 -0.75 -0.414214 -0.414214 -0.75 0 -0.75 0.414214 -0.75 0.75 -0.414214 0.75 0 0.75 0.414214 0.414214 0.75 0 0.75 Z "

+                    style="stroke:none"/>

+        </g>

+        <marker id="mrkr42-163" class="st34" refX="3.27" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend42" transform="scale(4.36) "/>

+        </marker>

+        <marker id="mrkr42-167" class="st36" refX="3.27" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend42" transform="scale(4.36) "/>

+        </marker>

+        <g id="lend4">

+            <path d="M 2 1 L 0 0 L 2 -1 L 2 1 " style="stroke:none"/>

+        </g>

+        <marker id="mrkr4-210" class="st44" refX="4.08" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend4" transform="scale(2.12) "/>

+        </marker>

+        <marker id="mrkr4-212" class="st44" refX="-4.08" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend4" transform="scale(-2.12,-2.12) "/>

+        </marker>

+        <marker id="mrkr2-350" class="st56" refX="-2.08" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend2" transform="scale(-2.26,-2.26) "/>

+        </marker>

+        <marker id="mrkr2-381" class="st58" refX="3.88" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend2" transform="scale(4.36) "/>

+        </marker>

+        <marker id="mrkr2-383" class="st58" refX="-3.88" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend2" transform="scale(-4.36,-4.36) "/>

+        </marker>

+        <marker id="mrkr4-405" class="st64" refX="5.744" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend4" transform="scale(3.016) "/>

+        </marker>

+        <marker id="mrkr4-411" class="st64" refX="-6.032" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend4" transform="scale(-3.016,-3.016) "/>

+        </marker>

+        <marker id="mrkr10-430" class="st24" refX="-1.542" orient="auto" markerUnits="strokeWidth" overflow="visible">

+            <use xlink:href="#lend10" transform="scale(-2.44,-2.44) "/>

+        </marker>

+    </defs>

+    <defs id="Filters">

+        <filter id="filter_3.3333334922791">

+            <feGaussianBlur stdDeviation="3.3333334922791"/>

+        </filter>

+    </defs>

+    <g>

+        <title>VBackground-1</title>

+        <g id="shape1-1">

+            <title>Solid</title>

+            <rect x="0" y="0" width="873.222" height="715.588" class="st1"/>

+        </g>

+    </g>

+    <g>

+        <title>Page-2</title>

+        <g id="shape52-3" transform="translate(336.222,-197.713)">

+            <title>Rectangle.52</title>

+            <rect x="0" y="598.588" width="495" height="117" class="st2"/>

+        </g>

+        <g id="group5-5" transform="translate(772.722,-60.4625)">

+            <title>Can</title>

+            <desc>Redfish Service</desc>

+            <g id="shape6-6">

+                <title>Sheet.6</title>

+                <path d="M0 704.34 A26.4375 11.25 -180 1 0 52.88 704.34 L52.88 663.84 L0 663.84 L0 704.34 Z" class="st3"/>

+            </g>

+            <g id="shape5-8">

+                <ellipse cx="26.4375" cy="663.838" rx="26.4375" ry="11.25" class="st3"/>

+                <text x="7.83" y="693.59" class="st4">Redfish <tspan x="8.6" dy="1.2em" class="st5">Service</tspan></text>          </g>

+        </g>

+        <g id="shape8-12" transform="translate(746.847,-24.4625)">

+            <title>Sheet.8</title>

+            <desc>Redfish Profile Simulator On Network</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="17.62" y="693.09" class="st7">Redfish Profile <tspan x="21.08" dy="1em" class="st5">Simulator On </tspan><tspan

+                        x="32.24" dy="1em" class="st5">Network</tspan></text>       </g>

+        <g id="shape10-17" transform="translate(408.222,-82.9625)">

+            <title>Sheet.10</title>

+            <desc>EFI REST EX</desc>

+            <rect x="0" y="679.588" width="261" height="36" class="st8"/>

+            <text x="99.8" y="700.84" class="st9">EFI REST EX </text>       </g>

+        <g id="shape12-20" transform="translate(57.2224,-197.713)">

+            <title>Rectangle</title>

+            <rect x="0" y="598.588" width="234" height="117" class="st2"/>

+        </g>

+        <g id="shape13-22" transform="translate(30.2224,-24.4625)">

+            <title>Rounded Rectangle.76</title>

+            <g id="shadow13-23" transform="matrix(1.02,0,0,1.02,-6.84,-13.2318)" class="st10">

+                <path d="M9 715.59 L675 715.59 A8.99985 8.99985 -180 0 0 684 706.59 L684 616.59 A8.99985 8.99985 -180 0 0 675 607.59

+                             L9 607.59 A8.99985 8.99985 -180 0 0 0 616.59 L0 706.59 A8.99985 8.99985 -180 0 0 9 715.59 Z"

+                        class="st11"/>

+            </g>

+            <path d="M9 715.59 L675 715.59 A8.99985 8.99985 -180 0 0 684 706.59 L684 616.59 A8.99985 8.99985 -180 0 0 675 607.59

+                         L9 607.59 A8.99985 8.99985 -180 0 0 0 616.59 L0 706.59 A8.99985 8.99985 -180 0 0 9 715.59 Z" class="st12"/>

+        </g>

+        <g id="shape16-27" transform="translate(75.2224,-82.9625)">

+            <title>Sheet.16</title>

+            <desc>EFI REST JSON to C Structure</desc>

+            <rect x="0" y="679.588" width="261" height="36" class="st8"/>

+            <text x="53.89" y="700.84" class="st9">EFI REST JSON to C Structure</text>      </g>

+        <g id="shape17-30" transform="translate(408.222,-37.9625)">

+            <title>Sheet.17</title>

+            <desc>EFI Network Stack</desc>

+            <rect x="0" y="679.588" width="261" height="36" class="st8"/>

+            <text x="81.72" y="700.84" class="st9">EFI Network Stack</text>     </g>

+        <g id="shape18-33" transform="translate(75.2224,-37.9625)">

+            <title>Sheet.18</title>

+            <desc>EFI Redfish Discover Protocl</desc>

+            <rect x="0" y="679.588" width="261" height="36" class="st8"/>

+            <text x="55.56" y="700.84" class="st9">EFI Redfish Discover Protocl</text>      </g>

+        <g id="shape19-36" transform="translate(291.222,-51.4625)">

+            <title>Sheet.19</title>

+            <desc>EDKII Redfish Foundation</desc>

+            <rect x="0" y="670.588" width="184" height="45" class="st6"/>

+            <text x="12.66" y="685.89" class="st13">EDKII Redfish <tspan x="26.69" dy="1.2em" class="st5">Foundation</tspan></text>     </g>

+        <g id="shape20-40" transform="translate(904.308,1335.5) rotate(-19.179) scale(1,-1)">

+            <title>Curve connect 1</title>

+            <path d="M0 715.59 A42.4531 42.4531 0 0 1 54.79 715.59 A42.4531 42.4531 -180 0 0 106.06 718.26 L106.35 718.04"

+                    class="st14"/>

+        </g>

+        <g id="shape21-46" transform="translate(18.9724,-139.213)">

+            <title>Sheet.21</title>

+            <desc>EDKII Redfish Client</desc>

+            <rect x="0" y="211.588" width="24.75" height="504" class="st16"/>

+            <text x="-10.85" y="-540.93" writing-mode="tb-rl" transform="rotate(180)" class="st17">EDKII Redfish Client</text>      </g>

+        <g id="shape24-49" transform="translate(111.222,-253.963)">

+            <title>Sheet.24</title>

+            <rect x="0" y="670.588" width="153" height="45" class="st18"/>

+        </g>

+        <g id="shape25-51" transform="translate(84.2224,-240.463)">

+            <title>Sheet.25</title>

+            <rect x="0" y="670.588" width="153" height="45" class="st18"/>

+        </g>

+        <g id="shape26-53" transform="translate(75.2224,-226.963)">

+            <title>Sheet.26</title>

+            <desc>Script-generated Redfish JSON schema to C Structure convertor</desc>

+            <rect x="0" y="670.588" width="153" height="45" class="st19"/>

+            <text x="11.2" y="683.34" class="st20">Script-generated Redfish <tspan x="29.22" dy="1em" class="st5">JSON schema to C </tspan><tspan

+                        x="24.45" dy="1em" class="st5">Structure convertor</tspan></text>       </g>

+        <g id="shape28-58" transform="translate(241.722,-267.463)">

+            <title>Sheet.28</title>

+            <ellipse cx="1.6875" cy="713.9" rx="1.6875" ry="1.6875" class="st21"/>

+        </g>

+        <g id="shape29-60" transform="translate(245.66,-272.525)">

+            <title>Sheet.29</title>

+            <ellipse cx="1.6875" cy="713.9" rx="1.6875" ry="1.6875" class="st21"/>

+        </g>

+        <g id="shape30-62" transform="translate(250.16,-277.588)">

+            <title>Sheet.30</title>

+            <ellipse cx="1.6875" cy="713.9" rx="1.6875" ry="1.6875" class="st21"/>

+        </g>

+        <g id="shape31-64" transform="translate(178.722,-204.463)">

+            <title>Sheet.31</title>

+            <desc>ComputerSystem</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="18.16" y="704.59" class="st22">ComputerSystem</text>       </g>

+        <g id="shape32-67" transform="translate(201.222,-220.213)">

+            <title>Sheet.32</title>

+            <desc>BootOption</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="29.69" y="704.59" class="st22">BootOption</text>       </g>

+        <g id="shape33-70" transform="translate(210.222,-233.713)">

+            <title>Sheet.33</title>

+            <desc>Memory</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="36.21" y="704.59" class="st22">Memory</text>       </g>

+        <g id="shape34-73" transform="translate(385.722,-247.213)">

+            <title>Sheet.34</title>

+            <rect x="0" y="670.588" width="153" height="45" class="st18"/>

+        </g>

+        <g id="shape35-75" transform="translate(358.722,-233.713)">

+            <title>Sheet.35</title>

+            <rect x="0" y="670.588" width="153" height="45" class="st18"/>

+        </g>

+        <g id="shape36-77" transform="translate(349.722,-220.213)">

+            <title>Sheet.36</title>

+            <desc>Script-generated EDK2 Redfish Feature Driver</desc>

+            <rect x="0" y="670.588" width="153" height="45" class="st19"/>

+            <text x="16.96" y="689.84" class="st20">Script-generated EDK2 <tspan x="17.33" dy="1em" class="st5">Redfish Feature Driver</tspan></text>       </g>

+        <g id="shape40-81" transform="translate(453.222,-197.713)">

+            <title>Sheet.40</title>

+            <desc>ComputerSystem</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="18.16" y="704.59" class="st22">ComputerSystem</text>       </g>

+        <g id="shape41-84" transform="translate(475.722,-213.463)">

+            <title>Sheet.41</title>

+            <desc>BootOption</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="29.69" y="704.59" class="st22">BootOption</text>       </g>

+        <g id="shape42-87" transform="translate(493.722,-226.963)">

+            <title>Sheet.42</title>

+            <desc>Memory</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="36.21" y="704.59" class="st22">Memory</text>       </g>

+        <g id="shape43-90" transform="translate(608.472,-249.463)">

+            <title>Sheet.43</title>

+            <rect x="0" y="670.588" width="153" height="45" class="st18"/>

+        </g>

+        <g id="shape46-92" transform="translate(738.972,-262.963)">

+            <title>Sheet.46</title>

+            <ellipse cx="1.6875" cy="713.9" rx="1.6875" ry="1.6875" class="st21"/>

+        </g>

+        <g id="shape47-94" transform="translate(742.91,-268.025)">

+            <title>Sheet.47</title>

+            <ellipse cx="1.6875" cy="713.9" rx="1.6875" ry="1.6875" class="st21"/>

+        </g>

+        <g id="shape48-96" transform="translate(747.41,-273.088)">

+            <title>Sheet.48</title>

+            <ellipse cx="1.6875" cy="713.9" rx="1.6875" ry="1.6875" class="st21"/>

+        </g>

+        <g id="shape49-98" transform="translate(660.222,-199.963)">

+            <title>Sheet.49</title>

+            <desc>ComputerSystemCollection</desc>

+            <rect x="0" y="688.588" width="123.75" height="27" class="st6"/>

+            <text x="5.3" y="704.59" class="st22">ComputerSystemCollection</text>       </g>

+        <g id="shape50-101" transform="translate(720.972,-215.713)">

+            <title>Sheet.50</title>

+            <desc>BootOptionCollection</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="8.96" y="704.59" class="st22">BootOptionCollection</text>      </g>

+        <g id="shape51-104" transform="translate(732.222,-229.213)">

+            <title>Sheet.51</title>

+            <desc>MemoryCollection</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="15.48" y="704.59" class="st22">MemoryCollection</text>     </g>

+        <g id="shape56-107" transform="translate(515.651,-269.34) rotate(-1.84761)">

+            <title>Curve connect 2.56</title>

+            <path d="M1.08 713.99 L1.29 713.7 A41.432 41.432 0 0 1 69.79 715.59" class="st23"/>

+        </g>

+        <g id="shape57-113" transform="translate(581.472,-235.963)">

+            <title>Sheet.57</title>

+            <rect x="0" y="670.588" width="153" height="45" class="st18"/>

+        </g>

+        <g id="shape59-115" transform="translate(291.222,-242.713)">

+            <title>1-D double</title>

+            <path d="M13.5 693.99 L13.5 688.59 L0 702.09 L13.5 715.59 L13.5 710.19 L31.5 710.19 L31.5 715.59 L45 702.09 L31.5 688.59

+                         L31.5 693.99 L13.5 693.99 Z" class="st25"/>

+        </g>

+        <g id="shape64-117" transform="translate(619.722,-467.713)">

+            <title>Sheet.64</title>

+            <desc>EFI PLATFORM_CONFIG_TO_REDFISH_PROTOCOL</desc>

+            <g id="shadow64-118" transform="matrix(1.02,0,0,1.02,-1.98,-13.8618)" class="st10">

+                <path d="M0 715.59 L198 715.59 L198 670.59 L0 670.59 L0 715.59 Z" class="st26"/>

+            </g>

+            <path d="M0 715.59 L198 715.59 L198 670.59 L0 670.59 L0 715.59 Z" class="st27"/>

+            <text x="91.2" y="683.34" class="st20">EFI <tspan x="6.13" dy="1em" class="st5">PLATFORM</tspan>_CONFIG_TO_REDFISH_<tspan

+                        x="69.84" dy="1em" class="st5">PROTOCOL</tspan></text>      </g>

+        <g id="shape65-125" transform="translate(511.722,-445.213)">

+            <title>Sheet.65</title>

+            <desc>EFI PLATFORM_CONFIG_TO_REDFISH_PROTOCOL</desc>

+            <g id="shadow65-126" transform="matrix(1.02,0,0,1.02,-1.98,-13.8618)" class="st10">

+                <path d="M0 715.59 L198 715.59 L198 670.59 L0 670.59 L0 715.59 Z" class="st26"/>

+            </g>

+            <path d="M0 715.59 L198 715.59 L198 670.59 L0 670.59 L0 715.59 Z" class="st27"/>

+            <text x="91.2" y="683.34" class="st20">EFI <tspan x="6.13" dy="1em" class="st5">PLATFORM</tspan>_CONFIG_TO_REDFISH_<tspan

+                        x="69.84" dy="1em" class="st5">PROTOCOL</tspan></text>      </g>

+        <g id="shape67-133" transform="translate(536.472,-593.713)">

+            <title>Sheet.67</title>

+            <desc>Other Platform-specific Implementations</desc>

+            <rect x="0" y="688.588" width="243" height="27" class="st6"/>

+            <text x="20.02" y="705.09" class="st28">Other Platform-specific Implementations</text>      </g>

+        <g id="group71-136" transform="translate(567.972,-530.713)">

+            <title>Can.71</title>

+            <desc>EFI Variable/ FW Storage</desc>

+            <g id="shape72-137">

+                <title>Sheet.72</title>

+                <path d="M0 709.29 A29.25 6.3 -180 1 0 58.5 709.29 L58.5 658.89 L0 658.89 L0 709.29 Z" class="st29"/>

+            </g>

+            <g id="shape71-139">

+                <ellipse cx="29.25" cy="658.888" rx="29.25" ry="6.3" class="st29"/>

+                <text x="23.25" y="675.09" class="st30">EFI <tspan x="10.54" dy="1.2em" class="st5">Variable</tspan>/ <tspan

+                            x="5.79" dy="1.2em" class="st5">FW Storage</tspan></text>           </g>

+        </g>

+        <g id="group73-144" transform="translate(687.222,-530.713)">

+            <title>Can.73</title>

+            <desc>Other Storage</desc>

+            <g id="shape74-145">

+                <title>Sheet.74</title>

+                <path d="M0 709.29 A29.25 6.3 -180 1 0 58.5 709.29 L58.5 658.89 L0 658.89 L0 709.29 Z" class="st29"/>

+            </g>

+            <g id="shape73-147">

+                <ellipse cx="29.25" cy="658.888" rx="29.25" ry="6.3" class="st29"/>

+                <text x="17.41" y="681.09" class="st30">Other <tspan x="13.66" dy="1.2em" class="st5">Storage</tspan></text>            </g>

+        </g>

+        <g id="shape76-151" transform="translate(1306.06,184.875) rotate(90)">

+            <title>1-D double.76</title>

+            <path d="M6.75 704.79 L6.75 702.09 L0 708.84 L6.75 715.59 L6.75 712.89 L33.75 712.89 L33.75 715.59 L40.5 708.84 L33.75

+                         702.09 L33.75 704.79 L6.75 704.79 Z" class="st31"/>

+        </g>

+        <g id="shape77-153" transform="translate(1425.31,184.875) rotate(90)">

+            <title>1-D double.77</title>

+            <path d="M6.75 704.79 L6.75 702.09 L0 708.84 L6.75 715.59 L6.75 712.89 L11.25 712.89 L11.25 715.59 L18 708.84 L11.25

+                         702.09 L11.25 704.79 L6.75 704.79 Z" class="st31"/>

+        </g>

+        <g id="shape78-155" transform="translate(21.2224,-139.213)">

+            <title>Sheet.78</title>

+            <path d="M0 715.59 L810 715.59" class="st32"/>

+        </g>

+        <g id="group80-158" transform="translate(-173.49,382.875) rotate(-90)">

+            <title>Folded Corner</title>

+            <g id="shape80-159">

+                <g id="shadow80-160" transform="matrix(1.02,0,0,1.02,-3.105,-9.45175)" class="st10">

+                    <path d="M0 715.59 L278.62 715.59 L310.5 688.27 L310.5 229.59 L0 229.59 L0 715.59 Z" class="st33"/>

+                </g>

+                <path d="M0 715.59 L278.62 715.59 L310.5 688.27 L310.5 229.59 L0 229.59 L0 715.59 Z" class="st35"/>

+            </g>

+            <g id="shape81-168" transform="translate(278.625,0)">

+                <title>Sheet.81</title>

+                <g id="shadow81-169" transform="matrix(1.02,0,0,1.02,-0.6375,-14.3117)" class="st10">

+                    <path d="M0 715.59 L31.88 688.27 L4.87 684.09 L0 715.59 Z" class="st33"/>

+                </g>

+                <path d="M0 715.59 L31.88 688.27 L4.87 684.09 L0 715.59 Z" class="st37"/>

+            </g>

+        </g>

+        <g id="group82-175" transform="translate(432.972,-530.713)">

+            <title>Can.69</title>

+            <desc>EDK2 HII Database</desc>

+            <g id="shape83-176">

+                <title>Sheet.83</title>

+                <path d="M0 709.29 A29.25 6.3 -180 1 0 58.5 709.29 L58.5 658.89 L0 658.89 L0 709.29 Z" class="st38"/>

+            </g>

+            <g id="shape82-178">

+                <ellipse cx="29.25" cy="658.888" rx="29.25" ry="6.3" class="st38"/>

+                <text x="11.84" y="681.09" class="st30">EDK2 HII <tspan x="10.24" dy="1.2em" class="st5">Database</tspan></text>            </g>

+        </g>

+        <g id="shape84-182" transform="translate(390.222,-429.463)">

+            <title>Sheet.84</title>

+            <desc>EFI PLATFORM_CONFIG_TO_REDFISH_PROTOCOL</desc>

+            <g id="shadow84-183" transform="matrix(1.02,0,0,1.02,-1.44,-13.8618)" class="st10">

+                <rect x="0" y="670.588" width="144" height="45" class="st39"/>

+            </g>

+            <rect x="0" y="670.588" width="144" height="45" class="st40"/>

+            <text x="64.2" y="683.34" class="st20">EFI <tspan x="4.73" dy="1em" class="st5">PLATFORM</tspan>_CONFIG_TO_<tspan

+                        x="17.24" dy="1em" class="st5">REDFISH</tspan>_PROTOCOL</text>      </g>

+        <g id="shape85-190" transform="translate(1171.06,184.875) rotate(90)">

+            <title>1-D double.75</title>

+            <path d="M6.75 704.79 L6.75 702.09 L0 708.84 L6.75 715.59 L6.75 712.89 L49.5 712.89 L49.5 715.59 L56.25 708.84 L49.5

+                         702.09 L49.5 704.79 L6.75 704.79 Z" class="st38"/>

+        </g>

+        <g id="shape86-192" transform="translate(1164.31,286.125) rotate(90)">

+            <title>1-D double.68</title>

+            <g id="shadow86-193" transform="matrix(1.02,0,0,1.02,-1.1475,-14.0418)" class="st10">

+                <path d="M13.5 693.99 L13.5 688.59 L0 702.09 L13.5 715.59 L13.5 710.19 L101.25 710.19 L101.25 715.59 L114.75 702.09

+                             L101.25 688.59 L101.25 693.99 L13.5 693.99 Z" class="st39"/>

+            </g>

+            <path d="M13.5 693.99 L13.5 688.59 L0 702.09 L13.5 715.59 L13.5 710.19 L101.25 710.19 L101.25 715.59 L114.75 702.09 L101.25

+                         688.59 L101.25 693.99 L13.5 693.99 Z" class="st38"/>

+        </g>

+        <g id="shape87-197" transform="translate(27.9724,-616.213)">

+            <title>Sheet.87</title>

+            <desc>EDK2 Open Source Implementation</desc>

+            <rect x="0" y="688.588" width="243" height="27" class="st6"/>

+            <text x="34.39" y="705.09" class="st28">EDK2 Open Source Implementation</text>      </g>

+        <g id="shape88-200" transform="translate(1312.81,270.375) rotate(90)">

+            <title>1-D double.88</title>

+            <path d="M13.5 693.99 L13.5 688.59 L0 702.09 L13.5 715.59 L13.5 710.19 L117 710.19 L117 715.59 L130.5 702.09 L117 688.59

+                         L117 693.99 L13.5 693.99 Z" class="st41"/>

+        </g>

+        <g id="shape89-202" transform="translate(1434.31,247.875) rotate(90)">

+            <title>1-D double.89</title>

+            <path d="M13.5 693.99 L13.5 688.59 L0 702.09 L13.5 715.59 L13.5 710.19 L139.5 710.19 L139.5 715.59 L153 702.09 L139.5

+                         688.59 L139.5 693.99 L13.5 693.99 Z" class="st42"/>

+        </g>

+        <g id="shape90-204" transform="translate(838.629,252.112) rotate(68.1986)">

+            <title>Curve connect 1.61</title>

+            <path d="M7.53 720.84 L7.83 721.04 A30.61 30.61 -180 0 0 42.41 715.59 A30.61 30.61 0 0 1 76.99 710.13 L77.29 710.34"

+                    class="st43"/>

+        </g>

+        <g id="shape91-213" transform="translate(-37.5816,162.844) rotate(-60.2551) scale(-1,1)">

+            <title>Curve connect 1.62</title>

+            <path d="M7.67 720.62 L7.98 720.82 A34.3918 34.3918 -180 0 0 45.35 715.59 A34.3918 34.3918 0 0 1 82.72 710.35 L83.03

+                         710.55" class="st43"/>

+        </g>

+        <g id="shape94-220" transform="translate(488.651,-255.84) rotate(-1.84761)">

+            <title>Curve connect 2.54</title>

+            <path d="M1.08 713.99 L1.29 713.7 A41.432 41.432 0 0 1 69.79 715.59" class="st23"/>

+        </g>

+        <g id="shape96-225" transform="translate(572.472,-222.463)">

+            <title>Sheet.96</title>

+            <desc>Script-generated EDK2 Redfish Collection Driver</desc>

+            <rect x="0" y="670.588" width="153" height="45" class="st19"/>

+            <text x="16.96" y="689.84" class="st20">Script-generated EDK2 <tspan x="11.39" dy="1em" class="st5">Redfish Collection Driver</tspan></text>        </g>

+        <g id="shape98-229" transform="translate(67.3474,-420.463)">

+            <title>Rounded Rectangle.98</title>

+            <desc>EDK2 HII UNI file #string STR_OPTION_A #language x-uefi-redfi...</desc>

+            <path d="M7.73 715.59 L266.77 715.59 A7.73227 7.73227 -180 0 0 274.5 707.86 L274.5 637.82 A7.73227 7.73227 -180 0 0 266.77

+                         630.09 L7.73 630.09 A7.73227 7.73227 -180 0 0 -0 637.82 L0 707.86 A7.73227 7.73227 -180 0 0 7.73 715.59

+                         Z" class="st45"/>

+            <text x="4" y="646.69" class="st46">EDK2 HII UNI file<tspan x="4" dy="1.425em" class="st47">#</tspan><tspan

+                        class="st47">string </tspan><tspan class="st48">STR</tspan><tspan class="st48">_</tspan><tspan class="st48">OPTION</tspan><tspan

+                        class="st48">_</tspan><tspan class="st48">A</tspan><tspan class="st47">  </tspan><tspan class="st47">#</tspan><tspan

+                        class="st47">language </tspan><tspan class="st48">x</tspan><tspan class="st48">-</tspan><tspan class="st48">uefi</tspan><tspan

+                        class="st48">-</tspan><tspan class="st48">redfish</tspan><tspan class="st48">-</tspan><tspan class="st48">SCHEMA</tspan><tspan

+                        class="st48">.</tspan><tspan class="st48">VERSION</tspan><tspan class="st47">  </tspan><tspan class="st48"> </tspan><tspan

+                        x="4" dy="1.2em" class="st49">“</tspan><tspan class="st49">/</tspan><tspan class="st49">SCHEMA</tspan><tspan

+                        class="st49">/</tspan><tspan class="st49">PropertyA</tspan><tspan class="st48">” </tspan><tspan

+                        class="st47">  </tspan><tspan x="4" dy="1.2em" class="st47">#</tspan><tspan class="st47">string</tspan><tspan

+                        class="st48"> </tspan><tspan class="st48">STR</tspan><tspan class="st48">_</tspan><tspan class="st48">OPTION</tspan><tspan

+                        class="st48">_</tspan><tspan class="st48">B</tspan><tspan class="st47">  </tspan><tspan class="st47">#</tspan><tspan

+                        class="st47">language</tspan><tspan class="st48"> </tspan><tspan class="st48">x</tspan><tspan class="st48">-</tspan><tspan

+                        class="st48">uefi</tspan><tspan class="st48">-</tspan><tspan class="st48">redfish</tspan><tspan

+                        class="st48">-</tspan><tspan class="st48">SCHEMA</tspan><tspan class="st48">.</tspan><tspan class="st48">VERSION</tspan><tspan

+                        class="st47">  </tspan><tspan class="st49"> </tspan><tspan x="4" dy="1.2em" class="st49">“</tspan><tspan

+                        class="st49">/</tspan><tspan class="st49">SCHEMA</tspan><tspan class="st49">/</tspan><tspan class="st49">PropertyB</tspan><tspan

+                        class="st49">” </tspan><tspan x="4" dy="1.2em" class="st47">#</tspan><tspan class="st47">string </tspan><tspan

+                        class="st48">STR</tspan><tspan class="st48">_</tspan><tspan class="st48">OPTION</tspan><tspan class="st48">_</tspan><tspan

+                        class="st47">C  </tspan><tspan class="st47">#</tspan><tspan class="st47">language</tspan><tspan

+                        class="st48"> </tspan><tspan class="st48">x</tspan><tspan class="st48">-</tspan><tspan class="st48">uefi</tspan><tspan

+                        class="st48">-</tspan><tspan class="st48">redfish</tspan><tspan class="st48">-</tspan><tspan class="st48">SCHEMA</tspan><tspan

+                        class="st48">.</tspan><tspan class="st48">VERSION</tspan><tspan class="st47">  </tspan><tspan class="st49"> </tspan><tspan

+                        x="4" dy="1.312em" class="st49">“</tspan><tspan class="st49">/</tspan><tspan class="st49">SCHEMA</tspan><tspan

+                        class="st49">/</tspan><tspan class="st49">PropertyC</tspan><tspan class="st49">”</tspan></text>       </g>

+        <g id="shape100-316" transform="translate(171.972,-550.963)">

+            <title>Rounded Rectangle.100</title>

+            <desc>EDK2 HII VFR Form Option A Enabled Option B Disabled Option C...</desc>

+            <path d="M4.5 715.59 L148.5 715.59 A4.49993 4.49993 -180 0 0 153 711.09 L153 664.96 A4.49993 4.49993 -180 0 0 148.5 660.46

+                         L4.5 660.46 A4.49993 4.49993 -180 0 0 0 664.96 L0 711.09 A4.49993 4.49993 -180 0 0 4.5 715.59 Z"

+                    class="st50"/>

+            <text x="37.65" y="671.66" class="st51">EDK2 HII VFR Form<tspan x="24.37" dy="1.6em" class="st52">Option A        Enabled </tspan><tspan

+                        x="24.6" dy="0.8em" class="st52">Option B       Disabled </tspan><tspan x="24.4" dy="0.8em" class="st52">Option C              </tspan><tspan

+                        class="st52">0</tspan><tspan class="st52">x</tspan><tspan class="st52">16</tspan></text>        </g>

+        <g id="shape101-325" transform="translate(147.222,-539.713)">

+            <title>Rounded Rectangle.101</title>

+            <desc>EDK2 HII VFR Form Option A Enabled Option B Disabled Option C...</desc>

+            <path d="M4.5 715.59 L148.5 715.59 A4.49993 4.49993 -180 0 0 153 711.09 L153 664.96 A4.49993 4.49993 -180 0 0 148.5 660.46

+                         L4.5 660.46 A4.49993 4.49993 -180 0 0 0 664.96 L0 711.09 A4.49993 4.49993 -180 0 0 4.5 715.59 Z"

+                    class="st50"/>

+            <text x="37.65" y="671.66" class="st51">EDK2 HII VFR Form<tspan x="24.37" dy="1.6em" class="st52">Option A        Enabled </tspan><tspan

+                        x="24.6" dy="0.8em" class="st52">Option B       Disabled </tspan><tspan x="24.4" dy="0.8em" class="st52">Option C              </tspan><tspan

+                        class="st52">0</tspan><tspan class="st52">x</tspan><tspan class="st52">16</tspan></text>        </g>

+        <g id="shape102-334" transform="translate(129.222,-526.213)">

+            <title>Rounded Rectangle</title>

+            <desc>EDK2 HII VFR Form Option A Enabled Option B Disabled Option C...</desc>

+            <path d="M4.5 715.59 L148.5 715.59 A4.49993 4.49993 -180 0 0 153 711.09 L153 664.96 A4.49993 4.49993 -180 0 0 148.5 660.46

+                         L4.5 660.46 A4.49993 4.49993 -180 0 0 0 664.96 L0 711.09 A4.49993 4.49993 -180 0 0 4.5 715.59 Z"

+                    class="st50"/>

+            <text x="29.88" y="671.66" class="st28">EDK2 HII VFR Form<tspan x="24.37" dy="1.6em" class="st53">Option A        </tspan><tspan

+                        class="st54">Enabled </tspan><tspan x="24.6" dy="0.8em" class="st53">Option B       </tspan><tspan

+                        class="st54">Disabled </tspan><tspan x="24.4" dy="0.8em" class="st53">Option C              </tspan><tspan

+                        class="st54">0</tspan><tspan class="st54">x</tspan><tspan class="st54">16</tspan></text>        </g>

+        <g id="shape110-345" transform="translate(503.938,-444.613) rotate(13.0919)">

+            <title>Curve connect 1.110</title>

+            <path d="M0 715.59 A11.592 11.592 0 0 1 22.97 715.59 A13.4718 13.4718 -180 0 0 48.31 719.9 L48.42 719.56" class="st55"/>

+        </g>

+        <g id="shape122-351" transform="translate(41.4724,-96.4625)">

+            <title>Sheet.122</title>

+            <desc>[1]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[1]</text>        </g>

+        <g id="shape123-354" transform="translate(746.847,-100.963)">

+            <title>Sheet.123</title>

+            <desc>[2]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[2]</text>        </g>

+        <g id="shape124-357" transform="translate(68.4724,-278.713)">

+            <title>Sheet.124</title>

+            <desc>[3]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[3]</text>        </g>

+        <g id="shape125-360" transform="translate(338.472,-269.713)">

+            <title>Sheet.125</title>

+            <desc>[4]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[4]</text>        </g>

+        <g id="shape126-363" transform="translate(761.472,-269.713)">

+            <title>Sheet.126</title>

+            <desc>[5]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[5]</text>        </g>

+        <g id="shape127-366" transform="translate(390.222,-476.713)">

+            <title>Sheet.127</title>

+            <desc>[6]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[6]</text>        </g>

+        <g id="shape128-369" transform="translate(123.597,-579.088)">

+            <title>Sheet.128</title>

+            <desc>[8]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[8]</text>        </g>

+        <g id="shape129-372" transform="translate(62.8474,-501.463)">

+            <title>Sheet.129</title>

+            <desc>[9]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[9]</text>        </g>

+        <g id="shape132-375" transform="translate(583.722,1233.46) rotate(180)">

+            <title>Curve connect 2.132</title>

+            <path d="M2.78 714.72 L3.12 714.61 A681.188 681.188 0 0 1 406.38 714.61 L406.72 714.72" class="st57"/>

+        </g>

+        <g id="shape133-384" transform="translate(238.347,-157.213)">

+            <title>Sheet.133</title>

+            <desc>Script-generated EDK2 Redfish client driver/library based on ...</desc>

+            <rect x="0" y="688.588" width="261" height="27" class="st1"/>

+            <text x="11.21" y="699.84" class="st59">Script-generated EDK2 Redfish client driver/library based on the <tspan

+                        x="45.23" dy="1em" class="st5">standard Redfish schemas </tspan>published by DMTF</text>        </g>

+        <g id="shape134-388" transform="translate(21.2224,-679.775)">

+            <title>Rectangle.134</title>

+            <rect x="0" y="703.213" width="24.75" height="12.375" class="st2"/>

+        </g>

+        <g id="shape135-390" transform="translate(41.4724,-670.213)">

+            <title>Sheet.135</title>

+            <desc>Script-generated code</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="12.79" y="704.34" class="st60">Script-generated code</text>        </g>

+        <g id="shape137-393" transform="translate(21.2224,-661.213)">

+            <title>Rectangle.137</title>

+            <rect x="0" y="703.213" width="24.75" height="12.375" class="st61"/>

+        </g>

+        <g id="shape138-395" transform="translate(43.7224,-652.213)">

+            <title>Sheet.138</title>

+            <desc>UEFI/EDK2 open source</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="9.97" y="704.34" class="st60">UEFI/EDK2 open source</text>     </g>

+        <g id="shape140-398" transform="translate(281.66,-341.784)">

+            <title>Configure</title>

+            <path d="M41.27 698.83 C40.4 698.46 37.61 697.28 37.61 697.28 L37.79 694.96 L37.94 693.01 L37.69 689.29 L39.53 688.23

+                         C39.53 688.23 40.46 687.84 41.33 687.49 C40.71 685.96 40.45 685.33 39.82 683.81 C38.94 684.17 36.06 685.35

+                         36.06 685.35 L34.63 683.57 C33.94 682.7 33.09 681.89 32.02 681.06 L30.33 679.75 L31.01 677.68 C31.01 677.68

+                         31.41 676.7 31.79 675.77 C30.27 675.14 29.64 674.88 28.12 674.26 C27.72 675.23 26.52 678.17 26.52 678.17

+                         L24.28 677.95 C23.14 677.83 21.96 677.86 20.77 678.02 L18.64 678.3 L17.65 676.35 C17.65 676.35 17.21 675.31

+                         16.78 674.31 C15.27 674.95 14.64 675.21 13.13 675.85 C13.58 676.92 14.85 679.93 14.85 679.93 L13.12 681.37

+                         C12.3 682.05 11.54 682.85 10.79 683.83 L9.49 685.52 L7.41 684.86 C7.41 684.86 6.28 684.4 5.17 683.96 C4.56

+                         685.49 4.31 686.12 3.69 687.65 C4.82 688.1 7.84 689.31 7.84 689.31 C7.84 689.31 7.65 692.73 7.63 693 C7.65

+                         693.25 7.7 694.01 7.7 694.03 C7.7 694.03 7.87 695.84 7.87 695.84 L6.79 696.82 C6.46 697.15 6.34 697.24 3.64

+                         698.3 C4.24 699.84 4.49 700.47 5.08 702.01 C6.21 701.57 9.36 700.34 9.36 700.34 L10.99 702.57 C11.49 703.19

+                         12.18 703.89 13.04 704.61 L14.63 705.96 L13.93 707.96 C13.93 707.96 13.45 709.08 12.97 710.2 C14.47 710.85

+                         15.1 711.12 16.61 711.77 C17.05 710.74 18.36 707.71 18.36 707.71 L20.65 708.03 C21.73 708.19 22.89 708.21

+                         24.1 708.1 L26.18 707.92 L27.11 709.84 C27.11 709.84 27.53 710.9 27.94 711.93 C29.47 711.32 30.1 711.07

+                         31.63 710.45 C31.25 709.51 30.04 706.48 30.04 706.48 L32.32 704.83 C32.97 704.31 33.71 703.56 34.48 702.62

+                         L35.81 701 L37.85 701.7 C37.85 701.7 38.82 702.1 39.73 702.49 C40.37 700.97 40.64 700.34 41.27 698.83 ZM40.58

+                         695.32 C40.58 695.32 40.57 695.4 40.56 695.47 C40.95 695.64 44.96 697.33 44.96 697.33 L41.23 706.17 C41.23

+                         706.17 37.13 704.45 36.75 704.28 C36.7 704.34 36.65 704.41 36.65 704.41 C35.76 705.49 34.89 706.37 33.97

+                         707.11 C33.97 707.11 33.67 707.33 33.46 707.47 C33.62 707.88 35.28 712.02 35.28 712.02 L26.38 715.59 C26.38

+                         715.59 24.65 711.28 24.5 710.89 C24.42 710.9 24.34 710.9 24.34 710.9 C22.91 711.03 21.54 711 20.25 710.82

+                         C20.25 710.82 20.17 710.8 20.09 710.79 C19.93 711.19 18.08 715.47 18.08 715.47 L9.27 711.66 C9.27 711.66

+                         11.18 707.25 11.34 706.86 C11.29 706.81 11.22 706.76 11.22 706.76 C10.23 705.92 9.41 705.09 8.72 704.23

+                         C8.72 704.23 8.51 703.94 8.37 703.75 C7.96 703.9 3.49 705.65 3.49 705.65 L0 696.71 C0 696.71 4.8 694.83

+                         4.8 694.83 C4.8 694.83 4.88 694.8 4.95 694.78 C4.92 694.54 4.89 694.21 4.89 694.21 L4.82 693.02 C4.82 693.02

+                         4.9 691.52 4.92 691.17 C4.54 691.02 0.04 689.21 0.04 689.21 L3.6 680.3 C3.6 680.3 8.06 682.09 8.46 682.25

+                         C8.51 682.18 8.56 682.12 8.56 682.12 C9.43 680.98 10.34 680.02 11.33 679.2 C11.33 679.2 11.39 679.15 11.45

+                         679.11 C11.29 678.72 9.45 674.35 9.45 674.35 L18.29 670.62 C18.29 670.62 20.07 674.85 20.24 675.25 C20.31

+                         675.24 20.39 675.23 20.39 675.23 C21.8 675.04 23.2 675.01 24.56 675.15 C24.56 675.15 24.63 675.16 24.71

+                         675.16 C24.87 674.78 26.59 670.59 26.59 670.59 L35.46 674.23 C35.46 674.23 33.77 678.34 33.61 678.74 C33.67

+                         678.78 33.74 678.83 33.74 678.83 C34.99 679.8 35.99 680.77 36.82 681.8 C36.82 681.8 36.88 681.88 36.94 681.95

+                         C37.33 681.79 41.35 680.14 41.35 680.14 L45 689.02 C45 689.02 40.99 690.67 40.6 690.83 C40.61 690.9 40.62

+                         690.98 40.62 690.98 C40.71 691.76 40.75 692.41 40.75 693.01 C40.75 693.7 40.7 694.43 40.58 695.32 ZM26.56

+                         697.76 C29.16 695.67 29.58 691.87 27.5 689.26 C25.42 686.65 21.62 686.23 19.01 688.31 C16.41 690.4 15.98

+                         694.2 18.07 696.81 C20.15 699.42 23.95 699.84 26.56 697.76 ZM23.76 684.23 C26.11 684.49 28.22 685.65 29.7

+                         687.5 C32.75 691.32 32.12 696.9 28.31 699.95 C26.47 701.43 24.16 702.1 21.8 701.84 C19.45 701.58 17.34 700.41

+                         15.87 698.56 C14.57 696.94 13.93 694.98 13.93 693.04 C13.93 690.44 15.07 687.86 17.25 686.12 C19.1 684.64

+                         21.41 683.97 23.76 684.23 Z" class="st62"/>

+        </g>

+        <g id="shape145-400" transform="translate(323.911,1069.28) scale(1,-1)">

+            <title>Side to top/bottom.145</title>

+            <path d="M7.18 715.59 L7.54 715.59 L96.69 715.59 L96.69 668.4" class="st63"/>

+        </g>

+        <g id="shape146-406" transform="translate(204.597,-382.144)">

+            <title>Bottom to top fixed 2</title>

+            <path d="M0 677.27 L0 697.59 L99.14 697.59 L99.14 708.05" class="st65"/>

+        </g>

+        <g id="shape150-412" transform="translate(281.66,1070.51) rotate(180)">

+            <title>Side to top/bottom</title>

+            <path d="M7.18 715.59 L7.54 715.59 L107.44 715.59 L107.44 669.64" class="st63"/>

+        </g>

+        <g id="shape152-417" transform="translate(173.097,-359.713)">

+            <title>Sheet.152</title>

+            <desc>[10]</desc>

+            <rect x="0" y="688.588" width="45" height="27" class="st6"/>

+            <text x="12.52" y="705.09" class="st7">[10]</text>      </g>

+        <g id="shape153-420" transform="translate(186.597,-359.713)">

+            <title>Sheet.153</title>

+            <desc>EDK2 Build Tool</desc>

+            <rect x="0" y="688.588" width="108" height="27" class="st6"/>

+            <text x="21.18" y="704.59" class="st22">EDK2 Build Tool</text>      </g>

+        <g id="shape95-423" transform="translate(479.651,-242.34) rotate(-1.84761)">

+            <title>Curve connect 2</title>

+            <path d="M1.08 713.99 L1.29 713.7 A41.432 41.432 0 0 1 68.5 713.7 L68.7 713.99" class="st66"/>

+        </g>

+        <g id="shape154-431" transform="translate(546.597,-607.213)">

+            <title>Sheet.154</title>

+            <desc>[7]</desc>

+            <rect x="0" y="688.588" width="24.75" height="27" class="st6"/>

+            <text x="5.44" y="705.09" class="st7">[7]</text>        </g>

+        <g id="shape155-434" transform="translate(919.083,249.319) rotate(-86.8202) scale(1,-1)">

+            <title>Curve connect 1.155</title>

+            <path d="M0 715.59 A6.2366 6.2366 0 0 1 11.73 715.59 A4.54475 4.54475 -180 0 0 20.28 715.59" class="st67"/>

+        </g>

+    </g>

+</svg>

--

2.17.1

 


Re: [PATCH] NetworkPkg: Add HTTP Additional Event Notifications

Heng Luo
 

Thank Jiaxin, the patch V2 is sent out following Jiaxin's comment.

-----Original Message-----
From: Wu, Jiaxin <jiaxin.wu@...>
Sent: Tuesday, July 20, 2021 9:45 AM
To: Luo, Heng <heng.luo@...>; devel@edk2.groups.io
Cc: Maciej Rabeda <maciej.rabeda@...>; Fu, Siyuan
<siyuan.fu@...>
Subject: RE: [PATCH] NetworkPkg: Add HTTP Additional Event Notifications

For the below EDKII_HTTP_CALLBACK_EVENT definition:

All event is to retrieve the event Status, so the comments should be made clearly
and align with code returned status, for example,

+ /// Retrieve the host address, EventStatus:
There might be the misunderstanding you want the host address, but actually,
you only want the status. It's better to be:

+ /// The Status of DNS Event to retrieve the host address.
The same to all event.


With above changes, the patch is good to me.



Thanks,
Jiaxin





+///

+/// EDKII_HTTP_CALLBACK_EVENT

+///

+typedef enum {

+ ///

+ /// Retrieve the host address, EventStatus:

+ /// EFI_SUCCESS Operation succeeded.

+ /// EFI_OUT_OF_RESOURCES Failed to allocate needed resources.

+ /// EFI_DEVICE_ERROR An unexpected network error occurred.

+ /// Others Other errors as indicated.

+ ///

+ HttpEventDns,

+

+ ///

+ /// Initiate a nonblocking TCP connection request, EventStatus:

+ /// EFI_SUCCESS The connection request is successfully initiated.

+ /// EFI_NOT_STARTED This EFI TCP Protocol instance has not been
configured.

+ /// EFI_DEVICE_ERROR An unexpected system or network error
occurred.

+ /// Others Other errors as indicated.

+ ///

+ HttpEventConnectTcp,

+

+ ///

+ /// Connect one TLS session by finishing the TLS handshake process,
EventStatus:

+ /// EFI_SUCCESS The TLS session is established.

+ /// EFI_OUT_OF_RESOURCES Can't allocate memory resources.

+ /// EFI_ABORTED TLS session state is incorrect.

+ /// Others Other error as indicated.

+ ///

+ HttpEventTlsConnectSession,

+

+ ///

+ /// Initialize Http session

+ /// EFI_SUCCESS The initialization of session is done.

+ /// Others Other error as indicated.

+ ///

+ HttpEventInitSession

+} EDKII_HTTP_CALLBACK_EVENT;

+


[Patch V2] NetworkPkg: Add HTTP Additional Event Notifications

Heng Luo
 

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

Add new EDKII_HTTP_CALLBACK_PROTOCOL in NetworkPkg,
Send HTTP Events via EDKII_HTTP_CALLBACK_PROTOCOL
when Dns/ConnectTcp/TlsConnectSession/InitSession
occurs.

Signed-off-by: Heng Luo <heng.luo@...>
Cc: Maciej Rabeda <maciej.rabeda@...>
Cc: Jiaxin Wu <jiaxin.wu@...>
Cc: Siyuan Fu <siyuan.fu@...>
---
NetworkPkg/HttpDxe/HttpDriver.h | 3 ++-
NetworkPkg/HttpDxe/HttpDxe.inf | 3 ++-
NetworkPkg/HttpDxe/HttpImpl.c | 4 +++-
NetworkPkg/HttpDxe/HttpProto.c | 58 ++++++++++++++++++++++++++=
+++++++++++++++++++++++++++++++-
NetworkPkg/HttpDxe/HttpProto.h | 15 ++++++++++++++-
NetworkPkg/Include/Protocol/HttpCallback.h | 85 ++++++++++++++++++++++++++=
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NetworkPkg/NetworkPkg.dec | 3 +++
7 files changed, 166 insertions(+), 5 deletions(-)

diff --git a/NetworkPkg/HttpDxe/HttpDriver.h b/NetworkPkg/HttpDxe/HttpDrive=
r.h
index 5fe8c5b5e9..b701b80858 100644
--- a/NetworkPkg/HttpDxe/HttpDriver.h
+++ b/NetworkPkg/HttpDxe/HttpDriver.h
@@ -1,7 +1,7 @@
/** @file=0D
The header files of the driver binding and service binding protocol for =
HttpDxe driver.=0D
=0D
- Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>=0D
+ Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>=0D
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>=0D
=0D
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
@@ -47,6 +47,7 @@
#include <Protocol/Ip6Config.h>=0D
#include <Protocol/Tls.h>=0D
#include <Protocol/TlsConfig.h>=0D
+#include <Protocol/HttpCallback.h>=0D
=0D
#include <Guid/ImageAuthentication.h>=0D
//=0D
diff --git a/NetworkPkg/HttpDxe/HttpDxe.inf b/NetworkPkg/HttpDxe/HttpDxe.inf
index 35fe31af18..23fb9ec394 100644
--- a/NetworkPkg/HttpDxe/HttpDxe.inf
+++ b/NetworkPkg/HttpDxe/HttpDxe.inf
@@ -1,7 +1,7 @@
## @file=0D
# Implementation of EFI HTTP protocol interfaces.=0D
#=0D
-# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>=
=0D
+# Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>=
=0D
#=0D
# SPDX-License-Identifier: BSD-2-Clause-Patent=0D
#=0D
@@ -65,6 +65,7 @@
gEfiTlsServiceBindingProtocolGuid ## SOMETIMES_CONSUMES=0D
gEfiTlsProtocolGuid ## SOMETIMES_CONSUMES=0D
gEfiTlsConfigurationProtocolGuid ## SOMETIMES_CONSUMES=0D
+ gEdkiiHttpCallbackProtocolGuid ## SOMETIMES_CONSUMES=0D
=0D
[Guids]=0D
gEfiTlsCaCertificateGuid ## SOMETIMES_CONSUMES =
## Variable:L"TlsCaCertificate"=0D
diff --git a/NetworkPkg/HttpDxe/HttpImpl.c b/NetworkPkg/HttpDxe/HttpImpl.c
index 5a6ecbc9d9..97f15d229f 100644
--- a/NetworkPkg/HttpDxe/HttpImpl.c
+++ b/NetworkPkg/HttpDxe/HttpImpl.c
@@ -1,7 +1,7 @@
/** @file=0D
Implementation of EFI_HTTP_PROTOCOL protocol interfaces.=0D
=0D
- Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>=0D
+ Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>=0D
(C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP<BR>=0D
=0D
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
@@ -527,6 +527,7 @@ EfiHttpRequest (
} else {=0D
Status =3D HttpDns6 (HttpInstance, HostNameStr, &HttpInstance->Rem=
oteIpv6Addr);=0D
}=0D
+ HttpNotify (HttpEventDns, Status);=0D
=0D
FreePool (HostNameStr);=0D
if (EFI_ERROR (Status)) {=0D
@@ -588,6 +589,7 @@ EfiHttpRequest (
Configure || ReConfigure,=0D
TlsConfigure=0D
);=0D
+ HttpNotify (HttpEventInitSession, Status);=0D
if (EFI_ERROR (Status)) {=0D
goto Error2;=0D
}=0D
diff --git a/NetworkPkg/HttpDxe/HttpProto.c b/NetworkPkg/HttpDxe/HttpProto.c
index afc7db5a72..affa916bd6 100644
--- a/NetworkPkg/HttpDxe/HttpProto.c
+++ b/NetworkPkg/HttpDxe/HttpProto.c
@@ -1,7 +1,7 @@
/** @file=0D
Miscellaneous routines for HttpDxe driver.=0D
=0D
-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>=0D
+Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>=0D
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>=0D
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
=0D
@@ -966,6 +966,7 @@ HttpCreateConnection (
HttpInstance->IsTcp4ConnDone =3D FALSE;=0D
HttpInstance->Tcp4ConnToken.CompletionToken.Status =3D EFI_NOT_READY;=
=0D
Status =3D HttpInstance->Tcp4->Connect (HttpInstance->Tcp4, &HttpInsta=
nce->Tcp4ConnToken);=0D
+ HttpNotify (HttpEventConnectTcp, Status);=0D
if (EFI_ERROR (Status)) {=0D
DEBUG ((EFI_D_ERROR, "HttpCreateConnection: Tcp4->Connect() =3D %r\n=
", Status));=0D
return Status;=0D
@@ -981,6 +982,7 @@ HttpCreateConnection (
HttpInstance->IsTcp6ConnDone =3D FALSE;=0D
HttpInstance->Tcp6ConnToken.CompletionToken.Status =3D EFI_NOT_READY;=
=0D
Status =3D HttpInstance->Tcp6->Connect (HttpInstance->Tcp6, &HttpInsta=
nce->Tcp6ConnToken);=0D
+ HttpNotify (HttpEventConnectTcp, Status);=0D
if (EFI_ERROR (Status)) {=0D
DEBUG ((EFI_D_ERROR, "HttpCreateConnection: Tcp6->Connect() =3D %r\n=
", Status));=0D
return Status;=0D
@@ -1277,6 +1279,7 @@ HttpConnectTcp4 (
}=0D
=0D
Status =3D TlsConnectSession (HttpInstance, HttpInstance->TimeoutEvent=
);=0D
+ HttpNotify (HttpEventTlsConnectSession, Status);=0D
=0D
gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);=0D
=0D
@@ -1369,6 +1372,7 @@ HttpConnectTcp6 (
}=0D
=0D
Status =3D TlsConnectSession (HttpInstance, HttpInstance->TimeoutEvent=
);=0D
+ HttpNotify (HttpEventTlsConnectSession, Status);=0D
=0D
gBS->SetTimer (HttpInstance->TimeoutEvent, TimerCancel, 0);=0D
=0D
@@ -2195,3 +2199,55 @@ HttpTcpTokenCleanup (
}=0D
=0D
}=0D
+=0D
+/**=0D
+ Send Events via EDKII_HTTP_CALLBACK_PROTOCOL.=0D
+=0D
+ @param[in] Event The event that occurs in the current sta=
te.=0D
+ @param[in] EventStatus The Status of Event, EFI_SUCCESS or othe=
r errors.=0D
+=0D
+**/=0D
+VOID=0D
+HttpNotify (=0D
+ IN EDKII_HTTP_CALLBACK_EVENT Event,=0D
+ IN EFI_STATUS EventStatus=0D
+ )=0D
+{=0D
+ EFI_STATUS Status;=0D
+ EFI_HANDLE *Handles;=0D
+ UINTN Index;=0D
+ UINTN HandleCount;=0D
+ EFI_HANDLE Handle;=0D
+ EDKII_HTTP_CALLBACK_PROTOCOL *HttpCallback;=0D
+=0D
+ DEBUG ((DEBUG_INFO, "HttpNotify: Event - %d, EventStatus - %r\n", Event,=
EventStatus));=0D
+=0D
+ Handles =3D NULL;=0D
+ HandleCount =3D 0;=0D
+ Status =3D gBS->LocateHandleBuffer (=0D
+ ByProtocol,=0D
+ &gEdkiiHttpCallbackProtocolGuid,=0D
+ NULL,=0D
+ &HandleCount,=0D
+ &Handles=0D
+ );=0D
+ if (Status =3D=3D EFI_SUCCESS) {=0D
+ for (Index =3D 0; Index < HandleCount; Index++) {=0D
+ Handle =3D Handles[Index];=0D
+ Status =3D gBS->HandleProtocol (=0D
+ Handle,=0D
+ &gEdkiiHttpCallbackProtocolGuid,=0D
+ (VOID **) &HttpCallback=0D
+ );=0D
+ if (Status =3D=3D EFI_SUCCESS) {=0D
+ DEBUG ((DEBUG_INFO, "HttpNotify: Notifying %p\n", HttpCallback));=
=0D
+ HttpCallback->Callback (=0D
+ HttpCallback,=0D
+ Event,=0D
+ EventStatus=0D
+ );=0D
+ }=0D
+ }=0D
+ FreePool (Handles);=0D
+ }=0D
+}=0D
diff --git a/NetworkPkg/HttpDxe/HttpProto.h b/NetworkPkg/HttpDxe/HttpProto.h
index 00ba26aca4..5b90a6b074 100644
--- a/NetworkPkg/HttpDxe/HttpProto.h
+++ b/NetworkPkg/HttpDxe/HttpProto.h
@@ -1,7 +1,7 @@
/** @file=0D
The header files of miscellaneous routines for HttpDxe driver.=0D
=0D
-Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>=0D
+Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.<BR>=0D
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>=0D
SPDX-License-Identifier: BSD-2-Clause-Patent=0D
=0D
@@ -609,4 +609,17 @@ HttpResponseWorker (
IN HTTP_TOKEN_WRAP *Wrap=0D
);=0D
=0D
+/**=0D
+ Send Events via EDKII_HTTP_CALLBACK_PROTOCOL.=0D
+=0D
+ @param[in] Event The event that occurs in the current sta=
te.=0D
+ @param[in] EventStatus The Status of Event, EFI_SUCCESS or othe=
r errors.=0D
+=0D
+**/=0D
+VOID=0D
+HttpNotify (=0D
+ IN EDKII_HTTP_CALLBACK_EVENT Event,=0D
+ IN EFI_STATUS EventStatus=0D
+ );=0D
+=0D
#endif=0D
diff --git a/NetworkPkg/Include/Protocol/HttpCallback.h b/NetworkPkg/Includ=
e/Protocol/HttpCallback.h
new file mode 100644
index 0000000000..d036a8a4be
--- /dev/null
+++ b/NetworkPkg/Include/Protocol/HttpCallback.h
@@ -0,0 +1,85 @@
+/** @file=0D
+ This file defines the EDKII HTTP Callback Protocol interface.=0D
+=0D
+ Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>=0D
+ SPDX-License-Identifier: BSD-2-Clause-Patent=0D
+**/=0D
+=0D
+#ifndef __EDKII_HTTP_CALLBACK_H__=0D
+#define __EDKII_HTTP_CALLBACK_H__=0D
+=0D
+#define EDKII_HTTP_CALLBACK_PROTOCOL_GUID \=0D
+ { \=0D
+ 0x611114f1, 0xa37b, 0x4468, {0xa4, 0x36, 0x5b, 0xdd, 0xa1, 0x6a, 0xa2,=
0x40} \=0D
+ }=0D
+=0D
+typedef struct _EDKII_HTTP_CALLBACK_PROTOCOL EDKII_HTTP_CALLBACK_PROTOCOL=
;=0D
+=0D
+///=0D
+/// EDKII_HTTP_CALLBACK_EVENT=0D
+///=0D
+typedef enum {=0D
+ ///=0D
+ /// The Status of DNS Event to retrieve the host address.=0D
+ /// EventStatus:=0D
+ /// EFI_SUCCESS Operation succeeded.=0D
+ /// EFI_OUT_OF_RESOURCES Failed to allocate needed resources.=0D
+ /// EFI_DEVICE_ERROR An unexpected network error occurred.=0D
+ /// Others Other errors as indicated.=0D
+ ///=0D
+ HttpEventDns,=0D
+=0D
+ ///=0D
+ /// The Status of Event to initiate a nonblocking TCP connection request=
.=0D
+ /// EventStatus:=0D
+ /// EFI_SUCCESS The connection request is successfully initia=
ted.=0D
+ /// EFI_NOT_STARTED This EFI TCP Protocol instance has not been c=
onfigured.=0D
+ /// EFI_DEVICE_ERROR An unexpected system or network error occurre=
d.=0D
+ /// Others Other errors as indicated.=0D
+ ///=0D
+ HttpEventConnectTcp,=0D
+=0D
+ ///=0D
+ /// The Status of Event to connect one TLS session by finishing the TLS =
handshake process.=0D
+ /// EventStatus:=0D
+ /// EFI_SUCCESS The TLS session is established.=0D
+ /// EFI_OUT_OF_RESOURCES Can't allocate memory resources.=0D
+ /// EFI_ABORTED TLS session state is incorrect.=0D
+ /// Others Other error as indicated.=0D
+ ///=0D
+ HttpEventTlsConnectSession,=0D
+=0D
+ ///=0D
+ /// The Status of Event to initialize Http session=0D
+ /// EventStatus:=0D
+ /// EFI_SUCCESS The initialization of session is done.=0D
+ /// Others Other error as indicated.=0D
+ ///=0D
+ HttpEventInitSession=0D
+} EDKII_HTTP_CALLBACK_EVENT;=0D
+=0D
+/**=0D
+ Callback function that is invoked when HTTP event occurs.=0D
+=0D
+ @param[in] This Pointer to the EDKII_HTTP_CALLBACK_PROTO=
COL instance.=0D
+ @param[in] Event The event that occurs in the current sta=
te.=0D
+ @param[in] EventStatus The Status of Event, EFI_SUCCESS or othe=
r errors.=0D
+**/=0D
+typedef=0D
+VOID=0D
+(EFIAPI * EDKII_HTTP_CALLBACK) (=0D
+ IN EDKII_HTTP_CALLBACK_PROTOCOL *This,=0D
+ IN EDKII_HTTP_CALLBACK_EVENT Event,=0D
+ IN EFI_STATUS EventStatus=0D
+ );=0D
+=0D
+///=0D
+/// EFI HTTP Callback Protocol is invoked when HTTP event occurs.=0D
+///=0D
+struct _EDKII_HTTP_CALLBACK_PROTOCOL {=0D
+ EDKII_HTTP_CALLBACK Callback;=0D
+};=0D
+=0D
+extern EFI_GUID gEdkiiHttpCallbackProtocolGuid;=0D
+=0D
+#endif=0D
diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
index b81f10ef6e..0f9f7bb15e 100644
--- a/NetworkPkg/NetworkPkg.dec
+++ b/NetworkPkg/NetworkPkg.dec
@@ -88,6 +88,9 @@
## Include/Protocol/Dpc.h=0D
gEfiDpcProtocolGuid =3D {0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0=
x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6 }}=0D
=0D
+ ## Include/Protocol/HttpCallback.h=0D
+ gEdkiiHttpCallbackProtocolGuid =3D {0x611114f1, 0xa37b, 0x4468, {0xa4, =
0x36, 0x5b, 0xdd, 0xa1, 0x6a, 0xa2, 0x40}}=0D
+=0D
[PcdsFixedAtBuild]=0D
## The max attempt number will be created by iSCSI driver.=0D
# @Prompt Max attempt number.=0D
--=20
2.31.1.windows.1


回复: [edk2-devel] [PATCH v4 5/5] StandaloneMmPkg: build for 32bit arm machines

gaoliming
 

Hi, all
This patch set has passed code review. How about merge it for this stable tag edk2 202108?

Thanks
Liming

-----邮件原件-----
发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Sami
Mujawar
发送时间: 2021年5月19日 17:58
收件人: Etienne Carriere <etienne.carriere@...>;
devel@edk2.groups.io
抄送: Achin Gupta <achin.gupta@...>; Ard Biesheuvel
<ardb+tianocore@...>; Jiewen Yao <jiewen.yao@...>; Leif
Lindholm <leif@...>; Sughosh Ganu <sughosh.ganu@...>;
nd@...
主题: Re: [edk2-devel] [PATCH v4 5/5] StandaloneMmPkg: build for 32bit arm
machines

Hi Etienn,

This patch looks good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@...>

Regards,

Sami Mujawar

On 19/05/2021 08:14 AM, Etienne Carriere wrote:
This change allows to build StandaloneMmPkg components for 32bit Arm
StandaloneMm firmware.

This change mainly moves AArch64/ source files to Arm/ side directory
for several components: StandaloneMmCpu,
StandaloneMmCoreEntryPoint
and StandaloneMmMemLib. The source file is built for both 32b and 64b
Arm targets.

Signed-off-by: Etienne Carriere <etienne.carriere@...>
---
Changes since v3:
- Fix BuildOptions.ARM in StandaloneMmPkg.
- Remove Cc tags.

No change since v2

Changes since v1:
- ARM_SMC_ID_MM_COMMUNICATE 32b/64b agnostic helper ID is
defined
in ArmStdSmc.h (see 1st commit in this series) instead of being
local to EventHandle.c.
- Fix void occurrence to VOID.
- Fix path in StandaloneMmPkg/StandaloneMmPkg.dsc
---
StandaloneMmPkg/Core/StandaloneMmCore.inf
| 2 +-
StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64
=> }/EventHandle.c
| 5 +++--
StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64
=> }/StandaloneMmCpu.c
| 2 +-
StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64
=> }/StandaloneMmCpu.h
| 0
StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64
=> }/StandaloneMmCpu.inf
| 0
StandaloneMmPkg/Include/Library/{AArch64 =>
Arm}/StandaloneMmCoreEntryPoint.h
| 0
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 =>
Arm}/CreateHobList.c | 2 +-
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 =>
Arm}/SetPermissions.c | 2 +-
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 =>
Arm}/StandaloneMmCoreEntryPoint.c | 16
++++++++--------
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCor
eEntryPoint.inf | 14
+++++++-------
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 =>
Arm}/StandaloneMmCoreHobLib.c | 0
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 =>
Arm}/StandaloneMmCoreHobLibInternal.c | 0
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreH
obLib.inf | 8 ++++----
StandaloneMmPkg/Library/StandaloneMmMemLib/{AArch64/StandaloneMm
MemLibInternal.c => ArmStandaloneMmMemLibInternal.c} | 9 ++++++++-
StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.i
nf | 6
+++---
StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependenc
y.inf | 2 +-
StandaloneMmPkg/StandaloneMmPkg.dsc
| 12 ++++++++----
17 files changed, 46 insertions(+), 34 deletions(-)

diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf
b/StandaloneMmPkg/Core/StandaloneMmCore.inf
index 87bf6e9440..56042b7b39 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.inf
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf
@@ -17,7 +17,7 @@
PI_SPECIFICATION_VERSION = 0x00010032
ENTRY_POINT = StandaloneMmMain

-# VALID_ARCHITECTURES = IA32 X64 AARCH64
+# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM

[Sources]
StandaloneMmCore.c
diff --git
a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
similarity index 95%
rename from
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
index 63fbe26642..165d696f99 100644
---
a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c
@@ -2,6 +2,7 @@

Copyright (c) 2016 HP Development Company, L.P.
Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2021, Linaro Limited

SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -92,8 +93,8 @@ PiMmStandaloneArmTfCpuDriverEntry (
// receipt of a synchronous MM request. Use the Event ID to
distinguish
// between synchronous and asynchronous events.
//
- if ((ARM_SMC_ID_MM_COMMUNICATE_AARCH64 != EventId) &&
- (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 !=
EventId)) {
+ if ((ARM_SMC_ID_MM_COMMUNICATE != EventId) &&
+ (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != EventId)) {
DEBUG ((DEBUG_INFO, "UnRecognized Event - 0x%x\n", EventId));
return EFI_INVALID_PARAMETER;
}
diff --git
a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCp
u.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
similarity index 96%
rename from
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.
c
rename to
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
index d4590bcd19..10097f792f 100644
---
a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCp
u.c
+++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c
@@ -10,7 +10,7 @@

#include <Base.h>
#include <Pi/PiMmCis.h>
-#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
+#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
#include <Library/DebugLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/ArmLib.h>
diff --git
a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCp
u.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
similarity index 100%
rename from
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.
h
rename to
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h
diff --git
a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCp
u.inf b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
similarity index 100%
rename from
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.i
nf
rename to
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
diff --git
a/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoin
t.h
b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h
similarity index 100%
rename from
StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
rename to
StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h
diff --git
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Create
HobList.c
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHob
List.c
similarity index 97%
rename from
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHo
bList.c
rename to
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobLis
t.c
index 4d4cf3d5ff..85f8194687 100644
---
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Create
HobList.c
+++
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHob
List.c
@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MpInformation.h>

-#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
+#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
#include <Library/ArmMmuLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/DebugLib.h>
diff --git
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPer
missions.c
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissi
ons.c
similarity index 96%
rename from
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermi
ssions.c
rename to
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissio
ns.c
index 4a380df4a6..cd4b90823e 100644
---
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPer
missions.c
+++
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissi
ons.c
@@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MpInformation.h>

-#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
+#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
#include <Library/ArmMmuLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/DebugLib.h>
diff --git
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standa
loneMmCoreEntryPoint.c
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Standalone
MmCoreEntryPoint.c
similarity index 94%
rename from
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standalo
neMmCoreEntryPoint.c
rename to
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneM
mCoreEntryPoint.c
index b445d6942e..49cf51a789 100644
---
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/Standa
loneMmCoreEntryPoint.c
+++
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Standalone
MmCoreEntryPoint.c
@@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

#include <PiMm.h>

-#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
+#include <Library/Arm/StandaloneMmCoreEntryPoint.h>

#include <PiPei.h>
#include <Guid/MmramMemoryReserve.h>
@@ -182,13 +182,13 @@ DelegatedEventLoop (
}

if (FfaEnabled) {
- EventCompleteSvcArgs->Arg0 =
ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64;
+ EventCompleteSvcArgs->Arg0 =
ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP;
EventCompleteSvcArgs->Arg1 = 0;
EventCompleteSvcArgs->Arg2 = 0;
- EventCompleteSvcArgs->Arg3 =
ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
+ EventCompleteSvcArgs->Arg3 =
ARM_SVC_ID_SP_EVENT_COMPLETE;
EventCompleteSvcArgs->Arg4 = SvcStatus;
} else {
- EventCompleteSvcArgs->Arg0 =
ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
+ EventCompleteSvcArgs->Arg0 =
ARM_SVC_ID_SP_EVENT_COMPLETE;
EventCompleteSvcArgs->Arg1 = SvcStatus;
}
}
@@ -273,13 +273,13 @@ InitArmSvcArgs (
)
{
if (FeaturePcdGet (PcdFfaEnable)) {
- InitMmFoundationSvcArgs->Arg0 =
ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64;
+ InitMmFoundationSvcArgs->Arg0 =
ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP;
InitMmFoundationSvcArgs->Arg1 = 0;
InitMmFoundationSvcArgs->Arg2 = 0;
- InitMmFoundationSvcArgs->Arg3 =
ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
+ InitMmFoundationSvcArgs->Arg3 =
ARM_SVC_ID_SP_EVENT_COMPLETE;
InitMmFoundationSvcArgs->Arg4 = *Ret;
} else {
- InitMmFoundationSvcArgs->Arg0 =
ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
+ InitMmFoundationSvcArgs->Arg0 =
ARM_SVC_ID_SP_EVENT_COMPLETE;
InitMmFoundationSvcArgs->Arg1 = *Ret;
}
}
@@ -395,7 +395,7 @@ _ModuleEntryPoint (
//
ProcessModuleEntryPointList (HobStart);

- DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP 0x%lx\n", (UINT64)
CpuDriverEntryPoint));
+ DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP %p\n", (VOID *)
CpuDriverEntryPoint));

finish:
if (Status == RETURN_UNSUPPORTED) {
diff --git
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
CoreEntryPoint.inf
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
CoreEntryPoint.inf
index 4fa426f58e..1762586cfa 100644
---
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
CoreEntryPoint.inf
+++
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMm
CoreEntryPoint.inf
@@ -21,10 +21,10 @@
# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for
build only)
#

-[Sources.AARCH64]
- AArch64/StandaloneMmCoreEntryPoint.c
- AArch64/SetPermissions.c
- AArch64/CreateHobList.c
+[Sources.AARCH64, Sources.ARM]
+ Arm/StandaloneMmCoreEntryPoint.c
+ Arm/SetPermissions.c
+ Arm/CreateHobList.c

[Sources.X64]
X64/StandaloneMmCoreEntryPoint.c
@@ -34,14 +34,14 @@
MdeModulePkg/MdeModulePkg.dec
StandaloneMmPkg/StandaloneMmPkg.dec

-[Packages.AARCH64]
+[Packages.ARM, Packages.AARCH64]
ArmPkg/ArmPkg.dec

[LibraryClasses]
BaseLib
DebugLib

-[LibraryClasses.AARCH64]
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
StandaloneMmMmuLib
ArmSvcLib

@@ -51,7 +51,7 @@
gEfiStandaloneMmNonSecureBufferGuid
gEfiArmTfCpuDriverEpDescriptorGuid

-[FeaturePcd.AARCH64]
+[FeaturePcd.ARM, FeaturePcd.AARCH64]
gArmTokenSpaceGuid.PcdFfaEnable

[BuildOptions]
diff --git
a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/Standalon
eMmCoreHobLib.c
b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneM
mCoreHobLib.c
similarity index 100%
rename from
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/Standalone
MmCoreHobLib.c
rename to
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmC
oreHobLib.c
diff --git
a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/Standalon
eMmCoreHobLibInternal.c
b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneM
mCoreHobLibInternal.c
similarity index 100%
rename from
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/Standalone
MmCoreHobLibInternal.c
rename to
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmC
oreHobLibInternal.c
diff --git
a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCore
HobLib.inf
b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCore
HobLib.inf
index a2559920e8..34ed536480 100644
---
a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCore
HobLib.inf
+++
b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCore
HobLib.inf
@@ -22,7 +22,7 @@
LIBRARY_CLASS =
HobLib|MM_CORE_STANDALONE

#
-# VALID_ARCHITECTURES = X64 AARCH64
+# VALID_ARCHITECTURES = X64 AARCH64 ARM
#
[Sources.common]
Common.c
@@ -30,9 +30,9 @@
[Sources.X64]
X64/StandaloneMmCoreHobLib.c

-[Sources.AARCH64]
- AArch64/StandaloneMmCoreHobLib.c
- AArch64/StandaloneMmCoreHobLibInternal.c
+[Sources.AARCH64, Sources.ARM]
+ Arm/StandaloneMmCoreHobLib.c
+ Arm/StandaloneMmCoreHobLibInternal.c

[Packages]
MdePkg/MdePkg.dec
diff --git
a/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneM
mMemLibInternal.c
b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMe
mLibInternal.c
similarity index 86%
rename from
StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMm
MemLibInternal.c
rename to
StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemL
ibInternal.c
index 4124959e04..fa7df46413 100644
---
a/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneM
mMemLibInternal.c
+++
b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMe
mLibInternal.c
@@ -20,6 +20,13 @@
//
extern EFI_PHYSICAL_ADDRESS
mMmMemLibInternalMaximumSupportAddress;

+#ifdef MDE_CPU_AARCH64
+#define ARM_PHYSICAL_ADDRESS_BITS 36
+#endif
+#ifdef MDE_CPU_ARM
+#define ARM_PHYSICAL_ADDRESS_BITS 32
+#endif
+
/**
Calculate and save the maximum support address.

@@ -31,7 +38,7 @@
MmMemLibInternalCalculateMaximumSupportAddress (
{
UINT8 PhysicalAddressBits;

- PhysicalAddressBits = 36;
+ PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS;

//
// Save the maximum support address in one global variable
diff --git
a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib
.inf
b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib
.inf
index 062b0d7a11..b29d97a746 100644
---
a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib
.inf
+++
b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib
.inf
@@ -28,7 +28,7 @@
#
# The following information is for reference only and not required by the
build tools.
#
-# VALID_ARCHITECTURES = IA32 X64 AARCH64
+# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM
#

[Sources.Common]
@@ -37,8 +37,8 @@
[Sources.IA32, Sources.X64]
X86StandaloneMmMemLibInternal.c

-[Sources.AARCH64]
- AArch64/StandaloneMmMemLibInternal.c
+[Sources.AARCH64, Sources.ARM]
+ ArmStandaloneMmMemLibInternal.c

[Packages]
MdePkg/MdePkg.dec
diff --git
a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende
ncy.inf
b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende
ncy.inf
index a2a059c5d6..ffb2a6d083 100644
---
a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende
ncy.inf
+++
b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende
ncy.inf
@@ -20,7 +20,7 @@
#
# The following information is for reference only and not required by the
build tools.
#
-# VALID_ARCHITECTURES = AARCH64
+# VALID_ARCHITECTURES = AARCH64|ARM
#
#

diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc
b/StandaloneMmPkg/StandaloneMmPkg.dsc
index 0c45df95e2..8012f93b7d 100644
--- a/StandaloneMmPkg/StandaloneMmPkg.dsc
+++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
@@ -20,7 +20,7 @@
PLATFORM_VERSION = 1.0
DSC_SPECIFICATION = 0x00010011
OUTPUT_DIRECTORY = Build/StandaloneMm
- SUPPORTED_ARCHITECTURES = AARCH64|X64
+ SUPPORTED_ARCHITECTURES = AARCH64|X64|ARM
BUILD_TARGETS = DEBUG|RELEASE
SKUID_IDENTIFIER = DEFAULT

@@ -60,7 +60,7 @@
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryP
oint/StandaloneMmDriverEntryPoint.inf
VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependenc
y/VariableMmDependency.inf

-[LibraryClasses.AARCH64]
+[LibraryClasses.AARCH64, LibraryClasses.ARM]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuSt
andaloneMmLib.inf
ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
@@ -118,8 +118,8 @@
StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/Standalone
MmMemoryAllocationLib.inf
StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependenc
y.inf

-[Components.AARCH64]
-
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.i
nf
+[Components.AARCH64, Components.ARM]
+ StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/Standalone
MmPeCoffExtraActionLib.inf

##############################################################
#####################################
@@ -135,6 +135,10 @@
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
-march=armv8-a+nofp -mstrict-align
GCC:*_*_*_CC_FLAGS = -mstrict-align

+[BuildOptions.ARM]
+GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
-march=armv7-a
+GCC:*_*_*_CC_FLAGS = -fno-stack-protector
+
[BuildOptions.X64]
MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000




Re: [PATCH] NetworkPkg: Add HTTP Additional Event Notifications

Wu, Jiaxin
 

For the below EDKII_HTTP_CALLBACK_EVENT definition:

All event is to retrieve the event Status, so the comments should be made clearly and align with code returned status, for example,

+ /// Retrieve the host address, EventStatus:
There might be the misunderstanding you want the host address, but actually, you only want the status. It's better to be:

+ /// The Status of DNS Event to retrieve the host address.
The same to all event.


With above changes, the patch is good to me.



Thanks,
Jiaxin





+///

+/// EDKII_HTTP_CALLBACK_EVENT

+///

+typedef enum {

+ ///

+ /// Retrieve the host address, EventStatus:

+ /// EFI_SUCCESS Operation succeeded.

+ /// EFI_OUT_OF_RESOURCES Failed to allocate needed resources.

+ /// EFI_DEVICE_ERROR An unexpected network error occurred.

+ /// Others Other errors as indicated.

+ ///

+ HttpEventDns,

+

+ ///

+ /// Initiate a nonblocking TCP connection request, EventStatus:

+ /// EFI_SUCCESS The connection request is successfully initiated.

+ /// EFI_NOT_STARTED This EFI TCP Protocol instance has not been
configured.

+ /// EFI_DEVICE_ERROR An unexpected system or network error
occurred.

+ /// Others Other errors as indicated.

+ ///

+ HttpEventConnectTcp,

+

+ ///

+ /// Connect one TLS session by finishing the TLS handshake process,
EventStatus:

+ /// EFI_SUCCESS The TLS session is established.

+ /// EFI_OUT_OF_RESOURCES Can't allocate memory resources.

+ /// EFI_ABORTED TLS session state is incorrect.

+ /// Others Other error as indicated.

+ ///

+ HttpEventTlsConnectSession,

+

+ ///

+ /// Initialize Http session

+ /// EFI_SUCCESS The initialization of session is done.

+ /// Others Other error as indicated.

+ ///

+ HttpEventInitSession

+} EDKII_HTTP_CALLBACK_EVENT;

+


回复: [edk2-devel] [PATCH v6 00/11] Secure Boot default keys

gaoliming
 

Sami:
For EmulatorPkg, Reviewed-by: Liming Gao <gaoliming@...>

Thanks
Liming
-----邮件原件-----
发件人: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>
发送时间: 2021年7月16日 20:00
收件人: devel@edk2.groups.io; gjb@...
抄送: leif@...; ardb+tianocore@...; Sunny Wang
<Sunny.Wang@...>; mw@...; upstream@...;
jiewen.yao@...; jian.j.wang@...; min.m.xu@...;
lersek@...; Sami Mujawar <Sami.Mujawar@...>;
afish@...; ray.ni@...; jordan.l.justen@...;
rebecca@...; grehan@...; Thomas Abraham
<thomas.abraham@...>; chasel.chiu@...;
nathaniel.l.desimone@...; gaoliming@...;
eric.dong@...; michael.d.kinney@...; zailiang.sun@...;
yi.qian@...; graeme@...; rad@...; pete@...;
Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>
主题: RE: [edk2-devel] [PATCH v6 00/11] Secure Boot default keys

The v6 of this series seems to have all the necessary Reviewed-By (and
some
Tested-By) of all parts, except the following platform specific parts.
Could we
get help from maintainers to review these please?

Much appreciated!

- ArmVirtPkg : https://edk2.groups.io/g/devel/message/77772
- ArmPlatformPkg: https://edk2.groups.io/g/devel/message/77775
- EmulatorPkg: https://edk2.groups.io/g/devel/message/77773
- Intel Platforms (Platform/Intel/QuarkPlatformPkg,
Platform/Intel/MinPlatformPkg, Platform/Intel/Vlv2TbltDevicePkg):
https://edk2.groups.io/g/devel/message/77781

Thanks,
--Samer





-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of
Grzegorz Bernacki via groups.io
Sent: Wednesday, July 14, 2021 8:30 AM
To: devel@edk2.groups.io
Cc: leif@...; ardb+tianocore@...; Samer
El-Haj-Mahmoud
<Samer.El-Haj-Mahmoud@...>; Sunny Wang
<Sunny.Wang@...>; mw@...; upstream@...;
jiewen.yao@...; jian.j.wang@...; min.m.xu@...;
lersek@...; Sami Mujawar <Sami.Mujawar@...>;
afish@...; ray.ni@...; jordan.l.justen@...;
rebecca@...; grehan@...; Thomas Abraham
<thomas.abraham@...>; chasel.chiu@...;
nathaniel.l.desimone@...; gaoliming@...;
eric.dong@...; michael.d.kinney@...; zailiang.sun@...;
yi.qian@...; graeme@...; rad@...;
pete@...; Grzegorz Bernacki <gjb@...>
Subject: [edk2-devel] [PATCH v6 00/11] Secure Boot default keys

This patchset adds support for initialization of default
Secure Boot variables based on keys content embedded in
flash binary. This feature is active only if Secure Boot
is enabled and DEFAULT_KEY is defined. The patchset
consist also application to enroll keys from default
variables and secure boot menu change to allow user
to reset key content to default values.
Discussion on design can be found at:
https://edk2.groups.io/g/rfc/topic/82139806#600

Built with:
GCC
- RISC-V (U500, U540) [requires fixes in dsc to build]
- Intel (Vlv2TbltDevicePkg (X64/IA32), Quark, MinPlatformPkg,
EmulatorPkg (X64), Bhyve, OvmfPkg (X64/IA32))
- ARM (Sgi75,SbsaQemu,DeveloperBox, RPi3/RPi4)

RISC-V, Quark, Vlv2TbltDevicePkg, Bhyve requires additional fixes to be
built,
will be post on edk2 maillist later

VS2019
- Intel (OvmfPkgX64)

Test with:
GCC5/RPi4
VS2019/OvmfX64 (requires changes to enable feature)

Tests:
1. Try to enroll key in incorrect format.
2. Enroll with only PKDefault keys specified.
3. Enroll with all keys specified.
4. Enroll when keys are enrolled.
5. Reset keys values.
6. Running signed & unsigned app after enrollment.

Changes since v1:
- change names:
SecBootVariableLib => SecureBootVariableLib
SecBootDefaultKeysDxe => SecureBootDefaultKeysDxe
SecEnrollDefaultKeysApp => EnrollFromDefaultKeysApp
- change name of function CheckSetupMode to GetSetupMode
- remove ShellPkg dependecy from EnrollFromDefaultKeysApp
- rebase to master

Changes since v2:
- fix coding style for functions headers in SecureBootVariableLib.h
- add header to SecureBootDefaultKeys.fdf.inc
- remove empty line spaces in SecureBootDefaultKeysDxe files
- revert FAIL macro in EnrollFromDefaultKeysApp
- remove functions duplicates and add SecureBootVariableLib
to platforms which used it

Changes since v3:
- move SecureBootDefaultKeys.fdf.inc to ArmPlatformPkg
- leave duplicate of CreateTimeBasedPayload in PlatformVarCleanupLib
- fix typo in guid description

Changes since v4:
- reorder patches to make it bisectable
- split commits related to more than one platform
- move edk2-platform commits to separate patchset

Changes since v5:
- split SecureBootVariableLib into SecureBootVariableLib and
SecureBootVariableProvisionLib

Grzegorz Bernacki (11):
SecurityPkg: Create SecureBootVariableLib.
SecurityPkg: Create library for enrolling Secure Boot variables.
ArmVirtPkg: add SecureBootVariableLib class resolution
OvmfPkg: add SecureBootVariableLib class resolution
EmulatorPkg: add SecureBootVariableLib class resolution
SecurityPkg: Remove duplicated functions from SecureBootConfigDxe.
ArmPlatformPkg: Create include file for default key content.
SecurityPkg: Add SecureBootDefaultKeysDxe driver
SecurityPkg: Add EnrollFromDefaultKeys application.
SecurityPkg: Add new modules to Security package.
SecurityPkg: Add option to reset secure boot keys.

SecurityPkg/SecurityPkg.dec
| 14 +
ArmVirtPkg/ArmVirt.dsc.inc
| 2 +
EmulatorPkg/EmulatorPkg.dsc
| 2 +
OvmfPkg/Bhyve/BhyveX64.dsc
| 2 +
OvmfPkg/OvmfPkgIa32.dsc
| 2 +
OvmfPkg/OvmfPkgIa32X64.dsc
| 2 +
OvmfPkg/OvmfPkgX64.dsc
| 2 +
SecurityPkg/SecurityPkg.dsc
| 5 +
SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf
| 48 ++
SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
| 80 +++

SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariablePro
visionLib.inf | 80 +++

SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi
gDxe.inf | 3 +

SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBoot
DefaultKeysDxe.inf | 46 ++
SecurityPkg/Include/Library/SecureBootVariableLib.h
| 153
++++++
SecurityPkg/Include/Library/SecureBootVariableProvisionLib.h
| 134 +++++

SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi
gNvData.h | 2 +

SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi
g.vfr | 6 +
SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.c
| 110 +++++
SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
| 511 ++++++++++++++++++++

SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariablePro
visionLib.c | 491 +++++++++++++++++++

SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi
gImpl.c | 344 ++++++-------

SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBoot
DefaultKeysDxe.c | 69 +++
ArmPlatformPkg/SecureBootDefaultKeys.fdf.inc
| 70
+++
SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.uni
| 17 +

SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariablePro
visionLib.uni | 16 +

SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfi
gStrings.uni | 4 +

SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBoot
DefaultKeysDxe.uni | 16 +
27 files changed, 2043 insertions(+), 188 deletions(-)
create mode 100644
SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.inf
create mode 100644
SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf
create mode 100644
SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariablePro
visionLib.inf
create mode 100644
SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBoot
DefaultKeysDxe.inf
create mode 100644
SecurityPkg/Include/Library/SecureBootVariableLib.h
create mode 100644
SecurityPkg/Include/Library/SecureBootVariableProvisionLib.h
create mode 100644
SecurityPkg/EnrollFromDefaultKeysApp/EnrollFromDefaultKeysApp.c
create mode 100644
SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.c
create mode 100644
SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariablePro
visionLib.c
create mode 100644
SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBoot
DefaultKeysDxe.c
create mode 100644 ArmPlatformPkg/SecureBootDefaultKeys.fdf.inc
create mode 100644
SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.uni
create mode 100644
SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariablePro
visionLib.uni
create mode 100644
SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBoot
DefaultKeysDxe.uni

--
2.25.1




IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended
recipient,
please notify the sender immediately and do not disclose the contents to
any
other person, use it for any purpose, or store or copy the information in
any
medium. Thank you.


Event: TianoCore Bug Triage - APAC / NAMO - 07/20/2021 #cal-reminder

devel@edk2.groups.io Calendar <noreply@...>
 

Reminder: TianoCore Bug Triage - APAC / NAMO

When:
07/20/2021
6:30pm to 7:30pm
(UTC-07:00) America/Los Angeles

Where:
https://teams.microsoft.com/l/meetup-join/19%3ameeting_OTUyZTg2NjgtNDhlNS00ODVlLTllYTUtYzg1OTNjNjdiZjFh%40thread.v2/0?context=%7b%22Tid%22%3a%2246c98d88-e344-4ed4-8496-4ed7712e255d%22%2c%22Oid%22%3a%22b286b53a-1218-4db3-bfc9-3d4c5aa7669e%22%7d

Organizer: Liming Gao gaoliming@...

View Event

Description:

TianoCore Bug Triage - APAC / NAMO

Hosted by Liming Gao

 

________________________________________________________________________________

Microsoft Teams meeting

Join on your computer or mobile app

Click here to join the meeting

Join with a video conferencing device

teams@...

Video Conference ID: 116 062 094 0

Alternate VTC dialing instructions

Or call in (audio only)

+1 916-245-6934,,77463821#   United States, Sacramento

Phone Conference ID: 774 638 21#

Find a local number | Reset PIN

Learn More | Meeting options


Re: [PATCH v2 03/11] OvmfPkg: PlatformBootManagerLibGrub: Allow executing kernel via fw_cfg

Christoph Willing
 

On 20/7/21 3:58 am, Dov Murik wrote:


On 19/07/2021 15:56, Christoph Willing wrote:
Thanks for the clarification Dov.

I've been trying with just "normal" VMs, not SEV. I did already find and try the confidential-containers-demo sev-hashes-v2 branch but it didn't help - not surprising if it's not relevant to normal VMs.

Do you know whether this functionality (-kernel, -initrd, -append options) is actually supposed to work in normal VMs at the moment? The only conditions under which it works here with qemu-6.0.0 is with vUDK2017 & 2018 and an old ovmf binary package from kraxel.og dated 2017. Anything built from the edk2 master branch has failed when using those qemu options, although all the same builds work perfectly using the VMs' internal kernels & initrds. I've also extracted OVMF files from the current kraxel.org package as well as Ubuntu's (hirsute) package and these also fail the same way i.e. kernel boots and initrd works (loads modules) but then the VM filesystem doesn't seem to be found (no /dev/sdX exists to mount the filesystem root).

I guess this could be a qemu problem but since it works with some (old) udk/edk2 versions, I thought I'd look here first.

Can you please try with edk2 commit d1fc3d7ef3cb - just before we did
some changes around this QEMU-interop code in OVMF?
I just tried a build at d1fc3d7ef3cb... with the same result. Works with
VM's internal kernel & initrd but not with external (using -kernel,
-initrd & -append options).

As soon as I revert to OVMF files (CODE & VARS) from vUDK2018, all works
as expected with external kernel & initrd.

Since this problem seems to go back to around 2018, is it better to
report in bugzilla?

Thanks,
chris


[edk2-platform][PATCH v1 1/1] Platform/RaspberryPi/RPi4: Fix non-standard ACPI HIDs

Samer El-Haj-Mahmoud
 

Remove non-standard RPI ACPI _CIDs that are not needed.
This also fixes the FWTS failure reported in
https://github.com/pftf/RPi4/issues/67

The windows drivers at https://github.com/raspberrypi/windows-drivers
are still able to match the ACPI objects using the HIDs which
are supported in the drivers, with these two recent changes needed:
469702898789e555c6947e50216a3f79e0ddeb9
and
5c5e2742b4c983b3001c473b168b0dae2fcba0c2

Cc: Leif Lindholm <leif@...>
Cc: Ard Biesheuvel <ardb+tianocore@...>
Cc: Pete Batard <pete@...>
Cc: Andrei Warkentin <awarkentin@...>
Cc: Mario Bălănică <mariobalanica02@...>
Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@...>
Tested-by: Mario Bălănică <mariobalanica02@...>
---
Platform/RaspberryPi/AcpiTables/GpuDevs.asl | 26 +++++++++++---------
Platform/RaspberryPi/AcpiTables/Sdhc.asl | 4 +--
Platform/RaspberryPi/AcpiTables/Uart.asl | 2 +-
3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/Platform/RaspberryPi/AcpiTables/GpuDevs.asl b/Platform/RaspberryPi/AcpiTables/GpuDevs.asl
index 966a94cdb5b5..9750dc25c07c 100644
--- a/Platform/RaspberryPi/AcpiTables/GpuDevs.asl
+++ b/Platform/RaspberryPi/AcpiTables/GpuDevs.asl
@@ -13,7 +13,11 @@
Device (USB0)
{
Name (_HID, "BCM2848")
- Name (_CID, Package() { "DWC_OTG", "DWC2_OTG" })
+#if (RPI_MODEL == 3)
+ Name (_CID, "DWC_OTG")
+#elif (RPI_MODEL == 4)
+ Name (_CID, "BCM2848")
+#endif
Name (_UID, 0x0)
Name (_CCA, 0x0)
Method (_STA)
@@ -36,7 +40,7 @@ Device (USB0)
Device (GPU0)
{
Name (_HID, "BCM2850")
- Name (_CID, "VC4")
+ Name (_CID, "BCM2850")
Name (_UID, 0x0)
Name (_CCA, 0x0)
Method (_STA)
@@ -140,7 +144,7 @@ Device (GPU0)
Device (RPIQ)
{
Name (_HID, "BCM2849")
- Name (_CID, "RPIQ")
+ Name (_CID, "BCM2849")
Name (_UID, 0)
Name (_CCA, 0x0)
Method (_STA)
@@ -164,7 +168,7 @@ Device (RPIQ)
Device (VCIQ)
{
Name (_HID, "BCM2835")
- Name (_CID, "VCIQ")
+ Name (_CID, "BCM2835")
Name (_UID, 0)
Name (_CCA, 0x0)
Name (_DEP, Package() { \_SB.GDV0.RPIQ })
@@ -189,7 +193,7 @@ Device (VCIQ)
Device (VCSM)
{
Name (_HID, "BCM2856")
- Name (_CID, "VCSM")
+ Name (_CID, "BCM2856")
Name (_UID, 0)
Name (_CCA, 0x0)
Name (_DEP, Package() { \_SB.GDV0.VCIQ })
@@ -203,7 +207,7 @@ Device (VCSM)
Device (GPI0)
{
Name (_HID, "BCM2845")
- Name (_CID, "BCMGPIO")
+ Name (_CID, "BCM2845")
Name (_UID, 0x0)
Name (_CCA, 0x0)
Method (_STA)
@@ -230,7 +234,7 @@ Device (GPI0)
Device (I2C1)
{
Name (_HID, "BCM2841")
- Name (_CID, "BCMI2C")
+ Name (_CID, "BCM2841")
Name (_UID, 0x1)
Name (_CCA, 0x0)
Method (_STA)
@@ -254,7 +258,7 @@ Device (I2C1)
Device (I2C2)
{
Name (_HID, "BCM2841")
- Name (_CID, "BCMI2C")
+ Name (_CID, "BCM2841")
Name (_UID, 0x2)
Name (_CCA, 0x0)
Method (_STA)
@@ -278,7 +282,7 @@ Device (I2C2)
Device (SPI0)
{
Name (_HID, "BCM2838")
- Name (_CID, "BCMSPI0")
+ Name (_CID, "BCM2838")
Name (_UID, 0x0)
Name (_CCA, 0x0)
Method (_STA)
@@ -304,7 +308,7 @@ Device (SPI0)
Device (SPI1)
{
Name (_HID, "BCM2839")
- Name (_CID, "BCMAUXSPI")
+ Name (_CID, "BCM2839")
Name (_UID, 0x1)
Name (_CCA, 0x0)
Name (_DEP, Package() { \_SB.GDV0.RPIQ })
@@ -331,7 +335,7 @@ Device (SPI1)
// Device (SPI2)
// {
// Name (_HID, "BCM2839")
-// Name (_CID, "BCMAUXSPI")
+// Name (_CID, "BCM2839")
// Name (_UID, 0x2)
// Name (_CCA, 0x0)
// Name (_DEP, Package() { \_SB.GDV0.RPIQ })
diff --git a/Platform/RaspberryPi/AcpiTables/Sdhc.asl b/Platform/RaspberryPi/AcpiTables/Sdhc.asl
index 42776e33bbc6..85d5053a338c 100644
--- a/Platform/RaspberryPi/AcpiTables/Sdhc.asl
+++ b/Platform/RaspberryPi/AcpiTables/Sdhc.asl
@@ -23,7 +23,7 @@
Device (SDC1)
{
Name (_HID, "BCM2847")
- Name (_CID, "ARASAN")
+ Name (_CID, "BCM2847")
Name (_UID, 0x0)
Name (_CCA, 0x0)
Name (_S1D, 0x1)
@@ -78,7 +78,7 @@ Device (SDC1)
Device (SDC2)
{
Name (_HID, "BCM2855")
- Name (_CID, "SDHST")
+ Name (_CID, "BCM2855")
Name (_UID, 0x0)
Name (_CCA, 0x0)
Name (_S1D, 0x1)
diff --git a/Platform/RaspberryPi/AcpiTables/Uart.asl b/Platform/RaspberryPi/AcpiTables/Uart.asl
index 167f94e8892b..974f06d3bc3f 100644
--- a/Platform/RaspberryPi/AcpiTables/Uart.asl
+++ b/Platform/RaspberryPi/AcpiTables/Uart.asl
@@ -59,7 +59,7 @@ Device (URT0)
Device (URTM)
{
Name (_HID, "BCM2836")
- Name (_CID, "MINIUART")
+ Name (_CID, "BCM2836")
Name (_UID, 0x0)
Name (_CCA, 0x0)
Method (_STA)
--
2.25.1


Re: [PATCH v5 3/4] OvmfPkg/PlatformPei: Mark SEC GHCB page as unencrypted via hypercall

Ashish Kalra
 

Hello Tom,

On Fri, Jul 16, 2021 at 09:22:20AM -0500, Tom Lendacky wrote:
On 7/8/21 9:08 AM, Ashish Kalra wrote:
From: Ashish Kalra <ashish.kalra@...>

Mark the SEC GHCB page (that is mapped as unencrypted in
ResetVector code) in the hypervisor page status tracking.

Cc: Jordan Justen <jordan.l.justen@...>
Cc: Laszlo Ersek <lersek@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Ashish Kalra <ashish.kalra@...>
---
OvmfPkg/PlatformPei/AmdSev.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c
index a8bf610022..1ec0de48fe 100644
--- a/OvmfPkg/PlatformPei/AmdSev.c
+++ b/OvmfPkg/PlatformPei/AmdSev.c
@@ -52,6 +52,15 @@ AmdSevEsInitialize (
PcdStatus = PcdSetBoolS (PcdSevEsIsEnabled, TRUE);
ASSERT_RETURN_ERROR (PcdStatus);

+ //
+ // GHCB_BASE setup during reset-vector needs to be marked as
s/GHCB_BASE/The SEC Ghcb/

+ // decrypted in the hypervisor page encryption bitmap.
Is the "hypervisor page encryption bitmap" valid anymore? This gets passed
up to userspace now, right?

You should go through all the patches to be sure you aren't talking about
a bitmap anymore and just state that you're updating the encryption state
with the hypervisor.
Ok, i will fix that.

+ //
+ SetMemoryEncDecHypercall3 (FixedPcdGet32 (PcdOvmfSecGhcbBase),
The first argument needs to be moved down to a line of its own and
indented like the following arguments.

+ EFI_SIZE_TO_PAGES(FixedPcdGet32 (PcdOvmfSecGhcbSize)),
+ KVM_MAP_GPA_RANGE_DECRYPTED
Ah, now I see this #define used, but you should be passing a 0 or 1,
right? This happens to evaluate to 0, but it's the wrong way to call this
function.
Ok.

Thanks,
Ashish

+ );
+
//
// Allocate GHCB and per-CPU variable pages.
// Since the pages must survive across the UEFI to OS transition


Re: [PATCH v5 2/4] OvmfPkg/VmgExitLib: Add support for hypercalls with SEV-ES.

Ashish Kalra
 

Hello Tom,

On Fri, Jul 16, 2021 at 09:16:00AM -0500, Tom Lendacky wrote:
On 7/8/21 9:08 AM, Ashish Kalra wrote:
From: Ashish Kalra <ashish.kalra@...>
The subject isn't correct since the #VC handler already supports
hypercalls. It should say something like "Make the #VC handler aware of
the encryption state change hypercall" or "Update the #VC handler to
support the encryption state change hypercall" or something like that.
Ok.

Make the VC handler hypercall aware by adding support
to compare the hypercall number and add the additional
register values used by hypercall in the GHCB.

Also mark the SEC GHCB page (that is mapped as
unencrypted in ResetVector code) in the hypervisor
guest page status tracking.
This part of the commit message shoudn't be here any more.
Yes.


Cc: Jordan Justen <jordan.l.justen@...>
Cc: Laszlo Ersek <lersek@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Ashish Kalra <ashish.kalra@...>
---
OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c b/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c
index 41b0c8cc53..7f69bfab5f 100644
--- a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c
+++ b/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c
@@ -1171,6 +1171,15 @@ VmmCallExit (
Ghcb->SaveArea.Cpl = (UINT8) (Regs->Cs & 0x3);
VmgSetOffsetValid (Ghcb, GhcbCpl);
Add a comment that this hypercall requires these extra registers so you
are explicitly adding them.
Ok.

Thanks,
Ashish

+ if (Regs->Rax == KVM_HC_MAP_GPA_RANGE) {
+ Ghcb->SaveArea.Rbx = Regs->Rbx;
+ VmgSetOffsetValid (Ghcb, GhcbRbx);
+ Ghcb->SaveArea.Rcx = Regs->Rcx;
+ VmgSetOffsetValid (Ghcb, GhcbRcx);
+ Ghcb->SaveArea.Rdx = Regs->Rdx;
+ VmgSetOffsetValid (Ghcb, GhcbRdx);
+ }
+
Status = VmgExit (Ghcb, SVM_EXIT_VMMCALL, 0, 0);
if (Status != 0) {
return Status;


Re: [PATCH v5 1/4] OvmfPkg/BaseMemEncryptLib: Support to issue unencrypted hypercall

Ashish Kalra
 

Hello Tom,

On Fri, Jul 16, 2021 at 09:11:23AM -0500, Tom Lendacky wrote:
On 7/8/21 9:07 AM, Ashish Kalra wrote:
From: Ashish Kalra <ashish.kalra@...>
The patch subject is a bit confusing. Something more like "Add API to
issue hypercall on page encryption state change" or similar, since this is
issued for changes to shared and private, not just shared.

By default all the SEV guest memory regions are considered encrypted,
if a guest changes the encryption attribute of the page (e.g mark a
page as decrypted) then notify hypervisor. Hypervisor will need to
track the unencrypted pages. The information will be used during
guest live migration, guest page migration and guest debugging.

This hypercall is used to notify hypervisor when the page's
encryption state changes.
This is a large patch. It looks like this should be split into a few patches.
- one patch for the MemEncryptSevLiveMigrationIsEnabled() API
- one patch for the SetMemoryEncDecHypercall3() API
- one patch to make use of the SetMemoryEncDecHypercall3() API.
Ok.


Cc: Jordan Justen <jordan.l.justen@...>
Cc: Laszlo Ersek <lersek@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Brijesh Singh <brijesh.singh@...>
Signed-off-by: Ashish Kalra <ashish.kalra@...>
---
OvmfPkg/Include/Library/MemEncryptSevLib.h | 69 ++++++++++++++++++++
OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf | 1 +
OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c | 39 +++++++++++
OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c | 27 ++++++++
OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c | 51 +++++++++++++++
OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf | 1 +
OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c | 39 +++++++++++
OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c | 38 +++++++++++
OvmfPkg/Library/BaseMemEncryptSevLib/X64/AsmHelperStub.nasm | 33 ++++++++++
OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c | 54 +++++++++++++++
OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c | 22 ++++++-
11 files changed, 373 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/Include/Library/MemEncryptSevLib.h b/OvmfPkg/Include/Library/MemEncryptSevLib.h
index 76d06c206c..c2b2a99a08 100644
--- a/OvmfPkg/Include/Library/MemEncryptSevLib.h
+++ b/OvmfPkg/Include/Library/MemEncryptSevLib.h
@@ -90,6 +90,18 @@ MemEncryptSevIsEnabled (
VOID
);

+/**
+ Returns a boolean to indicate whether SEV live migration is enabled.
+
+ @retval TRUE SEV live migration is enabled
+ @retval FALSE SEV live migration is not enabled
+**/
+BOOLEAN
+EFIAPI
+MemEncryptSevLiveMigrationIsEnabled (
+ VOID
+ );
+
/**
This function clears memory encryption bit for the memory region specified by
BaseAddress and NumPages from the current page table context.
@@ -222,4 +234,61 @@ MemEncryptSevClearMmioPageEncMask (
IN UINTN NumPages
);

+/**
+ This hypercall is used to notify hypervisor when the page's encryption
+ state changes.
+
+ @param[in] PhysicalAddress The physical address that is the start address
+ of a memory region. The PhysicalAddress is
+ expected to be PAGE_SIZE aligned.
+ @param[in] Pages Number of pages in memory region.
+ @param[in] Status Encrypted(1) or Decrypted(0).
+
+@retval RETURN_SUCCESS Hypercall returned success.
It looks like RETURN_UNSUPPORTED is also possible.

+**/
+RETURN_STATUS
+EFIAPI
+SetMemoryEncDecHypercall3 (
+ IN UINTN PhysicalAddress,
+ IN UINTN Pages,
+ IN UINTN Status
+ );
+
+#define KVM_HC_MAP_GPA_RANGE 12
+#define KVM_MAP_GPA_RANGE_PAGE_SZ_4K 0
+#define KVM_MAP_GPA_RANGE_PAGE_SZ_2M BIT0
+#define KVM_MAP_GPA_RANGE_PAGE_SZ_1G BIT1
+#define KVM_MAP_GPA_RANGE_ENC_STAT(n) ((n) << 4)
+#define KVM_MAP_GPA_RANGE_ENCRYPTED KVM_MAP_GPA_RANGE_ENC_STAT(1)
+#define KVM_MAP_GPA_RANGE_DECRYPTED KVM_MAP_GPA_RANGE_ENC_STAT(0)
You define these but don't use them (and you should).
Used later in another patch.

+
+#define KVM_FEATURE_MIGRATION_CONTROL BIT17
+
+/**
+ Figures out if we are running inside KVM HVM and
+ KVM HVM supports SEV Live Migration feature.
+
+ @retval TRUE SEV live migration is supported.
+ @retval FALSE SEV live migration is not supported.
+**/
+BOOLEAN
+EFIAPI
+KvmDetectSevLiveMigrationFeature(
+ VOID
+ );
+
+/**
+ Interface exposed by the ASM implementation of the core hypercall
+
+ @retval Hypercall returned status.
+**/
+UINTN
+EFIAPI
+SetMemoryEncDecHypercall3AsmStub (
+ IN UINTN HypercallNum,
+ IN UINTN PhysicalAddress,
+ IN UINTN Pages,
+ IN UINTN Attributes
+ );
+
#endif // _MEM_ENCRYPT_SEV_LIB_H_
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
index f2e162d680..0c28afadee 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf
@@ -38,6 +38,7 @@
X64/PeiDxeVirtualMemory.c
X64/VirtualMemory.c
X64/VirtualMemory.h
+ X64/AsmHelperStub.nasm

[Sources.IA32]
Ia32/MemEncryptSevLib.c
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
index 2816f859a0..ead754cd7b 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLibInternal.c
@@ -20,6 +20,8 @@
STATIC BOOLEAN mSevStatus = FALSE;
STATIC BOOLEAN mSevEsStatus = FALSE;
STATIC BOOLEAN mSevStatusChecked = FALSE;
+STATIC BOOLEAN mSevLiveMigrationStatus = FALSE;
+STATIC BOOLEAN mSevLiveMigrationStatusChecked = FALSE;

STATIC UINT64 mSevEncryptionMask = 0;
STATIC BOOLEAN mSevEncryptionMaskSaved = FALSE;
@@ -87,6 +89,24 @@ InternalMemEncryptSevStatus (
mSevStatusChecked = TRUE;
}

+/**
+ Figures out if we are running inside KVM HVM and
+ KVM HVM supports SEV Live Migration feature.
+**/
+STATIC
+VOID
+EFIAPI
+InternalDetectSevLiveMigrationFeature(
+ VOID
+ )
+{
+ if (KvmDetectSevLiveMigrationFeature()) {
+ mSevLiveMigrationStatus = TRUE;
+ }
+
+ mSevLiveMigrationStatusChecked = TRUE;
+}
+
/**
Returns a boolean to indicate whether SEV-ES is enabled.

@@ -125,6 +145,25 @@ MemEncryptSevIsEnabled (
return mSevStatus;
}

+/**
+ Returns a boolean to indicate whether SEV live migration is enabled.
+
+ @retval TRUE SEV live migration is enabled
+ @retval FALSE SEV live migration is not enabled
+**/
+BOOLEAN
+EFIAPI
+MemEncryptSevLiveMigrationIsEnabled (
+ VOID
+ )
+{
+ if (!mSevLiveMigrationStatusChecked) {
+ InternalDetectSevLiveMigrationFeature ();
+ }
+
+ return mSevLiveMigrationStatus;
+}
+
/**
Returns the SEV encryption mask.

diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c b/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c
index be260e0d10..62392309fe 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c
@@ -136,3 +136,30 @@ MemEncryptSevClearMmioPageEncMask (
//
return RETURN_UNSUPPORTED;
}
+
+/**
+ This hyercall is used to notify hypervisor when the page's encryption
+ state changes.
+
+ @param[in] PhysicalAddress The physical address that is the start address
+ of a memory region. The physical address is
+ expected to be PAGE_SIZE aligned.
+ @param[in] Pages Number of Pages in the memory region.
+ @param[in] Status Encrypted(1) or Decrypted(0).
+
+@retval RETURN_SUCCESS Hypercall returned success.
+**/
+RETURN_STATUS
+EFIAPI
+SetMemoryEncDecHypercall3 (
+ IN UINTN PhysicalAddress,
+ IN UINTN Pages,
+ IN UINTN Status
+ )
+{
+ //
+ // Memory encryption bit is not accessible in 32-bit mode
+ //
+ return RETURN_UNSUPPORTED;
+}
+
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c
index b4a9f464e2..0c9f7e17ba 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiDxeMemEncryptSevLibInternal.c
@@ -61,3 +61,54 @@ MemEncryptSevLocateInitialSmramSaveStateMapPages (

return RETURN_SUCCESS;
}
+
+/**
+ Figures out if we are running inside KVM HVM and
+ KVM HVM supports SEV Live Migration feature.
+
+ @retval TRUE SEV live migration is supported.
+ @retval FALSE SEV live migration is not supported.
+**/
+BOOLEAN
+EFIAPI
+KvmDetectSevLiveMigrationFeature(
+ VOID
+ )
+{
+ CHAR8 Signature[13];
+ UINT32 mKvmLeaf;
+ UINT32 RegEax, RegEbx, RegEcx, RegEdx;
+
+ Signature[12] = '\0';
+ for (mKvmLeaf = 0x40000000; mKvmLeaf < 0x40010000; mKvmLeaf += 0x100) {
+ AsmCpuid (mKvmLeaf,
+ NULL,
+ (UINT32 *) &Signature[0],
+ (UINT32 *) &Signature[4],
+ (UINT32 *) &Signature[8]);
+
+ if (AsciiStrCmp ((CHAR8 *) Signature, "KVMKVMKVM\0\0\0") == 0) {
+ DEBUG ((
+ DEBUG_INFO,
+ "%a: KVM Detected, signature = %s\n",
+ __FUNCTION__,
+ Signature
+ ));
+
+ RegEax = mKvmLeaf + 1;
+ RegEcx = 0;
+ AsmCpuid (mKvmLeaf + 1, &RegEax, &RegEbx, &RegEcx, &RegEdx);
+ if ((RegEax & KVM_FEATURE_MIGRATION_CONTROL) != 0) {
+ DEBUG ((
+ DEBUG_INFO,
+ "%a: Live Migration feature supported\n",
+ __FUNCTION__
+ ));
+
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
+}
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
index 03a78c32df..3233ca7979 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf
@@ -38,6 +38,7 @@
X64/PeiDxeVirtualMemory.c
X64/VirtualMemory.c
X64/VirtualMemory.h
+ X64/AsmHelperStub.nasm

[Sources.IA32]
Ia32/MemEncryptSevLib.c
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
index e2fd109d12..9db6c2ef71 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLibInternal.c
@@ -20,6 +20,8 @@
STATIC BOOLEAN mSevStatus = FALSE;
STATIC BOOLEAN mSevEsStatus = FALSE;
STATIC BOOLEAN mSevStatusChecked = FALSE;
+STATIC BOOLEAN mSevLiveMigrationStatus = FALSE;
+STATIC BOOLEAN mSevLiveMigrationStatusChecked = FALSE;

STATIC UINT64 mSevEncryptionMask = 0;
STATIC BOOLEAN mSevEncryptionMaskSaved = FALSE;
@@ -87,6 +89,24 @@ InternalMemEncryptSevStatus (
mSevStatusChecked = TRUE;
}

+/**
+ Figures out if we are running inside KVM HVM and
+ KVM HVM supports SEV Live Migration feature.
+**/
+STATIC
+VOID
+EFIAPI
+InternalDetectSevLiveMigrationFeature(
+ VOID
+ )
+{
+ if (KvmDetectSevLiveMigrationFeature()) {
+ mSevLiveMigrationStatus = TRUE;
+ }
+
+ mSevLiveMigrationStatusChecked = TRUE;
+}
+
/**
Returns a boolean to indicate whether SEV-ES is enabled.

@@ -125,6 +145,25 @@ MemEncryptSevIsEnabled (
return mSevStatus;
}

+/**
+ Returns a boolean to indicate whether SEV live migration is enabled.
+
+ @retval TRUE SEV live migration is enabled
+ @retval FALSE SEV live migration is not enabled
+**/
+BOOLEAN
+EFIAPI
+MemEncryptSevLiveMigrationIsEnabled (
+ VOID
+ )
+{
+ if (!mSevLiveMigrationStatusChecked) {
+ InternalDetectSevLiveMigrationFeature ();
+ }
+
+ return mSevLiveMigrationStatus;
+}
+
/**
Returns the SEV encryption mask.

diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c
index 56d8f3f318..b926c7b786 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLibInternal.c
@@ -100,6 +100,44 @@ MemEncryptSevIsEnabled (
return Msr.Bits.SevBit ? TRUE : FALSE;
}

+/**
+ Interface exposed by the ASM implementation of the core hypercall
+
+ @retval Hypercall returned status.
+**/
+UINTN
+EFIAPI
+SetMemoryEncDecHypercall3AsmStub (
+ IN UINTN HypercallNum,
+ IN UINTN PhysicalAddress,
+ IN UINTN Pages,
+ IN UINTN Attributes
+ )
+{
+ //
+ // Not used in SEC phase.
+ //
+ return RETURN_UNSUPPORTED;
+}
+
+/**
+ Returns a boolean to indicate whether SEV live migration is enabled.
+
+ @retval TRUE SEV live migration is enabled
+ @retval FALSE SEV live migration is not enabled
+**/
+BOOLEAN
+EFIAPI
+MemEncryptSevLiveMigrationIsEnabled (
+ VOID
+ )
+{
+ //
+ // Not used in SEC phase.
+ //
+ return FALSE;
+}
+
/**
Returns the SEV encryption mask.

diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/AsmHelperStub.nasm b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/AsmHelperStub.nasm
new file mode 100644
index 0000000000..c7c11f77f1
--- /dev/null
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/AsmHelperStub.nasm
@@ -0,0 +1,33 @@
+/** @file
+
+ ASM helper stub to invoke hypercall
+
+ Copyright (c) 2021, AMD Incorporated. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+DEFAULT REL
+SECTION .text
+
+; UINTN
+; EFIAPI
+; SetMemoryEncDecHypercall3AsmStub (
+; IN UINTN HypercallNum,
+; IN UINTN Arg1,
+; IN UINTN Arg2,
+; IN UINTN Arg3
+; );
+global ASM_PFX(SetMemoryEncDecHypercall3AsmStub)
+ASM_PFX(SetMemoryEncDecHypercall3AsmStub):
+ ; UEFI calling conventions require RBX to
+ ; be nonvolatile/callee-saved.
+ push rbx
+ mov rax, rcx ; Copy HypercallNumber to rax
+ mov rbx, rdx ; Copy Arg1 to the register expected by KVM
+ mov rcx, r8 ; Copy Arg2 to register expected by KVM
+ mov rdx, r9 ; Copy Arg2 to register expected by KVM
+ vmmcall ; Call VMMCALL
+ pop rbx
+ ret
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c
index a57e8fd37f..57447e69dc 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c
@@ -143,3 +143,57 @@ MemEncryptSevClearMmioPageEncMask (
);

}
+
+/**
+ This hyercall is used to notify hypervisor when the page's encryption
+ state changes.
+
+ @param[in] PhysicalAddress The physical address that is the start address
+ of a memory region. The physical address is
+ expected to be PAGE_SIZE aligned.
+ @param[in] Pages Number of Pages in the memory region.
+ @param[in] Status Encrypted(1) or Decrypted(0).
+
+@retval RETURN_SUCCESS Hypercall returned success.
I see RETURN_NO_MAPPING also, so you'll need to update the retvals everywhere.
Yes.

+**/
+RETURN_STATUS
+EFIAPI
+SetMemoryEncDecHypercall3 (
+ IN UINTN PhysicalAddress,
+ IN UINTN Pages,
+ IN UINTN Status
+ )
+{
+ RETURN_STATUS Ret;
+ INTN Error;
Should be UINTN.

+
+ Ret = RETURN_UNSUPPORTED;
+
+ if (MemEncryptSevLiveMigrationIsEnabled ()) {
+ Ret = EFI_SUCCESS;
RETURN_SUCCESS since Ret is type RETURN_STATUS.
Ok.

+ //
+ // The encryption bit is set/clear on the smallest page size, hence
+ // use the 4k page size in MAP_GPA_RANGE hypercall below.
+ // Also, the hypercall expects the guest physical address to be
+ // page-aligned.
+ //
+ Error = SetMemoryEncDecHypercall3AsmStub (
+ KVM_HC_MAP_GPA_RANGE,
+ (PhysicalAddress & (~(EFI_PAGE_SIZE-1))),
+ Pages,
+ KVM_MAP_GPA_RANGE_PAGE_SZ_4K | KVM_MAP_GPA_RANGE_ENC_STAT(Status)
Status is UINTN, but is passed from an enum variable. If for any reason
that enum should change in the future, this may break. So you should fixup
your call to explicitly pass 0 or 1 and then you can safely use that value
here.

Maybe add an "ASSERT (Status == 0 || Status == 1)" to catch bad input values.
Ok.

+ );
+
+ if (Error != 0) {
+ DEBUG ((DEBUG_ERROR,
+ "SetMemoryEncDecHypercall3 failed, Phys = %Lx, Pages = %Ld, Err = %Ld\n",
+ PhysicalAddress,
+ Pages,
+ (INT64)Error));
+
+ Ret = RETURN_NO_MAPPING;
+ }
+ }
+
+ return Ret;
+}
diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
index c696745f9d..0b1588a4c1 100644
--- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
+++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c
@@ -536,7 +536,6 @@ EnableReadOnlyPageWriteProtect (
AsmWriteCr0 (AsmReadCr0() | BIT16);
}

-
/**
This function either sets or clears memory encryption bit for the memory
region specified by PhysicalAddress and Length from the current page table
@@ -585,6 +584,9 @@ SetMemoryEncDec (
UINT64 AddressEncMask;
BOOLEAN IsWpEnabled;
RETURN_STATUS Status;
+ UINTN Size;
+ BOOLEAN CBitChanged;
+ PHYSICAL_ADDRESS OrigPhysicalAddress;

//
// Set PageMapLevel4Entry to suppress incorrect compiler/analyzer warnings.
@@ -636,6 +638,10 @@ SetMemoryEncDec (

Status = EFI_SUCCESS;

+ Size = Length;
+ CBitChanged = FALSE;
+ OrigPhysicalAddress = PhysicalAddress;
+
while (Length != 0)
{
//
@@ -695,6 +701,7 @@ SetMemoryEncDec (
));
PhysicalAddress += BIT30;
Length -= BIT30;
+ CBitChanged = TRUE;
} else {
//
// We must split the page
@@ -749,6 +756,7 @@ SetMemoryEncDec (
SetOrClearCBit (&PageDirectory2MEntry->Uint64, Mode);
PhysicalAddress += BIT21;
Length -= BIT21;
+ CBitChanged = TRUE;
} else {
//
// We must split up this page into 4K pages
@@ -791,6 +799,7 @@ SetMemoryEncDec (
SetOrClearCBit (&PageTableEntry->Uint64, Mode);
PhysicalAddress += EFI_PAGE_SIZE;
Length -= EFI_PAGE_SIZE;
+ CBitChanged = TRUE;
}
}
}
@@ -808,6 +817,17 @@ SetMemoryEncDec (
//
CpuFlushTlb();

+ //
+ // Notify Hypervisor on C-bit status
+ //
+ if (CBitChanged) {
+ Status = SetMemoryEncDecHypercall3 (
+ OrigPhysicalAddress,
+ EFI_SIZE_TO_PAGES(Size),
+ !Mode
"Mode" is a MAP_RANGE_MODE enum that is local to this file. So you need to
either move this to a common header file so you can use it with
SetMemoryEncDecHypercall3() or set a 0 or 1 based on Mode and pass that.

Ok.

Thanks,
Ashish

+ );
+ }
+
Done:
//
// Restore page table write protection, if any.


Re: [PATCH v2 10/11] OvmfPkg: add SevHashesBlobVerifierLib

Lendacky, Thomas
 

On 7/19/21 2:47 PM, Dov Murik wrote:
On 19/07/2021 20:28, Tom Lendacky wrote:
On 7/6/21 3:55 AM, Dov Murik wrote:
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = SevHashesBlobVerifierLib
But is this BASE_NAME okay?

Or should it be BlobVerifierLibSevHashes ?
I guess that it should probably be BlobVerifierLibSevHashes just for
consistency, but I'm not sure whether there's a convention for BASE_NAME.

Thanks,
Tom



+ FILE_GUID = 59e713b5-eff3-46a7-8d8b-46f4c004ad7b
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = BlobVerifierLib
+ CONSTRUCTOR = SevHashesBlobVerifierLibConstructor
+
+[Sources]
+ SevHashesBlobVerifier.c
+
+[Packages]
+ CryptoPkg/CryptoPkg.dec
+ MdePkg/MdePkg.dec
+ OvmfPkg/OvmfPkg.dec
+
+[LibraryClasses]
+ BaseCryptLib
+ BaseMemoryLib
+ DebugLib
+ PcdLib
+
+[FixedPcd]
+ gUefiOvmfPkgTokenSpaceGuid.PcdQemuHashTableBase
+ gUefiOvmfPkgTokenSpaceGuid.PcdQemuHashTableSize
diff --git a/OvmfPkg/Library/BlobVerifierLib/SevHashesBlobVerifier.c b/OvmfPkg/Library/BlobVerifierLib/SevHashesBlobVerifier.c
new file mode 100644
index 000000000000..961ee29f5df3
--- /dev/null
+++ b/OvmfPkg/Library/BlobVerifierLib/SevHashesBlobVerifier.c
@@ -0,0 +1,199 @@
+/** @file
+
+ Blob verifier library that uses SEV hashes table.
+
+ Copyright (C) 2021, IBM Corporation
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Library/BaseCryptLib.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/BlobVerifierLib.h>
+
+/**
+ The SEV Hashes table must be in encrypted memory and has the table
+ and its entries described by
+
+ <GUID>|UINT16 <len>|<data>
+
+ With the whole table GUID being 9438d606-4f22-4cc9-b479-a793d411fd21
+
+ The current possible table entries are for the kernel, the initrd
+ and the cmdline:
+
+ 4de79437-abd2-427f-b835-d5b172d2045b kernel
+ 44baf731-3a2f-4bd7-9af1-41e29169781d initrd
+ 97d02dd8-bd20-4c94-aa78-e7714d36ab2a cmdline
+
+ The size of the entry is used to identify the hash, but the
+ expectation is that it will be 32 bytes of SHA-256.
+**/
+
+#define SEV_HASH_TABLE_GUID \
+ (GUID) { 0x9438d606, 0x4f22, 0x4cc9, { 0xb4, 0x79, 0xa7, 0x93, 0xd4, 0x11, 0xfd, 0x21 } }
+#define SEV_KERNEL_HASH_GUID \
+ (GUID) { 0x4de79437, 0xabd2, 0x427f, { 0xb8, 0x35, 0xd5, 0xb1, 0x72, 0xd2, 0x04, 0x5b } }
+#define SEV_INITRD_HASH_GUID \
+ (GUID) { 0x44baf731, 0x3a2f, 0x4bd7, { 0x9a, 0xf1, 0x41, 0xe2, 0x91, 0x69, 0x78, 0x1d } }
+#define SEV_CMDLINE_HASH_GUID \
+ (GUID) { 0x97d02dd8, 0xbd20, 0x4c94, { 0xaa, 0x78, 0xe7, 0x71, 0x4d, 0x36, 0xab, 0x2a } }
+
+STATIC CONST EFI_GUID mSevKernelHashGuid = SEV_KERNEL_HASH_GUID;
+STATIC CONST EFI_GUID mSevInitrdHashGuid = SEV_INITRD_HASH_GUID;
+STATIC CONST EFI_GUID mSevCmdlineHashGuid = SEV_CMDLINE_HASH_GUID;
+
+#pragma pack (1)
+typedef struct {
+ GUID Guid;
+ UINT16 Len;
+ UINT8 Data[];
+} HASH_TABLE;
+#pragma pack ()
+
+STATIC HASH_TABLE *mHashesTable;
+STATIC UINT16 mHashesTableSize;
+
+STATIC
+CONST GUID*
+FindBlobEntryGuid (
+ IN CONST CHAR16 *BlobName
+ )
+{
+ if (StrCmp (BlobName, L"kernel") == 0) {
+ return &mSevKernelHashGuid;
+ } else if (StrCmp (BlobName, L"initrd") == 0) {
+ return &mSevInitrdHashGuid;
+ } else if (StrCmp (BlobName, L"cmdline") == 0) {
+ return &mSevCmdlineHashGuid;
+ } else {
+ return NULL;
+ }
+}
+
+/**
+ Verify blob from an external source.
+
+ @param BlobName The name of the blob
+ @param Buf The data of the blob
+ @param BufSize The size of the blob in bytes
+
+ @retval EFI_SUCCESS The blob was verified successfully.
+ @retval EFI_ACCESS_DENIED The blob could not be verified, and therefore
+ should be considered non-secure.
+**/
+EFI_STATUS
+EFIAPI
+VerifyBlob (
+ IN CONST CHAR16 *BlobName,
+ IN CONST VOID *Buf,
+ UINT32 BufSize
+ )
+{
+ CONST GUID *Guid;
+ INT32 Len;
Any reason for this not to be a UINT16 like the struct or mHashesTableSize?
Detect overflows in the `for` loop below?

If a (bad) Entry->Len is 0xffff, then adding it to Len will overflow the
UINT16 and the Len < mHashesTableSize condition is still true.


+ HASH_TABLE *Entry;
+ UINT8 Hash[SHA256_DIGEST_SIZE];
+
+ if (mHashesTable == NULL || mHashesTableSize == 0) {
+ DEBUG ((DEBUG_ERROR,
+ "%a: Verifier called but no hashes table discoverd in MEMFD\n",
+ __FUNCTION__));
+ return EFI_ACCESS_DENIED;
+ }
+
+ Guid = FindBlobEntryGuid (BlobName);
+ if (Guid == NULL) {
+ DEBUG ((DEBUG_ERROR, "%a: Unknown blob name \"%s\"\n", __FUNCTION__,
+ BlobName));
+ return EFI_ACCESS_DENIED;
+ }
+
+ Sha256HashAll (Buf, BufSize, Hash);
Maybe search for and find the Guid (done in the for loop below) before
calling Sha256HashAll?
Yep; I'll move it just before CompareMem below.

Thanks,
-Dov


Thanks,
Tom

+
+ for (Entry = mHashesTable, Len = 0;
+ Len < (INT32)mHashesTableSize;
+ Len += Entry->Len,
+ Entry = (HASH_TABLE *)((UINT8 *)Entry + Entry->Len)) {
+ UINTN EntrySize;
+ EFI_STATUS Status;
+
+ if (!CompareGuid (&Entry->Guid, Guid)) {
+ continue;
+ }
+
+ DEBUG ((DEBUG_INFO, "%a: Found GUID %g in table\n", __FUNCTION__, Guid));
+
+ //
+ // Verify that the buffer's calculated hash is identical to the expected
+ // hash table entry
+ //
+ EntrySize = Entry->Len - sizeof (Entry->Guid) - sizeof (Entry->Len);
+ if (EntrySize != SHA256_DIGEST_SIZE) {
+ DEBUG ((DEBUG_ERROR, "%a: Hash has the wrong size %d != %d\n",
+ __FUNCTION__, EntrySize, SHA256_DIGEST_SIZE));
+ return EFI_ACCESS_DENIED;
+ }
+
+ if (CompareMem (Entry->Data, Hash, EntrySize) == 0) {
+ Status = EFI_SUCCESS;
+ DEBUG ((DEBUG_INFO, "%a: Hash comparison succeeded for \"%s\"\n",
+ __FUNCTION__, BlobName));
+ } else {
+ Status = EFI_ACCESS_DENIED;
+ DEBUG ((DEBUG_ERROR, "%a: Hash comparison failed for \"%s\"\n",
+ __FUNCTION__, BlobName));
+ }
+ return Status;
+ }
+
+ DEBUG ((DEBUG_ERROR, "%a: Hash GUID %g not found in table\n", __FUNCTION__,
+ Guid));
+ return EFI_ACCESS_DENIED;
+}
+
+/**
+ Locate the SEV hashes table.
+
+ This function always returns success, even if the table can't be found. The
+ subsequent VerifyBlob calls will fail if no table was found.
+
+ @retval RETURN_SUCCESS The verifier tables were set up correctly
+**/
+RETURN_STATUS
+EFIAPI
+SevHashesBlobVerifierLibConstructor (
+ VOID
+ )
+{
+ HASH_TABLE *Ptr = (void *)(UINTN)FixedPcdGet64 (PcdQemuHashTableBase);
+ UINT32 Size = FixedPcdGet32 (PcdQemuHashTableSize);
+
+ mHashesTable = NULL;
+ mHashesTableSize = 0;
+
+ if (Ptr == NULL || Size == 0) {
+ return RETURN_SUCCESS;
+ }
+
+ if (!CompareGuid (&Ptr->Guid, &SEV_HASH_TABLE_GUID)) {
+ return RETURN_SUCCESS;
+ }
+
+ if (Ptr->Len < (sizeof Ptr->Guid + sizeof Ptr->Len)) {
+ return RETURN_SUCCESS;
+ }
+
+ DEBUG ((DEBUG_INFO, "%a: Found injected hashes table in secure location\n",
+ __FUNCTION__));
+
+ mHashesTable = (HASH_TABLE *)Ptr->Data;
+ mHashesTableSize = Ptr->Len - sizeof Ptr->Guid - sizeof Ptr->Len;
+
+ DEBUG ((DEBUG_VERBOSE, "%a: mHashesTable=0x%p, Size=%u\n", __FUNCTION__,
+ mHashesTable, mHashesTableSize));
+
+ return RETURN_SUCCESS;
+}


Re: [PATCH] UefiCpuPkg VTF0 X64: Build page tables using 1-GByte Page Granularity

Dov Murik
 

On 19/07/2021 10:09, Ard Biesheuvel wrote:
On Mon, 19 Jul 2021 at 05:14, Ni, Ray <ray.ni@...> wrote:

This change generates the reset vector binary which only contains 1G page table. If a platform doesn't support 1G page table, this will cause system hang.

To Ard and Jordan,
Can you evaluate whether this change impacts OVMF?
I don't have a clue, sorry, and I wouldn't know where to begin looking.

Brijesh, Dov, James, Erdem: after Laszlo's sudden departure, I will be
needing help reviewing OVMF patches that are highly specific to
SEV/SNP or x86 in general.
Adding Tom too - I think he modified the OVMF reset vector lately and
might know.


Please take a look.

I'm not an expert, but I think that OVMF has its own reset vector in
OvmfPkg/ResetVector, and therefore the changes in uefiCpuPkg will not
affect OVMF.


Regarding the patch itself:

(1) I suggest separating the python tooling changes to one patch,
verifying that the new python scripts generate the same binary files as
the original python scripts. Then add another patch which introduces
the reset vector changes.

(2) Do all x64 CPUs support 1 GB pages? Is it always enabled? Do we need
to check this capability somewhere?


-Dov




To Prince,
Can you evaluate whether this change impacts SimicsOpenBoardPkg?

Thanks,
Ray

-----Original Message-----
From: S, Ashraf Ali <ashraf.ali.s@...>
Sent: Friday, July 2, 2021 8:25 PM
To: devel@edk2.groups.io
Cc: S, Ashraf Ali <ashraf.ali.s@...>; Ni, Ray <ray.ni@...>; Kumar, Rahul1 <rahul1.kumar@...>; De, Debkumar <debkumar.de@...>; Han, Harry <harry.han@...>; West, Catharine <catharine.west@...>; V, Sangeetha <sangeetha.v@...>
Subject: [PATCH] UefiCpuPkg VTF0 X64: Build page tables using 1-GByte Page Granularity

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

X64 Reset Vector Code can access the memory range till 4GB using the Linear-Address Translation to a 2-MByte Page, when user wants to use more than 4G using 2M Page it will leads to use more number of Page table entries. using the 1-GByte Page table user can use more than 4G Memory by reducing the page table entries using 1-GByte Page, this patch attached can access memory range till 512GByte.
Build Scrips for Reset Vector currently based on Python 2 which is already EOL, needs to modify the build script based on Python 3, update the Binary accordingly.

Cc: Ray Ni <ray.ni@...>
Cc: Rahul Kumar <rahul1.kumar@...>
Cc: Debkumar De <debkumar.de@...>
Cc: Harry Han <harry.han@...>
Cc: Catharine West <catharine.west@...>
Cc: Sangeetha V <sangeetha.v@...>
Signed-off-by: Ashraf Ali S <ashraf.ali.s@...>
---
.../Vtf0/Bin/ResetVector.ia32.port80.raw | Bin 516 -> 484 bytes
.../ResetVector/Vtf0/Bin/ResetVector.ia32.raw | Bin 484 -> 468 bytes
.../Vtf0/Bin/ResetVector.ia32.serial.raw | Bin 884 -> 868 bytes
.../Vtf0/Bin/ResetVector.x64.port80.raw | Bin 28676 -> 12292 bytes
.../ResetVector/Vtf0/Bin/ResetVector.x64.raw | Bin 28676 -> 12292 bytes
.../Vtf0/Bin/ResetVector.x64.serial.raw | Bin 28676 -> 12292 bytes
UefiCpuPkg/ResetVector/Vtf0/Build.py | 11 +--
.../ResetVector/Vtf0/Ia32/PageTables64.asm | 2 +-
UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt | 2 +-
.../Vtf0/Tools/FixupForRawSection.py | 4 +-
UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb | 4 +-
.../ResetVector/Vtf0/X64/1GPageTables.asm | 64 ++++++++++++++++++
.../X64/{PageTables.asm => 2MPageTables.asm} | 0
13 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 UefiCpuPkg/ResetVector/Vtf0/X64/1GPageTables.asm
rename UefiCpuPkg/ResetVector/Vtf0/X64/{PageTables.asm => 2MPageTables.asm} (100%)

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.port80.raw
index 2c6ff655ded2a5855ca8f4428d559a7727eb6983..79b23c047bdc6e552d77d5c9e9aeae21ff04d91d 100644 GIT binary patch delta 410
zcmZo+dBQ9-0SF8a=rRZ}FxWCMF#Invo+zYJ-&~=>P<pEKFmr@L>EYMB8#X*^*s&i7
zI*-2o*Lifq#%B#L{TUe;3~zVd>wJ;c9c#dNqsaO-vqO<t>wyxZ<^$|Sx+*`qBE-KP
zRw#MZ?IF_m@c;k+44fxR?lK-MVJf=bP$9%z%Jy2m^*||G=ZV*+3=ec3YyDQrw&BCG
zhLV39>OTT4_yTke(6spG0}_@eiX$2-m<39tfuvB0QMW|nV~~MBTOFDYFc(>?{CR!5
z`2b5=qlIr&sV@Ka2ph)3jn)CK3=F06%+4CG<$;o&htnFZ!=g(0n4LMA4`}djk7m=n
z@tSo9&>Du9B|zggh&^lgwVUBX-))iIZU6Ps_!-61b|^D2IPfbSNPCqzIiFFU^R?Xs
zd4>r<#gi8>%0vL2z`!uOpJBgKz-zAkjsdS((>jm5W_tbeb@R)JfB*l#TmvLJAN+p?
a3S}hl`Z9zAvN|lpjbXxs*L#qpCjbB+6v6TU

delta 442
zcmX9)O-lk%6n)b;mb6f&NEbm;61Fgs7G?G=i3EW`h#0jTXjjt=xN`<_@e*RfKhRH@
zRthehQp<ioAq+%O48GjhrlO+Pox1Q2_nv#+{d#7P9J~e=HbTgQ&;mk;ijh-3kW;e(
z2#|b@Yi!yt8wAow*Da-71;Y*UMJdG%{oGQ>0fSK3#P_%@6n3VVmKY~2sF%gXydlkT
zz2J+}fsf;~_pRoa+J(fR`Ut;~>qat}3#muERkA!QyT~Xg^M>rg%^bM|McBYs`8V0A
zcP&Nw(O;ogKlFmCBIg5bq<OffWLb~o2jr#sf=_+23&RMToIQfL9{47AKyeO;1a)>J
zBhR=?>3OE6Mw4r>-vk>Al5t4>DR50tqp6HM5M^V1To7n?Y1=u`A{@A7c!=ymHGRlZ
zJ}anuVpcRdDYzN0P#%MY-J^!^vR_OvBRp9GvF1f*Ah$29X~lhJI8j|qcKWL;$&ORN
mb+{6FrzA&7=!a5r41gb~Ws5tejhbe+Ol`#xF!g`tAAbQ#M!vED

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.ia32.raw
index e34780a3a2c9b22bd10a1d5a405e344faaff94f3..ce7faa502b858e99908bcdb397b776258205e1d5 100644 GIT binary patch delta 421 zcmaFDe1%zP0uUG;&}9%{V6bIiVEA8TJW)ucz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n_>~T%y|SO&#T1?W(j2HroM8dT6;J?X
zO+L>6re~jL*zXkZns2{jz-!L5&Lb~R`~e2e%P;?5ivNFk_0RwRFIW8q2IYhQ&nCRS
WJpl|r#)O5qF-(~7`Upe>LIMEmI;Oe+

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.port80.raw
index 6c0bcc47ebff84830b59047790c70d96e9488296..835f8ea423437fdd8b33470ca07b5d09e27ef5bf 100644 GIT binary patch literal 12292 zcmeI&+i#oo0mkts4Go129J)fo=$7=rD1$;94uge`K!JtR2m?x1&W9N`jtlni4!~nY
zMKVPp5;sh{V}AhViU1dVP$**DtP&R#RiF&CsHt!04FZH}-n3u#KY(6K@yE_L{>6E&
z?8q}SGc)VwyIqx+a)EMza)EMza)EMza)EMza)EMza)EMza)EMz@AU%z;;$<lUAkFl
z463KNvDDER)G|66gX*QDF{oqcXbfsO9gRWt(a{*xv2-*BwStbuppK)XF{tC|XbkEH
zbTkI_LpmCRI)RSHpiZQtF{lb1jY0L((HPW8bTkIFl8(lpendxOP^;)@4C-V$8iP88
zj>e!?)6p2z03D4%ok~YzP(P-lF{sn%Xbfr%9gRW#gpS6beo9AUP=j<d1~o)SV^C}9
zXbfr{9gRV)r=u~b4RkaHbvhl5LH&%5#-PriqcNzBbTkHaCLN7I{hW@*pw6PBF{rcY
zXbfr-9gRVqLq}s!=hD#_)Mh#wgW5tzV^G6%GzN7Z9gRVqPe)@=7tqld)P;032K5U%
z8iTrsj>e!arlT>aU((SS)Ce7oL0v*eV^CY^XbkFCbTkHaDIJYLjndH=)Ma!u26Z_d
zjX`arqcNx}=x7Y;N;(>Yx{8j*pngq9V^CvsGzN7w9gRU<Lq}s!*V54#)OB<;26a6h
zjY0i}j>e#FprbLUaXK1<x{;2?pngk7V^BBI(HPXtbTkHa3muI?ZKtC#s9Wi13~GXo
z#-M&jM`KVs=x7Y;HaZ%Ex}A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zhciF%)U9W}`f>ODkCWd$Jay`hhev15KkPl9diJ5GpYxPQUUK94M?B#%hkwokE`9X<
zPwsd4!`qIyaO0Wtk9hJ^&))sgN8jbt{SVKce$EHn=>a#LoI2dS;qVbBXAUoRL(IjC
zr?0%}^c8dZr*1xV`pWsqis;jCeRy=2(+@g*MIY|m`}CFl@&_J{zC2EzbtwPsx$$?`
zz2vzcckwOHoWA6qXKr}o!@e92IrH)-9*(&zZpb?w&UWRTx#2Ex-A&i^b#vX#*S+}U
zafkBWQHMkR_nYeQ^lj_5pTa-u*W)(7{=fafc-}id;g(l_-a9?vmOGuf@chFk;pCq$
zo_yBDlT)v{c=6<^x86ML@RC>EaJaec+jCdl=Y?0@=LJ{Y=lNG%n2UdLIMppT-hRGY
SPx9m^JvI){eBb~48~hhX6Rzk0

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw b/UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.x64.serial.raw
index 61c71349a8a599916f3eeae8c5dee92efb56db71..9a24e8a752440462541a9589e514770692a838e4 100644 GIT binary patch literal 12292 zcmeI&No<sL9LDjd3`;?ADxy?DDT|5=+Jc~nO9jQc<AxRYZQQpyqvQUYG{lT(ZQ{Wg
zk6gUT%~}sUrlROY5)WdCrfM_{V;Um~qGHE);A=uhqn`DB5A&J-d^7L7|KId5(@cMV
zfB(GUT21MZP9U8?I)QWo=>*aVq!UOdkWL_-KsteR0_g<O3H+xguz}qrcGmAE1{&3r
z+^KgAG-@0j1C7eiG0>>-bPP0V0v!X5nn=e$qbAWY(5PlQ1{yV)j)6u^p<|#?2hlOm
zsDtSkXw+0X1{!q;9RrQZ(lOAe7CHtRbtoMJjhaTsK%)+$W1vyf=@@9#;dBf%>Igap
z8a0ECfkw5`G0><Z=@@9#QFIJ6Y9<{6jhaQrK%<VPW1vyT&@s@c*>nsvs*R3;M$MsP
zpiy(_7--ZyItCgwpN@e>9ZSbRqmH9vpi#%uG0><5bPP1=1Ud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xo_YVt^@oS|
z9R9?~+uwiX$~`exuAIK*{?j+l>3biz{`4*LZ57d{pMBVR-05eXzPS$%o_hM0e#iO4
z-Zx!yl|1K~Y5VAFw*NPu>jxZ8+LiY1s~6g>m;cwT=R9KT36I!%{N<l{UHrsdZ+qPr
zUiqjqr>}eRnR`C$a6KFj?aVu#beNVK<DPuX;Vf^NM}9E3U2{y&zGnLu9^;vN9v64r
ze^=i%cRg^|TTWhbn5#=qjXJ!?&o3@lC-CZc=zrnA?0X*e>weB}jn}{MWe<MP>p$^j
z58iO*;u}u#y@!kU<R`D3Jo?JXOW%9t%E>M7JAA3bjNX3F;bkBC7rNV@_NLpP_Qu<v
j_J-Rp&Xu=6c;CbCb@e@7{+Tb1OP3z}mY;w3OP78Y>oK+#

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Build.py b/UefiCpuPkg/ResetVector/Vtf0/Build.py
index 343c53b5ff..29f29ff0c2 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Build.py
+++ b/UefiCpuPkg/ResetVector/Vtf0/Build.py
@@ -1,7 +1,7 @@
## @file
# Automate the process of building the various reset vector types # -# Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2021, Intel Corporation. All rights
+reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -32,16 +32,19 @@ for arch in ('ia32', 'x64'):
'-o', output,
'Vtf0.nasmb',
)
+ print(f"Command : {' '.join(commandLine)}")
ret = RunCommand(commandLine)
- print '\tASM\t' + output
- if ret != 0: sys.exit(ret)
+ if ret != 0:
+ print(f"something went wrong while executing the {commandLine[-1]}")
+ sys.exit()
+ print('\tASM\t' + output)

commandLine = (
'python',
'Tools/FixupForRawSection.py',
output,
)
- print '\tFIXUP\t' + output
+ print('\tFIXUP\t' + output)
ret = RunCommand(commandLine)
if ret != 0: sys.exit(ret)

diff --git a/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm b/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm
index 87a4125d4b..9cc6f56c17 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm
+++ b/UefiCpuPkg/ResetVector/Vtf0/Ia32/PageTables64.asm
@@ -15,7 +15,7 @@ BITS 32
SetCr3ForPageTables64:

;
- ; These pages are built into the ROM image in X64/PageTables.asm
+ ; These pages are built into the ROM image in X64/1GPageTables.asm
;
mov eax, ADDR_OF(TopLevelPageDirectory)
mov cr3, eax
diff --git a/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt b/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt
index e6e5b54243..eb9dd24ee2 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt
+++ b/UefiCpuPkg/ResetVector/Vtf0/ReadMe.txt
@@ -29,7 +29,7 @@ EBP/RBP - Pointer to the start of the Boot Firmware Volume === HOW TO BUILD VTF0 ===

Dependencies:
-* Python 2.5~2.7
+* Python 3.0 or newer
* Nasm 2.03 or newer

To rebuild the VTF0 binaries:
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py b/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
index c77438a0ce..de771eba22 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
+++ b/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py
@@ -1,7 +1,7 @@
## @file
# Apply fixup to VTF binary image for FFS Raw section # -# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2021, Intel Corporation. All rights
+reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -15,6 +15,6 @@ c = ((len(d) + 4 + 7) & ~7) - 4 if c > len(d):
c -= len(d)
f = open(sys.argv[1], 'wb')
- f.write('\x90' * c)
+ f.write(b'\x90' * c)
f.write(d)
f.close()
diff --git a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb
index 493738c79c..0625efc456 100644
--- a/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb
+++ b/UefiCpuPkg/ResetVector/Vtf0/Vtf0.nasmb
@@ -2,7 +2,7 @@
; @file
; This file includes all other code files to assemble the reset vector code ; -; Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2008 - 2021, Intel Corporation. All rights
+reserved.<BR>
; SPDX-License-Identifier: BSD-2-Clause-Patent ;
;------------------------------------------------------------------------------
@@ -36,7 +36,7 @@
%include "PostCodes.inc"

%ifdef ARCH_X64
-%include "X64/PageTables.asm"
+%include "X64/1GPageTables.asm"
%endif

%ifdef DEBUG_PORT80
diff --git a/UefiCpuPkg/ResetVector/Vtf0/X64/1GPageTables.asm b/UefiCpuPkg/ResetVector/Vtf0/X64/1GPageTables.asm
new file mode 100644
index 0000000000..8ae6c4c98c
--- /dev/null
+++ b/UefiCpuPkg/ResetVector/Vtf0/X64/1GPageTables.asm
@@ -0,0 +1,64 @@
+;----------------------------------------------------------------------
+--------
+; @file
+; Emits Page Tables for 1:1 mapping of the addresses 0 - 0x8000000000
+(512GB) ; ; Copyright (c) 2021, Intel Corporation. All rights
+reserved.<BR> ; SPDX-License-Identifier: BSD-2-Clause-Patent ;
+Linear-Address Translation to a 1-GByte Page ;
+;----------------------------------------------------------------------
+--------
+
+BITS 64
+
+%define ALIGN_TOP_TO_4K_FOR_PAGING
+
+%define PAGE_PRESENT 0x01
+%define PAGE_READ_WRITE 0x02
+%define PAGE_USER_SUPERVISOR 0x04
+%define PAGE_WRITE_THROUGH 0x08
+%define PAGE_CACHE_DISABLE 0x010
+%define PAGE_ACCESSED 0x020
+%define PAGE_DIRTY 0x040
+%define PAGE_PAT 0x080
+%define PAGE_GLOBAL 0x0100
+%define PAGE_1G 0x80
+
+%define PAGE_PDP_ATTR (PAGE_ACCESSED + \
+ PAGE_READ_WRITE + \
+ PAGE_PRESENT)
+
+%define PAGE_PDP_1G_ATTR (PAGE_ACCESSED + \
+ PAGE_READ_WRITE + \
+ PAGE_PRESENT + \
+ PAGE_1G)
+
+%define PGTBLS_OFFSET(x) ((x) - TopLevelPageDirectory) %define
+PGTBLS_ADDR(x) (ADDR_OF(TopLevelPageDirectory) + (x))
+
+%define PDP(offset) (ADDR_OF(TopLevelPageDirectory) + (offset) + \
+ PAGE_PDP_ATTR)
+
+%define PDP_1G(x) ((x << 30) + PAGE_PDP_1G_ATTR)
+
+ALIGN 16
+
+TopLevelPageDirectory:
+
+ ;
+ ; Top level Page Directory Pointers (1 * 512GB entry)
+ ;
+ DQ PDP(0x1000)
+
+
+ TIMES 0x1000-PGTBLS_OFFSET($) DB 0
+ ;
+ ; Next level Page Directory Pointers (512 * 1GB entries => 512GB)
+ ;
+%assign i 0
+%rep 512
+ DQ PDP_1G(i)
+ %assign i i+1
+%endrep
+
+
+EndOfPageTables:
diff --git a/UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm b/UefiCpuPkg/ResetVector/Vtf0/X64/2MPageTables.asm
similarity index 100%
rename from UefiCpuPkg/ResetVector/Vtf0/X64/PageTables.asm
rename to UefiCpuPkg/ResetVector/Vtf0/X64/2MPageTables.asm
--
2.32.0.windows.1

19041 - 19060 of 96907