public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@lists.01.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Subject: [PATCH v2 3/5] OvmfPkg/PlatformPei: align EmuVariableNvStore at any page boundary
Date: Thu, 18 May 2017 17:14:34 +0200	[thread overview]
Message-ID: <20170518151436.16566-4-lersek@redhat.com> (raw)
In-Reply-To: <20170518151436.16566-1-lersek@redhat.com>

EmuVariableFvbRuntimeDxe now uses a 4KB (EFI_PAGE_SIZE) block size.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Gary Lin <glin@suse.com>
---

Notes:
    v2:
    - no changes
    - add Gary's R-t-b

 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




  parent reply	other threads:[~2017-05-18 15:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 15:14 [PATCH v2 0/5] OvmfPkg: complete the 4MB flash image support ("-bios" / emulated variables) Laszlo Ersek
2017-05-18 15:14 ` [PATCH v2 1/5] OvmfPkg/EmuVariableFvbRuntimeDxe: strip trailing whitespace Laszlo Ersek
2017-05-18 22:12   ` Laszlo Ersek
2017-05-18 15:14 ` [PATCH v2 2/5] OvmfPkg/EmuVariableFvbRuntimeDxe: change block size to 4KB Laszlo Ersek
2017-05-18 18:49   ` Jordan Justen
2017-05-18 19:40     ` Laszlo Ersek
2017-05-18 20:56       ` Jordan Justen
2017-05-18 21:09         ` Laszlo Ersek
2017-05-18 22:13           ` Laszlo Ersek
2017-05-18 15:14 ` Laszlo Ersek [this message]
2017-05-18 22:13   ` [PATCH v2 3/5] OvmfPkg/PlatformPei: align EmuVariableNvStore at any page boundary Laszlo Ersek
2017-05-18 15:14 ` [PATCH v2 4/5] OvmfPkg/README: document 4MB flash layout Laszlo Ersek
2017-05-18 22:13   ` Laszlo Ersek
2017-05-18 15:14 ` [PATCH v2 5/5] OvmfPkg: make the 4MB flash size the default (again) Laszlo Ersek
2017-05-23 16:05   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170518151436.16566-4-lersek@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox