All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Yonggang Luo <luoyonggang@gmail.com>
Cc: qemu-devel@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	qemu-riscv@nongnu.org, "David Hildenbrand" <david@kernel.org>,
	"Glenn Miles" <milesg@linux.ibm.com>,
	"Zhao Liu" <zhao1.liu@intel.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Ilya Leoshkevich" <iii@linux.ibm.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Daniel Henrique Barboza" <daniel.barboza@oss.qualcomm.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Dr. David Alan Gilbert" <dave@treblig.org>,
	"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
	"Bibo Mao" <maobibo@loongson.cn>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Song Gao" <17746591750@163.com>,
	"Chinmay Rath" <rathc@linux.ibm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Brian Cain" <brian.cain@oss.qualcomm.com>,
	"Aleksandar Rikalo" <arikalo@gmail.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Eric Farman" <farman@linux.ibm.com>,
	"Philippe Mathieu-Daude" <philmd@mailo.com>,
	"Xianglai Li" <lixianglai@loongson.cn>,
	"Chao Liu" <chao.liu@processmission.com>,
	qemu-s390x@nongnu.org, "Palmer Dabbelt" <palmer@dabbelt.com>,
	"Matthew Rosato" <mjrosato@linux.ibm.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Harsh Prateek Bora" <harshpb@linux.ibm.com>,
	"Yoshinori Sato" <yoshinori.sato@nifty.com>
Subject: Re: [PATCH] target-info: dispatch CPU QMP, dump, monitor, and Angel semihosting
Date: Thu, 15 Oct 2026 10:28:48 +0100	[thread overview]
Message-ID: <atCc0GPHiZo2WlNM@redhat.com> (raw)
In-Reply-To: <20261015044104.879-1-luoyonggang@gmail.com>

On Thu, Oct 15, 2026 at 12:41:02PM +0800, Yonggang Luo wrote:
> Put query-cpu-definitions, dump notes, monitor, and Angel semihosting on
> TargetOps[SYS_EMU_TARGET__MAX] and look up by target_arch().
> Keep the table in target-ops.c and with a stub
> 
> - Register with a QEMU_ARCH_* bitmask so shared base-arch objects
>   can fill both slots (e.g. QEMU_ARCH_ARM is ARM|AARCH64).
> - TARGET_INFO_CPU_OP is type_init. A NULL member means no handler.
> - Drop stubs/qmp-cpu.c
>        stubs/hmp-cmd-info_tlb.c
>        stubs/hmp-cmd-info_mem.c
>        stubs/dump.c
> 
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> +typedef struct TargetOps {
> +    void (*info_tlb)(MonitorHMP *hmp, const QDict *qdict);
> +    void (*info_mem)(MonitorHMP *hmp, const QDict *qdict);
> +    CpuDefinitionInfoList *(*query_cpu_definitions)(Error **errp);
> +    CpuModelExpansionInfo *(*query_cpu_model_expansion)(
> +        CpuModelExpansionType type, CpuModelInfo *model, Error **errp);
> +    int (*get_dump_info)(ArchDumpInfo *info,
> +                         const struct GuestPhysBlockList *guest_phys_blocks);
> +    ssize_t (*get_note_size)(int class, int machine, int nr_cpus);
> +    const CPUSemihostingOps *semihosting;
> +} TargetOps;

IMHO, TargetOps shouldn't exist and this kind of thing should
be done as virtual methods aginst the CPUClass, or failing
that, against the MachineClass.


With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  parent reply	other threads:[~2026-10-15  9:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  4:41 [PATCH] target-info: dispatch CPU QMP, dump, monitor, and Angel semihosting Yonggang Luo
2026-10-15  9:19 ` Peter Maydell
2026-10-15  9:38   ` Yonggang Luo
2026-10-15  9:28 ` Daniel P. Berrangé [this message]
2026-10-15  9:41   ` Yonggang Luo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=atCc0GPHiZo2WlNM@redhat.com \
    --to=berrange@redhat.com \
    --cc=17746591750@163.com \
    --cc=alex.bennee@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=arikalo@gmail.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=brian.cain@oss.qualcomm.com \
    --cc=chao.liu@processmission.com \
    --cc=cohuck@redhat.com \
    --cc=daniel.barboza@oss.qualcomm.com \
    --cc=dave@treblig.org \
    --cc=david@kernel.org \
    --cc=farman@linux.ibm.com \
    --cc=harshpb@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=laurent@vivier.eu \
    --cc=liwei1518@gmail.com \
    --cc=lixianglai@loongson.cn \
    --cc=luoyonggang@gmail.com \
    --cc=maobibo@loongson.cn \
    --cc=marcandre.lureau@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=milesg@linux.ibm.com \
    --cc=mjrosato@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@mailo.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=pierrick.bouvier@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rathc@linux.ibm.com \
    --cc=richard.henderson@linaro.org \
    --cc=yoshinori.sato@nifty.com \
    --cc=zhao1.liu@intel.com \
    --cc=zhiwei_liu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.