From: "Andreas Färber" <afaerber@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] Virtualising qmp_query_cpus() arch specifics
Date: Thu, 09 Jul 2015 14:31:31 +0200 [thread overview]
Message-ID: <559E69A3.2020000@suse.de> (raw)
In-Reply-To: <CAEgOgz4MMdmTZYe-hSUyDfdK8W3N5_zzsY8fnuWGuwcpX3F0nw@mail.gmail.com>
Am 09.07.2015 um 08:36 schrieb Peter Crosthwaite:
> Hi All,
>
> So for my multi-arch work, one of the eventual requirements is to
> remove all #define TARGET_FOO from core code. I came across this in
> cpus.c/qmp_query_cpus():
>
> #if defined(TARGET_I386)
> X86CPU *x86_cpu = X86_CPU(cpu);
> CPUX86State *env = &x86_cpu->env;
> #elif defined(TARGET_PPC)
> PowerPCCPU *ppc_cpu = POWERPC_CPU(cpu);
> CPUPPCState *env = &ppc_cpu->env;
> ...
>
> #if defined(TARGET_I386)
> info->value->has_pc = true;
> info->value->pc = env->eip + env->segs[R_CS].base;
> #elif defined(TARGET_PPC)
> info->value->has_nip = true;
> info->value->nip = env->nip;
> ...
>
> This should probably be a QOM CPU virtual function. What makes me
> uneasy about it however, is a direct implementation means the QAPI
> autogenerated CPUInfoList struct would need to be exposed to
> target-foo/cpu.c. Is this ok or an abstraction fail? Do we need some
> other other minimal struct to communicate between target-foo and QMP
> with these particulars? Any third options?
Wouldn't that just be a get_pc() matching your set_pc() hook?
Unfortunately there's name differences above, pc vs. nip. Maybe we can
just use a generic field and keep #ifdef stuff only as legacy compat?
Cheers,
Andreas
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
21284 (AG Nürnberg)
next prev parent reply other threads:[~2015-07-09 12:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-09 6:36 [Qemu-devel] Virtualising qmp_query_cpus() arch specifics Peter Crosthwaite
2015-07-09 12:31 ` Andreas Färber [this message]
2015-07-09 19:04 ` Peter Crosthwaite
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=559E69A3.2020000@suse.de \
--to=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=qemu-devel@nongnu.org \
/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.