From nobody Sun Nov 24 14:43:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=oro.sh ARC-Seal: i=1; a=rsa-sha256; t=1722603149; cv=none; d=zohomail.com; s=zohoarc; b=Xg34cO+GC8UayNWpbamtGC55AI+kiDVeXVFFCg4xRswQZ2l9RZr9nXGHZ+Iu+QwahqX3Wmmj3prSacLuz7Rn+Al0rGncbo0ZnFLge5U5wtKDBdXUvw8OWOlpEq8eWjREuVwBq2ZFpI1jNhyTuIjHzkaDjbR5YDDCXNGuLva3tNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1722603149; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yFCW6+JCo6EKvl12jXJZXQ1CcdpBm41NoW/x9AFHQQE=; b=DqYsJ9W5UZZhRYSEHyNixq38ifmamujfQAngMxvGaWoZOHjRqaizOMiBxT+KZ2TAM5X9aqCgjQ7fvuaUQI+EdDX6L08/EhZw5ZZbKPrkVm3xXjpHzjdF/qvDqe9yZgm8qzwQSPiwULwEk74V+8BlIFhJFcHYgQYF0/GPqkG8CrQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1722603149063296.5825248233423; Fri, 2 Aug 2024 05:52:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sZrlT-00084X-5U; Fri, 02 Aug 2024 08:52:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZrlR-00083q-Me for qemu-devel@nongnu.org; Fri, 02 Aug 2024 08:52:09 -0400 Received: from out-177.mta1.migadu.com ([2001:41d0:203:375::b1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sZrlN-0002fJ-N7 for qemu-devel@nongnu.org; Fri, 02 Aug 2024 08:52:09 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oro.sh; s=key1; t=1722603122; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yFCW6+JCo6EKvl12jXJZXQ1CcdpBm41NoW/x9AFHQQE=; b=OMGama4KNaHFqfMysNkvgiz53ckhqDJTcsqvS2tgVvleJPcp8XHxYCa/0rrjYvZebQzwlB CJhrG1XvhY+lHyWIEanPlvCj7dz267Z2LTXT+tdGH3vEoqNggK0kYZsc+yPUQJHcn1YimT /w6Oe3G1HBvJkAatNWwtKVqF1fI9dog= From: Josh Junon To: qemu-devel@nongnu.org Cc: Josh Junon , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Eric Blake , Markus Armbruster , Eduardo Habkost , Marcel Apfelbaum , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Yanan Wang , Zhao Liu , Paolo Bonzini , Richard Henderson Subject: [PATCH v2] qmp: Use unsigned integers for address parameters Date: Fri, 2 Aug 2024 14:51:32 +0200 Message-Id: <20240802125132.19860-1-junon@oro.sh> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2001:41d0:203:375::b1; envelope-from=junon@oro.sh; helo=out-177.mta1.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @oro.sh) X-ZM-MESSAGEID: 1722603151595116600 Content-Type: text/plain; charset="utf-8" Fixes higher-half address parsing for QMP commands `[p]memsave` and `dump-guest-memory`. Signed-off-by: Josh Junon --- dump/dump.c | 4 ++-- qapi/dump.json | 2 +- qapi/machine.json | 11 +++++++++-- system/cpus.c | 8 ++++---- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 45e84428ae..00a1323735 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -2063,8 +2063,8 @@ DumpQueryResult *qmp_query_dump(Error **errp) =20 void qmp_dump_guest_memory(bool paging, const char *protocol, bool has_detach, bool detach, - bool has_begin, int64_t begin, - bool has_length, int64_t length, + bool has_begin, uint64_t begin, + bool has_length, uint64_t length, bool has_format, DumpGuestMemoryFormat format, Error **errp) { diff --git a/qapi/dump.json b/qapi/dump.json index d8145dad97..3b751c0356 100644 --- a/qapi/dump.json +++ b/qapi/dump.json @@ -102,7 +102,7 @@ ## { 'command': 'dump-guest-memory', 'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool', - '*begin': 'int', '*length': 'int', + '*begin': 'uint64', '*length': 'size', '*format': 'DumpGuestMemoryFormat'} } =20 ## diff --git a/qapi/machine.json b/qapi/machine.json index fcfd249e2d..fb618dc99f 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -852,7 +852,11 @@ # <- { "return": {} } ## { 'command': 'memsave', - 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': '= int'} } + 'data': { + 'val': 'uint64', + 'size': 'size', + 'filename': 'str', + '*cpu-index': 'int' } } =20 ## # @pmemsave: @@ -878,7 +882,10 @@ # <- { "return": {} } ## { 'command': 'pmemsave', - 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} } + 'data': { + 'val': 'uint64', + 'size': 'size', + 'filename': 'str' } } =20 ## # @Memdev: diff --git a/system/cpus.c b/system/cpus.c index 5e3a988a0a..128face42b 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -792,14 +792,14 @@ int vm_stop_force_state(RunState state) } } =20 -void qmp_memsave(int64_t addr, int64_t size, const char *filename, +void qmp_memsave(uint64_t addr, uint64_t size, const char *filename, bool has_cpu, int64_t cpu_index, Error **errp) { FILE *f; uint32_t l; CPUState *cpu; uint8_t buf[1024]; - int64_t orig_addr =3D addr, orig_size =3D size; + uint64_t orig_addr =3D addr, orig_size =3D size; =20 if (!has_cpu) { cpu_index =3D 0; @@ -840,11 +840,11 @@ exit: fclose(f); } =20 -void qmp_pmemsave(int64_t addr, int64_t size, const char *filename, +void qmp_pmemsave(uint64_t addr, uint64_t size, const char *filename, Error **errp) { FILE *f; - uint32_t l; + uint64_t l; uint8_t buf[1024]; =20 f =3D fopen(filename, "wb"); --=20 2.34.1