[edk2-devel] [PATCH] OvmfPkg: Close mAcceptAllMemoryEvent

Dionna Glaze via groups.io posted 1 patch 1 year, 2 months ago
Failed in applying to current master (apply log)
OvmfPkg/AmdSevDxe/AmdSevDxe.c | 1 +
1 file changed, 1 insertion(+)
[edk2-devel] [PATCH] OvmfPkg: Close mAcceptAllMemoryEvent
Posted by Dionna Glaze via groups.io 1 year, 2 months ago
This event should only trigger once. It should be idempotent, but the
allocation of the memory map itself is observable and can cause
ExitBootServices to fail with a modified map key.

Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Thomas Lendacky <Thomas.Lendacky@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Min Xu <min.m.xu@intel.com>
Cc: Michael Roth <michael.roth@amd.com>

Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
---
 OvmfPkg/AmdSevDxe/AmdSevDxe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
index 6391d1f775..f9baca90bd 100644
--- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c
+++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
@@ -124,6 +124,7 @@ AcceptAllMemory (
   }
 
   gBS->FreePool (AllDescMap);
+  gBS->CloseEvent (mAcceptAllMemoryEvent);
   return Status;
 }
 
-- 
2.39.1.637.g21b0678d19-goog



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100199): https://edk2.groups.io/g/devel/message/100199
Mute This Topic: https://groups.io/mt/96972431/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] OvmfPkg: Close mAcceptAllMemoryEvent
Posted by Gupta, Pankaj via groups.io 1 year, 2 months ago
On 2/15/2023 12:07 AM, Dionna Glaze via groups.io wrote:
> This event should only trigger once. It should be idempotent, but the
> allocation of the memory map itself is observable and can cause
> ExitBootServices to fail with a modified map key.
> 
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Thomas Lendacky <Thomas.Lendacky@amd.com>
> Cc: Erdem Aktas <erdemaktas@google.com>
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Min Xu <min.m.xu@intel.com>
> Cc: Michael Roth <michael.roth@amd.com>
> 
> Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
> ---
>   OvmfPkg/AmdSevDxe/AmdSevDxe.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> index 6391d1f775..f9baca90bd 100644
> --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> @@ -124,6 +124,7 @@ AcceptAllMemory (
>     }
>   
>     gBS->FreePool (AllDescMap);
> +  gBS->CloseEvent (mAcceptAllMemoryEvent);
>     return Status;
>   }

Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com>
Tested-by: Pankaj Gupta <pankaj.gupta@amd.com>
Fixes: a00e2e5513 ("OvmfPkg: Add memory acceptance event in AmdSevDxe")




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100208): https://edk2.groups.io/g/devel/message/100208
Mute This Topic: https://groups.io/mt/96972431/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] OvmfPkg: Close mAcceptAllMemoryEvent
Posted by Ard Biesheuvel 1 year, 2 months ago
On Wed, 15 Feb 2023 at 00:07, Dionna Glaze <dionnaglaze@google.com> wrote:
>
> This event should only trigger once. It should be idempotent, but the
> allocation of the memory map itself is observable and can cause
> ExitBootServices to fail with a modified map key.
>
> Cc: Ard Biesheuvel <ardb@kernel.org>
> Cc: Thomas Lendacky <Thomas.Lendacky@amd.com>
> Cc: Erdem Aktas <erdemaktas@google.com>
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Min Xu <min.m.xu@intel.com>
> Cc: Michael Roth <michael.roth@amd.com>
>
> Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
> ---
>  OvmfPkg/AmdSevDxe/AmdSevDxe.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> index 6391d1f775..f9baca90bd 100644
> --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c
> @@ -124,6 +124,7 @@ AcceptAllMemory (
>    }
>
>    gBS->FreePool (AllDescMap);
> +  gBS->CloseEvent (mAcceptAllMemoryEvent);
>    return Status;
>  }
>
> --
> 2.39.1.637.g21b0678d19-goog
>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Queued as #4041


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100200): https://edk2.groups.io/g/devel/message/100200
Mute This Topic: https://groups.io/mt/96972431/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-