From nobody Sat Nov 2 16:34:13 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 148727771343554.258020372621445; Thu, 16 Feb 2017 12:41:53 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 3BF39820FC; Thu, 16 Feb 2017 12:41:52 -0800 (PST) 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 X-Original-To: edk2-devel@ml01.01.org From: Laszlo Ersek To: edk2-devel-01 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: [edk2] [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: , Cc: Jordan Justen MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Cc: Jordan Justen Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3D359 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 @@ =20 typedef enum { QemuLoaderCmdAllocate =3D 1, QemuLoaderCmdAddPointer, QemuLoaderCmdAddChecksum, + QemuLoaderCmdWritePointer, } QEMU_LOADER_COMMAND_TYPE; =20 typedef enum { QemuLoaderAllocHigh =3D 1, QemuLoaderAllocFSeg @@ -70,16 +71,41 @@ typedef struct { UINT32 ResultOffset; UINT32 Start; UINT32 Length; } QEMU_LOADER_ADD_CHECKSUM; =20 +// +// QemuLoaderCmdWritePointer: the bytes at +// [PointerOffset..PointerOffset+PointerSize) in the writeable fw_cfg file +// PointerFile are to receive the absolute address of PointeeFile, as allo= cated +// and downloaded by the firmware, incremented by the value of PointeeOffs= et. +// Store the sum of (a) the base address of where PointeeFile's contents h= ave +// been placed (when QemuLoaderCmdAllocate has been executed for PointeeFi= le) +// and (b) PointeeOffset, to this portion of PointerFile. +// +// This command is similar to QemuLoaderCmdAddPointer; the difference is t= hat +// 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 val= ues 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 () =20 --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel