From nobody Sat May 4 05:48:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150212992641432.52103684230747; Mon, 7 Aug 2017 11:18:46 -0700 (PDT) Received: from localhost ([::1]:38812 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demc0-0007rB-TI for importer@patchew.org; Mon, 07 Aug 2017 14:18:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demZs-0006ML-Kh for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1demZn-0008AL-D6 for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48720) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1demZn-00089O-3o for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:27 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDDF4883C4 for ; Mon, 7 Aug 2017 18:16:25 +0000 (UTC) Received: from localhost (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 63A3A8F36A; Mon, 7 Aug 2017 18:16:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DDDF4883C4 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 20:16:11 +0200 Message-Id: <20170807181618.22562-2-marcandre.lureau@redhat.com> In-Reply-To: <20170807181618.22562-1-marcandre.lureau@redhat.com> References: <20170807181618.22562-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 07 Aug 2017 18:16:26 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 1/8] fw_cfg: rename read callback X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, anderson@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , imammedo@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The callback is called on select. Furthermore, the next patch introduced a new callback, so rename the function type with a generic name. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/hw/loader.h | 2 +- include/hw/nvram/fw_cfg.h | 7 ++++--- hw/core/loader.c | 2 +- hw/nvram/fw_cfg.c | 30 ++++++++++++++++-------------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/include/hw/loader.h b/include/hw/loader.h index 490c9ff8e6..355fe0f5a2 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -192,7 +192,7 @@ int rom_add_file(const char *file, const char *fw_dir, MemoryRegion *rom_add_blob(const char *name, const void *blob, size_t len, size_t max_len, hwaddr addr, const char *fw_file_name, - FWCfgReadCallback fw_callback, + FWCfgCallback fw_callback, void *callback_opaque, AddressSpace *as, bool read_only); int rom_add_elf_program(const char *name, void *data, size_t datasize, diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index b77ea48abb..f50d068563 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -44,7 +44,7 @@ typedef struct FWCfgDmaAccess { uint64_t address; } QEMU_PACKED FWCfgDmaAccess; =20 -typedef void (*FWCfgReadCallback)(void *opaque); +typedef void (*FWCfgCallback)(void *opaque); =20 struct FWCfgState { /*< private >*/ @@ -182,7 +182,7 @@ void fw_cfg_add_file(FWCfgState *s, const char *filenam= e, void *data, * fw_cfg_add_file_callback: * @s: fw_cfg device being modified * @filename: name of new fw_cfg file item - * @callback: callback function + * @select_cb: callback function when selecting * @callback_opaque: argument to be passed into callback function * @data: pointer to start of item data * @len: size of item data @@ -201,7 +201,8 @@ void fw_cfg_add_file(FWCfgState *s, const char *filenam= e, void *data, * with FW_CFG_DMA_CTL_SELECT). */ void fw_cfg_add_file_callback(FWCfgState *s, const char *filename, - FWCfgReadCallback callback, void *callback_o= paque, + FWCfgCallback select_cb, + void *callback_opaque, void *data, size_t len, bool read_only); =20 /** diff --git a/hw/core/loader.c b/hw/core/loader.c index ebe574c7ea..4593061445 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -989,7 +989,7 @@ err: =20 MemoryRegion *rom_add_blob(const char *name, const void *blob, size_t len, size_t max_len, hwaddr addr, const char *fw_file_name, - FWCfgReadCallback fw_callback, void *callback_opaque, + FWCfgCallback fw_callback, void *callback_opaque, AddressSpace *as, bool read_only) { MachineClass *mc =3D MACHINE_GET_CLASS(qdev_get_machine()); diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 5bd904487f..e3bd626b8c 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -55,7 +55,7 @@ struct FWCfgEntry { bool allow_write; uint8_t *data; void *callback_opaque; - FWCfgReadCallback read_callback; + FWCfgCallback select_cb; }; =20 #define JPG_FILE 0 @@ -236,8 +236,8 @@ static int fw_cfg_select(FWCfgState *s, uint16_t key) /* entry successfully selected, now run callback if present */ arch =3D !!(key & FW_CFG_ARCH_LOCAL); e =3D &s->entries[arch][key & FW_CFG_ENTRY_MASK]; - if (e->read_callback) { - e->read_callback(e->callback_opaque); + if (e->select_cb) { + e->select_cb(e->callback_opaque); } } =20 @@ -568,11 +568,11 @@ static const VMStateDescription vmstate_fw_cfg =3D { } }; =20 -static void fw_cfg_add_bytes_read_callback(FWCfgState *s, uint16_t key, - FWCfgReadCallback callback, - void *callback_opaque, - void *data, size_t len, - bool read_only) +static void fw_cfg_add_bytes_callback(FWCfgState *s, uint16_t key, + FWCfgCallback select_cb, + void *callback_opaque, + void *data, size_t len, + bool read_only) { int arch =3D !!(key & FW_CFG_ARCH_LOCAL); =20 @@ -583,7 +583,7 @@ static void fw_cfg_add_bytes_read_callback(FWCfgState *= s, uint16_t key, =20 s->entries[arch][key].data =3D data; s->entries[arch][key].len =3D (uint32_t)len; - s->entries[arch][key].read_callback =3D callback; + s->entries[arch][key].select_cb =3D select_cb; s->entries[arch][key].callback_opaque =3D callback_opaque; s->entries[arch][key].allow_write =3D !read_only; } @@ -610,7 +610,7 @@ static void *fw_cfg_modify_bytes_read(FWCfgState *s, ui= nt16_t key, =20 void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, void *data, size_t len) { - fw_cfg_add_bytes_read_callback(s, key, NULL, NULL, data, len, true); + fw_cfg_add_bytes_callback(s, key, NULL, NULL, data, len, true); } =20 void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value) @@ -736,7 +736,8 @@ static int get_fw_cfg_order(FWCfgState *s, const char *= name) } =20 void fw_cfg_add_file_callback(FWCfgState *s, const char *filename, - FWCfgReadCallback callback, void *callback_o= paque, + FWCfgCallback select_cb, + void *callback_opaque, void *data, size_t len, bool read_only) { int i, index, count; @@ -798,9 +799,10 @@ void fw_cfg_add_file_callback(FWCfgState *s, const ch= ar *filename, } } =20 - fw_cfg_add_bytes_read_callback(s, FW_CFG_FILE_FIRST + index, - callback, callback_opaque, data, len, - read_only); + fw_cfg_add_bytes_callback(s, FW_CFG_FILE_FIRST + index, + select_cb, + callback_opaque, data, len, + read_only); =20 s->files->f[index].size =3D cpu_to_be32(len); s->files->f[index].select =3D cpu_to_be16(FW_CFG_FILE_FIRST + index); --=20 2.14.0.1.geff633fa0 From nobody Sat May 4 05:48:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502130083810889.2060801754217; Mon, 7 Aug 2017 11:21:23 -0700 (PDT) Received: from localhost ([::1]:38827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demeY-00025F-Dn for importer@patchew.org; Mon, 07 Aug 2017 14:21:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39439) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demZy-0006YX-7Z for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1demZs-0008Ip-NQ for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43178) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1demZs-0008Hz-Eu for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:32 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C7FB6148C; Mon, 7 Aug 2017 18:16:31 +0000 (UTC) Received: from localhost (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2588562688; Mon, 7 Aug 2017 18:16:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6C7FB6148C Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 20:16:12 +0200 Message-Id: <20170807181618.22562-3-marcandre.lureau@redhat.com> In-Reply-To: <20170807181618.22562-1-marcandre.lureau@redhat.com> References: <20170807181618.22562-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 07 Aug 2017 18:16:31 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 2/8] fw_cfg: add write callback X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, Ben Warren , mst@redhat.com, Paolo Bonzini , anderson@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , imammedo@redhat.com, lersek@redhat.com, Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Reintroduce the write callback that was removed when write support was removed in commit 023e3148567ac898c7258138f8e86c3c2bb40d07. The write_cb callback is called when a write reaches the end of file, that is when the write pointer/offset reaches the size of the file. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/hw/nvram/fw_cfg.h | 2 ++ hw/acpi/vmgenid.c | 2 +- hw/core/loader.c | 2 +- hw/i386/acpi-build.c | 2 +- hw/isa/lpc_ich9.c | 4 ++-- hw/nvram/fw_cfg.c | 18 ++++++++++++++---- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index f50d068563..3527cd51d8 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -183,6 +183,7 @@ void fw_cfg_add_file(FWCfgState *s, const char *filenam= e, void *data, * @s: fw_cfg device being modified * @filename: name of new fw_cfg file item * @select_cb: callback function when selecting + * @write_cb: callback function when write reached EOF * @callback_opaque: argument to be passed into callback function * @data: pointer to start of item data * @len: size of item data @@ -202,6 +203,7 @@ void fw_cfg_add_file(FWCfgState *s, const char *filenam= e, void *data, */ void fw_cfg_add_file_callback(FWCfgState *s, const char *filename, FWCfgCallback select_cb, + FWCfgCallback write_cb, void *callback_opaque, void *data, size_t len, bool read_only); =20 diff --git a/hw/acpi/vmgenid.c b/hw/acpi/vmgenid.c index a32b847fe0..c1e935da9f 100644 --- a/hw/acpi/vmgenid.c +++ b/hw/acpi/vmgenid.c @@ -124,7 +124,7 @@ void vmgenid_add_fw_cfg(VmGenIdState *vms, FWCfgState *= s, GArray *guid) fw_cfg_add_file(s, VMGENID_GUID_FW_CFG_FILE, guid->data, VMGENID_FW_CFG_SIZE); /* Create a read-write fw_cfg file for Address */ - fw_cfg_add_file_callback(s, VMGENID_ADDR_FW_CFG_FILE, NULL, NULL, + fw_cfg_add_file_callback(s, VMGENID_ADDR_FW_CFG_FILE, NULL, NULL, NULL, vms->vmgenid_addr_le, ARRAY_SIZE(vms->vmgenid_addr_le), false); } diff --git a/hw/core/loader.c b/hw/core/loader.c index 4593061445..91669d65aa 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -1023,7 +1023,7 @@ MemoryRegion *rom_add_blob(const char *name, const vo= id *blob, size_t len, } =20 fw_cfg_add_file_callback(fw_cfg, fw_file_name, - fw_callback, callback_opaque, + fw_callback, NULL, callback_opaque, data, rom->datasize, read_only); } return mr; diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index b9c245c9bb..be2992b708 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2922,7 +2922,7 @@ void acpi_setup(void) =20 build_state->rsdp =3D g_memdup(tables.rsdp->data, rsdp_size); fw_cfg_add_file_callback(pcms->fw_cfg, ACPI_BUILD_RSDP_FILE, - acpi_build_update, build_state, + acpi_build_update, NULL, build_state, build_state->rsdp, rsdp_size, true); build_state->rsdp_mr =3D NULL; } else { diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index ac8416d42b..de8fbb7260 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -402,12 +402,12 @@ void ich9_lpc_pm_init(PCIDevice *lpc_pci, bool smm_en= abled) * just link them into fw_cfg here. */ fw_cfg_add_file_callback(fw_cfg, "etc/smi/requested-features", - NULL, NULL, + NULL, NULL, NULL, lpc->smi_guest_features_le, sizeof lpc->smi_guest_features_le, false); fw_cfg_add_file_callback(fw_cfg, "etc/smi/features-ok", - smi_features_ok_callback, lpc, + smi_features_ok_callback, NULL, lpc, &lpc->smi_features_ok, sizeof lpc->smi_features_ok, true); diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index e3bd626b8c..28780088b9 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -56,6 +56,7 @@ struct FWCfgEntry { uint8_t *data; void *callback_opaque; FWCfgCallback select_cb; + FWCfgCallback write_cb; }; =20 #define JPG_FILE 0 @@ -384,6 +385,12 @@ static void fw_cfg_dma_transfer(FWCfgState *s) stl_be_dma(s->dma_as, dma_addr + offsetof(FWCfgDmaAccess, control), dma.control); =20 + if (write && + !(dma.control & FW_CFG_DMA_CTL_ERROR) && + s->cur_offset =3D=3D e->len) { + e->write_cb(e->callback_opaque); + } + trace_fw_cfg_read(s, 0); } =20 @@ -570,6 +577,7 @@ static const VMStateDescription vmstate_fw_cfg =3D { =20 static void fw_cfg_add_bytes_callback(FWCfgState *s, uint16_t key, FWCfgCallback select_cb, + FWCfgCallback write_cb, void *callback_opaque, void *data, size_t len, bool read_only) @@ -584,6 +592,7 @@ static void fw_cfg_add_bytes_callback(FWCfgState *s, ui= nt16_t key, s->entries[arch][key].data =3D data; s->entries[arch][key].len =3D (uint32_t)len; s->entries[arch][key].select_cb =3D select_cb; + s->entries[arch][key].write_cb =3D write_cb; s->entries[arch][key].callback_opaque =3D callback_opaque; s->entries[arch][key].allow_write =3D !read_only; } @@ -610,7 +619,7 @@ static void *fw_cfg_modify_bytes_read(FWCfgState *s, ui= nt16_t key, =20 void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, void *data, size_t len) { - fw_cfg_add_bytes_callback(s, key, NULL, NULL, data, len, true); + fw_cfg_add_bytes_callback(s, key, NULL, NULL, NULL, data, len, true); } =20 void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value) @@ -737,6 +746,7 @@ static int get_fw_cfg_order(FWCfgState *s, const char *= name) =20 void fw_cfg_add_file_callback(FWCfgState *s, const char *filename, FWCfgCallback select_cb, + FWCfgCallback write_cb, void *callback_opaque, void *data, size_t len, bool read_only) { @@ -800,7 +810,7 @@ void fw_cfg_add_file_callback(FWCfgState *s, const cha= r *filename, } =20 fw_cfg_add_bytes_callback(s, FW_CFG_FILE_FIRST + index, - select_cb, + select_cb, write_cb, callback_opaque, data, len, read_only); =20 @@ -815,7 +825,7 @@ void fw_cfg_add_file_callback(FWCfgState *s, const cha= r *filename, void fw_cfg_add_file(FWCfgState *s, const char *filename, void *data, size_t len) { - fw_cfg_add_file_callback(s, filename, NULL, NULL, data, len, true); + fw_cfg_add_file_callback(s, filename, NULL, NULL, NULL, data, len, tru= e); } =20 void *fw_cfg_modify_file(FWCfgState *s, const char *filename, @@ -838,7 +848,7 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *fil= ename, } } /* add new one */ - fw_cfg_add_file_callback(s, filename, NULL, NULL, data, len, true); + fw_cfg_add_file_callback(s, filename, NULL, NULL, NULL, data, len, tru= e); return NULL; } =20 --=20 2.14.0.1.geff633fa0 From nobody Sat May 4 05:48:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502130079125410.15856608574245; Mon, 7 Aug 2017 11:21:19 -0700 (PDT) Received: from localhost ([::1]:38825 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demeT-00021i-Qk for importer@patchew.org; Mon, 07 Aug 2017 14:21:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dema3-0006dz-HD for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1demZy-0008NQ-8L for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39780) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1demZx-0008Mi-Vh for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:38 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 07A2B7EA95 for ; Mon, 7 Aug 2017 18:16:37 +0000 (UTC) Received: from localhost (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 922886A317; Mon, 7 Aug 2017 18:16:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 07A2B7EA95 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 20:16:13 +0200 Message-Id: <20170807181618.22562-4-marcandre.lureau@redhat.com> In-Reply-To: <20170807181618.22562-1-marcandre.lureau@redhat.com> References: <20170807181618.22562-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 07 Aug 2017 18:16:37 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 3/8] fw_cfg: add vmcoreinfo file X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, anderson@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , imammedo@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" See docs/specs/fw_cfg.txt for details. The "etc/vmcoreinfo" is added when using "-global fw_cfg.vmcoreinfo=3Don" qemu option. Disabled by default for machine types v2.9 and older. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/hw/compat.h | 8 ++++++++ include/hw/nvram/fw_cfg.h | 9 +++++++++ hw/nvram/fw_cfg.c | 20 ++++++++++++++++++++ docs/specs/fw_cfg.txt | 16 ++++++++++++++++ 4 files changed, 53 insertions(+) diff --git a/include/hw/compat.h b/include/hw/compat.h index 08f36004da..317fd2e2e3 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -18,6 +18,14 @@ .driver =3D "pcie-root-port",\ .property =3D "x-migrate-msix",\ .value =3D "false",\ + },{\ + .driver =3D "fw_cfg_mem",\ + .property =3D "vmcoreinfo",\ + .value =3D "off",\ + },{\ + .driver =3D "fw_cfg_io",\ + .property =3D "vmcoreinfo",\ + .value =3D "off",\ }, =20 #define HW_COMPAT_2_8 \ diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index 3527cd51d8..a35f47405d 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -30,6 +30,11 @@ typedef struct FWCfgFile { void fw_cfg_set_order_override(FWCfgState *fw_cfg, int order); void fw_cfg_reset_order_override(FWCfgState *fw_cfg); =20 +typedef struct FWCfgVMCoreInfo { + uint64_t paddr; + uint32_t size; +} QEMU_PACKED FWCfgVMCoreInfo; + typedef struct FWCfgFiles { uint32_t count; FWCfgFile f[]; @@ -65,6 +70,10 @@ struct FWCfgState { dma_addr_t dma_addr; AddressSpace *dma_as; MemoryRegion dma_iomem; + + bool vmcoreinfo_enabled; + bool has_vmcoreinfo; + FWCfgVMCoreInfo vmcoreinfo; }; =20 struct FWCfgIoState { diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 28780088b9..342afc4ed2 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -504,6 +504,7 @@ static void fw_cfg_reset(DeviceState *d) =20 /* we never register a read callback for FW_CFG_SIGNATURE */ fw_cfg_select(s, FW_CFG_SIGNATURE); + s->has_vmcoreinfo =3D false; } =20 /* Save restore 32 bit int as uint16_t @@ -869,7 +870,12 @@ static void fw_cfg_machine_ready(struct Notifier *n, v= oid *data) qemu_register_reset(fw_cfg_machine_reset, s); } =20 +static void fw_cfg_vmci_written(void *dev) +{ + FWCfgState *s =3D FW_CFG(dev); =20 + s->has_vmcoreinfo =3D true; +} =20 static void fw_cfg_common_realize(DeviceState *dev, Error **errp) { @@ -895,6 +901,16 @@ static void fw_cfg_common_realize(DeviceState *dev, Er= ror **errp) =20 fw_cfg_add_i32(s, FW_CFG_ID, version); =20 + if (s->vmcoreinfo_enabled) { + if (!s->dma_enabled) { + error_setg(errp, "vmcoreinfo requires dma_enabled"); + return; + } + fw_cfg_add_file_callback(s, "etc/vmcoreinfo", + NULL, fw_cfg_vmci_written, s, + &s->vmcoreinfo, sizeof(s->vmcoreinfo), fa= lse); + } + s->machine_ready.notify =3D fw_cfg_machine_ready; qemu_add_machine_init_done_notifier(&s->machine_ready); } @@ -1031,6 +1047,8 @@ static void fw_cfg_file_slots_allocate(FWCfgState *s,= Error **errp) static Property fw_cfg_io_properties[] =3D { DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled, true), + DEFINE_PROP_BOOL("vmcoreinfo", FWCfgIoState, parent_obj.vmcoreinfo_ena= bled, + true), DEFINE_PROP_UINT16("x-file-slots", FWCfgIoState, parent_obj.file_slots, FW_CFG_FILE_SLOTS_DFLT), DEFINE_PROP_END_OF_LIST(), @@ -1082,6 +1100,8 @@ static Property fw_cfg_mem_properties[] =3D { DEFINE_PROP_UINT32("data_width", FWCfgMemState, data_width, -1), DEFINE_PROP_BOOL("dma_enabled", FWCfgMemState, parent_obj.dma_enabled, true), + DEFINE_PROP_BOOL("vmcoreinfo", FWCfgMemState, parent_obj.vmcoreinfo_en= abled, + true), DEFINE_PROP_UINT16("x-file-slots", FWCfgMemState, parent_obj.file_slot= s, FW_CFG_FILE_SLOTS_DFLT), DEFINE_PROP_END_OF_LIST(), diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt index 08c00bdf44..37d0f9f40a 100644 --- a/docs/specs/fw_cfg.txt +++ b/docs/specs/fw_cfg.txt @@ -136,6 +136,22 @@ struct FWCfgFile { /* an individual file entry, 64 by= tes total */ char name[56]; /* fw_cfg item name, NUL-terminated ascii */ }; =20 +=3D=3D=3D etc/vmcoreinfo =3D=3D=3D + +A guest may use this entry to add information details to qemu +dumps. The entry gives location and size of an ELF note that is +appended in qemu dumps. + +The entry is of 12 bytes with this format: + +struct FWCfgVMCoreInfo { + uint64_t paddr; /* physical address of ELF note, LE */ + uint32_t size; /* size of ELF note region, LE */ +}; + +The note format/class must be of the target bitness and the size must +be less than 1Mb. + =3D=3D=3D All Other Data Items =3D=3D=3D =20 Please consult the QEMU source for the most up-to-date and authoritative l= ist --=20 2.14.0.1.geff633fa0 From nobody Sat May 4 05:48:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502130196212968.3958644242199; Mon, 7 Aug 2017 11:23:16 -0700 (PDT) Received: from localhost ([::1]:38836 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demgM-0003Od-TH for importer@patchew.org; Mon, 07 Aug 2017 14:23:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dema5-0006jM-5T for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1demZz-0008OE-QP for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43188) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1demZz-0008Np-HT for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:39 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 89EC0C047B7D for ; Mon, 7 Aug 2017 18:16:38 +0000 (UTC) Received: from localhost (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B7326A317; Mon, 7 Aug 2017 18:16:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 89EC0C047B7D Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 20:16:14 +0200 Message-Id: <20170807181618.22562-5-marcandre.lureau@redhat.com> In-Reply-To: <20170807181618.22562-1-marcandre.lureau@redhat.com> References: <20170807181618.22562-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 07 Aug 2017 18:16:38 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 4/8] dump: add guest ELF note X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, anderson@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , imammedo@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Read the guest ELF PT_NOTE from guest memory when fw_cfg etc/vmcoreinfo entry provides the location, and write it as an additional note in the dump. Signed-off-by: Marc-Andr=C3=A9 Lureau --- include/sysemu/dump.h | 2 + dump.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 105 insertions(+) diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index 2672a15f8b..df43bd0e07 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -192,6 +192,8 @@ typedef struct DumpState { * this could be used to calculate * how much work we have * finished. */ + uint8_t *guest_note; /* ELF note content */ + size_t guest_note_size; } DumpState; =20 uint16_t cpu_to_dump16(DumpState *s, uint16_t val); diff --git a/dump.c b/dump.c index d9090a24cc..7fe1044280 100644 --- a/dump.c +++ b/dump.c @@ -26,6 +26,8 @@ #include "qapi/qmp/qerror.h" #include "qmp-commands.h" #include "qapi-event.h" +#include "qemu/error-report.h" +#include "hw/nvram/fw_cfg.h" =20 #include #ifdef CONFIG_LZO @@ -38,6 +40,13 @@ #define ELF_MACHINE_UNAME "Unknown" #endif =20 +#define MAX_GUEST_NOTE_SIZE (1 << 20) /* 1MB should be enough */ + +#define ELF_NOTE_SIZE(hdr_size, name_size, desc_size) \ + ((DIV_ROUND_UP((hdr_size), 4) + \ + DIV_ROUND_UP((name_size), 4) + \ + DIV_ROUND_UP((desc_size), 4)) * 4) + uint16_t cpu_to_dump16(DumpState *s, uint16_t val) { if (s->dump_info.d_endian =3D=3D ELFDATA2LSB) { @@ -76,6 +85,8 @@ static int dump_cleanup(DumpState *s) guest_phys_blocks_free(&s->guest_phys_blocks); memory_mapping_list_free(&s->list); close(s->fd); + g_free(s->guest_note); + s->guest_note =3D NULL; if (s->resume) { if (s->detached) { qemu_mutex_lock_iothread(); @@ -235,6 +246,19 @@ static inline int cpu_index(CPUState *cpu) return cpu->cpu_index + 1; } =20 +static void write_guest_note(WriteCoreDumpFunction f, DumpState *s, + Error **errp) +{ + int ret; + + if (s->guest_note) { + ret =3D f(s->guest_note, s->guest_note_size, s); + if (ret < 0) { + error_setg(errp, "dump: failed to write guest note"); + } + } +} + static void write_elf64_notes(WriteCoreDumpFunction f, DumpState *s, Error **errp) { @@ -258,6 +282,8 @@ static void write_elf64_notes(WriteCoreDumpFunction f, = DumpState *s, return; } } + + write_guest_note(f, s, errp); } =20 static void write_elf32_note(DumpState *s, Error **errp) @@ -303,6 +329,8 @@ static void write_elf32_notes(WriteCoreDumpFunction f, = DumpState *s, return; } } + + write_guest_note(f, s, errp); } =20 static void write_elf_section(DumpState *s, int type, Error **errp) @@ -714,6 +742,44 @@ static int buf_write_note(const void *buf, size_t size= , void *opaque) return 0; } =20 +/* + * This function retrieves various sizes from an elf header. + * + * @note has to be a valid ELF note. The return sizes are unmodified + * (not padded or rounded up to be multiple of 4). + */ +static void get_note_sizes(DumpState *s, const void *note, + uint64_t *note_head_size, + uint64_t *name_size, + uint64_t *desc_size) +{ + uint64_t note_head_sz; + uint64_t name_sz; + uint64_t desc_sz; + + if (s->dump_info.d_class =3D=3D ELFCLASS64) { + const Elf64_Nhdr *hdr =3D note; + note_head_sz =3D sizeof(Elf64_Nhdr); + name_sz =3D tswap64(hdr->n_namesz); + desc_sz =3D tswap64(hdr->n_descsz); + } else { + const Elf32_Nhdr *hdr =3D note; + note_head_sz =3D sizeof(Elf32_Nhdr); + name_sz =3D tswap32(hdr->n_namesz); + desc_sz =3D tswap32(hdr->n_descsz); + } + + if (note_head_size) { + *note_head_size =3D note_head_sz; + } + if (name_size) { + *name_size =3D name_sz; + } + if (desc_size) { + *desc_size =3D desc_sz; + } +} + /* write common header, sub header and elf note to vmcore */ static void create_header32(DumpState *s, Error **errp) { @@ -1492,6 +1558,7 @@ static void dump_init(DumpState *s, int fd, bool has_= format, DumpGuestMemoryFormat format, bool paging, bool has_= filter, int64_t begin, int64_t length, Error **errp) { + FWCfgState *fw_cfg =3D fw_cfg_find(); CPUState *cpu; int nr_cpus; Error *err =3D NULL; @@ -1563,6 +1630,42 @@ static void dump_init(DumpState *s, int fd, bool has= _format, goto cleanup; } =20 + /* + * The goal of this block is to copy the guest note out of + * the guest. Failure to do so is not fatal for dumping. + */ + if (fw_cfg) { + uint64_t addr, note_head_size, name_size, desc_size; + uint32_t size; + + note_head_size =3D s->dump_info.d_class =3D=3D ELFCLASS32 ? + sizeof(Elf32_Nhdr) : sizeof(Elf64_Nhdr); + + size =3D le32_to_cpu(fw_cfg->vmcoreinfo.size); + addr =3D le64_to_cpu(fw_cfg->vmcoreinfo.paddr); + if (!fw_cfg->has_vmcoreinfo) { + warn_report("guest note is not present"); + } else if (size < note_head_size || size > MAX_GUEST_NOTE_SIZE) { + warn_report("guest note size is invalid: %" PRIu32, size); + } else { + s->guest_note =3D g_malloc(size + 1); /* +1 for adding \0 */ + cpu_physical_memory_read(addr, s->guest_note, size); + + get_note_sizes(s, s->guest_note, NULL, &name_size, &desc_size); + s->guest_note_size =3D ELF_NOTE_SIZE(note_head_size, name_size, + desc_size); + if (name_size > MAX_GUEST_NOTE_SIZE || + desc_size > MAX_GUEST_NOTE_SIZE || + s->guest_note_size > size) { + warn_report("Invalid guest note header"); + g_free(s->guest_note); + s->guest_note =3D NULL; + } else { + s->note_size +=3D s->guest_note_size; + } + } + } + /* get memory mapping */ if (paging) { qemu_get_guest_memory_mapping(&s->list, &s->guest_phys_blocks, &er= r); --=20 2.14.0.1.geff633fa0 From nobody Sat May 4 05:48:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502129954189581.2294985389859; Mon, 7 Aug 2017 11:19:14 -0700 (PDT) Received: from localhost ([::1]:38814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demcS-0008DZ-AF for importer@patchew.org; Mon, 07 Aug 2017 14:19:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39579) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demaE-0006uR-AH for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dema9-00007A-5p for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40142) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dema8-00005u-UP for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:49 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4F827EA88 for ; Mon, 7 Aug 2017 18:16:47 +0000 (UTC) Received: from localhost (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id D737C5D9C9; Mon, 7 Aug 2017 18:16:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D4F827EA88 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 20:16:15 +0200 Message-Id: <20170807181618.22562-6-marcandre.lureau@redhat.com> In-Reply-To: <20170807181618.22562-1-marcandre.lureau@redhat.com> References: <20170807181618.22562-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Mon, 07 Aug 2017 18:16:48 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 5/8] dump: update phys_base header field based on VMCOREINFO content X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, anderson@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , imammedo@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" If the guest note is VMCOREINFO, try to get phys_base from it. Signed-off-by: Marc-Andr=C3=A9 Lureau --- dump.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++= ++-- docs/specs/fw_cfg.txt | 8 ++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/dump.c b/dump.c index 7fe1044280..cef2dd5bf9 100644 --- a/dump.c +++ b/dump.c @@ -780,6 +780,23 @@ static void get_note_sizes(DumpState *s, const void *n= ote, } } =20 +static bool note_name_equal(DumpState *s, + const uint8_t *note, const char *name) +{ + int len =3D strlen(name) + 1; + uint64_t head_size, name_size; + + get_note_sizes(s, note, &head_size, &name_size, NULL); + head_size =3D ROUND_UP(head_size, 4); + + if (name_size !=3D len || + memcmp(note + head_size, "VMCOREINFO", len)) { + return false; + } + + return true; +} + /* write common header, sub header and elf note to vmcore */ static void create_header32(DumpState *s, Error **errp) { @@ -1554,6 +1571,39 @@ static int64_t dump_calculate_size(DumpState *s) return total; } =20 +static void vmcoreinfo_update_phys_base(DumpState *s) +{ + uint64_t size, note_head_size, name_size, phys_base; + char **lines; + uint8_t *vmci; + size_t i; + + if (!note_name_equal(s, s->guest_note, "VMCOREINFO")) { + return; + } + + get_note_sizes(s, s->guest_note, ¬e_head_size, &name_size, &size); + note_head_size =3D ROUND_UP(note_head_size, 4); + + vmci =3D s->guest_note + note_head_size + ROUND_UP(name_size, 4); + *(vmci + size) =3D '\0'; + + lines =3D g_strsplit((char *)vmci, "\n", -1); + for (i =3D 0; lines[i]; i++) { + if (g_str_has_prefix(lines[i], "NUMBER(phys_base)=3D")) { + if (qemu_strtou64(lines[i] + 18, NULL, 16, + &phys_base) < 0) { + warn_report("Failed to read NUMBER(phys_base)=3D"); + } else { + s->dump_info.phys_base =3D phys_base; + } + break; + } + } + + g_strfreev(lines); +} + static void dump_init(DumpState *s, int fd, bool has_format, DumpGuestMemoryFormat format, bool paging, bool has_= filter, int64_t begin, int64_t length, Error **errp) @@ -1631,8 +1681,9 @@ static void dump_init(DumpState *s, int fd, bool has_= format, } =20 /* - * The goal of this block is to copy the guest note out of - * the guest. Failure to do so is not fatal for dumping. + * The goal of this block is to (a) update the previously guessed + * phys_base, (b) copy the guest note note out of the guest. + * Failure to do so is not fatal for dumping. */ if (fw_cfg) { uint64_t addr, note_head_size, name_size, desc_size; @@ -1661,6 +1712,7 @@ static void dump_init(DumpState *s, int fd, bool has_= format, g_free(s->guest_note); s->guest_note =3D NULL; } else { + vmcoreinfo_update_phys_base(s); s->note_size +=3D s->guest_note_size; } } diff --git a/docs/specs/fw_cfg.txt b/docs/specs/fw_cfg.txt index 37d0f9f40a..64c6aaed1f 100644 --- a/docs/specs/fw_cfg.txt +++ b/docs/specs/fw_cfg.txt @@ -152,6 +152,14 @@ struct FWCfgVMCoreInfo { The note format/class must be of the target bitness and the size must be less than 1Mb. =20 +If the ELF note name is "VMCOREINFO", it is expected to be the Linux +vmcoreinfo note (see Documentation/ABI/testing/sysfs-kernel-vmcoreinfo +in Linux source). In this case, qemu dump code will read the content +as a key=3Dvalue text file, looking for "NUMBER(phys_base)" key +value. The value is expected to be more accurate than architecture +guess of the value. This is useful for KASLR-enabled guest with +ancient tools not handling the VMCOREINFO note. + =3D=3D=3D All Other Data Items =3D=3D=3D =20 Please consult the QEMU source for the most up-to-date and authoritative l= ist --=20 2.14.0.1.geff633fa0 From nobody Sat May 4 05:48:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502130106520455.92486510767833; Mon, 7 Aug 2017 11:21:46 -0700 (PDT) Received: from localhost ([::1]:38828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demev-0002Kh-D0 for importer@patchew.org; Mon, 07 Aug 2017 14:21:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demaJ-0006zA-O1 for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:17:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1demaE-0000Ay-Pe for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49536) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1demaE-0000AL-JO for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8A22C883A0 for ; Mon, 7 Aug 2017 18:16:53 +0000 (UTC) Received: from localhost (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0401D61F3E; Mon, 7 Aug 2017 18:16:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A22C883A0 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 20:16:16 +0200 Message-Id: <20170807181618.22562-7-marcandre.lureau@redhat.com> In-Reply-To: <20170807181618.22562-1-marcandre.lureau@redhat.com> References: <20170807181618.22562-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 07 Aug 2017 18:16:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 6/8] kdump: set vmcoreinfo location X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, anderson@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , imammedo@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" kdump header provides offset and size of the vmcoreinfo content, append it if available (skip the ELF note header). crash-7.1.9 was the first version that started looking in the vmcoreinfo data for phys_base instead of in the kdump_sub_header. Signed-off-by: Marc-Andr=C3=A9 Lureau --- dump.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dump.c b/dump.c index cef2dd5bf9..49805a3cdc 100644 --- a/dump.c +++ b/dump.c @@ -858,6 +858,18 @@ static void create_header32(DumpState *s, Error **errp) kh->dump_level =3D cpu_to_dump32(s, DUMP_LEVEL); =20 offset_note =3D DISKDUMP_HEADER_BLOCKS * block_size + size; + if (s->guest_note && + note_name_equal(s, s->guest_note, "VMCOREINFO")) { + uint64_t hsize, name_size, size_vmcoreinfo_desc, offset_vmcoreinfo; + + get_note_sizes(s, s->guest_note, + &hsize, &name_size, &size_vmcoreinfo_desc); + offset_vmcoreinfo =3D offset_note + s->note_size - s->guest_note_s= ize + + (DIV_ROUND_UP(hsize, 4) + DIV_ROUND_UP(name_size, 4)) * 4; + kh->offset_vmcoreinfo =3D cpu_to_dump64(s, offset_vmcoreinfo); + kh->size_vmcoreinfo =3D cpu_to_dump32(s, size_vmcoreinfo_desc); + } + kh->offset_note =3D cpu_to_dump64(s, offset_note); kh->note_size =3D cpu_to_dump32(s, s->note_size); =20 @@ -958,6 +970,18 @@ static void create_header64(DumpState *s, Error **errp) kh->dump_level =3D cpu_to_dump32(s, DUMP_LEVEL); =20 offset_note =3D DISKDUMP_HEADER_BLOCKS * block_size + size; + if (s->guest_note && + note_name_equal(s, s->guest_note, "VMCOREINFO")) { + uint64_t hsize, name_size, size_vmcoreinfo_desc, offset_vmcoreinfo; + + get_note_sizes(s, s->guest_note, + &hsize, &name_size, &size_vmcoreinfo_desc); + offset_vmcoreinfo =3D offset_note + s->note_size - s->guest_note_s= ize + + (DIV_ROUND_UP(hsize, 4) + DIV_ROUND_UP(name_size, 4)) * 4; + kh->offset_vmcoreinfo =3D cpu_to_dump64(s, offset_vmcoreinfo); + kh->size_vmcoreinfo =3D cpu_to_dump64(s, size_vmcoreinfo_desc); + } + kh->offset_note =3D cpu_to_dump64(s, offset_note); kh->note_size =3D cpu_to_dump64(s, s->note_size); =20 --=20 2.14.0.1.geff633fa0 From nobody Sat May 4 05:48:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502129989167695.3495303026001; Mon, 7 Aug 2017 11:19:49 -0700 (PDT) Received: from localhost ([::1]:38815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demd1-0000F3-Sd for importer@patchew.org; Mon, 07 Aug 2017 14:19:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demaP-00073z-1r for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:17:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1demaJ-0000DN-O5 for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:17:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49836) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1demaJ-0000Cw-EQ for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:16:59 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 066D8883BE for ; Mon, 7 Aug 2017 18:16:58 +0000 (UTC) Received: from localhost (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 959B35D96C; Mon, 7 Aug 2017 18:16:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 066D8883BE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 20:16:17 +0200 Message-Id: <20170807181618.22562-8-marcandre.lureau@redhat.com> In-Reply-To: <20170807181618.22562-1-marcandre.lureau@redhat.com> References: <20170807181618.22562-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 07 Aug 2017 18:16:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 7/8] scripts/dump-guest-memory.py: add vmcoreinfo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, anderson@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , imammedo@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add vmcoreinfo ELF note if fw-cfg has the memory location details. Signed-off-by: Marc-Andr=C3=A9 Lureau --- scripts/dump-guest-memory.py | 51 ++++++++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 51 insertions(+) diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py index f7c6635f15..1f97373f0d 100644 --- a/scripts/dump-guest-memory.py +++ b/scripts/dump-guest-memory.py @@ -14,6 +14,7 @@ the COPYING file in the top-level directory. """ =20 import ctypes +import struct =20 UINTPTR_T =3D gdb.lookup_type("uintptr_t") =20 @@ -45,6 +46,12 @@ EM_S390 =3D 22 EM_AARCH =3D 183 EM_X86_64 =3D 62 =20 +def le32_to_cpu(val): + return struct.unpack(" 1 << 20: + print('warning: invalid vmcoreinfo size') + return + # now get the full note + note =3D get_arch_note(self.endianness, + header.n_namesz - 1, header.n_descsz) + ctypes.memmove(ctypes.pointer(note), vmcoreinfo, ctypes.sizeof(not= e)) + + self.notes.append(note) + self.segments[0].p_filesz +=3D ctypes.sizeof(note) + self.segments[0].p_memsz +=3D ctypes.sizeof(note) + def add_segment(self, p_type, p_paddr, p_size): """Adds a segment to the elf.""" =20 @@ -505,6 +531,30 @@ shape and this command should mostly work.""" cur +=3D chunk_size left -=3D chunk_size =20 + def phys_memory_read(self, addr, size): + qemu_core =3D gdb.inferiors()[0] + for block in self.guest_phys_blocks: + if block["target_start"] <=3D addr \ + and addr + size <=3D block["target_end"]: + haddr =3D block["host_addr"] + (addr - block["target_start= "]) + return qemu_core.read_memory(haddr, size) + return None + + def add_vmcoreinfo(self): + if not gdb.parse_and_eval("fw_cfg_find()") \ + or not gdb.parse_and_eval("fw_cfg_find()->have_vmcoreinfo"): + return + + addr =3D gdb.parse_and_eval("fw_cfg_find()->vmcoreinfo.paddr") + size =3D gdb.parse_and_eval("fw_cfg_find()->vmcoreinfo.size") + + addr =3D le64_to_cpu(addr) + size =3D le32_to_cpu(size) + + vmcoreinfo =3D self.phys_memory_read(addr, size) + if vmcoreinfo: + self.elf.add_vmcoreinfo_note(vmcoreinfo.tobytes()) + def invoke(self, args, from_tty): """Handles command invocation from gdb.""" =20 @@ -518,6 +568,7 @@ shape and this command should mostly work.""" =20 self.elf =3D ELF(argv[1]) self.guest_phys_blocks =3D get_guest_phys_blocks() + self.add_vmcoreinfo() =20 with open(argv[0], "wb") as vmcore: self.dump_init(vmcore) --=20 2.14.0.1.geff633fa0 From nobody Sat May 4 05:48:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1502130268722885.0233929747428; Mon, 7 Aug 2017 11:24:28 -0700 (PDT) Received: from localhost ([::1]:38841 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demhX-00041P-1t for importer@patchew.org; Mon, 07 Aug 2017 14:24:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1demaV-00078B-8C for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:17:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1demaQ-0000Gl-CH for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:17:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41564) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1demaQ-0000GF-6n for qemu-devel@nongnu.org; Mon, 07 Aug 2017 14:17:06 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0F525DB935 for ; Mon, 7 Aug 2017 18:17:05 +0000 (UTC) Received: from localhost (ovpn-112-30.ams2.redhat.com [10.36.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 366328FBF6; Mon, 7 Aug 2017 18:16:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0F525DB935 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=marcandre.lureau@redhat.com From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= To: qemu-devel@nongnu.org Date: Mon, 7 Aug 2017 20:16:18 +0200 Message-Id: <20170807181618.22562-9-marcandre.lureau@redhat.com> In-Reply-To: <20170807181618.22562-1-marcandre.lureau@redhat.com> References: <20170807181618.22562-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 07 Aug 2017 18:17:05 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v5 8/8] MAINTAINERS: add Dump maintainers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ehabkost@redhat.com, mst@redhat.com, anderson@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , imammedo@redhat.com, lersek@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Proposing myself, since I have some familiarity with the code now. Signed-off-by: Marc-Andr=C3=A9 Lureau Acked-by: Laszlo Ersek --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index ccee28b12d..ed07334ffb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1286,6 +1286,15 @@ S: Maintained F: device_tree.c F: include/sysemu/device_tree.h =20 +Dump +S: Supported +M: Marc-Andr=C3=A9 Lureau +F: dump.c +F: stubs/dump.c +F: include/sysemu/dump.h +F: include/sysemu/dump-arch.h +F: scripts/dump-guest-memory.py + Error reporting M: Markus Armbruster S: Supported --=20 2.14.0.1.geff633fa0