From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) by mx.groups.io with SMTP id smtpd.web10.2767.1667942167317472570 for ; Tue, 08 Nov 2022 13:16:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=gnlWWYlk; spf=pass (domain: flex--dionnaglaze.bounces.google.com, ip: 209.85.214.202, mailfrom: 3fsdqywskbxesxdccpvapotvddvat.rdbstktatszr.vgdjeh.xd@flex--dionnaglaze.bounces.google.com) Received: by mail-pl1-f202.google.com with SMTP id z15-20020a170903018f00b0018862d520fbso10223224plg.11 for ; Tue, 08 Nov 2022 13:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=5+vOdy3HiUnzrHPqNBSuz+TcGhTEORz+T79BzVUK2bU=; b=gnlWWYlk9ZZifem3fW64oqiR2mkXkZ9/VNiqOzkP7UmlAjwbaaHvK14RbHWtsXgGQC bdyZ0lMODfAlXc+S3kngbGrTYJORbf377J41Cs7J53945iV8nOF38wS8fdNYJRE56DoJ lbrq3YAPXZJxEh6YzlxX7s6b+7CREoNbw2/9qR68wfBfgSdT7n0h8AHZAxPK0FoQ3cx5 kmpoWfZMiM+BuhJhx2xaF1ThUkROU/VfDvCwbHnzR+eXFWemNVhjDW+ZD+qMYdI9AzBw 1NPvxyszaSkrZ1YGu0wEHxFb1lXv/5TeBPOLKE8QPETdKXAEgN9FYgg8d/ntxvzEmnjn ZrVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5+vOdy3HiUnzrHPqNBSuz+TcGhTEORz+T79BzVUK2bU=; b=sY7GiSIyRSW0Lg0K6IKgFxFcInG5kVM1z49kNPjNCnaxfzxAElZ3pYZOdGjqFfaC6f 41wJUB8Kfr/Fpb9x6RBUusL5V3mVOSOs1uUpAQIKlR6Cy3D2Wf/1yfoM6SRHtAsr4w7h hZ/x+pyCvEWotBDSCRJx8YNAIc2jnI8FhUpsBR/a9e0x9SlnS8N7GK9gOYzHsbg5Y4l1 nbXt7F+bJzxrW/ajCiOugbIA6xXGg6YCs0ZdbDl+GXR0XUAHVhmX9VS7+Gh3jb5xh4+c ZKRuktqc+bJaKlLfaUARLCBNKdmwjaZNeXsff9QCLEBmThvh5TdRZVOe+P5pvhlEmr/q BSVA== X-Gm-Message-State: ACrzQf2a7QNy6rubFzyvRXN00E97AruWtu3sS1WGXG6J3B2TIl9VOthe PFxKWbnGdd2swhQ44Hq1nNLv9OQfMBMIalrlDuXPRr1LqrbcKyZP9QE8JuOzb5TsB+JoGI1ZxJP /p88jjNg/nS6eocG03ocyxaYeXwbDSwSa79mikabxcUIn2Z9SjaJkSH+UhiJztVLw4wk9hL9u X-Google-Smtp-Source: AMsMyM6//HprRjENNfyLFJDEJGDACxfHp+heFIfaGlv+Q8P2AP3xJjnu1xVwq7mImTq0r6T7DoCJY4QqVVo3alnpsg== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a17:902:ebc7:b0:17e:7378:1da8 with SMTP id p7-20020a170902ebc700b0017e73781da8mr58219181plg.152.1667942166614; Tue, 08 Nov 2022 13:16:06 -0800 (PST) Date: Tue, 8 Nov 2022 21:15:53 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Message-ID: <20221108211557.3306520-1-dionnaglaze@google.com> Subject: [PATCH v2 0/4] SEV-SNP accepted memory and BeforeExitBootServices From: "Dionna Glaze" To: devel@edk2.groups.io Cc: Dionna Glaze , Ard Biescheuvel , "Min M. Xu" , Gerd Hoffmann , James Bottomley , Tom Lendacky , Jiewen Yao , Erdem Aktas , Andrew Fish , "Michael D. Kinney" Content-Type: text/plain; charset="UTF-8" This is the first half of the patch series [PATCH v8 0/7] Add safe unaccepted memory behavior These patches add SEV-SNP support for the MemoryAccept protocol, and implement an already standardized mechanism for performing any actions just before terminating the memory map. We implement a standardized event group from UEFI v2.9, EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES, since it provides exactly the right invocation point for eagerly accepting memory if eager acceptance has not been disabled (i.e., unaccepted memory is enabled). The use of the BeforeExitBootServices addition will come in the second half of this series. Changes since v1: * Added EFI_EVENT_GROUP_AFTER_READY_TO_BOOT and interpretation. Cc: Ard Biescheuvel Cc: "Min M. Xu" Cc: Gerd Hoffmann Cc: James Bottomley Cc: Tom Lendacky Cc: Jiewen Yao Cc: Erdem Aktas Cc: Andrew Fish Cc: "Michael D. Kinney" Signed-off-by: Dionna Glaze Dionna Glaze (4): OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe MdePkg: Add event groups for boot events MdeModulePkg: Notify BeforeExitBootServices in CoreExitBootServices MdePkg: Signal AfterReadyToBoot after ReadyToBoot MdeModulePkg/Core/Dxe/DxeMain.inf | 1 + MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 6 +++ MdePkg/Include/Guid/EventGroup.h | 10 ++++ MdePkg/Include/Library/UefiLib.h | 2 + MdePkg/Library/UefiLib/UefiLib.inf | 1 + MdePkg/Library/UefiLib/UefiNotTiano.c | 18 +++++++ MdePkg/MdePkg.dec | 8 ++- OvmfPkg/AmdSevDxe/AmdSevDxe.c | 55 ++++++++++++++++++-- OvmfPkg/AmdSevDxe/AmdSevDxe.inf | 3 ++ OvmfPkg/Library/BaseMemEncryptSevLib/X64/DxeSnpSystemRamValidate.c | 24 +++++++-- 10 files changed, 119 insertions(+), 9 deletions(-) -- 2.38.1.431.g37b22c650d-goog