xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Andreas Färber" <afaerber@suse.de>,
	"Anthony Liguori" <anthony@codemonkey.ws>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Michael Walle" <michael@walle.cc>,
	"Aurélien Jarno" <aurelien@aurel32.net>,
	"Alexander Graf" <agraf@suse.de>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	qemu-ppc <qemu-ppc@nongnu.org>,
	"Blue Swirl" <blauwirbel@gmail.com>,
	"Guan Xuetao" <gxt@mprc.pku.edu.cn>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Avi Kivity" <avi@redhat.com>,
	"Marcelo Tosatti" <mtosatti@redhat.com>,
	"Jan Kiszka" <jan.kiszka@siemens.com>, kvm <kvm@vger.kernel.org>,
	"Stefano Stabellini" <stefano.stabellini@eu.citrix.com>,
	xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH qom-next 00/59] QOM CPUState, part 4: CPU_COMMON
Date: Wed, 23 May 2012 05:07:23 +0200	[thread overview]
Message-ID: <1337742502-28565-1-git-send-email-afaerber@suse.de> (raw)

Hello,

This series, based on qom-next and the two pending ARM cleanup patches, starts
moving fields from CPUArchState (CPU_COMMON) to QOM CPUState. It stops short
of moving all easily possible fields (i.e., those not depending on target_ulong
or target_phys_addr_t) since the series got too long already and is expected to
spark some controversies due to collisions with several other series.

The series is structured as preparatory refactorings interwoven with the actual
touch-all movement of one field ("cpu: Move ... to CPUState"), optionally
followed by type signature cleanups, culminating in the movement of two fields
that are tied together by VMState.
Thus, unlike part 3, this series cannot randomly be cherry-picked to
<arch>-next trees, only select parts thereof (e.g., use of cpu_s390x_init()).

Please review and test.

The use of cpu_index vs. cpuid_apic_id for x86 cpu[n] still needs some thought.

The question was brought up whether adding the CPUs a child<X86CPU> properties
should be generalized outside the machine scope - I don't think so, since CPU
hotplug seems highly architecture-specific and not applicable everywhere (SoCs).

Blue will likely have a superb idea how to avoid the cpu_tlb_flush() indirection
that I needed for VMState, but apart from having been a lot of dumb typing, it
works fine as interim solution. "Blah." wasn't terribly helpful as a comment.

