From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.51105.1674666655087821304 for ; Wed, 25 Jan 2023 09:10:55 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cOExBtQP; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674666654; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ixtSb19AP/w1oOJW5FzxZmP3ZEyBtmpJnA7IEeBe2UA=; b=cOExBtQPs6+WvtW+Y0lpj//Oh27vRbtdhPQDSaxKIJehUh3TOFpyn9VzIUXXp3d2pL1q0E AIgqGqJz2Oqlw7Caa8xk3EkToi1mZnJz8uTUpd76mIGhPyl5afMmNyan+KSg/Rm+DPSlB/ ibHTzrA2FxLCw3CLaRkmNixkoh1HIUM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-384-k9MSWd6BO1a_B49iIIp03g-1; Wed, 25 Jan 2023 12:10:52 -0500 X-MC-Unique: k9MSWd6BO1a_B49iIIp03g-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6227D181E3F2; Wed, 25 Jan 2023 17:10:52 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.186]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1511B492B01; Wed, 25 Jan 2023 17:10:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 55E0D1800623; Wed, 25 Jan 2023 18:10:49 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Pawel Polawski , Tom Lendacky , Jiewen Yao , Oliver Steffen , Gerd Hoffmann , Ard Biesheuvel , Jordan Justen Subject: [PATCH 1/1] OvmfPkg: fix BuildResourceDescriptorHob call in PlatformAddHobCB() Date: Wed, 25 Jan 2023 18:10:49 +0100 Message-Id: <20230125171049.1958204-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true BuildResourceDescriptorHob() expects the third parameter be the Length, not the End address. Fixes: 328076cfdf45 ("OvmfPkg/PlatformInitLib: Add PlatformAddHobCB") Reported-by: Tom Lendacky Signed-off-by: Gerd Hoffmann --- OvmfPkg/Library/PlatformInitLib/MemDetect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c index 5aeeeff89f57..38cece9173e8 100644 --- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c +++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c @@ -200,7 +200,7 @@ PlatformAddHobCB ( break; case EfiAcpiAddressRangeReserved: - BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End); + BuildResourceDescriptorHob (EFI_RESOURCE_MEMORY_RESERVED, 0, Base, End - Base); DEBUG ((DEBUG_INFO, "%a: Reserved [0x%Lx, 0x%Lx)\n", __FUNCTION__, Base, End)); break; default: -- 2.39.1