From nobody Thu Nov 14 16:24:39 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+94474+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+94474+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1664379231; cv=none; d=zohomail.com; s=zohoarc; b=YSLzJSpzj+ho8x3/y7AXNq5VMzDJc0sdz6wFW4MvRAM02KryQlGYlpOXE9lZuRkuNHBe4WePL7cATq52TircOQ8Cw4feJLU8KjRUqH5iKioPshoT9Z+jVRNXUM+NFyvaegzyP7MGfsWWiiVWjLJVdTx0MEe7LzLPxSTFtDDGOww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664379231; 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=Xeaa7vbsC7iXsc+T54TtvxDSsIp+913+FdEgSgxnxLA=; b=TrnjNVXYlrQrUzQDNiIk3QCP1R8AYYNT7kOyCfzYWRQw83I1FdbC1WRU4UbU7Gif55TsphlzzBKP8T6Xy/GzUtlnL45Cd1hmvMvN/+V/eCl+RgquvWZN1urEEsNJRkzwffbkSWVShOyOa/k5YPeOjXfhN7FgDW+oFS2YrOGFkHo= 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+94474+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1664379231700470.23040727442526; Wed, 28 Sep 2022 08:33:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id xvI5YY1788612xV8DR5bFVE5; Wed, 28 Sep 2022 08:33:50 -0700 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.web10.9452.1664379229517397355 for ; Wed, 28 Sep 2022 08:33:49 -0700 X-Received: by mail-pg1-f201.google.com with SMTP id e187-20020a6369c4000000b0041c8dfb8447so7692004pgc.23 for ; Wed, 28 Sep 2022 08:33:49 -0700 (PDT) X-Gm-Message-State: 1cUmI4fE7pk52MUai8H6bD79x1787277AA= X-Google-Smtp-Source: AMsMyM5+qooofjM/TOJqLewQZKDxNgM93OKNhwID0s1CVONV7ieLVzbUNijgRsBSNA3opSsvpRafuegoW2wBBh1/Tg== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:2ee6]) (user=dionnaglaze job=sendgmr) by 2002:a17:90b:1c8b:b0:203:dcf1:128a with SMTP id oo11-20020a17090b1c8b00b00203dcf1128amr10797413pjb.182.1664379228867; Wed, 28 Sep 2022 08:33:48 -0700 (PDT) Date: Wed, 28 Sep 2022 15:33:23 +0000 In-Reply-To: <20220928153323.2583389-1-dionnaglaze@google.com> Mime-Version: 1.0 References: <20220928153323.2583389-1-dionnaglaze@google.com> Message-ID: <20220928153323.2583389-7-dionnaglaze@google.com> Subject: [edk2-devel] [PATCH v4 6/6] 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=1664379230; bh=90RnkxdKUueLMJX/xMJe+uayQq7Q7QGcW9TTK72M0OI=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=fAeYo4w1Cb9pkGk38aXfHcQHO3feNkQthCgqYIPhw2q8IfUgTPOAoAiAp8zlxuCjvmH 1LF6VC6HgHSKLOWdr+fRWiZkyHNW95pCjhgLBCUw/F+n3xbBsZpsLw/pPLo41o+Vp89nd uGRM5tyPmbLrzkDIlYW9wuXDEBBP88cZIDk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1664379233334100001 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 ENABLE_UNACCEPTED_MEMORY_PROTOCOL to 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 enable 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 385562b44c..2a52d6f491 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 EFI_RESOURCE_MEMORY_UNACCEPTED; + continue; + } =20 if (ResourceHob->ResourceType =3D=3D EFI_RESOURCE_SYSTEM_MEMORY) { MemEncryptSevSnpPreValidateSystemRam ( --=20 2.37.3.998.g577e59143f-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 (#94474): https://edk2.groups.io/g/devel/message/94474 Mute This Topic: https://groups.io/mt/93975256/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-