public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: edk2-devel-01 <edk2-devel@ml01.01.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Subject: [PATCH 2/6] OvmfPkg/AcpiPlatformDxe: update PointerValue comments in "BootScript.c"
Date: Tue, 21 Feb 2017 16:38:08 +0100	[thread overview]
Message-ID: <20170221153812.1420-3-lersek@redhat.com> (raw)
In-Reply-To: <20170221153812.1420-1-lersek@redhat.com>

Commit df73df138d9d ("OvmfPkg/AcpiPlatformDxe: replay
QEMU_LOADER_WRITE_POINTER commands at S3", 2017-02-09) added
"BootScript.c" with such comments on the PointerValue field of
CONDENSED_WRITE_POINTER, and on the corresponding PointerValue parameter
of SaveCondensedWritePointerToS3Context(), that did not consider the
then-latest update of the QEMU_LOADER_WRITE_POINTER structure. (Namely,
the introduction of the PointeeOffset field.)

The code is fine as-is -- ProcessCmdWritePointer() already calls
SaveCondensedWritePointerToS3Context() correctly, and "BootScript.c"
itself is indifferent to the exact values --, but the comments in
"BootScript.c" should match reality too. Update them.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/AcpiPlatformDxe/BootScript.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/AcpiPlatformDxe/BootScript.c
index b7a7f270f223..1ad468e2f834 100644
--- a/OvmfPkg/AcpiPlatformDxe/BootScript.c
+++ b/OvmfPkg/AcpiPlatformDxe/BootScript.c
@@ -29,6 +29,7 @@ typedef struct {
   UINT8  PointerSize;   // copied as-is from QEMU_LOADER_WRITE_POINTER
   UINT32 PointerOffset; // copied as-is from QEMU_LOADER_WRITE_POINTER
   UINT64 PointerValue;  // resolved from QEMU_LOADER_WRITE_POINTER.PointeeFile
+                        //   and QEMU_LOADER_WRITE_POINTER.PointeeOffset
 } CONDENSED_WRITE_POINTER;
 
 
@@ -159,7 +160,8 @@ ReleaseS3Context (
 
   @param[in] PointerValue   The base address of the allocated / downloaded
                             fw_cfg blob that is identified by
-                            QEMU_LOADER_WRITE_POINTER.PointeeFile.
+                            QEMU_LOADER_WRITE_POINTER.PointeeFile, plus
+                            QEMU_LOADER_WRITE_POINTER.PointeeOffset.
 
   @retval EFI_SUCCESS           The information derived from
                                 QEMU_LOADER_WRITE_POINTER has been successfully
@@ -271,9 +273,9 @@ TransferS3ContextToBootScript (
   // (2) call QEMU with the FW_CFG_DMA_ACCESS object,
   // (3) wait for the select+skip to finish,
   // (4) restore a SCRATCH_BUFFER object in reserved memory that writes
-  //     PointerValue (base address of the allocated / downloaded PointeeFile),
-  //     of size PointerSize, into the fw_cfg file selected in (1), at the
-  //     offset sought to in (1),
+  //     PointerValue (base address of the allocated / downloaded PointeeFile,
+  //     plus PointeeOffset), of size PointerSize, into the fw_cfg file
+  //     selected in (1), at the offset sought to in (1),
   // (5) call QEMU with the FW_CFG_DMA_ACCESS object,
   // (6) wait for the write to finish.
   //
@@ -346,8 +348,8 @@ TransferS3ContextToBootScript (
     //
     // (4) restore a SCRATCH_BUFFER object in reserved memory that writes
     //     PointerValue (base address of the allocated / downloaded
-    //     PointeeFile), of size PointerSize, into the fw_cfg file selected in
-    //     (1), at the offset sought to in (1),
+    //     PointeeFile, plus PointeeOffset), of size PointerSize, into the
+    //     fw_cfg file selected in (1), at the offset sought to in (1),
     //
     Access->Control = SwapBytes32 (FW_CFG_DMA_CTL_WRITE);
     Access->Length = SwapBytes32 (Condensed->PointerSize);
-- 
2.9.3




  parent reply	other threads:[~2017-02-21 15:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 15:38 [PATCH 0/6] OvmfPkg: AcpiPlatformDxe, QemuFwCfg: small cleanups after WRITE_POINTER Laszlo Ersek
2017-02-21 15:38 ` [PATCH 1/6] OvmfPkg/AcpiPlatformDxe: drop double right shift in ADD/WRITE POINTER cmds Laszlo Ersek
2017-02-21 15:38 ` Laszlo Ersek [this message]
2017-02-21 15:38 ` [PATCH 3/6] OvmfPkg/QemuFwCfgLib: move types/macros from lib class to IndustryStandard Laszlo Ersek
2017-02-21 15:38 ` [PATCH 4/6] OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_SELECTOR, adapt the package Laszlo Ersek
2017-02-21 15:38 ` [PATCH 5/6] OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_DATA, " Laszlo Ersek
2017-02-21 15:38 ` [PATCH 6/6] OvmfPkg/QemuFwCfg: introduce FW_CFG_IO_DMA_ADDRESS, " Laszlo Ersek
2017-02-22  1:58 ` [PATCH 0/6] OvmfPkg: AcpiPlatformDxe, QemuFwCfg: small cleanups after WRITE_POINTER Jordan Justen
2017-02-22  2:41   ` 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=20170221153812.1420-3-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