{"id":2222137,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2222137/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-ppc/patch/20260410195323.17937-2-philmd@linaro.org/","project":{"id":69,"url":"http://patchwork.ozlabs.org/api/1.1/projects/69/?format=json","name":"QEMU powerpc development","link_name":"qemu-ppc","list_id":"qemu-ppc.nongnu.org","list_email":"qemu-ppc@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260410195323.17937-2-philmd@linaro.org>","date":"2026-04-10T19:52:55","name":"[v2,01/27] monitor: Have MonitorDef::get_value() always return int64_t type","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"1d6d91b6b8b726a15f2eaab506f0aea1f1a29571","submitter":{"id":85046,"url":"http://patchwork.ozlabs.org/api/1.1/people/85046/?format=json","name":"Philippe Mathieu-Daudé","email":"philmd@linaro.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-ppc/patch/20260410195323.17937-2-philmd@linaro.org/mbox/","series":[{"id":499497,"url":"http://patchwork.ozlabs.org/api/1.1/series/499497/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-ppc/list/?series=499497","date":"2026-04-10T19:52:55","name":"monitor: Remove need of per-target handlers","version":2,"mbox":"http://patchwork.ozlabs.org/series/499497/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222137/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2222137/checks/","tags":{},"headers":{"Return-Path":"<qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=UWTA0ZCw;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsnYc1GZGz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 05:53:54 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-ppc-bounces@nongnu.org>)\n\tid 1wBHv7-0008Sm-Fo; Fri, 10 Apr 2026 15:53:37 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wBHv6-0008Rm-73\n for qemu-ppc@nongnu.org; Fri, 10 Apr 2026 15:53:36 -0400","from mail-wr1-x431.google.com ([2a00:1450:4864:20::431])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <philmd@linaro.org>) id 1wBHv4-0000Sl-Ab\n for qemu-ppc@nongnu.org; Fri, 10 Apr 2026 15:53:35 -0400","by mail-wr1-x431.google.com with SMTP id\n ffacd0b85a97d-43d02a71526so1509146f8f.3\n for <qemu-ppc@nongnu.org>; Fri, 10 Apr 2026 12:53:33 -0700 (PDT)","from localhost.localdomain (88-187-86-199.subs.proxad.net.\n [88.187.86.199]) by smtp.gmail.com with ESMTPSA id\n ffacd0b85a97d-43d63deba9esm10266885f8f.10.2026.04.10.12.53.31\n (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);\n Fri, 10 Apr 2026 12:53:32 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775850813; x=1776455613; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=vgSDBpX5CLw08pNI+SPMIuoznTVCeN74IG0qPtzmxwM=;\n b=UWTA0ZCwd6DkBI7Zcydv37n/mKXNdg2B1rN/GlFMe7RfqsegtD3T1BeoVP+Jp0/Btj\n oCKybYrkdpcXq/zvXJIDRMm6Ydz7zZbwHU5vz0WuPPDlFgB8fi63uRgosx1kTcFqTclO\n Lua5hoSiF9WsmN3Nr+sfm7o/TFGiTUtzE+t9r0UUhvy860OrwPfB2HfPlH7brYznlH+m\n zflt0RQ+vlm7gbb3V7jBoMtaHN/3VwVeK9kht/4y2o94HwCH7jnNUc8DD6vY6kuVai5e\n WG4Yhwdc0iTDkZW3ItMv117AA5zTF5iJje8oeyXCGshVR9KKq9HaOVb5USQOvapzifTz\n NLIw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775850813; x=1776455613;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=vgSDBpX5CLw08pNI+SPMIuoznTVCeN74IG0qPtzmxwM=;\n b=jvXMnjVAAPyeoj92t5RSqxqHh4Pf9erSsl6UjkDlhu9GKDU7rvaqSsNc0v/cnnt0iG\n 6S/OKQwEd2I7uDHdk/wV8gQZg4cMsP3Cp7q6IQ3LvtJoDqqwi/rBTQqGBLtLqa1WK+zK\n seIjH7XvrXeVzwiF+TUhzOrGnEAjUec4STXgEZv5gVLhRO0Wklpvbwsj40BZ1GOepWSC\n FeSDzWuEJv4RxelsgYGLY0tEiePpbZLUkXhRonGgcvldKBIL4GNUL7rJi2j82JE59pfg\n ZNykhMK6sotv7yI6oUjH919/0nK0Rzu8LTNkkkD/bp342Mv4+MKTJ/eTc6JbGNAM7fxr\n 8RAw==","X-Forwarded-Encrypted":"i=1;\n AJvYcCXZgG8XLWe3NcSe57wowAytN8TbI8JgHfAuvZJpra5TqSKphHbZcvDBJWlmgYHig+IVJzJfd1SO6A==@nongnu.org","X-Gm-Message-State":"AOJu0YzgK3ZcunRWx2z2hYMh1lnUJBgZCqTqg98N+/pk/LlutCghp9aF\n zj/Nju3IFXQjeilv54aq3ioYGDCpCVRJsrhp/+kff3R+a15JrMIk7kr+HQbZMcdtky8=","X-Gm-Gg":"AeBDieupzzvDvCCEU2zBv3wUn3JD0hiOcjLTifr1TNH7KLHHiwDkIqPzW111fxAeJyS\n MZrc5MnGpmRrrop+gq/Wv7oTUtEdE6TXGer9xFs00TgiCp5sLYbI6t9pmjQtgRc/vPtPm6f20cd\n tZ43VPUXKFYIWgyyKU/2ePhLEJqwqMexQs+KOoYuRApoqs4AGk7Kw/DxzuDQ/Wz7fbOl6GE7wzR\n +S80FcUdolktdza9P1HqrqA4xcxAdPIy7OWYj3kh/d7CPtJqLR9rHI1wHzn+BDS7oMhoUknkZxa\n oVxkyI0FmlmXVAUVzGjT4R1Sl217T8MuetfzM3TfRYky6nkZQezsAFCz0k1c5jCrvH4AymP2p/K\n n5q9guoKJKa+hUQuQpIJaCcWR57ZIZdQFkebcIBdmszss0yJA7NjnMXWuFzBD5TNpD1Dw1fLzzL\n jAbe4AaMuW2ovoXSpHuHotdZHd6eih+lQj+x5XkehCc9xWv3Z0NafLajof0x+SxGwCdKwEsds9","X-Received":"by 2002:a05:6000:420b:b0:43c:fd18:a30e with SMTP id\n ffacd0b85a97d-43d642b4653mr6664483f8f.35.1775850812787;\n Fri, 10 Apr 2026 12:53:32 -0700 (PDT)","From":"=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>","To":"qemu-devel@nongnu.org","Cc":"Richard Henderson <richard.henderson@linaro.org>,\n \"Dr. David Alan Gilbert\" <dave@treblig.org>,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>, qemu-riscv@nongnu.org,\n Markus Armbruster <armbru@redhat.com>, qemu-s390x@nongnu.org,\n kvm@vger.kernel.org, qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud?=\n\t=?utf-8?q?=C3=A9?= <philmd@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>,\n Zhao Liu <zhao1.liu@intel.com>","Subject":"[PATCH v2 01/27] monitor: Have MonitorDef::get_value() always return\n int64_t type","Date":"Fri, 10 Apr 2026 21:52:55 +0200","Message-ID":"<20260410195323.17937-2-philmd@linaro.org>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260410195323.17937-1-philmd@linaro.org>","References":"<20260410195323.17937-1-philmd@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=2a00:1450:4864:20::431;\n envelope-from=philmd@linaro.org; helo=mail-wr1-x431.google.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,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-ppc@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<qemu-ppc.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-ppc>,\n <mailto:qemu-ppc-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-ppc>","List-Post":"<mailto:qemu-ppc@nongnu.org>","List-Help":"<mailto:qemu-ppc-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-ppc>,\n <mailto:qemu-ppc-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"Simplify MonitorDef::get_value() handler by having it always\nreturn a int64_t type. Truncate to 32-bit in the single caller.\n\nNote, this handler is only implemented once for the x86 targets.\n\nSigned-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>\n---\n include/monitor/hmp-target.h | 6 +-----\n monitor/hmp-target.c         | 4 +++-\n target/i386/monitor.c        | 4 ++--\n 3 files changed, 6 insertions(+), 8 deletions(-)","diff":"diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h\nindex ce0bb1983cc..6364c94edf8 100644\n--- a/include/monitor/hmp-target.h\n+++ b/include/monitor/hmp-target.h\n@@ -27,15 +27,11 @@\n \n typedef struct MonitorDef MonitorDef;\n \n-#ifdef COMPILING_PER_TARGET\n-#include \"exec/target_long.h\"\n struct MonitorDef {\n     const char *name;\n     int offset;\n-    target_long (*get_value)(Monitor *mon, const struct MonitorDef *md,\n-                             int val);\n+    int64_t (*get_value)(Monitor *mon, const struct MonitorDef *md, int offset);\n };\n-#endif\n \n const MonitorDef *target_monitor_defs(void);\n int target_get_monitor_def(CPUState *cs, const char *name, uint64_t *pval);\ndiff --git a/monitor/hmp-target.c b/monitor/hmp-target.c\nindex da7dd7f31f2..812714ada01 100644\n--- a/monitor/hmp-target.c\n+++ b/monitor/hmp-target.c\n@@ -23,6 +23,7 @@\n  */\n \n #include \"qemu/osdep.h\"\n+#include \"qemu/target-info.h\"\n #include \"monitor-internal.h\"\n #include \"monitor/qdev.h\"\n #include \"net/slirp.h\"\n@@ -79,7 +80,8 @@ int get_monitor_def(Monitor *mon, int64_t *pval, const char *name)\n     for(; md->name != NULL; md++) {\n         if (hmp_compare_cmd(name, md->name)) {\n             if (md->get_value) {\n-                *pval = md->get_value(mon, md, md->offset);\n+                int64_t val = md->get_value(mon, md, md->offset);\n+                *pval = target_long_bits() == 32 ? (int32_t)val : val;\n             } else {\n                 CPUArchState *env = mon_get_cpu_env(mon);\n                 ptr = (uint8_t *)env + md->offset;\ndiff --git a/target/i386/monitor.c b/target/i386/monitor.c\nindex 977f65fe16c..b128334e571 100644\n--- a/target/i386/monitor.c\n+++ b/target/i386/monitor.c\n@@ -593,8 +593,8 @@ void hmp_mce(Monitor *mon, const QDict *qdict)\n     }\n }\n \n-static target_long monitor_get_pc(Monitor *mon, const struct MonitorDef *md,\n-                                  int val)\n+static int64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md,\n+                              int offset)\n {\n     CPUArchState *env = mon_get_cpu_env(mon);\n     return env->eip + env->segs[R_CS].base;\n","prefixes":["v2","01/27"]}