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/5] OvmfPkg/AcpiPlatformDxe: add QEMU_LOADER_WRITE_POINTER definitions
Date: Thu, 16 Feb 2017 21:41:34 +0100	[thread overview]
Message-ID: <20170216204137.30221-3-lersek@redhat.com> (raw)
In-Reply-To: <20170216204137.30221-1-lersek@redhat.com>

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 OvmfPkg/AcpiPlatformDxe/QemuLoader.h | 26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/OvmfPkg/AcpiPlatformDxe/QemuLoader.h b/OvmfPkg/AcpiPlatformDxe/QemuLoader.h
index b29944378d76..437776d86d9a 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuLoader.h
+++ b/OvmfPkg/AcpiPlatformDxe/QemuLoader.h
@@ -26,10 +26,11 @@
 
 typedef enum {
   QemuLoaderCmdAllocate = 1,
   QemuLoaderCmdAddPointer,
   QemuLoaderCmdAddChecksum,
+  QemuLoaderCmdWritePointer,
 } QEMU_LOADER_COMMAND_TYPE;
 
 typedef enum {
   QemuLoaderAllocHigh = 1,
   QemuLoaderAllocFSeg
@@ -70,16 +71,41 @@ typedef struct {
   UINT32 ResultOffset;
   UINT32 Start;
   UINT32 Length;
 } QEMU_LOADER_ADD_CHECKSUM;
 
+//
+// QemuLoaderCmdWritePointer: the bytes at
+// [PointerOffset..PointerOffset+PointerSize) in the writeable fw_cfg file
+// PointerFile are to receive the absolute address of PointeeFile, as allocated
+// and downloaded by the firmware, incremented by the value of PointeeOffset.
+// Store the sum of (a) the base address of where PointeeFile's contents have
+// been placed (when QemuLoaderCmdAllocate has been executed for PointeeFile)
+// and (b) PointeeOffset, to this portion of PointerFile.
+//
+// This command is similar to QemuLoaderCmdAddPointer; the difference is that
+// the "pointer to patch" does not exist in guest-physical address space, only
+// in "fw_cfg file space". In addition, the "pointer to patch" is not
+// initialized by QEMU in-place with a possibly nonzero offset value: the
+// relative offset into PointeeFile comes from the explicit PointeeOffset
+// field.
+//
+typedef struct {
+  UINT8  PointerFile[QEMU_LOADER_FNAME_SIZE]; // NUL-terminated
+  UINT8  PointeeFile[QEMU_LOADER_FNAME_SIZE]; // NUL-terminated
+  UINT32 PointerOffset;
+  UINT32 PointeeOffset;
+  UINT8  PointerSize;                         // one of 1, 2, 4, 8
+} QEMU_LOADER_WRITE_POINTER;
+
 typedef struct {
   UINT32 Type;                             // QEMU_LOADER_COMMAND_TYPE values
   union {
     QEMU_LOADER_ALLOCATE      Allocate;
     QEMU_LOADER_ADD_POINTER   AddPointer;
     QEMU_LOADER_ADD_CHECKSUM  AddChecksum;
+    QEMU_LOADER_WRITE_POINTER WritePointer;
     UINT8                     Padding[124];
   } Command;
 } QEMU_LOADER_ENTRY;
 #pragma pack ()
 
-- 
2.9.3




  parent reply	other threads:[~2017-02-16 20:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-16 20:41 [PATCH 0/5] OvmfPkg: support QEMU_LOADER_WRITE_POINTER Laszlo Ersek
2017-02-16 20:41 ` [PATCH 1/5] OvmfPkg/AcpiPlatformDxe: prepare for QEMU_LOADER_WRITE_POINTER definitions Laszlo Ersek
2017-02-16 20:41 ` Laszlo Ersek [this message]
2017-02-16 20:41 ` [PATCH 3/5] OvmfPkg/AcpiPlatformDxe: rewrap license block in "QemuFwCfgAcpi.c" Laszlo Ersek
2017-02-16 20:41 ` [PATCH 4/5] OvmfPkg/AcpiPlatformDxe: implement the QEMU_LOADER_WRITE_POINTER command Laszlo Ersek
2017-02-17 19:34   ` Jordan Justen
2017-02-17 20:51     ` Laszlo Ersek
2017-02-16 20:41 ` [PATCH 5/5] OvmfPkg/AcpiPlatformDxe: replay QEMU_LOADER_WRITE_POINTER commands at S3 Laszlo Ersek
2017-02-17 21:25   ` Jordan Justen
2017-02-17 22:41     ` Laszlo Ersek
2017-02-17 22:48       ` Laszlo Ersek
2017-02-21  0:17         ` Jordan Justen
2017-02-21 12:15           ` 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=20170216204137.30221-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