From patchwork Mon Jun 10 15:07:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 803011 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1990508wro; Mon, 10 Jun 2024 08:08:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUfA4eUF/lY9fcTiqng3Wj87JVSCmPMyXr37XUONeRoqyDnb95816BUk4e9vjGjD4FWdoEJgjaFZfgWN4X4tmFa X-Google-Smtp-Source: AGHT+IEZgAD3xEAxAG1o68hUyRGvrk7T+n2B/xYIYk8Ynea51abH7NTh4FmTlXjPyiLMVh7NSc3V X-Received: by 2002:a05:6808:30a8:b0:3d2:1549:1f2d with SMTP id 5614622812f47-3d215492139mr10308580b6e.19.1718032129541; Mon, 10 Jun 2024 08:08:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718032129; cv=none; d=google.com; s=arc-20160816; b=ZBBditYNRmVukovMtqpgVWmOq//pG8RpN1lpHwICCYNVryNtV2MbBePDQC+49oqc2W 4XnZILsbHTRojE2173H082gn8sU9OKomm2nwse2xYu2qLrErq13/r3bH8AenKTRSioR3 CIH2UtINTmlGvkHPOeoKr2q8As941A2QRTXklxLrJFsqhwMUxQgcFoiWOaG777jfnAVF jCuUqh0MXbYr5sXQLKu6jFQpiaBLUUnpocn8CuSQGPPm5qrbtrAic8jnsRPGfWrLnS+B zllmpaBPHguTKN5Fncq/zBRMoedFBDzKZcesD1SO5TZreA9Hf14RuFnlnqpshHXkZiP+ hKGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wXqCJDK1XRCqnAP9Ne+ASEPrZvUZL26UbajQQQFWIgo=; fh=F+shdip0qMpnO2Cf3HxyQ55mbne7FLl0Qz+Sn1N9G4s=; b=LEmec5a/lUlu6J2ZzfuP3AY6qGiOuSWFU2MszL25auqHMvWTopoLcAQerCmOW2zx+S XcsgyZuBNiAYAhlsXFCixX8IhNoM8VtKe51x86QWvtlZpulNNbFdRv+TcbTaKpBRRaDF kXx/llgwClaEGfGpN0PkQi0s8bXmehpKlGjvs1LQcthmrX1KeG1pcJipPpN06T/5x4qw 3Mas5ZJnT6xsfylbWfoFHB3ivQvZAvYp1eMNEAAhyDX2T0ACGr6zLqe1RSvHf6KmUPR4 GLicu4v6uBzbSPLcegnWdqobpzTfch3yyFYeH9Hc3uX1UxfMNdn7f0Inshln6dCGUu7g jntw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SjPyOeaQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ada2fe7eead31-48d7ab9a2a4si314798137.231.2024.06.10.08.08.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jun 2024 08:08:49 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SjPyOeaQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGgd2-0005dT-QE; Mon, 10 Jun 2024 11:08:12 -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 1sGgd1-0005cs-3l for qemu-devel@nongnu.org; Mon, 10 Jun 2024 11:08:11 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGgcz-0006Xp-E9 for qemu-devel@nongnu.org; Mon, 10 Jun 2024 11:08:10 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-35f275c7286so683199f8f.2 for ; Mon, 10 Jun 2024 08:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718032087; x=1718636887; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wXqCJDK1XRCqnAP9Ne+ASEPrZvUZL26UbajQQQFWIgo=; b=SjPyOeaQk1v+35t0ezHh8qgQz5ZBZLrcAEuwGcoNRiRRqBVibElI85yx2tACyixRGh ynoMqT3INzsRjfthkao+7pY+4egihCvpyx21cmb21xfG51fpPHZK4nC7k5nurUlwr/Yy i07RQWFhar+8d/hDWSIu/B++e5Sv+8jGpbwNtKixC1UPHb6LtQb0EJOaDotkbPqqBH5n AvDMcYBb8wU5HLBjMxlyX4LnE+FsXJcfue0057ew6VIfWQeYwFIDKMXKXPgrI4Z7SIcx hJZPgpn0mjBi6uNNNQrtyVNoflHlmq/eduadxQb8rMPi8SGuuDsfOn0qjhxQ0E30/CzZ 57uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718032087; x=1718636887; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wXqCJDK1XRCqnAP9Ne+ASEPrZvUZL26UbajQQQFWIgo=; b=Yrv1/PlXKONgyEiJocXapDXqoPbto1MKm/QATcKxDgwTfgX10jTV/22pDI4VEOuKW7 +UwFiP3uCU+MqdsmabgWFpP88+MCs502TldT0qCzBUY6DDFm2mjfK0mU+CnBEvOe5WJK 0XEQ9V/IjCUus/rMLi+ax/Spo5G0k34/Y2Vy30c5Ccbfo7J7jnVSSyo94OPPqncbcdOR QQU9crEgdLDoPFuvLKDWyZbeerjmGVuiJJp26CeujJg7wpaF554FW5yPeoDaWMhgoyWP he2d3FXmgd3YM30WDJ1bkA4zyRPVmOkBaZFpiw2MPQaKnxQuXexGoHQE0lBObCg6UKBx 3cUA== X-Gm-Message-State: AOJu0Yy8ZRXTbh9DJqti1MoniFCyBybKLg+7HwpdeBtet8t+fZZegdta Q+IDNj4uBvwgVZAhvrQl5isrqFwumY1fp5vIlL1MYmNMzThXqsrtINGC5+sPLAuQ17KezkWiQEq L X-Received: by 2002:a5d:64c8:0:b0:35f:2092:39fd with SMTP id ffacd0b85a97d-35f20923acdmr3979515f8f.36.1718032087265; Mon, 10 Jun 2024 08:08:07 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f08b280d0sm8525697f8f.86.2024.06.10.08.08.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jun 2024 08:08:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Markus Armbruster , Mark Cave-Ayland , =?utf-8?q?Daniel_P_=2E_Be?= =?utf-8?q?rrang=C3=A9?= , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 1/2] hw/misc/mos6522: Expose x-query-mos6522-devices QMP command Date: Mon, 10 Jun 2024 17:07:57 +0200 Message-ID: <20240610150758.2827-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240610150758.2827-1-philmd@linaro.org> References: <20240610150758.2827-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This is a counterpart to the HMP "info via" command. It is being added with an "x-" prefix because this QMP command is intended as an adhoc debugging tool and will thus not be modelled in QAPI as fully structured data, nor will it have long term guaranteed stability. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- MAINTAINERS | 2 +- qapi/machine.json | 17 +++++++++++++++++ hw/misc/mos6522-stubs.c | 18 ++++++++++++++++++ hw/misc/mos6522.c | 5 +++-- hw/misc/meson.build | 3 ++- 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 hw/misc/mos6522-stubs.c diff --git a/MAINTAINERS b/MAINTAINERS index 951556224a..e86638c68c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1453,7 +1453,7 @@ F: hw/ppc/mac_newworld.c F: hw/pci-host/uninorth.c F: hw/pci-bridge/dec.[hc] F: hw/misc/macio/ -F: hw/misc/mos6522.c +F: hw/misc/mos6522*.c F: hw/nvram/mac_nvram.c F: hw/ppc/fw_cfg.c F: hw/input/adb* diff --git a/qapi/machine.json b/qapi/machine.json index 1283d14493..a82b8dd39d 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1865,6 +1865,23 @@ 'data': { 'filename': 'str' }, 'if': 'CONFIG_FDT' } +## +# @x-query-mos6522-devices: +# +# Query information on MOS6522 VIA devices +# +# Features: +# +# @unstable: This command is meant for debugging. +# +# Returns: MOS6522 VIA devices information +# +# Since: 9.1 +## +{ 'command': 'x-query-mos6522-devices', + 'returns': 'HumanReadableText', + 'features': [ 'unstable' ]} + ## # @x-query-interrupt-controllers: # diff --git a/hw/misc/mos6522-stubs.c b/hw/misc/mos6522-stubs.c new file mode 100644 index 0000000000..c953f01a16 --- /dev/null +++ b/hw/misc/mos6522-stubs.c @@ -0,0 +1,18 @@ +/* + * QEMU MOS6522 VIA stubs + * + * SPDX-FileContributor: Philippe Mathieu-Daudé + * SPDX-FileCopyrightText: 2024 Linaro Ltd. + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "qapi/qapi-commands-machine.h" + +HumanReadableText *qmp_x_query_mos6522_devices(Error **errp) +{ + error_setg(errp, "Support for MOS6522 VIA devices not built-in"); + + return NULL; +} diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index 515f62e687..b1bb7f54f0 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -31,6 +31,7 @@ #include "migration/vmstate.h" #include "monitor/monitor.h" #include "monitor/hmp.h" +#include "qapi/qapi-commands-machine.h" #include "qapi/type-helpers.h" #include "qemu/timer.h" #include "qemu/cutils.h" @@ -576,7 +577,7 @@ static int qmp_x_query_via_foreach(Object *obj, void *opaque) return 0; } -static HumanReadableText *qmp_x_query_via(Error **errp) +HumanReadableText *qmp_x_query_mos6522_devices(Error **errp) { g_autoptr(GString) buf = g_string_new(""); @@ -589,7 +590,7 @@ static HumanReadableText *qmp_x_query_via(Error **errp) void hmp_info_via(Monitor *mon, const QDict *qdict) { Error *err = NULL; - g_autoptr(HumanReadableText) info = qmp_x_query_via(&err); + g_autoptr(HumanReadableText) info = qmp_x_query_mos6522_devices(&err); if (hmp_handle_error(mon, err)) { return; diff --git a/hw/misc/meson.build b/hw/misc/meson.build index 86596a3888..9fa0e98794 100644 --- a/hw/misc/meson.build +++ b/hw/misc/meson.build @@ -18,7 +18,8 @@ system_ss.add(when: 'CONFIG_ARM11SCU', if_true: files('arm11scu.c')) system_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m_ras.c')) # Mac devices -system_ss.add(when: 'CONFIG_MOS6522', if_true: files('mos6522.c')) +system_ss.add(when: 'CONFIG_MOS6522', if_true: files('mos6522.c'), + if_false: files('mos6522-stubs.c')) system_ss.add(when: 'CONFIG_DJMEMC', if_true: files('djmemc.c')) system_ss.add(when: 'CONFIG_IOSB', if_true: files('iosb.c')) From patchwork Mon Jun 10 15:07:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 803012 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp1990670wro; Mon, 10 Jun 2024 08:09:04 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXSemTZMO56jHvqXFzQX3CBOb1HEAMXrPkbeGnhcsjdV6V5DU2GrI6S5Gk2Kkxj3NyyaBzGnATezlLG1e2HODsw X-Google-Smtp-Source: AGHT+IFpHZ/w+GNA4sB9q3Op0p2Ddemfx8CVOnhqiyLm43kQXxZ7opWMva3G5e6L0WGTVbNjaRJZ X-Received: by 2002:a81:6fd5:0:b0:627:e281:6763 with SMTP id 00721157ae682-62cd55c59ffmr97628107b3.14.1718032143802; Mon, 10 Jun 2024 08:09:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718032143; cv=none; d=google.com; s=arc-20160816; b=wFpJ4X6yAw4uekBpLyn3H8fruFvmMQRfolFHLO9kyKW3ARo7QIRuP+nUyRtpAgZs9f remHe5EhuJR9+irI3eL77P+egJnVWt0UQgnzDkhS3WLB9rKYbgQ64ZFWLdYOkTEPqFob 8Xx06e0iQuYMGNuNoFgWr4V/ut0Pkd9WGICp8P6P8ciXFZs3vFrRm+48Eh/VNfyn7YAj UH7lrS/9IEkZzDARuW+RABps0/leFQhsvzOLxWUhwjZ3x2CKJNvW7NA1mbP0VxsvgjOY bmkaFIBriWXmWPMES/STBWSNYhG7ez+6t72lp8riMn/x2fY7EL4uYnNi/vgb3fSuuPe3 etug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yXk0bDQ1yYJpJgY5lHESnxmo/mUAUI8vWA756v/ff84=; fh=F+shdip0qMpnO2Cf3HxyQ55mbne7FLl0Qz+Sn1N9G4s=; b=cdU4tOC8o87CxTEAqDtKGhRLMt107ltnR/EKj+Jbh6/UrnBlZTlTS/JA774k//SQT6 ZGmCjSFlJzkG0ZXrVK5jiunBaP3H0bkfgg7g6RE3hhD/6N15opF+DeXC64nnROPfUrrt mtaTq1JZYKBXszyxn2pWv9iK894CrkX4HCxpTsa9tCk7/nnEG6vidSJWb75ta5ybvWyj JMEtglUqWU0Ss0VsB2I6H2ZtXjIOFQflNDDzNzM8LRGRjeeRFWneFZ5Jo7kYxxtEbIG8 yQTp3G5dCOkk6G0AW34Wu7ZdOr/+bTmBESwzkWfpkhl7r2LFIZeHRMXo7vmK8EOCOmCB VEsg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IP+419bC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a1e0cc1a2514c-80b88af2422si820571241.129.2024.06.10.08.09.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Jun 2024 08:09:03 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IP+419bC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGgd9-0005fU-D8; Mon, 10 Jun 2024 11:08:19 -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 1sGgd7-0005eL-Ij for qemu-devel@nongnu.org; Mon, 10 Jun 2024 11:08:17 -0400 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGgd5-0006Yw-SA for qemu-devel@nongnu.org; Mon, 10 Jun 2024 11:08:17 -0400 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2ebeefb9b56so506341fa.0 for ; Mon, 10 Jun 2024 08:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718032093; x=1718636893; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yXk0bDQ1yYJpJgY5lHESnxmo/mUAUI8vWA756v/ff84=; b=IP+419bCWvT4ByeHNw8/QBFSAJa4YP58FXPo0cm9KILSNBFSWKzDgHIQNnKDYroR84 Z/J0zl0A0LQfbkzl00eELfN7E/JF3ZwHtclLGTSJAt5TwpkTk4xY9bqhjB5GAyfyJ+c1 sfJsqplzHXyABFWZ1B5OmHra+RC/kqB1RaspNJnUh7q5DPzZZkrOybcnwvSOKfr/qI+S KdCgOT9yNGj8YcGEzrtywQ47CQKIisFRAAnAnZtumv43d55OaVbc3NaXunAn49R7m23n UtW5q3JVTUFd0wGJt4m4OKt5fR1g6O2d1PABPHOEjyREfnXb3Pcf3u8v/CNKzsTJI+OK 4ivw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718032093; x=1718636893; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yXk0bDQ1yYJpJgY5lHESnxmo/mUAUI8vWA756v/ff84=; b=mzR6omabrGBaOoG1ihxAq1Da0dwA6vVNYqHuecAU96Fzwot7oKivFMMXcE1rxWTTt/ 7D6x84PO5pH6QapXJR/1ITo5w6DtlJGbR2+zPUXZZXLWQpwnKMTeumb0WaIzuEyM9HlN DtnVV8oBQsSDRPEZr3F72z1OxfepfxBENoNkBb4JFJnpuQvfoPzIfYoF0lAIC1EgMh+b gMpjumYV6MZ8EkwDT4CrmJJLpqLk0FhWlAjA1b9uF45Nh5FS2oUlWPQ3pEpTlDYiZXCZ ASOVEWLlPwxyiQpgnX0pGOv29W94vkjdjM/YGqw/iXMEekRxy++3ETNWXBjEvgmrPPVp 69Pw== X-Gm-Message-State: AOJu0YwOlqDbE2mYz5YpFvRWovqXFAUT/7jjtdznXA5GjDlls5s/Rpbh BVMgeTKo1QaSB1JM149EC0ve0sGkZlRxRlqpucdWHnHuGbQ+Wr12unCB2uF5WF8LOQ0f6cyOq+Y L X-Received: by 2002:a05:651c:b06:b0:2eb:f029:7142 with SMTP id 38308e7fff4ca-2ebf029716emr2631901fa.15.1718032093424; Mon, 10 Jun 2024 08:08:13 -0700 (PDT) Received: from m1x-phil.lan ([176.176.129.242]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42196386d13sm47450965e9.12.2024.06.10.08.08.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Jun 2024 08:08:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Markus Armbruster , Mark Cave-Ayland , =?utf-8?q?Daniel_P_=2E_Be?= =?utf-8?q?rrang=C3=A9?= , qemu-ppc@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 2/2] hw/misc/mos6522: Do not open-code hmp_info_human_readable_text() Date: Mon, 10 Jun 2024 17:07:58 +0200 Message-ID: <20240610150758.2827-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240610150758.2827-1-philmd@linaro.org> References: <20240610150758.2827-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Register the command 'info via' using HMPCommand::cmd_info_hrt(), so it is processed using the generic hmp_info_human_readable_text(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé --- include/hw/misc/mos6522.h | 2 -- include/monitor/hmp-target.h | 1 - hw/misc/mos6522.c | 13 ------------- hmp-commands-info.hx | 2 +- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/include/hw/misc/mos6522.h b/include/hw/misc/mos6522.h index fba45668ab..a54fe063ac 100644 --- a/include/hw/misc/mos6522.h +++ b/include/hw/misc/mos6522.h @@ -172,6 +172,4 @@ extern const VMStateDescription vmstate_mos6522; uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned size); void mos6522_write(void *opaque, hwaddr addr, uint64_t val, unsigned size); -void hmp_info_via(Monitor *mon, const QDict *qdict); - #endif /* MOS6522_H */ diff --git a/include/monitor/hmp-target.h b/include/monitor/hmp-target.h index b679aaebbf..9b46fec84a 100644 --- a/include/monitor/hmp-target.h +++ b/include/monitor/hmp-target.h @@ -53,7 +53,6 @@ void hmp_mce(Monitor *mon, const QDict *qdict); void hmp_info_local_apic(Monitor *mon, const QDict *qdict); void hmp_info_sev(Monitor *mon, const QDict *qdict); void hmp_info_sgx(Monitor *mon, const QDict *qdict); -void hmp_info_via(Monitor *mon, const QDict *qdict); void hmp_memory_dump(Monitor *mon, const QDict *qdict); void hmp_physical_memory_dump(Monitor *mon, const QDict *qdict); void hmp_info_registers(Monitor *mon, const QDict *qdict); diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c index b1bb7f54f0..afa343dd27 100644 --- a/hw/misc/mos6522.c +++ b/hw/misc/mos6522.c @@ -29,8 +29,6 @@ #include "hw/misc/mos6522.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" -#include "monitor/monitor.h" -#include "monitor/hmp.h" #include "qapi/qapi-commands-machine.h" #include "qapi/type-helpers.h" #include "qemu/timer.h" @@ -587,17 +585,6 @@ HumanReadableText *qmp_x_query_mos6522_devices(Error **errp) return human_readable_text_from_str(buf); } -void hmp_info_via(Monitor *mon, const QDict *qdict) -{ - Error *err = NULL; - g_autoptr(HumanReadableText) info = qmp_x_query_mos6522_devices(&err); - - if (hmp_handle_error(mon, err)) { - return; - } - monitor_puts(mon, info->human_readable_text); -} - static const MemoryRegionOps mos6522_ops = { .read = mos6522_read, .write = mos6522_write, diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx index cfd4ad5651..a24c217d89 100644 --- a/hmp-commands-info.hx +++ b/hmp-commands-info.hx @@ -873,7 +873,7 @@ ERST .args_type = "", .params = "", .help = "show guest mos6522 VIA devices", - .cmd = hmp_info_via, + .cmd_info_hrt = qmp_x_query_mos6522_devices, }, #endif