Re: [edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.

2024-03-21 Thread Dionna Glaze via groups.io
On Thu, Mar 21, 2024 at 9:59 AM qinkun Bao wrote: > > From: Qinkun Bao > > The UEFI v2.10 spec defines the protocol EFI_CC_MEASUREMENT_PROTOCOL > to enable (for example) RTMR-based boot measurement for TDX VMs. > With the current UEFI spec’s “should not” wording and EDK2 > implementation, TPM mea

Re: [edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.

2024-03-22 Thread Dionna Glaze via groups.io
On Fri, Mar 22, 2024 at 1:52 AM Gerd Hoffmann wrote: > > On Fri, Mar 22, 2024 at 02:39:20AM +, Yao, Jiewen wrote: > > Please aware that this option will cause potential security risk. > > > > In case that any the guest component only knows one of vTPM or RTMR, > > and only extends one of vTPM

Re: [edk2-devel] [RFC PATCH] OvmfPkg/SecurityPkg: Add build option for coexistance of vTPM and RTMR.

2024-03-25 Thread Dionna Glaze via groups.io
On Mon, Mar 25, 2024 at 6:07 AM Mikko Ylinen wrote: > > > > > > > Looking at systemd-boot I see it will likewise not measure to both RTMR > > > and vTPM, but with reversed priority (use vTPM not RTMR in case both are > > > present). > > > > > > > Interesting. Thanks for this report. We'll push for

[edk2-devel] [PATCH 0/3] TCG_Sp800_155_PlatformId_Event3 support

2024-04-30 Thread Dionna Glaze via groups.io
In December 2023, the TCG published the PC Client Platform Firmware Profile version 1.06 revision 52. This revision includes a new event type for NIST SP 800-155 recommended signed BIOS reference measurements. The new type allows for the event log auditor to find local or remote copies of the signe

[edk2-devel] [PATCH 1/3] MdePkg: Add TcgSp800155Event3 type info

2024-04-30 Thread Dionna Glaze via groups.io
TCG PC Client Platform Firmware Profile 1.06 revision 52 of December 2023 added a new event signature and extended information about where a reference measurement document for the firmware can be found. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Dionna Glaze --- MdeP

[edk2-devel] [PATCH 2/3] SecurityPkg: recognize sp800155Event3 event too

2024-04-30 Thread Dionna Glaze via groups.io
The signatures for event2 or event3 are now valid TCG SP800155 event types. Cc: Jiewen Yao Cc: Rahul Kumar Signed-off-by: Dionna Glaze --- SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/Securi

[edk2-devel] [PATCH 3/3] OvmfPkg: add sp800155Event3 support

2024-04-30 Thread Dionna Glaze via groups.io
The signatures for event2 or event3 are now valid TCG SP800155 event types. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Signed-off-by: Dionna Glaze --- OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/Tcg/TdTcg2Dxe

[edk2-devel] [PATCH v2 0/3] TCG_Sp800_155_PlatformId_Event3 support

2024-05-01 Thread Dionna Glaze via groups.io
In December 2023, the TCG published the PC Client Platform Firmware Profile version 1.06 revision 52. This revision includes a new event type for NIST SP 800-155 recommended signed BIOS reference measurements. The new type allows for the event log auditor to find local or remote copies of the signe

[edk2-devel] [PATCH v2 1/3] MdePkg: Add TcgSp800155Event3 type info

2024-05-01 Thread Dionna Glaze via groups.io
TCG PC Client Platform Firmware Profile 1.06 revision 52 of December 2023 added a new event signature and extended information about where a reference measurement document for the firmware can be found. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Dionna Glaze --- .../

[edk2-devel] [PATCH v2 2/3] SecurityPkg: recognize sp800155Event3 event too

2024-05-01 Thread Dionna Glaze via groups.io
The signatures for event2 or event3 are now valid TCG SP800155 event types. Cc: Jiewen Yao Cc: Rahul Kumar Reviewed-by: Jiewen Yao Signed-off-by: Dionna Glaze --- SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SecurityPkg/Tcg/Tc

[edk2-devel] [PATCH v2 3/3] OvmfPkg: add sp800155Event3 support

2024-05-01 Thread Dionna Glaze via groups.io
The signatures for event2 or event3 are now valid TCG SP800155 event types. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Dionna Glaze --- OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --gi

Re: [edk2-devel] Proposal to switch TianoCore Code Review from email to GitHub Pull Requests on 5-24-2024

2024-05-01 Thread Dionna Glaze via groups.io
On Wed, May 1, 2024 at 11:12 AM Leif Lindholm via groups.io wrote: > > On 2024-05-01 18:43, Michael D Kinney wrote: > > Hello, > > > > I would like to propose that TianoCore move all code review from email > > based code reviews to GitHub Pull Requests based code reviews. > > > > The proposed date

[edk2-devel] [PATCH v3 1/3] MdePkg: Add TcgSp800155Event3 type info

2024-05-01 Thread Dionna Glaze via groups.io
TCG PC Client Platform Firmware Profile 1.06 revision 52 of December 2023 added a new event signature and extended information about where a reference measurement document for the firmware can be found. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Reviewed-By: Jiewen Yao Signed-off-by

[edk2-devel] [PATCH v3 0/3] TCG_Sp800_155_PlatformId_Event3 support

2024-05-01 Thread Dionna Glaze via groups.io
In December 2023, the TCG published the PC Client Platform Firmware Profile version 1.06 revision 52. This revision includes a new event type for NIST SP 800-155 recommended signed BIOS reference measurements. The new type allows for the event log auditor to find local or remote copies of the signe

[edk2-devel] [PATCH v3 2/3] SecurityPkg: recognize sp800155Event3 event too

2024-05-01 Thread Dionna Glaze via groups.io
The signatures for event2 or event3 are now valid TCG SP800155 event types. Cc: Jiewen Yao Cc: Rahul Kumar Reviewed-by: Jiewen Yao Signed-off-by: Dionna Glaze --- SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SecurityPkg/Tcg/Tc

[edk2-devel] [PATCH v3 3/3] OvmfPkg: add sp800155Event3 support

2024-05-01 Thread Dionna Glaze via groups.io
The signatures for event2 or event3 are now valid TCG SP800155 event types. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Dionna Glaze --- OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --gi

Re: [edk2-devel] Proposal to switch TianoCore Code Review from email to GitHub Pull Requests on 5-24-2024

2024-05-02 Thread Dionna Glaze via groups.io
On Thu, May 2, 2024 at 8:59 AM Brian J. Johnson wrote: > > On 5/1/24 18:19, Dionna Glaze via groups.io wrote: > > On Wed, May 1, 2024 at 11:12 AM Leif Lindholm via groups.io > > wrote: > >> > >> On 2024-05-01 18:43, Michael D Kinney wrote: > >>>

Re: [edk2-devel] [PATCH v3 0/3] TCG_Sp800_155_PlatformId_Event3 support

2024-05-06 Thread Dionna Glaze via groups.io
I had not passed some tests, apologies. I fixed the spacing issue and build failure with too many )s in https://github.com/tianocore/edk2/pull/5615. Shall I email a v4? On Sun, May 5, 2024 at 8:28 PM Yao, Jiewen wrote: > > Hi Dionna > I tried to create PR but I saw failure - > https://github.com

[edk2-devel] [PATCH v4 0/3] TCG_Sp800_155_PlatformId_Event3 support

2024-05-06 Thread Dionna Glaze via groups.io
In December 2023, the TCG published the PC Client Platform Firmware Profile version 1.06 revision 52. This revision includes a new event type for NIST SP 800-155 recommended signed BIOS reference measurements. The new type allows for the event log auditor to find local or remote copies of the signe

[edk2-devel] [PATCH v4 1/3] MdePkg: Add TcgSp800155Event3 type info

2024-05-06 Thread Dionna Glaze via groups.io
TCG PC Client Platform Firmware Profile 1.06 revision 52 of December 2023 added a new event signature and extended information about where a reference measurement document for the firmware can be found. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Reviewed-by: Jiewen Yao Signed-off-by

[edk2-devel] [PATCH v4 2/3] SecurityPkg: Recognize sp800155Event3 event

2024-05-06 Thread Dionna Glaze via groups.io
The signatures for event2 or event3 are now valid TCG SP800155 event types. Fixes uncrustify formatting. Cc: Jiewen Yao Cc: Rahul Kumar Reviewed-by: Jiewen Yao Signed-off-by: Dionna Glaze --- SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletion

[edk2-devel] [PATCH v4 3/3] OvmfPkg: Add sp800155Event3 support

2024-05-06 Thread Dionna Glaze via groups.io
The signatures for event2 or event3 are now valid TCG SP800155 event types. Fixes uncrustify formatting. Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Dionna Glaze --- OvmfPkg/Tcg/TdTcg2Dxe/TdTcg2Dxe.c | 15 ++- 1 file changed, 10 ins

Re: [edk2-devel] [PATCH 00/14] Introduce Lazy-accept for Tdx guest

2022-09-22 Thread Dionna Glaze via groups.io
I have a working stack with proposal 5. I was using a version of grub that didn't use Linux's EFI handover protocol, and I wasn't signalling the unaccepted memory behavior at the right place (before EBS). Many thanks to everyone who contributed to this discussion and brought some creative ideas to

[edk2-devel] [PATCH 0/3] Add safe unaccepted memory behavior

2022-09-22 Thread Dionna Glaze via groups.io
These three patches build on the lazy-accept patch series "Introduce Lazy-accept for Tdx guest" by adding SEV-SNP support for the MemoryAccept protocol, and importantly making eager memory acceptance the default behavior. For unaccepted memory to be enabled, we must know that the booted image su

[edk2-devel] [PATCH 1/3] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-09-22 Thread Dionna Glaze via groups.io
From: Sophia Wolf When a guest OS does not support unaccepted memory, the unaccepted memory must be accepted before returning a memory map to the caller. EfiMemoryAcceptProtocol is defined in MdePkg and is implementated / Installed in AmdSevDxe for AMD SEV-SNP memory acceptance. Cc: Gerd Hoffma

[edk2-devel] [PATCH 2/3] DxeMain accepts all memory at EBS if needed

2022-09-22 Thread Dionna Glaze via groups.io
With the addition of the EfiUnacceptedMemory memory type, it is possible the EFI-enlightened guests do not themselves support the new memory type. This commit adds a dynamic Pcd that can be set to enable unaccepted memory support before ExitBootServices is called. The expected usage is to set the

[edk2-devel] [PATCH 3/3] MdeModulePkg: add EnableUnacceptedMemoryProtocol

2022-09-22 Thread Dionna Glaze via groups.io
Add a simple protocol that enables the use of the unaccepted memory type. Must be called before ExitBootServices to be effective. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Signed-off-by: Dionna Glaze --- MdeModulePkg/Core/Dxe/DxeMain.h

Re: [edk2-devel] [PATCH 0/3] Add safe unaccepted memory behavior

2022-09-23 Thread Dionna Glaze via groups.io
Ah yes, I did forget to include that patch. Will add to v2. I was just setting the ResourceType to unaccepted and skipping the Prevalidate call in PlatformPei if the start address is greater or equal to SIZE_4GB. That seemed more self-contained than messing with PlatformInitLib. Would you prefer th

[edk2-devel] [PATCHv2 0/4] Add safe unaccepted memory behavior

2022-09-23 Thread Dionna Glaze via groups.io
These three patches build on the lazy-accept patch series "Introduce Lazy-accept for Tdx guest" by adding SEV-SNP support for the MemoryAccept protocol, and importantly making eager memory acceptance the default behavior. For unaccepted memory to be enabled, we must know that the booted image su

[edk2-devel] [PATCH 1/4] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-09-23 Thread Dionna Glaze via groups.io
From: Sophia Wolf When a guest OS does not support unaccepted memory, the unaccepted memory must be accepted before returning a memory map to the caller. EfiMemoryAcceptProtocol is defined in MdePkg and is implementated / Installed in AmdSevDxe for AMD SEV-SNP memory acceptance. Cc: Gerd Hoffma

[edk2-devel] [PATCH 2/4] DxeMain accepts all memory at EBS if needed

2022-09-23 Thread Dionna Glaze via groups.io
With the addition of the EfiUnacceptedMemory memory type, it is possible the EFI-enlightened guests do not themselves support the new memory type. This commit adds a dynamic Pcd that can be set to enable unaccepted memory support before ExitBootServices is called. The expected usage is to set the

[edk2-devel] [PATCHv2 3/4] MdeModulePkg: add EnableUnacceptedMemoryProtocol

2022-09-23 Thread Dionna Glaze via groups.io
Add a simple protocol that enables the use of the unaccepted memory type. Must be called before ExitBootServices to be effective. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Signed-off-by: Dionna Glaze --- MdeModulePkg/Core/Dxe/DxeMain.h

[edk2-devel] [PATCHv2 4/4] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted

2022-09-23 Thread Dionna Glaze via groups.io
Instead of eagerly accepting all memory in PEI, only accept memory under the 4GB address. This allows a loaded image to use the ENABLE_UNACCEPTED_MEMORY_PROTOCOL to indicate that it can interpret the memory type accordingly. This classification is safe since ExitBootServices will accept and reclas

Re: [edk2-devel] [PATCH 1/4] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-09-26 Thread Dionna Glaze via groups.io
> > Shouldn't this have a v2 in the subject (same goes for patch 2/4)? > Yes. I'm upset that didn't happen. I used --subject="PATCHv2" in git send-email, and editing the cover letter showed that all the other emails would have PATCHv2 in the subject. Then I said to send the emails and saw "PATCH "

[edk2-devel] [PATCH v3 0/4] Add safe unaccepted memory behavior

2022-09-26 Thread Dionna Glaze via groups.io
These three patches build on the lazy-accept patch series "Introduce Lazy-accept for Tdx guest" by adding SEV-SNP support for the MemoryAccept protocol, and importantly making eager memory acceptance the default behavior. For unaccepted memory to be enabled, we must know that the booted image su

[edk2-devel] [PATCH v3 2/4] DxeMain accepts all memory at EBS if needed

2022-09-26 Thread Dionna Glaze via groups.io
With the addition of the EfiUnacceptedMemory memory type, it is possible the EFI-enlightened guests do not themselves support the new memory type. This commit adds a dynamic Pcd that can be set to enable unaccepted memory support before ExitBootServices is called. The expected usage is to set the

[edk2-devel] [PATCH v3 1/4] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-09-26 Thread Dionna Glaze via groups.io
From: Sophia Wolf When a guest OS does not support unaccepted memory, the unaccepted memory must be accepted before returning a memory map to the caller. EfiMemoryAcceptProtocol is defined in MdePkg and is implemented / Installed in AmdSevDxe for AMD SEV-SNP memory acceptance. Cc: Gerd Hoffmann

[edk2-devel] [PATCH v3 3/4] MdeModulePkg: add EnableUnacceptedMemoryProtocol

2022-09-26 Thread Dionna Glaze via groups.io
Add a simple protocol that enables the use of the unaccepted memory type. Must be called before ExitBootServices to be effective. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Signed-off-by: Dionna Glaze --- MdeModulePkg/Core/Dxe/DxeMain.h

[edk2-devel] [PATCH v3 4/4] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted

2022-09-26 Thread Dionna Glaze via groups.io
Instead of eagerly accepting all memory in PEI, only accept memory under the 4GB address. This allows a loaded image to use the ENABLE_UNACCEPTED_MEMORY_PROTOCOL to indicate that it can interpret the memory type accordingly. This classification is safe since ExitBootServices will accept and reclas

[edk2-devel] [PATCH v4 0/6] Add safe unaccepted memory behavior

2022-09-28 Thread Dionna Glaze via groups.io
These three patches build on the lazy-accept patch series "Introduce Lazy-accept for Tdx guest" by adding SEV-SNP support for the MemoryAccept protocol, and importantly making eager memory acceptance the default behavior. For unaccepted memory to be enabled, we must know that the booted image su

[edk2-devel] [PATCH v4 2/6] MdeModulePkg: Add PcdEnableUnacceptedMemory

2022-09-28 Thread Dionna Glaze via groups.io
This Pcd is used to toggle whether ExitBootServices should not accept all unaccepted memory. It's the loaded image's responsibility to enable support so that it doesn't get memory types it doesn't understand in its memory map. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendack

[edk2-devel] [PATCH v4 3/6] OvmfPkg: set PcdEnableUnacceptedMemory to FALSE

2022-09-28 Thread Dionna Glaze via groups.io
The default value of PcdEnableUnacceptedMemory should be FALSE in order for default safe behavior. If the next started image does not yet understand UEFI v2.9's new memory type, then it's stuck with most of its memory inaccessible. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Le

[edk2-devel] [PATCH v4 1/6] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-09-28 Thread Dionna Glaze via groups.io
From: Sophia Wolf When a guest OS does not support unaccepted memory, the unaccepted memory must be accepted before returning a memory map to the caller. EfiMemoryAcceptProtocol is defined in MdePkg and is implemented / Installed in AmdSevDxe for AMD SEV-SNP memory acceptance. Cc: Gerd Hoffmann

[edk2-devel] [PATCH v4 4/6] MdeModulePkg: DxeMain accepts all memory at EBS if needed

2022-09-28 Thread Dionna Glaze via groups.io
With the addition of the EfiUnacceptedMemory memory type, it is possible the EFI-enlightened guests do not themselves support the new memory type. This commit uses the new PcdEnableUnacceptedMemory to enable unaccepted memory support before ExitBootServices is called by not accepting all unaccepted

[edk2-devel] [PATCH v4 5/6] MdeModulePkg: add EnableUnacceptedMemoryProtocol

2022-09-28 Thread Dionna Glaze via groups.io
Add a simple protocol that enables the use of the unaccepted memory type. Must be called before ExitBootServices to be effective. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Signed-off-by: Dionna Glaze --- MdeModulePkg/Core/Dxe/DxeMain.h

[edk2-devel] [PATCH v4 6/6] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted

2022-09-28 Thread Dionna Glaze via groups.io
Instead of eagerly accepting all memory in PEI, only accept memory under the 4GB address. This allows a loaded image to use the ENABLE_UNACCEPTED_MEMORY_PROTOCOL to indicate that it can interpret the memory type accordingly. This classification is safe since ExitBootServices will accept and reclas

Re: [edk2-devel] [PATCH v4 4/6] MdeModulePkg: DxeMain accepts all memory at EBS if needed

2022-09-29 Thread Dionna Glaze via groups.io
> > Can you explain a bit more why this PCD is needed? > I'll expand the comment further, but essentially we need a bit in the firmware to persist from a call into a protocol to the eventual call to ExitBootServices. If we needed offline persistence, then we'd need to standardize a new bit in the

Re: [edk2-devel] [PATCH v4 2/6] MdeModulePkg: Add PcdEnableUnacceptedMemory

2022-09-29 Thread Dionna Glaze via groups.io
> The name PcdEnableUnacceptedMemory is a bit confusing imho. Could we > rename this to PcdAcceptAllUnacceptedMemory or something like that? > Will do. Is the protocol name EnableUnacceptedMemory still acceptable now that it's setting an AcceptAllUnacceptedMemory value to FALSE? -- -Dionna Glaze

Re: [edk2-devel] [PATCH v4 3/6] OvmfPkg: set PcdEnableUnacceptedMemory to FALSE

2022-09-29 Thread Dionna Glaze via groups.io
> Generally, we tend to rely on the DEC default for new PCDs if we're > not deviating from it. > If there is no specific reason to deviate from this here, I think we > can drop this patch. > > Or is this also needed to declare them as the right type? In that > case, I think you can drop the hunks t

Re: [edk2-devel] [PATCH v4 1/6] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-09-30 Thread Dionna Glaze via groups.io
> > +{ > > + MemEncryptSevSnpPreValidateSystemRam ( > > +StartAddress, > > +EFI_SIZE_TO_PAGES (Size) > > Sorry, I forgot to ask this earlier in the series, but is StartAddress > guaranteed to be page-aligned and Size a multiple of 4KB? Should there be > any asserts for those just in case?

[edk2-devel] [PATCH v5 1/7] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-09-30 Thread Dionna Glaze via groups.io
From: Sophia Wolf When a guest OS does not support unaccepted memory, the unaccepted memory must be accepted before returning a memory map to the caller. EfiMemoryAcceptProtocol is defined in MdePkg and is implemented / Installed in AmdSevDxe for AMD SEV-SNP memory acceptance. Cc: Gerd Hoffmann

[edk2-devel] [PATCH v5 2/7] MdePkg: Introduce ExitBootServicesCallbackProtocol

2022-09-30 Thread Dionna Glaze via groups.io
This introduces a callback after the time that the timer is disabled and before the MemoryMap is finalized. This callback is useful to make final changes to the memory map due to protocols initiated (or not initiated) by the OS loader. Cc: Gerd Hoffmann Cc: "Min M. Xu" Cc: James Bottomley Cc:

[edk2-devel] [PATCH v5 0/7] Add safe unaccepted memory behavior

2022-09-30 Thread Dionna Glaze via groups.io
These seven patches build on the lazy-accept patch series "Introduce Lazy-accept for Tdx guest" by adding SEV-SNP support for the MemoryAccept protocol, and importantly making eager memory acceptance the default behavior. We add a new protocol, ExitBootServicesCallbackProtocol, with a single int

[edk2-devel] [PATCH v5 3/7] MdeModulePkg: Invoke all ExitBootServicesCallback instances at ExitBootServices

2022-09-30 Thread Dionna Glaze via groups.io
The protocol's intent is to allow drivers to install callbacks that can modify the memory map at ExitBootServices time, so that any changes will lead to the EFI_INVALID_PARAMETER error. This error is specified to require the EBS caller to call GetMemoryMap again if it already had. Cc: Gerd Hoffman

[edk2-devel] [PATCH v5 4/7] OvmfPkg: Introduce CocoDxe driver

2022-09-30 Thread Dionna Glaze via groups.io
This driver is meant as a join point for all Confidential Compute technologies to put shared behavior that doesn't belong anywhere else. The first behavior added here is to accept all unaccepted memory at ExitBootServices if the protocol is not disabled. This allows safe upgrades for OS loaders to

[edk2-devel] [PATCH v5 5/7] MdePkg: Introduce the AcceptAllUnacceptedMemory protocol

2022-09-30 Thread Dionna Glaze via groups.io
The default behavior for unaccepted memory is to accept all memory when ExitBootServices is called. An OS loader can use this protocol to Disable this behavior to assume responsibility for memory acceptance and to affirm that the OS can handle the unaccepted memory type. This is a candidate for st

[edk2-devel] [PATCH v5 6/7] OvmfPkg: Implement AcceptAllUnacceptedMemory in CocoDxe

2022-09-30 Thread Dionna Glaze via groups.io
This protocol implementation disables the accept-all-memory behavior of the ExitBootServicesCallback instance thise driver adds. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: "Min M. Xu" Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by:

[edk2-devel] [PATCH v5 7/7] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted

2022-09-30 Thread Dionna Glaze via groups.io
Instead of eagerly accepting all memory in PEI, only accept memory under the 4GB address. This allows a loaded image to use the ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL to disable the accept behavior and indicate that it can interpret the memory type accordingly. This classification is safe since Exi

Re: [edk2-devel] [PATCH v5 2/7] MdePkg: Introduce ExitBootServicesCallbackProtocol

2022-10-02 Thread Dionna Glaze via groups.io
> > Is it defined by UEFI Spec? > It is not. This is Ard's suggested solution https://patchew.org/EDK2/20220928153323.2583389-1-dionnagl...@google.com/20220928153323.2583389-5-dionnagl...@google.com/#camj1kxfwbu9oiulufxsrqhag1pf+yu2dl4jbuz2lo0k9uue...@mail.gmail.com -- -Dionna Glaze, PhD (she/he

Re: [edk2-devel] Can NULL pointer be a valid event?

2022-10-03 Thread Dionna Glaze via groups.io
CreateEvent returns an EFI_STATUS. It expects the OUT parameter, a pointer to an EFI_EVENT, to be non-NULL. A null pointer results in EFI_INVALID_PARAMETER. If the CreateEvent is successful, then `event` points to the newly created event. It's the caller's responsibility to pass a pointer to valid

Re: [edk2-devel] [PATCH v5 2/7] MdePkg: Introduce ExitBootServicesCallbackProtocol

2022-10-03 Thread Dionna Glaze via groups.io
> > What Ray is getting to (I think) is that that means that it should be > defined in MdeModulePkg not MdePkg. Oh, MemoryAcceptProtocol is also not specified AFAICT, so I thought this is where it would go. I can move it. -- -Dionna Glaze, PhD (she/her) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links:

[edk2-devel] [PATCH v6 0/7] Add safe unaccepted memory behavior

2022-10-03 Thread Dionna Glaze via groups.io
These seven patches build on the lazy-accept patch series "Introduce Lazy-accept for Tdx guest" by adding SEV-SNP support for the MemoryAccept protocol, and importantly making eager memory acceptance the default behavior. We add a new protocol, ExitBootServicesCallbackProtocol, with a single int

[edk2-devel] [PATCH v6 1/7] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-10-03 Thread Dionna Glaze via groups.io
From: Sophia Wolf When a guest OS does not support unaccepted memory, the unaccepted memory must be accepted before returning a memory map to the caller. EfiMemoryAcceptProtocol is defined in MdePkg and is implemented / Installed in AmdSevDxe for AMD SEV-SNP memory acceptance. Cc: Gerd Hoffmann

[edk2-devel] [PATCH v6 2/7] MdeModulePkg: Introduce ExitBootServicesCallbackProtocol

2022-10-03 Thread Dionna Glaze via groups.io
This introduces a callback after the time that the timer is disabled and before the MemoryMap is finalized. This callback is useful to make final changes to the memory map due to protocols initiated (or not initiated) by the OS loader. Cc: Gerd Hoffmann Cc: "Min M. Xu" Cc: James Bottomley Cc:

[edk2-devel] [PATCH v6 3/7] MdeModulePkg: Invoke all ExitBootServicesCallback instances at ExitBootServices

2022-10-03 Thread Dionna Glaze via groups.io
The protocol's intent is to allow drivers to install callbacks that can modify the memory map at ExitBootServices time, so that any changes will lead to the EFI_INVALID_PARAMETER error. This error is specified to require the EBS caller to call GetMemoryMap again if it already had. Cc: Gerd Hoffman

[edk2-devel] [PATCH v6 4/7] OvmfPkg: Introduce CocoDxe driver

2022-10-03 Thread Dionna Glaze via groups.io
This driver is meant as a join point for all Confidential Compute technologies to put shared behavior that doesn't belong anywhere else. The first behavior added here is to accept all unaccepted memory at ExitBootServices if the protocol is not disabled. This allows safe upgrades for OS loaders to

[edk2-devel] [PATCH v6 5/7] MdePkg: Introduce the AcceptAllUnacceptedMemory protocol

2022-10-03 Thread Dionna Glaze via groups.io
The default behavior for unaccepted memory is to accept all memory when ExitBootServices is called. An OS loader can use this protocol to Disable this behavior to assume responsibility for memory acceptance and to affirm that the OS can handle the unaccepted memory type. This is a candidate for st

[edk2-devel] [PATCH v6 6/7] OvmfPkg: Implement AcceptAllUnacceptedMemory in CocoDxe

2022-10-03 Thread Dionna Glaze via groups.io
This protocol implementation disables the accept-all-memory behavior of the ExitBootServicesCallback instance thise driver adds. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: "Min M. Xu" Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by:

[edk2-devel] [PATCH v6 7/7] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted

2022-10-03 Thread Dionna Glaze via groups.io
Instead of eagerly accepting all memory in PEI, only accept memory under the 4GB address. This allows a loaded image to use the ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL to disable the accept behavior and indicate that it can interpret the memory type accordingly. This classification is safe since Exi

Re: [edk2-devel] [PATCH v5 2/7] MdePkg: Introduce ExitBootServicesCallbackProtocol

2022-10-05 Thread Dionna Glaze via groups.io
Thanks Felix, this is great! I'll change the implementation to just be this specified thing. On Wed, Oct 5, 2022 at 9:20 AM Felix Polyudov wrote: > > > On Mon, 3 Oct 2022 at 03:16, Dionna Amalie Glaze > > wrote: > > > > > > > > > > > Is it defined by UEFI Spec? > > > > > > > > > > It is not. Thi

[edk2-devel] [PATCH v7 0/7] Add safe unaccepted memory behavior

2022-10-05 Thread Dionna Glaze via groups.io
These seven patches build on the lazy-accept patch series "Introduce Lazy-accept for Tdx guest" by adding SEV-SNP support for the MemoryAccept protocol, and importantly making eager memory acceptance the default behavior. We implement a standardized event group from UEFI v2.9, EFI_EVENT_GROUP_BE

[edk2-devel] [PATCH v7 1/7] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-10-05 Thread Dionna Glaze via groups.io
From: Sophia Wolf When a guest OS does not support unaccepted memory, the unaccepted memory must be accepted before returning a memory map to the caller. EfiMemoryAcceptProtocol is defined in MdePkg and is implemented / Installed in AmdSevDxe for AMD SEV-SNP memory acceptance. Cc: Gerd Hoffmann

[edk2-devel] [PATCH v7 2/7] MdePkg: Add EFI_EVENT_BEFORE_EXIT_BOOT_SERVICES_GUID

2022-10-05 Thread Dionna Glaze via groups.io
Event group as defined in UEFI standard v2.9. Cc: Ard Biescheuvel Cc: "Min M. Xu" Cc: Gerd Hoffmann Cc: James Bottomley Cc: Tom Lendacky Cc: Jiewen Yao Cc: Erdem Aktas Signed-off-by: Dionna Glaze --- MdePkg/Include/Guid/EventGroup.h | 5 + MdePkg/MdePkg.dec| 5 -

[edk2-devel] [PATCH v7 3/7] MdeModulePkg: Notify BeforeExitBootServices in CoreExitBootServices

2022-10-05 Thread Dionna Glaze via groups.io
Location of notification is has been specified in UEFI v2.9. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: "Min M. Xu" Cc: Andrew Fish Cc: "Michael D. Kinney" Cc: Ray Ni Signed-off-by: Dionna Glaze --- MdeModulePkg/Core/Dxe/DxeMain.inf

[edk2-devel] [PATCH v7 5/7] MdePkg: Introduce the AcceptAllUnacceptedMemory protocol

2022-10-05 Thread Dionna Glaze via groups.io
The default behavior for unaccepted memory is to accept all memory when ExitBootServices is called. An OS loader can use this protocol to Disable this behavior to assume responsibility for memory acceptance and to affirm that the OS can handle the unaccepted memory type. This is a candidate for st

[edk2-devel] [PATCH v7 6/7] OvmfPkg: Implement AcceptAllUnacceptedMemory in CocoDxe

2022-10-05 Thread Dionna Glaze via groups.io
This protocol implementation disables the accept-all-memory behavior of the BeforeExitBootServices event this driver adds. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: "Min M. Xu" Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by: Dionna

[edk2-devel] [PATCH v7 4/7] OvmfPkg: Introduce CocoDxe driver

2022-10-05 Thread Dionna Glaze via groups.io
This driver is meant as a join point for all Confidential Compute technologies to put shared behavior that doesn't belong anywhere else. The first behavior added here is to accept all unaccepted memory at ExitBootServices if the behavior is not disabled. This allows safe upgrades for OS loaders to

[edk2-devel] [PATCH v7 7/7] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted

2022-10-05 Thread Dionna Glaze via groups.io
Instead of eagerly accepting all memory in PEI, only accept memory under the 4GB address. This allows a loaded image to use the ACCEPT_ALL_UNACCEPTED_MEMORY_PROTOCOL to disable the accept behavior and indicate that it can interpret the memory type accordingly. This classification is safe since Exi

Re: [edk2-devel] [PATCH v7 3/7] MdeModulePkg: Notify BeforeExitBootServices in CoreExitBootServices

2022-10-05 Thread Dionna Glaze via groups.io
The specification says that disabling the timer should happen right after. Ard told me it should still work this way. On Wed, Oct 5, 2022 at 1:50 PM Tom Lendacky wrote: > > On 10/5/22 15:33, Dionna Glaze wrote: > > Location of notification is has been specified in UEFI v2.9. > > > > Cc: Gerd Hoff

Re: [edk2-devel] [PATCH v7 3/7] MdeModulePkg: Notify BeforeExitBootServices in CoreExitBootServices

2022-10-05 Thread Dionna Glaze via groups.io
> Ard told me it should still work this way. > Let me clarify that I've also tested the new code and it does still work. -- -Dionna Glaze, PhD (she/her) -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#94774): https://edk2.groups.io/g/d

Re: [edk2-devel] 回复: [PATCH V4 00/10] Introduce Lazy-accept for Tdx guest

2022-10-10 Thread Dionna Glaze via groups.io
> > Can OS call AcceptMemory protocol for those ranges that are not accepted? > AcceptMemory is not specified to avoid accepting previously accepted memory. As I understand it, AcceptMemory is purely a hardware abstraction layer for CC technologies inside the UEFI implementation. It additionally i

Re: [edk2-devel] 回复: [PATCH V4 00/10] Introduce Lazy-accept for Tdx guest

2022-10-12 Thread Dionna Glaze via groups.io
> The name of EDKII_MEMORY_ACCEPT_PROTOCOL indicates it is only used in edk2. Ah, yes I was basing my changes off probably a very old version of TDVF's patches that used the EFI_ naming convention, so folks looking at my branch might have been expecting that it'd be standardized. Cool. Just the on

Re: [edk2-devel] [edk2-platforms PATCH v1 0/1] BoardModulePkg: Copy device path

2022-10-13 Thread Dionna Glaze via groups.io
Hi Abdul, I'm not a maintainer, just a contributor. I thought I'd pop in with an observation though. I'm not seeing any diffs in these emails. I'm not going to click a suspicious-looking link either. Likely other folks have the same reservation. Have you read the contributor guidelines on how to se

Re: [edk2-devel] [PATCH v7 0/7] Add safe unaccepted memory behavior

2022-10-14 Thread Dionna Glaze via groups.io
> > Can OsIndicationsSupported UEFI variable provide the similar functionality? > Similar, but not the same. If we use a UEFI variable, its value will persist across boots. This can be fine if you only boot one OS, but if you have two where one supports unaccepted memory and the other doesn't then

Re: [edk2-devel] [PATCH v7 0/7] Add safe unaccepted memory behavior

2022-10-20 Thread Dionna Glaze via groups.io
> That assumes the variable is non-volatile, but I suppose we could use > a volatile variable [other than OsIndications] as well. > I suppose that's true. Would you prefer volatile versions of OsIndications/OsIndicationsSupported added to the spec, or this proposed one-off toggle protocol? No spec

Re: [edk2-devel] [PATCH v7 0/7] Add safe unaccepted memory behavior

2022-10-21 Thread Dionna Glaze via groups.io
> > I suppose that's true. Would you prefer volatile versions of > > OsIndications/OsIndicationsSupported added to the spec, or this > > proposed one-off toggle protocol? No specified global variables seem > > overloadable with this duty. > > > > No it would have to be a completely separate variabl

Re: [edk2-devel] 回复: [PATCH V4 00/10] Introduce Lazy-accept for Tdx guest

2022-10-21 Thread Dionna Glaze via groups.io
> > Min: > > I understand that they are for the different purpose and usage. But, their > > protocol name are very similar. > Yes. They do look very similar. > > > If there is no better protocol name, I will also be fine. > Dionna, what's your thought? > The accept_all_unaccepted_memory name c

Re: [edk2-devel] [PATCH v7 0/7] Add safe unaccepted memory behavior

2022-10-24 Thread Dionna Glaze via groups.io
> > Hey! > > Sorry if this was asked. I was wondering if this patchset is in some git repo > which I pull from as I struggle to get a buildable tree by applying this > patchset to whatever I can find. > > I tried https://github.com/deeglaze/edk2.git enable_umv7 but it does not > build (missing

[edk2-devel] [PATCH v8 0/7] Add safe unaccepted memory behavior

2022-10-24 Thread Dionna Glaze via groups.io
These seven patches build on the lazy-accept patch series "Introduce Lazy-accept for Tdx guest" by adding SEV-SNP support for the MemoryAccept protocol, and importantly making eager memory acceptance the default behavior. We implement a standardized event group from UEFI v2.9, EFI_EVENT_GROUP_BE

[edk2-devel] [PATCH v8 1/7] OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe

2022-10-24 Thread Dionna Glaze via groups.io
From: Sophia Wolf When a guest OS does not support unaccepted memory, the unaccepted memory must be accepted before returning a memory map to the caller. EfiMemoryAcceptProtocol is defined in MdePkg and is implemented / Installed in AmdSevDxe for AMD SEV-SNP memory acceptance. Cc: Gerd Hoffmann

[edk2-devel] [PATCH v8 2/7] MdePkg: Add EFI_EVENT_BEFORE_EXIT_BOOT_SERVICES_GUID

2022-10-24 Thread Dionna Glaze via groups.io
Event group as defined in UEFI standard v2.9. Cc: Ard Biescheuvel Cc: "Min M. Xu" Cc: Gerd Hoffmann Cc: James Bottomley Cc: Tom Lendacky Cc: Jiewen Yao Cc: Erdem Aktas Signed-off-by: Dionna Glaze --- MdePkg/Include/Guid/EventGroup.h | 5 + MdePkg/MdePkg.dec| 5 -

[edk2-devel] [PATCH v8 4/7] OvmfPkg: Introduce CocoDxe driver

2022-10-24 Thread Dionna Glaze via groups.io
This driver is meant as a join point for all Confidential Compute technologies to put shared behavior that doesn't belong anywhere else. The first behavior added here is to accept all unaccepted memory at ExitBootServices if the behavior is not disabled. This allows safe upgrades for OS loaders to

[edk2-devel] [PATCH v8 5/7] MdePkg: Introduce the MemoryAcceptance protocol

2022-10-24 Thread Dionna Glaze via groups.io
The default behavior for unaccepted memory is to accept all memory when ExitBootServices is called. An OS loader can use this protocol to disable this behavior to assume responsibility for memory acceptance and to affirm that the OS can handle the unaccepted memory type. This is a candidate for st

[edk2-devel] [PATCH v8 6/7] OvmfPkg: Implement AcceptAllUnacceptedMemory in CocoDxe

2022-10-24 Thread Dionna Glaze via groups.io
This protocol implementation disables the accept-all-memory behavior of the BeforeExitBootServices event this driver adds. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: "Min M. Xu" Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by: Dionna

[edk2-devel] [PATCH v8 7/7] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted

2022-10-24 Thread Dionna Glaze via groups.io
Instead of eagerly accepting all memory in PEI, only accept memory under the 4GB address. This allows a loaded image to use the MEMORY_ACCEPTANCE_PROTOCOL to disable the accept behavior and indicate that it can interpret the memory type accordingly. This classification is safe since ExitBootServic

[edk2-devel] [PATCH v8 3/7] MdeModulePkg: Notify BeforeExitBootServices in CoreExitBootServices

2022-10-24 Thread Dionna Glaze via groups.io
Location of notification is has been specified in UEFI v2.9. Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Ard Biesheuvel Cc: "Min M. Xu" Cc: Andrew Fish Cc: "Michael D. Kinney" Cc: Ray Ni Signed-off-by: Dionna Glaze --- MdeModulePkg/Core/Dxe/DxeMain.inf

Re: [edk2-devel] [PATCH v7 0/7] Add safe unaccepted memory behavior

2022-10-25 Thread Dionna Glaze via groups.io
On Tue, Oct 25, 2022 at 5:23 PM Alexey Kardashevskiy wrote: > > Hi Dionna, > > Thanks for updating the tree, builds nicely now! However the VM's kernel > does not boot - the guest kernel reports > > EFI stub: ERROR: exit_boot() failed! > > and hangs. I am not quite sure how it is supposed to work

Re: [edk2-devel] [PATCH v7 0/7] Add safe unaccepted memory behavior

2022-10-27 Thread Dionna Glaze via groups.io
> > btw it still fails in CoreTerminateMemoryMap() with the current upstream > kernel which is not aware of the lazy memory acceptance, is this > something known? Thanks, > It wasn't known. I'll take a look. Thanks for the report. -- -Dionna Glaze, PhD (she/her) -=-=-=-=-=-=-=-=-=-=-=- Groups.

Re: [edk2-devel] [PATCH v8 0/7] Add safe unaccepted memory behavior

2022-11-08 Thread Dionna Glaze via groups.io
On Tue, Nov 8, 2022 at 8:09 AM Yao, Jiewen wrote: > > Hi Tom/Dionna > I think this patch is addressing > https://bugzilla.tianocore.org/show_bug.cgi?id=3987. > > For patch 1~3, I am OK for the API which we already agreed, such as > EfiMemoryAcceptProtocol and EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SER

Re: [edk2-devel] [PATCH v8 0/7] Add safe unaccepted memory behavior

2022-11-08 Thread Dionna Glaze via groups.io
> > BTW: Is there any data for AMD-SEV? > Earlier this year, I tried to make the lazy accept patches work for SEV-SNP, but the boot would always crash in the Qemu try boot kernel step IIRC: https://github.com/AMDESE/ovmf/pull/4 Tom suggested accepting the first 4GiB and I didn't go back to try t

  1   2   >