From nobody Thu Nov 14 07:09:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+98406+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+98406+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1673568892; cv=none; d=zohomail.com; s=zohoarc; b=XmO1e09gLEopjwBdrFWE2Adeu9pgCDI2zV6HwUQu6n6x9o4bFEgde3ockmVA7DeRgolO1JHyf7oUtf2AhHo7F9KUfByp2ZNVv09yUkhOw/tLlMphSa+YTB30kCHb6FL+WlrB0JjKRiCcaKUuLHmF5n2rU2hGfvTHssYdf+JU7AY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673568892; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=TzG5VuX92a7OqtN+df+wMyHiDljyizF3kzi8iA9aUvA=; b=NlBC9TVGOc5ukDvzzH5lwYhMcWYB2vy9zrpR1aVWZg3GfY23STVZB0OyNm/p+owbd8pbtaor6Ei/fBlOh87JwSG4WkKV7UMSVEWOyJUyOLCtewnJ63TuJb2ibtj0ePa8V8WMUapI03vD+Gb/p3R1qI4wg2KdzgWowqiBPbOvFpc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+98406+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1673568892213620.3526320704563; Thu, 12 Jan 2023 16:14:52 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 7ogSYY1788612xWhKCmmIwCF; Thu, 12 Jan 2023 16:14:51 -0800 X-Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by mx.groups.io with SMTP id smtpd.web11.73502.1673568891161659521 for ; Thu, 12 Jan 2023 16:14:51 -0800 X-Received: by mail-pj1-f73.google.com with SMTP id h1-20020a17090a470100b0022646263abfso9037958pjg.6 for ; Thu, 12 Jan 2023 16:14:51 -0800 (PST) X-Gm-Message-State: jdwYVd6nM9dUAamsNqKUJWh9x1787277AA= X-Google-Smtp-Source: AMrXdXvZ/8r1h0+JzA31pstDLmeVwSI9YakjiVMiVj5eKgzkmZjVBBbukXqKkzkAjo4+hLJnIYg0N6tL21sDQI8QJg== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a05:6a00:1244:b0:56b:8181:fe3e with SMTP id u4-20020a056a00124400b0056b8181fe3emr5309022pfi.57.1673568890528; Thu, 12 Jan 2023 16:14:50 -0800 (PST) Date: Fri, 13 Jan 2023 00:14:19 +0000 In-Reply-To: <20230113001419.2519031-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20230113001419.2519031-1-dionnaglaze@google.com> Message-ID: <20230113001419.2519031-5-dionnaglaze@google.com> Subject: [edk2-devel] [PATCH v9 4/4] OvmfPkg/PlatformPei: SEV-SNP make >=4GB unaccepted From: "Dionna Glaze via groups.io" To: devel@edk2.groups.io Cc: Dionna Glaze , Ard Biescheuvel , "Min M. Xu" , Gerd Hoffmann , James Bottomley , Tom Lendacky , Jiewen Yao , Erdem Aktas Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dionnaglaze@google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1673568891; bh=IM+nfntfWGiNkjZm4yEcpQc70my5yKzAHDjneEhtLdc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=B7zBu4SrNRzGgeRzhIQfIv2r8Pk3kBUrb8+fLWrTZErhNN9MYWl8aw0nYscfGlZDaMB ld29kdTVKc60+0WAiansKM4OnKkKsTUkAClIkVFnTBMqeeXKY1Y0pIOZVt3s+47ZMdGfC wovbiBPH8AFNpDRsm5r9ayqMTv2v1dWX6OY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1673568893507100017 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 ExitBootServices will accept and reclassify the memory as conventional if the disable protocol is not used. 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 --- OvmfPkg/PlatformPei/AmdSev.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index e4e7b72e67..7d824cc282 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +64,10 @@ AmdSevSnpInitialize ( for (Hob.Raw =3D GetHobList (); !END_OF_HOB_LIST (Hob); Hob.Raw =3D GET_= NEXT_HOB (Hob)) { if ((Hob.Raw !=3D NULL) && (GET_HOB_TYPE (Hob) =3D=3D EFI_HOB_TYPE_RES= OURCE_DESCRIPTOR)) { ResourceHob =3D Hob.ResourceDescriptor; + if (ResourceHob->PhysicalStart >=3D SIZE_4GB) { + ResourceHob->ResourceType =3D BZ3937_EFI_RESOURCE_MEMORY_UNACCEPTE= D; + continue; + } =20 if (ResourceHob->ResourceType =3D=3D EFI_RESOURCE_SYSTEM_MEMORY) { MemEncryptSevSnpPreValidateSystemRam ( --=20 2.39.0.314.g84b9a713c41-goog -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#98406): https://edk2.groups.io/g/devel/message/98406 Mute This Topic: https://groups.io/mt/96236152/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-