From nobody Thu Mar 5 08:14:08 2026 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+113773+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+113773+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1705086970; cv=none; d=zohomail.com; s=zohoarc; b=TMrCyFVs7i4viI0WOjpV5vpHfDQzdtWN1IHkJAMjAj+b00DNF7lQ8v9dNZ69tlWbBJeiu7RbE3w4O0ckZzYhMP2BlEpeXlVQSqhjE+8hu0h+75SHellyJhr2SgTaDkrFhWZLid2uhgZFlDymiV9VTzVhJPK4YzwKy6I0bceu+bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705086970; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=BF6OPm3Odps4kvzcI2JxItpCYbVonSCvA6rmXM+Xsts=; b=bEBGNhoXK6M8WAkTChKseA9yHrU1NAd15NhfwBIhN8iPddo6UT3bsijCgowETlKA1iVNS+2nySgqoM+5ER1CySC/9OES/Jr5fhMm3FzEtWo5Gw6V86xlVDPkOQiEDlOsN4AcXScXM2BRgB6MiRsQ+rL4TXrvH4THJorxh2/YvM8= 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+113773+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1705086970232443.94957801254725; Fri, 12 Jan 2024 11:16:10 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=UjIbTmeJMcgK+z4lT0/XaUNaD5Dvrq4kk6jhtiuMdJ8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1705086969; v=1; b=iaT6yjP9yB8k1BuXZZ56np6yZHZUorqHpcOSFnMOWmw7BEOzVDRYJrSHGUoCdUAiionsCNBz mDVniFa2VKeCzuXf3zoi7xmEEh8xtxXvSXK5wPu6XvPz6ONU8plz+UnlyeVgrxdTi+sV7Fdjn7M 3mqzg7NGPxNT6VVpxZaNaFXo= X-Received: by 127.0.0.2 with SMTP id vhXtYY1788612xghitjKGuIb; Fri, 12 Jan 2024 11:16:09 -0800 X-Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) by mx.groups.io with SMTP id smtpd.web10.15592.1705084314489003761 for ; Fri, 12 Jan 2024 10:31:54 -0800 X-Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-6da4a923b1bso3838063b3a.2 for ; Fri, 12 Jan 2024 10:31:54 -0800 (PST) X-Gm-Message-State: XBblcP6Y6G4FclCMSEsLXK2Kx1787277AA= X-Google-Smtp-Source: AGHT+IEpFbf4KOT0IDPh+L7HTk8f0sXkUbj7uqqonvRTlP3cGTMSdv1DwFxbEj9mWEUY9AqBuMLPHg== X-Received: by 2002:a05:6a20:4f1e:b0:199:b189:eb93 with SMTP id gi30-20020a056a204f1e00b00199b189eb93mr1018089pzb.100.1705084313279; Fri, 12 Jan 2024 10:31:53 -0800 (PST) X-Received: from dev-hypervisor-01.hsd1.ca.comcast.net ([2601:645:8001:5750::6d3b]) by smtp.googlemail.com with ESMTPSA id w67-20020a626246000000b006d6b91c6eb6sm3699243pfb.13.2024.01.12.10.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 10:31:53 -0800 (PST) From: "Thomas Barrett" To: devel@edk2.groups.io Cc: Thomas Barrett , Anatol Belski , Ard Biesheuvel , Gerd Hoffmann , Jianyong Wu , Jiewen Yao , Laszlo Ersek , Rob Bradford Subject: [edk2-devel] [PATCH v3 2/3] OvmfPkg: Update PlatformAddressWidthInitialization for CloudHv Date: Fri, 12 Jan 2024 18:31:43 +0000 Message-Id: <2fa1fa4d809f0f295981d1f0b4e5ebebf0dcb91f.1705084003.git.tbarrett1200@gmail.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk 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,tbarrett1200@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1705086972209100068 Content-Type: text/plain; charset="utf-8" From: Thomas Barrett In addition to initializing the PhysMemAddressWidth and FirstNonAddress fields in PlatformInfoHob, the PlatformAddressWidthInitialization function is responsible for initializing the PcdPciMmio64Base and PcdPciMmio64Size fields. Currently, for CloudHv guests, the PcdPciMmio64Base is placed immediately after either the 4G boundary or the last RAM region, whichever is greater. We do not change this behavior. Previously, when booting CloudHv guests with greater than 1TiB of high memory, the PlatformAddressWidthInitialization function incorrect calculates the amount of RAM using the overflowed 24-bit CMOS register. Now, we update the PlatformAddressWidthInitialization behavior on CloudHv to scan the E820 entries to detect the amount of RAM. This allows CloudHv guests to boot with greater than 1TiB of RAM Cc: Anatol Belski Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jianyong Wu Cc: Jiewen Yao Cc: Laszlo Ersek Cc: Rob Bradford Signed-off-by: Thomas Barrett --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/= PlatformInitLib/MemDetect.c index 76a9dc9211..f042517bb6 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -873,6 +873,18 @@ PlatformAddressWidthInitialization ( =20 if (PlatformInfoHob->HostBridgeDevId =3D=3D 0xffff /* microvm */) { PlatformAddressWidthFromCpuid (PlatformInfoHob, FALSE); + return; + } else if (PlatformInfoHob->HostBridgeDevId =3D=3D CLOUDHV_DEVICE_ID) { + PlatformInfoHob->FirstNonAddress =3D BASE_4GB; + Status =3D PlatformScanE820 (PlatformGetFirs= tNonAddressCB, PlatformInfoHob); + if (EFI_ERROR (Status)) { + PlatformInfoHob->FirstNonAddress =3D BASE_4GB + PlatformGetSystemMem= orySizeAbove4gb (); + } + + PlatformInfoHob->PcdPciMmio64Base =3D PlatformInfoHob->FirstNonAddress; + PlatformAddressWidthFromCpuid (PlatformInfoHob, FALSE); + PlatformInfoHob->PcdPciMmio64Size =3D PlatformInfoHob->FirstNonAddress= - PlatformInfoHob->PcdPciMmio64Base; + return; } =20 --=20 2.34.1 -=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 (#113773): https://edk2.groups.io/g/devel/message/113773 Mute This Topic: https://groups.io/mt/103689732/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-