I have checked this to compile on ...
* openSUSE 12.1 x86_64 w/KVM,
* openSUSE Factory ppc w/KVM,
* SLES 11 SP2 s390x w/KVM,
* mingw32/64 cross-builds,
* OpenBSD 5.1 amd64 (not for final version though, master doesn't build).
Untested: Xen.
Only some targets including i386 were lightly runtime-tested.

Available for testing and cherry-picking (not pulling!) from:
git://github.com/afaerber/qemu-cpu.git qom-cpu-common.v1
https://github.com/afaerber/qemu-cpu/commits/qom-cpu-common.v1

Regards,
Andreas

Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>

Cc: Richard Henderson <rth@twiddle.net>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Cc: Michael Walle <michael@walle.cc>
Cc: Aurélien Jarno <aurelien@aurel32.net>
Cc: Alexander Graf <agraf@suse.de>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-ppc <qemu-ppc@nongnu.org>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Max Filippov <jcmvbkbc@gmail.com>

Cc: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: kvm <kvm@vger.kernel.org>

Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel <xen-devel@lists.xensource.com>

Changes from preview in Igor's apic thread:
* Use g_strdup_printf() for "cpu[x]" to be safe wrt length and nul termination.
* Clean up removal of x86 version 5 load/save support.
* Convert use of env->halted in s390x KVM code.
* Convert some uses of env->halted/interrupt_request in ppc KVM code.
* Convert some uses of env->halted in Xen code, prepend cpu_x86_init() patch.
* Avoid using POWERPC_CPU() / SPARC_CPU() macros inside *_set_irq() functions.

Andreas Färber (59):
  qemu-thread: Let qemu_thread_is_self() return bool
  cpu: Move CPU_COMMON_THREAD into CPUState
  cpu: Move thread field into CPUState
  pc: Add CPU as /machine/cpu[n]
  apic: Replace cpu_env pointer by X86CPU link
  pc: Pass X86CPU to cpu_is_bsp()
  cpu: Move thread_kicked to CPUState
  Makefile.dis: Add include/ to include path
  cpus: Pass CPUState to qemu_cpu_is_self()
  cpus: Pass CPUState to qemu_cpu_kick_thread()
  cpu: Move created field to CPUState
  cpu: Move stop field to CPUState
  ppce500_spin: Store PowerPCCPU in SpinKick
  cpu: Move stopped field to CPUState
  cpus: Pass CPUState to cpu_is_stopped()
  cpus: Pass CPUState to cpu_can_run()
  cpu: Move halt_cond to CPUState
  cpus: Pass CPUState to qemu_tcg_cpu_thread_fn
  cpus: Pass CPUState to qemu_tcg_init_vcpu()
  ppc: Pass PowerPCCPU to ppc6xx_set_irq()
  ppc: Pass PowerPCCPU to ppc970_set_irq()
  ppc: Pass PowerPCCPU to power7_set_irq()
  ppc: Pass PowerPCCPU to ppc40x_set_irq()
  ppc: Pass PowerPCCPU to ppce500_set_irq()
  sun4m: Pass SPARCCPU to cpu_set_irq()
  sun4m: Pass SPARCCPU to cpu_kick_irq()
  sun4u: Pass SPARCCPU to {,s,hs}tick_irq() and cpu_timer_create()
  sun4u: Pass SPARCCPU to cpu_kick_irq()
  target-ppc: Rename kvm_kick_{env => cpu} and pass PowerPCCPU
  target-s390x: Let cpu_s390x_init() return S390CPU
  s390-virtio: Use cpu_s390x_init() to obtain S390CPU
  s390-virtio: Let s390_cpu_addr2state() return S390CPU
  target-s390x: Pass S390CPU to s390_cpu_restart()
  cpus: Pass CPUState to qemu_cpu_kick()
  cpu: Move queued_work_{first,last} to CPUState
  cpus: Pass CPUState to flush_queued_work()
  cpus: Pass CPUState to qemu_wait_io_event_common()
  target-ppc: Pass PowerPCCPU to powerpc_excp()
  target-ppc: Pass PowerPCCPU to cpu_ppc_hypercall
  spapr: Pass PowerPCCPU to spapr_hypercall()
  spapr: Pass PowerPCCPU to hypercalls
  xtensa_pic: Pass XtensaCPU to xtensa_ccompare_cb()
  cpus: Pass CPUState to [qemu_]cpu_has_work()
  target-i386: Pass X86CPU to kvm_mce_inject()
  target-i386: Pass X86CPU to cpu_x86_inject_mce()
  cpus: Pass CPUState to run_on_cpu()
  cpu: Move thread_id to CPUState
  target-i386: Pass X86CPU to cpu_x86_load_seg_cache_sipi()
  target-i386: Drop version 5 CPU VMState support
  target-i386: Pass X86CPU to kvm_get_mp_state()
  target-i386: Pass X86CPU to kvm_handle_halt()
  target-mips: Pass MIPSCPU to mips_tc_wake()
  target-mips: Pass MIPSCPU to mips_vpe_is_wfi()
  target-mips: Pass MIPSCPU to mips_tc_sleep()
  target-mips: Pass MIPSCPU to mips_vpe_sleep()
  sun4u: Pass SPARCCPU to cpu_set_ivec_irq()
  cpu: Introduce mandatory tlb_flush callback
  xen_machine_pv: Use cpu_x86_init() to obtain X86CPU
  cpu: Move halted and interrupt_request to CPUState

 Makefile.dis                |    1 +
 cpu-all.h                   |    4 -
 cpu-defs.h                  |   19 ----
 cpu-exec.c                  |   40 ++++----
 cpus.c                      |  233 +++++++++++++++++++++++--------------------
 exec.c                      |   44 ++++++---
 gdbstub.c                   |    4 +-
 hw/apic.c                   |   34 ++++---
 hw/apic.h                   |    2 +-
 hw/apic_common.c            |   14 ++-
 hw/apic_internal.h          |    2 +-
 hw/kvm/apic.c               |    9 +-
 hw/kvmvapic.c               |    6 +-
 hw/leon3.c                  |    2 +-
 hw/omap1.c                  |    4 +-
 hw/pc.c                     |   31 +++++-
 hw/ppc.c                    |   69 ++++++++-----
 hw/ppce500_mpc8544ds.c      |    4 +-
 hw/ppce500_spin.c           |   15 ++--
 hw/pxa2xx_gpio.c            |    3 +-
 hw/pxa2xx_pic.c             |    2 +-
 hw/s390-virtio-bus.c        |    6 +-
 hw/s390-virtio.c            |   26 +++--
 hw/spapr.c                  |   10 +-
 hw/spapr.h                  |    4 +-
 hw/spapr_hcall.c            |   42 +++++---
 hw/spapr_llan.c             |   10 +-
 hw/spapr_rtas.c             |   13 ++-
 hw/spapr_vio.c              |   12 +-
 hw/spapr_vty.c              |    4 +-
 hw/sun4m.c                  |   31 +++---
 hw/sun4u.c                  |   47 +++++----
 hw/xen_machine_pv.c         |    6 +-
 hw/xics.c                   |   11 ++-
 hw/xtensa_pic.c             |   14 ++-
 include/qemu/cpu.h          |   81 +++++++++++++++
 kvm-all.c                   |   15 ++-
 monitor.c                   |    6 +-
 qemu-common.h               |    2 -
 qemu-thread-posix.c         |    2 +-
 qemu-thread-win32.c         |    2 +-
 qemu-thread.h               |    3 +-
 qom/cpu.c                   |   11 ++
 target-alpha/cpu.c          |   18 +++-
 target-alpha/cpu.h          |    4 +-
 target-alpha/translate.c    |    3 +-
 target-arm/cpu.c            |   10 ++
 target-arm/cpu.h            |    4 +-
 target-arm/helper.c         |    3 +-
 target-arm/op_helper.c      |    4 +-
 target-cris/cpu.c           |   10 ++
 target-cris/cpu.h           |    4 +-
 target-cris/translate.c     |    4 +-
 target-i386/cpu.c           |   10 ++
 target-i386/cpu.h           |   16 ++-
 target-i386/helper.c        |   21 ++--
 target-i386/kvm.c           |   77 ++++++++------
 target-i386/machine.c       |   10 +--
 target-i386/op_helper.c     |   13 ++-
 target-lm32/cpu.c           |   10 ++
 target-lm32/cpu.h           |    4 +-
 target-lm32/op_helper.c     |    4 +-
 target-m68k/cpu.c           |   10 ++
 target-m68k/cpu.h           |    4 +-
 target-m68k/op_helper.c     |    3 +-
 target-m68k/qregs.def       |    1 -
 target-m68k/translate.c     |    6 +
 target-microblaze/cpu.c     |   10 ++
 target-microblaze/cpu.h     |    4 +-
 target-mips/cpu.c           |   10 ++
 target-mips/cpu.h           |   15 ++--
 target-mips/op_helper.c     |   45 ++++++---
 target-mips/translate.c     |    8 +-
 target-ppc/cpu.h            |    8 +-
 target-ppc/helper.c         |   48 +++++----
 target-ppc/helper_regs.h    |    7 +-
 target-ppc/kvm.c            |   25 +++--
 target-ppc/op_helper.c      |    8 +-
 target-ppc/translate.c      |    3 +-
 target-ppc/translate_init.c |   10 ++
 target-s390x/cpu.c          |   12 ++-
 target-s390x/cpu.h          |   16 ++--
 target-s390x/helper.c       |   14 ++-
 target-s390x/kvm.c          |   18 ++-
 target-sh4/cpu.c            |   10 ++
 target-sh4/cpu.h            |    4 +-
 target-sh4/helper.c         |    5 +-
 target-sh4/op_helper.c      |    4 +-
 target-sparc/cpu.c          |   10 ++
 target-sparc/cpu.h          |    6 +-
 target-unicore32/cpu.c      |   18 +++-
 target-unicore32/cpu.h      |    4 +-
 target-xtensa/cpu.c         |   10 ++
 target-xtensa/cpu.h         |    4 +-
 target-xtensa/op_helper.c   |    4 +-
 xen-all.c                   |   10 +-
 96 files changed, 974 insertions(+), 529 deletions(-)

-- 
1.7.7


             reply	other threads:[~2012-05-23  3:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-23  3:07 Andreas Färber [this message]
2012-05-23  3:08 ` [PATCH qom-next 58/59] xen_machine_pv: Use cpu_x86_init() to obtain X86CPU Andreas Färber
2012-05-23  3:08 ` [PATCH qom-next 59/59] cpu: Move halted and interrupt_request to CPUState Andreas Färber
2012-05-23 11:27 ` [PATCH qom-next 00/59] QOM CPUState, part 4: CPU_COMMON Stefano Stabellini
2012-05-23 15:36   ` Andreas Färber
2012-05-23 15:16 ` [Qemu-devel] " Andreas Färber
2012-05-23 19:36 ` Blue Swirl

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=1337742502-28565-1-git-send-email-afaerber@suse.de \
    --to=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=aurelien@aurel32.net \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=edgar.iglesias@gmail.com \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=imammedo@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=michael@walle.cc \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).