qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC qom-cpu 00/41] QOM CPUState, part 13: Emptying CPU_COMMON
@ 2013-09-04  9:04 Andreas Färber
  2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 01/41] cpu: Turn cpu_has_work() into a CPUClass hook Andreas Färber
                   ` (43 more replies)
  0 siblings, 44 replies; 68+ messages in thread
From: Andreas Färber @ 2013-09-04  9:04 UTC (permalink / raw)
  To: qemu-devel
  Cc: Peter Maydell, Peter Crosthwaite, Eduardo Habkost, Riku Voipio,
	Alexander Graf, Blue Swirl, Michael Walle, Li Guang,
	Anthony Liguori, Igor Mammedov, Edgar E. Iglesias,
	Andreas Färber, Aurélien Jarno, Richard Henderson

Hello,

This series aggressively decimizes CPU_COMMON fields and then begins with some
follow-up cleanups in core CPU code. It is not complete in terms of cleanups,
surrounding Coding Style fixes or explanatory commit messages - sending it out
early as a gentle reminder not to use unnecessary CPUFooState but FooCPU in
target APIs please, since there is progress in getting rid of CPUArchState.
Not yet extensively tested.

After this series, only two CPU_COMMON fields remain: tlb_table and iotlb.
Problem with those is that they not only use target_ulong but depend on
NB_MMU_MODES (CPU-specific) and CPU_TLB_SIZE (host- and CPU-specific).
iotlb might be allocated in the CPU realizefn if we copy NB_MMU_MODES to a
CPUClass field. tlb_table by comparison is used as offset in host-specific
TCG-generated machine code, we would need to load a pointer in arch-specific ways
(and test them) if we were to move it out from CPU[Arch]State as once discussed.

On part 11, rth said for alpha that using CPUAlphaState in DisasContext was bad
and that the relevant fields should be copied into DisasContext instead; a few
targets still have an env field though and use it for register access and
cpu_abort(), so I have just changed the type for now and call upon maintainers
to review whether they want to do different changes.

Available for testing at:
git://github.com/afaerber/qemu-cpu.git qom-cpu-13.v1
https://github.com/afaerber/qemu-cpu/commits/qom-cpu-13.v1

Regards,
Andreas

>From qom-cpu-copy preview:
* Instead of moving cpu_copy() to a new linux-user/cpu.c, moved it to main.c,
  allowing to drop cpu_model_str field completely

Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Aurélien Jarno <aurelien@aurel32.net>
Cc: Richard Henderson <rth@twiddle.net> (TCG)
Cc: Li Guang <lig.fnst@cn.fujitsu.com>
Cc: Michael Walle <michael@walle.cc> (lm32)
Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com> (cris, microblaze)
Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com> (microblaze)
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Riku Voipio <riku.voipio@iki.fi> (linux-user)
Cc: Peter Maydell <peter.maydell@linaro.org> (arm)
Cc: Alexander Graf <agraf@suse.de> (aarch64, ppc)

Andreas Färber (41):
  cpu: Turn cpu_has_work() into a CPUClass hook
  cpu: Turn cpu_mmu_index() into a CPUClass hook
  cpu: Turn cpu_get_tb_cpu_state() into a CPUClass hook
  cpu: Turn cpu_handle_mmu_fault() into a CPUClass hook
  cpu: Move mem_io_{pc,vaddr} fields from CPU_COMMON to CPUState
  cpu: Move can_do_io field from CPU_COMMON to CPUState
  cpu: Move icount_extra field from CPU_COMMON to CPUState
  cpu: Move icount_decr field from CPU_COMMON to CPUState
  cpu: Move tb_jmp_cache field from CPU_COMMON to CPUState
  cpu: Move jmp_env field from CPU_COMMON to CPUState
  cpu: Move exception_index field from CPU_COMMON to CPUState
  cpu: Move cpu_copy() into linux-user
  cpu: Drop cpu_model_str from CPU_COMMON
  cpu: Move opaque field from CPU_COMMON to CPUState
  cpu: Move watchpoint fields from CPU_COMMON to CPUState
  cpu: Move breakpoints field from CPU_COMMON to CPUState
  cpu: Move tlb_flush_{addr,mask} fields from CPU_COMMON_TLB to CPUState
  exec: Change tlb_fill() argument to CPUState
  cpu-exec: Change cpu_loop_exit() argument to CPUState
  translate-all: Change cpu_restore_state() argument to CPUState
  translate-all: Change cpu_restore_state_from_tb() argument to CPUState
  translate-all: Change tb_check_watchpoint() argument to CPUState
  translate-all: Change cpu_io_recompile() argument to CPUState
  translate-all: Change tb_gen_code() argument to CPUState
  translate-all: Change tb_flush_jmp_cache() argument to CPUState
  target-ppc: Use PowerPCCPU in PowerPCCPUClass::handle_mmu_fault hook
  exec: Change cpu_watchpoint_{insert,remove{,_by_ref,_all}} argument
  exec: Change cpu_breakpoint_{insert,remove{,_by_ref,_all}} argument
  cpu-exec: Change cpu_resume_from_signal() argument to CPUState
  cputlb: Change tlb_update_dirty() argument to CPUState
  exec: Change memory_region_section_get_iotlb() argument to CPUState
  cputlb: Change tlb_set_page() argument to CPUState
  cputlb: Change tlb_set_page() argument to CPUState
  exec: Change cpu_abort() argument to CPUState
  target-cris: Replace DisasContext::env field with CRISCPU
  target-lm32: Replace DisasContext::env field with LM32CPU
  target-microblaze: Replace DisasContext::env field with MicroBlazeCPU
  target-lm32: Move features field from CPULM32State to LM32CPU
  cputlb: Change tlb_flush_page() argument to CPUState
  cputlb: Change tlb_flush() argument to CPUState
  user-exec: Change exception_action() argument to CPUState

 bsd-user/main.c                    |   2 +-
 cpu-exec.c                         | 111 ++++++++++----------
 cpus.c                             |  25 +++--
 cputlb.c                           |  60 +++++------
 exec.c                             | 154 +++++++++++----------------
 gdbstub.c                          |  48 ++++-----
 hw/i386/kvmvapic.c                 |  15 +--
 hw/ppc/e500.c                      |   3 +-
 hw/ppc/ppce500_spin.c              |   2 +-
 hw/ppc/spapr_hcall.c               |   2 +-
 hw/s390x/s390-virtio.c             |   8 +-
 hw/sh4/sh7750.c                    |   2 +-
 include/exec/cpu-all.h             |  24 -----
 include/exec/cpu-defs.h            |  65 ------------
 include/exec/cputlb.h              |   6 +-
 include/exec/exec-all.h            |  43 ++++----
 include/exec/gen-icount.h          |  10 +-
 include/exec/softmmu_header.h      |   4 +-
 include/exec/softmmu_template.h    |  22 ++--
 include/qom/cpu.h                  | 122 +++++++++++++++++++++-
 linux-user/elfload.c               |  10 +-
 linux-user/linuxload.c             |   3 +-
 linux-user/m68k-sim.c              |   3 +-
 linux-user/m68k/target_cpu.h       |   4 +-
 linux-user/main.c                  | 121 +++++++++++++--------
 linux-user/signal.c                |  24 +++--
 linux-user/syscall.c               |  30 +++---
 linux-user/vm86.c                  |  27 +++--
 qom/cpu.c                          |  18 ++++
 target-alpha/cpu.c                 |  64 ++++++++++--
 target-alpha/cpu.h                 |  52 +---------
 target-alpha/helper.c              |  38 ++++---
 target-alpha/mem_helper.c          |  16 +--
 target-alpha/sys_helper.c          |   4 +-
 target-alpha/translate.c           |   6 +-
 target-arm/arm-semi.c              |   9 +-
 target-arm/cpu.c                   |  51 ++++++++-
 target-arm/cpu.h                   |  39 +------
 target-arm/helper.c                | 110 +++++++++++++-------
 target-arm/op_helper.c             |  33 +++---
 target-arm/translate.c             |   6 +-
 target-cris/cpu.c                  |  36 ++++++-
 target-cris/cpu.h                  |  26 +----
 target-cris/helper.c               |  46 ++++----
 target-cris/mmu.c                  |   3 +-
 target-cris/op_helper.c            |  28 +++--
 target-cris/translate.c            |  21 ++--
 target-cris/translate_v10.c        |  16 +--
 target-i386/cpu.c                  |  54 ++++++++--
 target-i386/cpu.h                  |  37 +------
 target-i386/excp_helper.c          |   6 +-
 target-i386/helper.c               |  78 +++++++++-----
 target-i386/kvm.c                  |   8 +-
 target-i386/machine.c              |   7 +-
 target-i386/mem_helper.c           |  16 +--
 target-i386/misc_helper.c          |  14 ++-
 target-i386/seg_helper.c           |  18 ++--
 target-i386/svm_helper.c           |  26 ++---
 target-i386/translate.c            |   6 +-
 target-lm32/cpu-qom.h              |   3 +
 target-lm32/cpu.c                  |  25 ++++-
 target-lm32/cpu.h                  |  24 +----
 target-lm32/helper.c               |  26 ++---
 target-lm32/op_helper.c            |  23 ++--
 target-lm32/translate.c            |  67 ++++++------
 target-m68k/cpu.c                  |  36 ++++++-
 target-m68k/cpu.h                  |  24 +----
 target-m68k/helper.c               |  24 +++--
 target-m68k/m68k-semi.c            |   5 +-
 target-m68k/op_helper.c            |  34 +++---
 target-m68k/qregs.def              |   1 -
 target-m68k/translate.c            |  13 ++-
 target-microblaze/cpu.c            |  42 +++++++-
 target-microblaze/cpu.h            |  28 +----
 target-microblaze/helper.c         |  34 +++---
 target-microblaze/mmu.c            |   8 +-
 target-microblaze/op_helper.c      |  19 ++--
 target-microblaze/translate.c      | 110 +++++++++++---------
 target-mips/cpu.c                  |  58 ++++++++++-
 target-mips/cpu.h                  |  46 +-------
 target-mips/helper.c               |  56 ++++++----
 target-mips/machine.c              |   3 +-
 target-mips/op_helper.c            |  34 ++++--
 target-mips/translate.c            |   9 +-
 target-mips/translate_init.c       |   4 +-
 target-moxie/cpu.c                 |  26 ++++-
 target-moxie/cpu.h                 |  20 +---
 target-moxie/helper.c              |  51 +++++----
 target-moxie/translate.c           |   4 +-
 target-openrisc/cpu.c              |  45 +++++++-
 target-openrisc/cpu.h              |  28 +----
 target-openrisc/exception.c        |   6 +-
 target-openrisc/interrupt.c        |  29 +++---
 target-openrisc/interrupt_helper.c |   2 +-
 target-openrisc/mmu.c              |  17 +--
 target-openrisc/mmu_helper.c       |   8 +-
 target-openrisc/sys_helper.c       |   6 +-
 target-openrisc/translate.c        |   7 +-
 target-ppc/cpu-qom.h               |   8 +-
 target-ppc/cpu.h                   |  26 +----
 target-ppc/excp_helper.c           |  73 ++++++-------
 target-ppc/fpu_helper.c            |  26 +++--
 target-ppc/helper_regs.h           |   2 +-
 target-ppc/misc_helper.c           |   4 +-
 target-ppc/mmu-hash32.c            |  35 ++++---
 target-ppc/mmu-hash32.h            |   2 +-
 target-ppc/mmu-hash64.c            |  28 ++---
 target-ppc/mmu-hash64.h            |   2 +-
 target-ppc/mmu_helper.c            | 208 +++++++++++++++++++++----------------
 target-ppc/translate.c             |   4 +-
 target-ppc/translate_init.c        |  44 ++++++--
 target-ppc/user_only_helper.c      |   8 +-
 target-s390x/cc_helper.c           |   5 +-
 target-s390x/cpu.c                 |  48 +++++++--
 target-s390x/cpu.h                 |  32 +-----
 target-s390x/fpu_helper.c          |   4 +-
 target-s390x/helper.c              |  85 ++++++++-------
 target-s390x/mem_helper.c          |  52 ++++++----
 target-s390x/misc_helper.c         |  33 +++---
 target-s390x/translate.c           |   4 +-
 target-sh4/cpu.c                   |  42 ++++++--
 target-sh4/cpu.h                   |  28 +----
 target-sh4/helper.c                | 108 ++++++++++---------
 target-sh4/op_helper.c             |  20 ++--
 target-sh4/translate.c             |   4 +-
 target-sparc/cpu.c                 |  75 ++++++++++++-
 target-sparc/cpu.h                 |  59 +----------
 target-sparc/helper.c              |  28 ++---
 target-sparc/int32_helper.c        |  10 +-
 target-sparc/int64_helper.c        |   8 +-
 target-sparc/ldst_helper.c         |  36 ++++---
 target-sparc/machine.c             |   3 +-
 target-sparc/mmu_helper.c          |  40 ++++---
 target-sparc/translate.c           |   6 +-
 target-unicore32/cpu.c             |  35 ++++++-
 target-unicore32/cpu.h             |  26 +----
 target-unicore32/helper.c          |  18 ++--
 target-unicore32/op_helper.c       |  14 +--
 target-unicore32/softmmu.c         |  27 +++--
 target-unicore32/translate.c       |  32 +++++-
 target-unicore32/ucf64_helper.c    |   3 +-
 target-xtensa/cpu.c                |  50 +++++++++
 target-xtensa/cpu.h                |  44 +-------
 target-xtensa/helper.c             |  30 +++---
 target-xtensa/op_helper.c          |  50 +++++----
 target-xtensa/translate.c          |   5 +-
 translate-all.c                    | 118 +++++++++++----------
 translate-all.h                    |   2 +-
 user-exec.c                        |  28 +++--
 149 files changed, 2536 insertions(+), 1993 deletions(-)

-- 
1.8.1.4

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

end of thread, other threads:[~2014-02-07 17:43 UTC | newest]

Thread overview: 68+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-04  9:04 [Qemu-devel] [RFC qom-cpu 00/41] QOM CPUState, part 13: Emptying CPU_COMMON Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 01/41] cpu: Turn cpu_has_work() into a CPUClass hook Andreas Färber
2013-09-04 12:41   ` Jia Liu
2014-02-05 18:51   ` Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 02/41] cpu: Turn cpu_mmu_index() " Andreas Färber
2013-09-04 12:42   ` Jia Liu
2013-09-04 12:55     ` Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 03/41] cpu: Turn cpu_get_tb_cpu_state() " Andreas Färber
2013-09-04 10:26   ` Paolo Bonzini
2013-09-04 11:02     ` Andreas Färber
2013-09-04 11:20       ` Paolo Bonzini
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 04/41] cpu: Turn cpu_handle_mmu_fault() " Andreas Färber
2013-09-04 12:46   ` Jia Liu
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 05/41] cpu: Move mem_io_{pc, vaddr} fields from CPU_COMMON to CPUState Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 06/41] cpu: Move can_do_io field " Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 07/41] cpu: Move icount_extra " Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 08/41] cpu: Move icount_decr " Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 09/41] cpu: Move tb_jmp_cache " Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 10/41] cpu: Move jmp_env " Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 11/41] cpu: Move exception_index " Andreas Färber
2013-09-04 12:47   ` Jia Liu
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 12/41] cpu: Move cpu_copy() into linux-user Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 13/41] cpu: Drop cpu_model_str from CPU_COMMON Andreas Färber
2013-09-04 12:47   ` Jia Liu
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 14/41] cpu: Move opaque field from CPU_COMMON to CPUState Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 15/41] cpu: Move watchpoint fields " Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 16/41] cpu: Move breakpoints field " Andreas Färber
2013-09-04 12:48   ` Jia Liu
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 17/41] cpu: Move tlb_flush_{addr, mask} fields from CPU_COMMON_TLB " Andreas Färber
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 18/41] exec: Change tlb_fill() argument " Andreas Färber
2013-09-04 12:49   ` Jia Liu
2013-09-04  9:04 ` [Qemu-devel] [RFC qom-cpu 19/41] cpu-exec: Change cpu_loop_exit() " Andreas Färber
2013-09-04 12:49   ` Jia Liu
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 20/41] translate-all: Change cpu_restore_state() " Andreas Färber
2013-09-04 12:49   ` Jia Liu
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 21/41] translate-all: Change cpu_restore_state_from_tb() " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 22/41] translate-all: Change tb_check_watchpoint() " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 23/41] translate-all: Change cpu_io_recompile() " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 24/41] translate-all: Change tb_gen_code() " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 25/41] translate-all: Change tb_flush_jmp_cache() " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 26/41] target-ppc: Use PowerPCCPU in PowerPCCPUClass::handle_mmu_fault hook Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 27/41] exec: Change cpu_watchpoint_{insert, remove{, _by_ref, _all}} argument Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 28/41] exec: Change cpu_breakpoint_{insert, " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 29/41] cpu-exec: Change cpu_resume_from_signal() argument to CPUState Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 30/41] cputlb: Change tlb_update_dirty() " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 31/41] exec: Change memory_region_section_get_iotlb() " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 32/41] cputlb: Change tlb_set_page() " Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 33/41] " Andreas Färber
2013-09-04 12:51   ` Jia Liu
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 34/41] exec: Change cpu_abort() " Andreas Färber
2013-09-04 12:49   ` Jia Liu
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 35/41] target-cris: Replace DisasContext::env field with CRISCPU Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 36/41] target-lm32: Replace DisasContext::env field with LM32CPU Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 37/41] target-microblaze: Replace DisasContext::env field with MicroBlazeCPU Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 38/41] target-lm32: Move features field from CPULM32State to LM32CPU Andreas Färber
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 39/41] cputlb: Change tlb_flush_page() argument to CPUState Andreas Färber
2013-09-04 12:50   ` Jia Liu
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 40/41] cputlb: Change tlb_flush() " Andreas Färber
2013-09-04 12:50   ` Jia Liu
2013-09-04  9:05 ` [Qemu-devel] [RFC qom-cpu 41/41] user-exec: Change exception_action() " Andreas Färber
2013-09-09 16:39 ` [Qemu-devel] [RFC qom-cpu 00/41] QOM CPUState, part 13: Emptying CPU_COMMON Michael Walle
2013-09-09 16:47   ` Peter Maydell
2013-09-17 17:46     ` Michael Walle
2013-09-17 18:46       ` Richard Henderson
2013-09-17 21:26         ` Peter Maydell
2013-09-20 17:07         ` [Qemu-devel] Stopping the VM due to an illegal instruction [was: QOM CPUState, part 13: Emptying CPU_COMMON] Michael Walle
2013-09-17 17:32 ` [Qemu-devel] [RFC qom-cpu 00/41] QOM CPUState, part 13: Emptying CPU_COMMON Michael Walle
2014-02-07 17:43 ` Michael Walle

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).