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 6246B81F3A for ; Thu, 16 Feb 2017 12:41:50 -0800 (PST) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F29D761BA8; Thu, 16 Feb 2017 20:41:50 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-72.phx2.redhat.com [10.3.116.72]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1GKfgnZ011444; Thu, 16 Feb 2017 15:41:50 -0500 From: Laszlo Ersek To: edk2-devel-01 Cc: Jordan Justen Date: Thu, 16 Feb 2017 21:41:34 +0100 Message-Id: <20170216204137.30221-3-lersek@redhat.com> In-Reply-To: <20170216204137.30221-1-lersek@redhat.com> References: <20170216204137.30221-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 16 Feb 2017 20:41:51 +0000 (UTC) Subject: [PATCH 2/5] OvmfPkg/AcpiPlatformDxe: add QEMU_LOADER_WRITE_POINTER definitions X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Feb 2017 20:41:50 -0000 Cc: Jordan Justen Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=359 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- 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