From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E376221D28FD2 for ; Fri, 4 Aug 2017 18:52:27 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7972883AB; Sat, 5 Aug 2017 01:54:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B7972883AB Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-20.phx2.redhat.com [10.3.116.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 161536DA8C; Sat, 5 Aug 2017 01:54:39 +0000 (UTC) To: Jordan Justen , edk2-devel-01 References: <20170804230043.12977-1-lersek@redhat.com> <20170804230043.12977-2-lersek@redhat.com> <150189226552.3956.16656969706399914884@jljusten-skl> From: Laszlo Ersek Message-ID: Date: Sat, 5 Aug 2017 03:54:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <150189226552.3956.16656969706399914884@jljusten-skl> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Sat, 05 Aug 2017 01:54:40 +0000 (UTC) Subject: Re: [PATCH v2 1/1] OvmfPkg/PlatformPei: support >=1TB high RAM, and discontiguous high RAM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 01:52:28 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 08/05/17 02:17, Jordan Justen wrote: > On 2017-08-04 16:00:43, Laszlo Ersek wrote: >> + if (E820Entry.Type == EfiAcpiAddressRangeMemory && >> + E820Entry.BaseAddr >= BASE_4GB) { >> + if (MaxAddress == NULL) { >> + UINT64 Base; >> + UINT64 End; >> + >> + // >> + // Round up the start address, and round down the end address. >> + // >> + Base = ALIGN_VALUE (E820Entry.BaseAddr, (UINT64)EFI_PAGE_SIZE); >> + End = (E820Entry.BaseAddr + E820Entry.Length) & >> + ~(UINT64)EFI_PAGE_MASK; > > I had set non-aligned Base/End one level out, and then rounded them here. > >> + if (Base < End) { >> + AddMemoryRangeHob (Base, End); >> + DEBUG (( >> + DEBUG_VERBOSE, >> + "%a: AddMemoryRangeHob [0x%Lx, 0x%Lx)\n", >> + __FUNCTION__, >> + Base, >> + End >> + )); >> + } >> + } else { >> + UINT64 Candidate; >> + >> + Candidate = E820Entry.BaseAddr + E820Entry.Length; > > Therefore I already had End here. > >> + if (Candidate > *MaxAddress) { >> + *MaxAddress = Candidate; >> + DEBUG (( >> + DEBUG_VERBOSE, >> + "%a: MaxAddress=0x%Lx\n", >> + __FUNCTION__, >> + *MaxAddress >> + )); >> + } > > I just had: > > *MaxAddress = MAX(*MaxAddress, End); Whenever you go to the trouble of coding up your suggestions, please post them too! I'd welcome and appreciate that. I might even answer with an R-b, and then it's faster for everyone. (And it's nice to have some patches with dual S-o-b's :) ) > Reviewed-by: Jordan Justen Thank you, pushed as commit 1fceaddb12b5. Laszlo