From nobody Thu Nov 14 17:58:53 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+99102+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+99102+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1674767874; cv=none; d=zohomail.com; s=zohoarc; b=Fn+JH1A8gQEen0QQGcjmloTMFrQ5vJTnmf57rd55ZHAOASqgavgPaieXk2QGunojG3ABPCLF7RkmCjgdFlPqR1ty41KnqzHkFmwCdwNr1DLyQb7n4YAO4OETBRVj8hx0WMi5NDCtqUyZq/appN7x+29mb9Rx6j90LX9zDWt8S/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674767874; 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=fCgmlGoqqvywoOdEF1T04vrBr8tbwBAM37+sFipGD84=; b=ZWbYyPlJwtNCoNLaQSRMWRJdRJkIQgQDaR71MmkhoPBVLO6AxJ3qbrnx85DY/BKdMLyrccp00JSSjm2v1KvlaXRIzQYKiAPMAe13BPakFrrK+CdYZYsWeg62Fjaai3Ke1WFhyxxHd5lXnlFY+vviYt/z35rW/SMYbmkVTjzy7sU= 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+99102+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1674767874599527.2858118348187; Thu, 26 Jan 2023 13:17:54 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id pDaYYY1788612xQr1uqROm5y; Thu, 26 Jan 2023 13:17:54 -0800 X-Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) by mx.groups.io with SMTP id smtpd.web11.86800.1674767873716475155 for ; Thu, 26 Jan 2023 13:17:53 -0800 X-Received: by mail-pg1-f201.google.com with SMTP id 38-20020a630b26000000b004773803dda1so1281903pgl.17 for ; Thu, 26 Jan 2023 13:17:53 -0800 (PST) X-Gm-Message-State: wUOEAQhUQD6AJInTmXBRe6eUx1787277AA= X-Google-Smtp-Source: AMrXdXvav46tjxHEFnYAA6vZxq5VO3TCciw7sq+I45tj/j4DJxkyVkDRwoxjG289W/KRjhX4t7TdVDuJriCS1+srEA== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a17:90a:138a:b0:22b:ba09:cb1a with SMTP id i10-20020a17090a138a00b0022bba09cb1amr2886188pja.188.1674767873123; Thu, 26 Jan 2023 13:17:53 -0800 (PST) Date: Thu, 26 Jan 2023 21:17:40 +0000 In-Reply-To: <20230126211740.3235408-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20230126211740.3235408-1-dionnaglaze@google.com> Message-ID: <20230126211740.3235408-5-dionnaglaze@google.com> Subject: [edk2-devel] [PATCH v11 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=1674767874; bh=/5ABt3f+63E6eubPR0H+DAoMIM+nsbajKeSYUbuKEU8=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=R+tboLjYm8u+4Z6mgKxASm3eKw7eH4lj+1lKYjYFViyszM82NgS+7IgBIxUDwmYH5FF EM4Wu6DKSdM3Jrz1IXYEKbp5cP5yaGXYQkem6wOrRTcOe4i8frCQ9OrAioMTm0W3qNj2r V9UX/bktAElBXt5FRsKdxqhT6srEEoEdzQc= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1674767875449100018 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.1.456.gfc5497dd1b-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 (#99102): https://edk2.groups.io/g/devel/message/99102 Mute This Topic: https://groups.io/mt/96553086/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-