All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Virtualising qmp_query_cpus() arch specifics
@ 2015-07-09  6:36 Peter Crosthwaite
  2015-07-09 12:31 ` Andreas Färber
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Crosthwaite @ 2015-07-09  6:36 UTC (permalink / raw)
  To: Markus Armbruster, Michael Roth, Eric Blake,
	qemu-devel@nongnu.org Developers, Paolo Bonzini,
	Andreas Färber

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?

Regards,
Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-09 19:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-09  6:36 [Qemu-devel] Virtualising qmp_query_cpus() arch specifics Peter Crosthwaite
2015-07-09 12:31 ` Andreas Färber
2015-07-09 19:04   ` Peter Crosthwaite

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.