From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f202.google.com (mail-pg1-f202.google.com [209.85.215.202]) by mx.groups.io with SMTP id smtpd.web09.228.1667925982658760984 for ; Tue, 08 Nov 2022 08:46:22 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@google.com header.s=20210112 header.b=R15nYz8f; spf=pass (domain: flex--dionnaglaze.bounces.google.com, ip: 209.85.215.202, mailfrom: 33ydqywskbbgbgmllyejyxcemmejc.amkbctcjcbi0.epmsnq.gm@flex--dionnaglaze.bounces.google.com) Received: by mail-pg1-f202.google.com with SMTP id x16-20020a63b210000000b0045f5c1e18d0so8085934pge.0 for ; Tue, 08 Nov 2022 08:46:22 -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=vrRWVZ9ncKTtIrsvLAOIUhdIJ7myyBT7opZdQGfSwcs=; b=R15nYz8f3VdRCIlUBQrtND8jpW1wEIU7DSvPOXCeOA0aOAqsd1ZbauQcLFlhnUIKuK Inj3rFsDKRBoRdJ7Mvb60tZdpfhvO+V1JXOI/bCnYIBDmo+Ww3ftLi820+LT8D47F6g1 tN2+YMzS7fR68YA72WcqAyVfQPns9jjaAB2jbuM0dWnHpXb3CoVyB09RCjG8HOEFcK9b kaC8SlYxBWekYghWxx4f9At5M1RZlvVJCE0VKI4dy/6gkE06tQYtF0oEX1+SPcexeaG2 ZdGUoic56LAnOYb1EUFh1RD4At8k/LDlPk6O+U0C42vPXkp0ertUsDm4/q+rZQK7+cYl QpYQ== 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=vrRWVZ9ncKTtIrsvLAOIUhdIJ7myyBT7opZdQGfSwcs=; b=TB0RZuTBUkQOLULwnclXn2LUyq6AOIcVnJsqlGwN3XdduG/btmK1KGgRt61Zjq87wb Zs13/zSCtTtC6UfIrOm1Eywdu6sS+xfzafFPu1waA1254vmaKFDaXTLdUQlpiX3kwfOk K6u6j+ADLTGKWmfcxPDCrQ9ZtyU/+z4lst7frWRQOP6Wu7XoVJEMdAl33wfDP8qKTcXW /dZm45Ddv/4jTHTle8DrKPlaTZvNzHctxH+aJUW1Z6mZPv3nj2C/IBfFoqXPbKxoMip/ zLdVjbrnYp+BMI+RUG6uc8ZwneqVmkayJ7JvbKvzjGyeR6QUFDYPKq3Yu44b+HMu0RQj 9IkA== X-Gm-Message-State: ACrzQf2bkV3nFGFabTZaxMVfgg1I3YiocTnU7yYhhuT39KtgUUxGQEW6 25RxDisPdx3L8zM6qCqTSwTue36Q/FOba/rhBg5NXjdf2FV+/T8nwOItgxqTGFBEQlNzr6WMtlL tRmMqUbnCjA1q6orUGCRlWGWNJje7XbGGSUCbgjaBbqbV7MKwE+qPc/mlodqIG0ICWVgjrXLN X-Google-Smtp-Source: AMsMyM7uaoghU7ctrBZa503Ww8WY3VvLbW/ldvrInfhwj8UNs6hhE+5ESQuQODaJyCe1KFvmHjpy/RqzjgD40g7InA== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a17:902:9b8a:b0:170:f343:ba14 with SMTP id y10-20020a1709029b8a00b00170f343ba14mr1027035plp.70.1667925981713; Tue, 08 Nov 2022 08:46:21 -0800 (PST) Date: Tue, 8 Nov 2022 16:46:13 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog Message-ID: <20221108164616.3251967-1-dionnaglaze@google.com> Subject: [PATCH 0/3] 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. 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 (3): OvmfPkg: Realize EfiMemoryAcceptProtocol in AmdSevDxe MdePkg: Add EFI_EVENT_BEFORE_EXIT_BOOT_SERVICES_GUID MdeModulePkg: Notify BeforeExitBootServices in CoreExitBootServices MdeModulePkg/Core/Dxe/DxeMain.inf | 1 + MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 6 +++ MdePkg/Include/Guid/EventGroup.h | 5 ++ MdePkg/MdePkg.dec | 5 +- OvmfPkg/AmdSevDxe/AmdSevDxe.c | 55 ++++++++++++++++++-- OvmfPkg/AmdSevDxe/AmdSevDxe.inf | 3 ++ OvmfPkg/Library/BaseMemEncryptSevLib/X64/DxeSnpSystemRamValidate.c | 24 +++++++-- 7 files changed, 90 insertions(+), 9 deletions(-) -- 2.38.1.431.g37b22c650d-goog