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.web11.198222.1673966834704396138 for ; Tue, 17 Jan 2023 06:47:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YJh17oix; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673966833; 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: in-reply-to:in-reply-to:references:references; bh=kbuZxQtBqQIxQH05zpNIaiXBSE3Mi0ZWf5Cb5S3LI1U=; b=YJh17oixl6gLTXFomEv7izDmnHkQm0bfkApBuYlY/47Ea2yME2Z73BFI9EALCPvV7HIOFD LSl3oRUwUF/o6ChyNYi+T6bsqFgg5hS94UQr6I7WZrkDy9A6/LW/gmZcPg1/p1UNalOtwl KkAu5g+I6+gYPZOuESOLcdV4nV/RGbw= 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-522-n9-qRHxWMH2vgOCfXeFcbg-1; Tue, 17 Jan 2023 09:47:03 -0500 X-MC-Unique: n9-qRHxWMH2vgOCfXeFcbg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 572B8810BD4; Tue, 17 Jan 2023 14:46:56 +0000 (UTC) Received: from [10.39.194.135] (unknown [10.39.194.135]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D64117AE5; Tue, 17 Jan 2023 14:46:54 +0000 (UTC) Message-ID: Date: Tue, 17 Jan 2023 15:46:53 +0100 MIME-Version: 1.0 Subject: Re: [PATCH v4 1/5] OvmfPkg/PlatformInitLib: Add PlatformScanE820 and GetFirstNonAddressCB To: Gerd Hoffmann , devel@edk2.groups.io Cc: Jiewen Yao , Oliver Steffen , Ard Biesheuvel , Pawel Polawski , Jordan Justen References: <20230117121629.2149112-1-kraxel@redhat.com> <20230117121629.2149112-2-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20230117121629.2149112-2-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/17/23 13:16, Gerd Hoffmann wrote: > +/** > + Store first address not used by e820 RAM entries in > + PlatformInfoHob->FirstNonAddress > +**/ > +VOID > +PlatformGetFirstNonAddressCB ( > + IN EFI_E820_ENTRY64 *E820Entry, > + IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob > + ) > +{ > + UINT64 Candidate; > + > + if (E820Entry->Type != EfiAcpiAddressRangeMemory) { > + return; > + } > + > + Candidate = E820Entry->BaseAddr + E820Entry->Length; > + if (PlatformInfoHob->FirstNonAddress < Candidate) { > + DEBUG ((DEBUG_INFO, "%a: FirstNonAddress=0x%Lx\n", __FUNCTION__, Candidate)); > + PlatformInfoHob->FirstNonAddress = Candidate; > + } > +} This could have been made STATIC (like the other three callbacks), but it's not important. Laszlo