From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (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 6003921A16E5F for ; Fri, 12 May 2017 02:09:00 -0700 (PDT) Received: from emea4-mta.ukb.novell.com ([10.120.13.87]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Fri, 12 May 2017 11:08:58 +0200 Received: from GaryWorkstation (nwb-a10-snat.microfocus.com [10.120.13.201]) by emea4-mta.ukb.novell.com with ESMTP (TLS encrypted); Fri, 12 May 2017 10:08:31 +0100 Date: Fri, 12 May 2017 17:08:22 +0800 From: Gary Lin To: Laszlo Ersek Cc: edk2-devel-01 , Jordan Justen Message-ID: <20170512090822.peveic4wtyoxih4c@GaryWorkstation> References: <20170506193023.4767-1-lersek@redhat.com> <20170506193023.4767-4-lersek@redhat.com> MIME-Version: 1.0 In-Reply-To: <20170506193023.4767-4-lersek@redhat.com> User-Agent: Mutt/1.6.2 (2016-07-01) Subject: Re: [PATCH 3/5] OvmfPkg/PlatformPei: align EmuVariableNvStore at any page boundary 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: Fri, 12 May 2017 09:09:00 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, May 06, 2017 at 09:30:21PM +0200, Laszlo Ersek wrote: > EmuVariableFvbRuntimeDxe now uses a 4KB (EFI_PAGE_SIZE) block size. > > Cc: Jordan Justen > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek Regression-tested-by: Gary Lin > --- > OvmfPkg/PlatformPei/Platform.c | 20 ++++---------------- > 1 file changed, 4 insertions(+), 16 deletions(-) > > diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c > index 1b4dc00b0180..3e9fda7c7ab0 100644 > --- a/OvmfPkg/PlatformPei/Platform.c > +++ b/OvmfPkg/PlatformPei/Platform.c > @@ -504,7 +504,6 @@ ReserveEmuVariableNvStore ( > { > EFI_PHYSICAL_ADDRESS VariableStore; > RETURN_STATUS PcdStatus; > - UINT32 Alignment; > > // > // Allocate storage for NV variables early on so it will be > @@ -512,26 +511,15 @@ ReserveEmuVariableNvStore ( > // across reboots, this allows the NV variable storage to survive > // a VM reboot. > // > - Alignment = PcdGet32 (PcdFlashNvStorageFtwSpareSize); > - if ((Alignment & (Alignment - 1)) != 0) { > - // > - // Round up Alignment to the next power of two. > - // > - Alignment = GetPowerOfTwo32 (Alignment) << 1; > - } > - > VariableStore = > (EFI_PHYSICAL_ADDRESS)(UINTN) > - AllocateAlignedRuntimePages ( > - EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)), > - Alignment > + AllocateRuntimePages ( > + EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) > ); > DEBUG ((EFI_D_INFO, > - "Reserved variable store memory: 0x%lX; size: %dkb, " > - "alignment: 0x%x\n", > + "Reserved variable store memory: 0x%lX; size: %dkb\n", > VariableStore, > - (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024, > - Alignment > + (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)) / 1024 > )); > PcdStatus = PcdSet64S (PcdEmuVariableNvStoreReserved, VariableStore); > ASSERT_RETURN_ERROR (PcdStatus); > -- > 2.9.3 > > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel >