From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 096F5D80685 for ; Fri, 12 Jan 2024 19:16:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=T7SY4rm093m8ME0NBJiL5wr3b7DYF9KbEQ+Eu48JYZg=; 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=1705086976; v=1; b=Sg7S7wIHhNj7b3pPCsnp4IV1PKo8nj/aJcdBjQgra1EWffICNXu9SYZS1t9wx/UzNmBTTfyW spH9R269hEHuaLw+DelDpxiKneq3Zy23Kb7D/MweYzAZYDn8tkMb4NwlrOoLvzXtutyESamX1y1 nRCPymkKmSjTnFLUzCKljV2w= X-Received: by 127.0.0.2 with SMTP id hLH0YY7687511xPzoRr074iP; Fri, 12 Jan 2024 11:16:16 -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: Z2ZY2ka5Oo4rO7E9thJOIcjLx7686176AA= 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-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Sg7S7wIH; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none) 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 ( =0D if (PlatformInfoHob->HostBridgeDevId =3D=3D 0xffff /* microvm */) {=0D PlatformAddressWidthFromCpuid (PlatformInfoHob, FALSE);=0D + return;=0D + } else if (PlatformInfoHob->HostBridgeDevId =3D=3D CLOUDHV_DEVICE_ID) {= =0D + PlatformInfoHob->FirstNonAddress =3D BASE_4GB;=0D + Status =3D PlatformScanE820 (PlatformGetFirs= tNonAddressCB, PlatformInfoHob);=0D + if (EFI_ERROR (Status)) {=0D + PlatformInfoHob->FirstNonAddress =3D BASE_4GB + PlatformGetSystemMem= orySizeAbove4gb ();=0D + }=0D +=0D + PlatformInfoHob->PcdPciMmio64Base =3D PlatformInfoHob->FirstNonAddress= ;=0D + PlatformAddressWidthFromCpuid (PlatformInfoHob, FALSE);=0D + PlatformInfoHob->PcdPciMmio64Size =3D PlatformInfoHob->FirstNonAddress= - PlatformInfoHob->PcdPciMmio64Base;=0D +=0D return;=0D }=0D =0D --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-