[RFC v1 00/10] i386 cleanup

Claudio Fontana posted 10 patches 3 years, 5 months ago
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201109172755.16500-1-cfontana@suse.de
Maintainers: Peter Xu <peterx@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Paul Durrant <paul@xen.org>, Marcelo Tosatti <mtosatti@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Sunil Muthuswamy <sunilmut@microsoft.com>, Laurent Vivier <laurent@vivier.eu>, Sergio Lopez <slp@redhat.com>, Eduardo Habkost <ehabkost@redhat.com>, Jason Wang <jasowang@redhat.com>, Richard Henderson <rth@twiddle.net>, Paolo Bonzini <pbonzini@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Wenchao Wang <wenchao.wang@intel.com>, Anthony Perard <anthony.perard@citrix.com>, Roman Bolshakov <r.bolshakov@yadro.com>, Cameron Esfahani <dirty@apple.com>, Colin Xu <colin.xu@intel.com>, Thomas Huth <thuth@redhat.com>
There is a newer version of this series
MAINTAINERS                                 |  12 +-
accel/kvm/kvm-all.c                         |  11 +-
accel/qtest/qtest.c                         |  10 +-
accel/tcg/tcg-all.c                         |  11 +-
accel/xen/xen-all.c                         |  12 +-
bsd-user/main.c                             |   4 +
hw/i386/fw_cfg.c                            |   2 +-
hw/i386/intel_iommu.c                       |   2 +-
hw/i386/kvm/apic.c                          |   2 +-
hw/i386/kvm/clock.c                         |   2 +-
hw/i386/microvm.c                           |   2 +-
hw/i386/pc.c                                |   2 +-
hw/i386/pc_piix.c                           |   1 +
hw/i386/x86.c                               |   2 +-
include/qemu/module.h                       |  17 +
linux-user/main.c                           |  10 +-
meson.build                                 |   1 +
softmmu/vl.c                                |   6 +
target/i386/{ => accel/hax}/hax-all.c       |  12 +-
target/i386/{ => accel/hax}/hax-cpus.c      |   0
target/i386/{ => accel/hax}/hax-cpus.h      |   0
target/i386/{ => accel/hax}/hax-i386.h      |   6 +-
target/i386/{ => accel/hax}/hax-interface.h |   0
target/i386/{ => accel/hax}/hax-mem.c       |   0
target/i386/{ => accel/hax}/hax-posix.c     |   0
target/i386/{ => accel/hax}/hax-posix.h     |   0
target/i386/{ => accel/hax}/hax-windows.c   |   0
target/i386/{ => accel/hax}/hax-windows.h   |   0
target/i386/accel/hax/meson.build           |   7 +
target/i386/{ => accel}/hvf/README.md       |   0
target/i386/accel/hvf/hvf-cpu-type.c        |  78 +++
target/i386/{ => accel}/hvf/hvf-cpus.c      |   0
target/i386/{ => accel}/hvf/hvf-cpus.h      |   0
target/i386/{ => accel}/hvf/hvf-i386.h      |   0
target/i386/{ => accel}/hvf/hvf.c           |  10 +-
target/i386/{ => accel}/hvf/meson.build     |   1 +
target/i386/{ => accel}/hvf/panic.h         |   0
target/i386/{ => accel}/hvf/vmcs.h          |   0
target/i386/{ => accel}/hvf/vmx.h           |   0
target/i386/{ => accel}/hvf/x86.c           |   0
target/i386/{ => accel}/hvf/x86.h           |   0
target/i386/{ => accel}/hvf/x86_cpuid.c     |   0
target/i386/{ => accel}/hvf/x86_decode.c    |   0
target/i386/{ => accel}/hvf/x86_decode.h    |   0
target/i386/{ => accel}/hvf/x86_descr.c     |   0
target/i386/{ => accel}/hvf/x86_descr.h     |   0
target/i386/{ => accel}/hvf/x86_emu.c       |   0
target/i386/{ => accel}/hvf/x86_emu.h       |   0
target/i386/{ => accel}/hvf/x86_flags.c     |   0
target/i386/{ => accel}/hvf/x86_flags.h     |   0
target/i386/{ => accel}/hvf/x86_mmu.c       |   0
target/i386/{ => accel}/hvf/x86_mmu.h       |   0
target/i386/{ => accel}/hvf/x86_task.c      |   0
target/i386/{ => accel}/hvf/x86_task.h      |   0
target/i386/{ => accel}/hvf/x86hvf.c        |   0
target/i386/{ => accel}/hvf/x86hvf.h        |   0
target/i386/{ => accel/kvm}/hyperv-proto.h  |   0
target/i386/{ => accel/kvm}/hyperv-stub.c   |   0
target/i386/{ => accel/kvm}/hyperv.c        |   0
target/i386/{ => accel/kvm}/hyperv.h        |   0
target/i386/accel/kvm/kvm-cpu-type.c        | 161 ++++++
target/i386/accel/kvm/kvm-cpu-type.h        |  41 ++
target/i386/{ => accel/kvm}/kvm-stub.c      |   0
target/i386/{ => accel/kvm}/kvm.c           |   3 +-
target/i386/{ => accel/kvm}/kvm_i386.h      |   0
target/i386/accel/kvm/meson.build           |   8 +
target/i386/accel/kvm/trace-events          |   7 +
target/i386/accel/kvm/trace.h               |   1 +
target/i386/{ => accel/tcg}/bpt_helper.c    |   1 +
target/i386/{ => accel/tcg}/cc_helper.c     |   1 +
target/i386/{ => accel/tcg}/excp_helper.c   |   1 +
target/i386/{ => accel/tcg}/fpu_helper.c    |  33 +-
target/i386/{ => accel/tcg}/int_helper.c    |   1 +
target/i386/{ => accel/tcg}/mem_helper.c    |   1 +
target/i386/accel/tcg/meson.build           |  14 +
target/i386/{ => accel/tcg}/misc_helper.c   |   1 +
target/i386/{ => accel/tcg}/mpx_helper.c    |   1 +
target/i386/{ => accel/tcg}/seg_helper.c    |   1 +
target/i386/{ => accel/tcg}/smm_helper.c    |   2 +
target/i386/{ => accel/tcg}/svm_helper.c    |   1 +
target/i386/accel/tcg/tcg-cpu-type.c        | 176 +++++++
target/i386/accel/tcg/tcg-cpu-type.h        |  25 +
target/i386/{ => accel/tcg}/tcg-stub.c      |   0
target/i386/{ => accel/tcg}/translate.c     |   1 +
target/i386/accel/whpx/meson.build          |   4 +
target/i386/{ => accel/whpx}/whp-dispatch.h |   0
target/i386/{ => accel/whpx}/whpx-all.c     |  11 +-
target/i386/{ => accel/whpx}/whpx-cpus.c    |   0
target/i386/{ => accel/whpx}/whpx-cpus.h    |   0
target/i386/cpu-dump.c                      | 538 +++++++++++++++++++
target/i386/cpu.c                           | 489 ++++--------------
target/i386/cpu.h                           | 126 +----
target/i386/helper-tcg.h                    | 112 ++++
target/i386/helper.c                        | 539 +-------------------
target/i386/host-cpu.c                      | 201 ++++++++
target/i386/host-cpu.h                      |  21 +
target/i386/machine.c                       |   4 +-
target/i386/meson.build                     |  41 +-
target/i386/trace-events                    |   6 -
99 files changed, 1678 insertions(+), 1118 deletions(-)
rename target/i386/{ => accel/hax}/hax-all.c (99%)
rename target/i386/{ => accel/hax}/hax-cpus.c (100%)
rename target/i386/{ => accel/hax}/hax-cpus.h (100%)
rename target/i386/{ => accel/hax}/hax-i386.h (95%)
rename target/i386/{ => accel/hax}/hax-interface.h (100%)
rename target/i386/{ => accel/hax}/hax-mem.c (100%)
rename target/i386/{ => accel/hax}/hax-posix.c (100%)
rename target/i386/{ => accel/hax}/hax-posix.h (100%)
rename target/i386/{ => accel/hax}/hax-windows.c (100%)
rename target/i386/{ => accel/hax}/hax-windows.h (100%)
create mode 100644 target/i386/accel/hax/meson.build
rename target/i386/{ => accel}/hvf/README.md (100%)
create mode 100644 target/i386/accel/hvf/hvf-cpu-type.c
rename target/i386/{ => accel}/hvf/hvf-cpus.c (100%)
rename target/i386/{ => accel}/hvf/hvf-cpus.h (100%)
rename target/i386/{ => accel}/hvf/hvf-i386.h (100%)
rename target/i386/{ => accel}/hvf/hvf.c (99%)
rename target/i386/{ => accel}/hvf/meson.build (92%)
rename target/i386/{ => accel}/hvf/panic.h (100%)
rename target/i386/{ => accel}/hvf/vmcs.h (100%)
rename target/i386/{ => accel}/hvf/vmx.h (100%)
rename target/i386/{ => accel}/hvf/x86.c (100%)
rename target/i386/{ => accel}/hvf/x86.h (100%)
rename target/i386/{ => accel}/hvf/x86_cpuid.c (100%)
rename target/i386/{ => accel}/hvf/x86_decode.c (100%)
rename target/i386/{ => accel}/hvf/x86_decode.h (100%)
rename target/i386/{ => accel}/hvf/x86_descr.c (100%)
rename target/i386/{ => accel}/hvf/x86_descr.h (100%)
rename target/i386/{ => accel}/hvf/x86_emu.c (100%)
rename target/i386/{ => accel}/hvf/x86_emu.h (100%)
rename target/i386/{ => accel}/hvf/x86_flags.c (100%)
rename target/i386/{ => accel}/hvf/x86_flags.h (100%)
rename target/i386/{ => accel}/hvf/x86_mmu.c (100%)
rename target/i386/{ => accel}/hvf/x86_mmu.h (100%)
rename target/i386/{ => accel}/hvf/x86_task.c (100%)
rename target/i386/{ => accel}/hvf/x86_task.h (100%)
rename target/i386/{ => accel}/hvf/x86hvf.c (100%)
rename target/i386/{ => accel}/hvf/x86hvf.h (100%)
rename target/i386/{ => accel/kvm}/hyperv-proto.h (100%)
rename target/i386/{ => accel/kvm}/hyperv-stub.c (100%)
rename target/i386/{ => accel/kvm}/hyperv.c (100%)
rename target/i386/{ => accel/kvm}/hyperv.h (100%)
create mode 100644 target/i386/accel/kvm/kvm-cpu-type.c
create mode 100644 target/i386/accel/kvm/kvm-cpu-type.h
rename target/i386/{ => accel/kvm}/kvm-stub.c (100%)
rename target/i386/{ => accel/kvm}/kvm.c (99%)
rename target/i386/{ => accel/kvm}/kvm_i386.h (100%)
create mode 100644 target/i386/accel/kvm/meson.build
create mode 100644 target/i386/accel/kvm/trace-events
create mode 100644 target/i386/accel/kvm/trace.h
rename target/i386/{ => accel/tcg}/bpt_helper.c (99%)
rename target/i386/{ => accel/tcg}/cc_helper.c (99%)
rename target/i386/{ => accel/tcg}/excp_helper.c (99%)
rename target/i386/{ => accel/tcg}/fpu_helper.c (99%)
rename target/i386/{ => accel/tcg}/int_helper.c (99%)
rename target/i386/{ => accel/tcg}/mem_helper.c (99%)
create mode 100644 target/i386/accel/tcg/meson.build
rename target/i386/{ => accel/tcg}/misc_helper.c (99%)
rename target/i386/{ => accel/tcg}/mpx_helper.c (99%)
rename target/i386/{ => accel/tcg}/seg_helper.c (99%)
rename target/i386/{ => accel/tcg}/smm_helper.c (99%)
rename target/i386/{ => accel/tcg}/svm_helper.c (99%)
create mode 100644 target/i386/accel/tcg/tcg-cpu-type.c
create mode 100644 target/i386/accel/tcg/tcg-cpu-type.h
rename target/i386/{ => accel/tcg}/tcg-stub.c (100%)
rename target/i386/{ => accel/tcg}/translate.c (99%)
create mode 100644 target/i386/accel/whpx/meson.build
rename target/i386/{ => accel/whpx}/whp-dispatch.h (100%)
rename target/i386/{ => accel/whpx}/whpx-all.c (99%)
rename target/i386/{ => accel/whpx}/whpx-cpus.c (100%)
rename target/i386/{ => accel/whpx}/whpx-cpus.h (100%)
create mode 100644 target/i386/cpu-dump.c
create mode 100644 target/i386/helper-tcg.h
create mode 100644 target/i386/host-cpu.c
create mode 100644 target/i386/host-cpu.h
[RFC v1 00/10] i386 cleanup
Posted by Claudio Fontana 3 years, 5 months ago
Hi all,

this is very much a RFC, I have started to look at the i386
target dir and how to start refactoring and splitting up
things better, moving more and more of the code to
accelerator-specific parts that are conditionally compiled.

In this RFC I start by moving all i386-specific accelerators into
target/i386/accel/, away from the main target directory,

then I go on and strip away all the cpu dump code out of helper.c
into a new file. There is a large amount of checkpatch warnings
and errors, but this is due to the copy paste of the old code,
we might need to clean up the state of the dump code in a later
change if necessary.

After that I take out tcg-specific stuff from cpu.h and from
helper.c and put it in helper-tcg.h and in a new tcg-cpu module,
(that will be renamed later in the series as its role changes).

After this I considered and implemented a few options,
but after some initial evaluation I concluded that a good idea
could possibly be to introduce a new MODULE_INIT phase,

MODULE_INIT_ACCEL_CPU

that I could use to put all existing cpus accel interface
initializations,
and that I could also use to put all accelerator specific
cpu module registrations, deferring the usual registration
at MODULE_INIT_QOM time.
This deferring allows to make all x86 cpu models children
of an accel-specific cpu type, in turn having as parent
the generic TYPE_X86_CPU.

There are for sure other options out there, so let me know if
this way seems promising, or if you have other ideas on how
to proceed here, especially in the last 3 patches..

Motivation and higher level steps:

https://lists.gnu.org/archive/html/qemu-devel/2020-05/msg04628.html

Thank you for your comments,

Ciao,

Claudio

Claudio Fontana (10):
  i386: move kvm accel files into accel/kvm/
  i386: move whpx accel files to accel/whpx/
  i386: move hax accel files to accel/hax/
  i386: move hvf accel files into accel/hvf/
  i386: move TCG accel files into accel/tcg/
  i386: move cpu dump out of helper.c into cpu-dump.c
  i386: move TCG cpu class initialization out of helper.c
  module: introduce MODULE_INIT_ACCEL_CPU
  i386: split cpu.c and defer x86 models registration
  module: add priority to module_init

 MAINTAINERS                                 |  12 +-
 accel/kvm/kvm-all.c                         |  11 +-
 accel/qtest/qtest.c                         |  10 +-
 accel/tcg/tcg-all.c                         |  11 +-
 accel/xen/xen-all.c                         |  12 +-
 bsd-user/main.c                             |   4 +
 hw/i386/fw_cfg.c                            |   2 +-
 hw/i386/intel_iommu.c                       |   2 +-
 hw/i386/kvm/apic.c                          |   2 +-
 hw/i386/kvm/clock.c                         |   2 +-
 hw/i386/microvm.c                           |   2 +-
 hw/i386/pc.c                                |   2 +-
 hw/i386/pc_piix.c                           |   1 +
 hw/i386/x86.c                               |   2 +-
 include/qemu/module.h                       |  17 +
 linux-user/main.c                           |  10 +-
 meson.build                                 |   1 +
 softmmu/vl.c                                |   6 +
 target/i386/{ => accel/hax}/hax-all.c       |  12 +-
 target/i386/{ => accel/hax}/hax-cpus.c      |   0
 target/i386/{ => accel/hax}/hax-cpus.h      |   0
 target/i386/{ => accel/hax}/hax-i386.h      |   6 +-
 target/i386/{ => accel/hax}/hax-interface.h |   0
 target/i386/{ => accel/hax}/hax-mem.c       |   0
 target/i386/{ => accel/hax}/hax-posix.c     |   0
 target/i386/{ => accel/hax}/hax-posix.h     |   0
 target/i386/{ => accel/hax}/hax-windows.c   |   0
 target/i386/{ => accel/hax}/hax-windows.h   |   0
 target/i386/accel/hax/meson.build           |   7 +
 target/i386/{ => accel}/hvf/README.md       |   0
 target/i386/accel/hvf/hvf-cpu-type.c        |  78 +++
 target/i386/{ => accel}/hvf/hvf-cpus.c      |   0
 target/i386/{ => accel}/hvf/hvf-cpus.h      |   0
 target/i386/{ => accel}/hvf/hvf-i386.h      |   0
 target/i386/{ => accel}/hvf/hvf.c           |  10 +-
 target/i386/{ => accel}/hvf/meson.build     |   1 +
 target/i386/{ => accel}/hvf/panic.h         |   0
 target/i386/{ => accel}/hvf/vmcs.h          |   0
 target/i386/{ => accel}/hvf/vmx.h           |   0
 target/i386/{ => accel}/hvf/x86.c           |   0
 target/i386/{ => accel}/hvf/x86.h           |   0
 target/i386/{ => accel}/hvf/x86_cpuid.c     |   0
 target/i386/{ => accel}/hvf/x86_decode.c    |   0
 target/i386/{ => accel}/hvf/x86_decode.h    |   0
 target/i386/{ => accel}/hvf/x86_descr.c     |   0
 target/i386/{ => accel}/hvf/x86_descr.h     |   0
 target/i386/{ => accel}/hvf/x86_emu.c       |   0
 target/i386/{ => accel}/hvf/x86_emu.h       |   0
 target/i386/{ => accel}/hvf/x86_flags.c     |   0
 target/i386/{ => accel}/hvf/x86_flags.h     |   0
 target/i386/{ => accel}/hvf/x86_mmu.c       |   0
 target/i386/{ => accel}/hvf/x86_mmu.h       |   0
 target/i386/{ => accel}/hvf/x86_task.c      |   0
 target/i386/{ => accel}/hvf/x86_task.h      |   0
 target/i386/{ => accel}/hvf/x86hvf.c        |   0
 target/i386/{ => accel}/hvf/x86hvf.h        |   0
 target/i386/{ => accel/kvm}/hyperv-proto.h  |   0
 target/i386/{ => accel/kvm}/hyperv-stub.c   |   0
 target/i386/{ => accel/kvm}/hyperv.c        |   0
 target/i386/{ => accel/kvm}/hyperv.h        |   0
 target/i386/accel/kvm/kvm-cpu-type.c        | 161 ++++++
 target/i386/accel/kvm/kvm-cpu-type.h        |  41 ++
 target/i386/{ => accel/kvm}/kvm-stub.c      |   0
 target/i386/{ => accel/kvm}/kvm.c           |   3 +-
 target/i386/{ => accel/kvm}/kvm_i386.h      |   0
 target/i386/accel/kvm/meson.build           |   8 +
 target/i386/accel/kvm/trace-events          |   7 +
 target/i386/accel/kvm/trace.h               |   1 +
 target/i386/{ => accel/tcg}/bpt_helper.c    |   1 +
 target/i386/{ => accel/tcg}/cc_helper.c     |   1 +
 target/i386/{ => accel/tcg}/excp_helper.c   |   1 +
 target/i386/{ => accel/tcg}/fpu_helper.c    |  33 +-
 target/i386/{ => accel/tcg}/int_helper.c    |   1 +
 target/i386/{ => accel/tcg}/mem_helper.c    |   1 +
 target/i386/accel/tcg/meson.build           |  14 +
 target/i386/{ => accel/tcg}/misc_helper.c   |   1 +
 target/i386/{ => accel/tcg}/mpx_helper.c    |   1 +
 target/i386/{ => accel/tcg}/seg_helper.c    |   1 +
 target/i386/{ => accel/tcg}/smm_helper.c    |   2 +
 target/i386/{ => accel/tcg}/svm_helper.c    |   1 +
 target/i386/accel/tcg/tcg-cpu-type.c        | 176 +++++++
 target/i386/accel/tcg/tcg-cpu-type.h        |  25 +
 target/i386/{ => accel/tcg}/tcg-stub.c      |   0
 target/i386/{ => accel/tcg}/translate.c     |   1 +
 target/i386/accel/whpx/meson.build          |   4 +
 target/i386/{ => accel/whpx}/whp-dispatch.h |   0
 target/i386/{ => accel/whpx}/whpx-all.c     |  11 +-
 target/i386/{ => accel/whpx}/whpx-cpus.c    |   0
 target/i386/{ => accel/whpx}/whpx-cpus.h    |   0
 target/i386/cpu-dump.c                      | 538 +++++++++++++++++++
 target/i386/cpu.c                           | 489 ++++--------------
 target/i386/cpu.h                           | 126 +----
 target/i386/helper-tcg.h                    | 112 ++++
 target/i386/helper.c                        | 539 +-------------------
 target/i386/host-cpu.c                      | 201 ++++++++
 target/i386/host-cpu.h                      |  21 +
 target/i386/machine.c                       |   4 +-
 target/i386/meson.build                     |  41 +-
 target/i386/trace-events                    |   6 -
 99 files changed, 1678 insertions(+), 1118 deletions(-)
 rename target/i386/{ => accel/hax}/hax-all.c (99%)
 rename target/i386/{ => accel/hax}/hax-cpus.c (100%)
 rename target/i386/{ => accel/hax}/hax-cpus.h (100%)
 rename target/i386/{ => accel/hax}/hax-i386.h (95%)
 rename target/i386/{ => accel/hax}/hax-interface.h (100%)
 rename target/i386/{ => accel/hax}/hax-mem.c (100%)
 rename target/i386/{ => accel/hax}/hax-posix.c (100%)
 rename target/i386/{ => accel/hax}/hax-posix.h (100%)
 rename target/i386/{ => accel/hax}/hax-windows.c (100%)
 rename target/i386/{ => accel/hax}/hax-windows.h (100%)
 create mode 100644 target/i386/accel/hax/meson.build
 rename target/i386/{ => accel}/hvf/README.md (100%)
 create mode 100644 target/i386/accel/hvf/hvf-cpu-type.c
 rename target/i386/{ => accel}/hvf/hvf-cpus.c (100%)
 rename target/i386/{ => accel}/hvf/hvf-cpus.h (100%)
 rename target/i386/{ => accel}/hvf/hvf-i386.h (100%)
 rename target/i386/{ => accel}/hvf/hvf.c (99%)
 rename target/i386/{ => accel}/hvf/meson.build (92%)
 rename target/i386/{ => accel}/hvf/panic.h (100%)
 rename target/i386/{ => accel}/hvf/vmcs.h (100%)
 rename target/i386/{ => accel}/hvf/vmx.h (100%)
 rename target/i386/{ => accel}/hvf/x86.c (100%)
 rename target/i386/{ => accel}/hvf/x86.h (100%)
 rename target/i386/{ => accel}/hvf/x86_cpuid.c (100%)
 rename target/i386/{ => accel}/hvf/x86_decode.c (100%)
 rename target/i386/{ => accel}/hvf/x86_decode.h (100%)
 rename target/i386/{ => accel}/hvf/x86_descr.c (100%)
 rename target/i386/{ => accel}/hvf/x86_descr.h (100%)
 rename target/i386/{ => accel}/hvf/x86_emu.c (100%)
 rename target/i386/{ => accel}/hvf/x86_emu.h (100%)
 rename target/i386/{ => accel}/hvf/x86_flags.c (100%)
 rename target/i386/{ => accel}/hvf/x86_flags.h (100%)
 rename target/i386/{ => accel}/hvf/x86_mmu.c (100%)
 rename target/i386/{ => accel}/hvf/x86_mmu.h (100%)
 rename target/i386/{ => accel}/hvf/x86_task.c (100%)
 rename target/i386/{ => accel}/hvf/x86_task.h (100%)
 rename target/i386/{ => accel}/hvf/x86hvf.c (100%)
 rename target/i386/{ => accel}/hvf/x86hvf.h (100%)
 rename target/i386/{ => accel/kvm}/hyperv-proto.h (100%)
 rename target/i386/{ => accel/kvm}/hyperv-stub.c (100%)
 rename target/i386/{ => accel/kvm}/hyperv.c (100%)
 rename target/i386/{ => accel/kvm}/hyperv.h (100%)
 create mode 100644 target/i386/accel/kvm/kvm-cpu-type.c
 create mode 100644 target/i386/accel/kvm/kvm-cpu-type.h
 rename target/i386/{ => accel/kvm}/kvm-stub.c (100%)
 rename target/i386/{ => accel/kvm}/kvm.c (99%)
 rename target/i386/{ => accel/kvm}/kvm_i386.h (100%)
 create mode 100644 target/i386/accel/kvm/meson.build
 create mode 100644 target/i386/accel/kvm/trace-events
 create mode 100644 target/i386/accel/kvm/trace.h
 rename target/i386/{ => accel/tcg}/bpt_helper.c (99%)
 rename target/i386/{ => accel/tcg}/cc_helper.c (99%)
 rename target/i386/{ => accel/tcg}/excp_helper.c (99%)
 rename target/i386/{ => accel/tcg}/fpu_helper.c (99%)
 rename target/i386/{ => accel/tcg}/int_helper.c (99%)
 rename target/i386/{ => accel/tcg}/mem_helper.c (99%)
 create mode 100644 target/i386/accel/tcg/meson.build
 rename target/i386/{ => accel/tcg}/misc_helper.c (99%)
 rename target/i386/{ => accel/tcg}/mpx_helper.c (99%)
 rename target/i386/{ => accel/tcg}/seg_helper.c (99%)
 rename target/i386/{ => accel/tcg}/smm_helper.c (99%)
 rename target/i386/{ => accel/tcg}/svm_helper.c (99%)
 create mode 100644 target/i386/accel/tcg/tcg-cpu-type.c
 create mode 100644 target/i386/accel/tcg/tcg-cpu-type.h
 rename target/i386/{ => accel/tcg}/tcg-stub.c (100%)
 rename target/i386/{ => accel/tcg}/translate.c (99%)
 create mode 100644 target/i386/accel/whpx/meson.build
 rename target/i386/{ => accel/whpx}/whp-dispatch.h (100%)
 rename target/i386/{ => accel/whpx}/whpx-all.c (99%)
 rename target/i386/{ => accel/whpx}/whpx-cpus.c (100%)
 rename target/i386/{ => accel/whpx}/whpx-cpus.h (100%)
 create mode 100644 target/i386/cpu-dump.c
 create mode 100644 target/i386/helper-tcg.h
 create mode 100644 target/i386/host-cpu.c
 create mode 100644 target/i386/host-cpu.h

-- 
2.26.2


Re: [RFC v1 00/10] i386 cleanup
Posted by no-reply@patchew.org 3 years, 5 months ago
Patchew URL: https://patchew.org/QEMU/20201109172755.16500-1-cfontana@suse.de/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Message-id: 20201109172755.16500-1-cfontana@suse.de
Subject: [RFC v1 00/10] i386 cleanup
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 - [tag update]      patchew/20201109090422.2445166-1-f4bug@amsat.org -> patchew/20201109090422.2445166-1-f4bug@amsat.org
 - [tag update]      patchew/20201109162621.18885-1-peter.maydell@linaro.org -> patchew/20201109162621.18885-1-peter.maydell@linaro.org
 * [new tag]         patchew/20201109172755.16500-1-cfontana@suse.de -> patchew/20201109172755.16500-1-cfontana@suse.de
Switched to a new branch 'test'
79d85c4 module: add priority to module_init
c947a1f i386: split cpu.c and defer x86 models registration
22999b7 module: introduce MODULE_INIT_ACCEL_CPU
41dd5f6 i386: move TCG cpu class initialization out of helper.c
09b68b7 i386: move cpu dump out of helper.c into cpu-dump.c
dd91165 i386: move TCG accel files into accel/tcg/
c341f6d i386: move hvf accel files into accel/hvf/
76dbf66 i386: move hax accel files to accel/hax/
2c0221e i386: move whpx accel files to accel/whpx/
41d7cb1 i386: move kvm accel files into accel/kvm/

=== OUTPUT BEGIN ===
1/10 Checking commit 41d7cb1d063e (i386: move kvm accel files into accel/kvm/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#128: 
rename from target/i386/hyperv-proto.h

total: 0 errors, 1 warnings, 150 lines checked

Patch 1/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/10 Checking commit 2c0221e3dcf3 (i386: move whpx accel files to accel/whpx/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#27: 
new file mode 100644

total: 0 errors, 1 warnings, 32 lines checked

Patch 2/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/10 Checking commit 76dbf6695e74 (i386: move hax accel files to accel/hax/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#25: 
rename from target/i386/hax-all.c

total: 0 errors, 1 warnings, 47 lines checked

Patch 3/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/10 Checking commit c341f6d31a78 (i386: move hvf accel files into accel/hvf/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#26: 
rename from target/i386/hvf/README.md

total: 0 errors, 1 warnings, 17 lines checked

Patch 4/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/10 Checking commit dd91165f2ce0 (i386: move TCG accel files into accel/tcg/)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#12: 
rename from target/i386/bpt_helper.c

total: 0 errors, 1 warnings, 39 lines checked

Patch 5/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
6/10 Checking commit 09b68b7a3ccb (i386: move cpu dump out of helper.c into cpu-dump.c)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#11: 
new file mode 100644

ERROR: braces {} are necessary for all arms of this statement
#128: FILE: target/i386/cpu-dump.c:113:
+    if (!(env->hflags & HF_PE_MASK) || !(sc->flags & DESC_P_MASK))
[...]

WARNING: Block comments use a leading /* on a separate line
#172: FILE: target/i386/cpu-dump.c:157:
+/* ARRAY_SIZE check is not required because

WARNING: Block comments use a leading /* on a separate line
#211: FILE: target/i386/cpu-dump.c:196:
+/* ARRAY_SIZE check is not required because

ERROR: line over 90 characters
#373: FILE: target/i386/cpu-dump.c:358:
+        qemu_fprintf(f, "RAX=%016" PRIx64 " RBX=%016" PRIx64 " RCX=%016" PRIx64 " RDX=%016" PRIx64 "\n"

ERROR: line over 90 characters
#374: FILE: target/i386/cpu-dump.c:359:
+                     "RSI=%016" PRIx64 " RDI=%016" PRIx64 " RBP=%016" PRIx64 " RSP=%016" PRIx64 "\n"

ERROR: line over 90 characters
#375: FILE: target/i386/cpu-dump.c:360:
+                     "R8 =%016" PRIx64 " R9 =%016" PRIx64 " R10=%016" PRIx64 " R11=%016" PRIx64 "\n"

ERROR: line over 90 characters
#376: FILE: target/i386/cpu-dump.c:361:
+                     "R12=%016" PRIx64 " R13=%016" PRIx64 " R14=%016" PRIx64 " R15=%016" PRIx64 "\n"

ERROR: line over 90 characters
#377: FILE: target/i386/cpu-dump.c:362:
+                     "RIP=%016" PRIx64 " RFL=%08x [%c%c%c%c%c%c%c] CPL=%d II=%d A20=%d SMM=%d HLT=%d\n",

ERROR: space required before the open parenthesis '('
#436: FILE: target/i386/cpu-dump.c:421:
+    for(i = 0; i < 6; i++) {

WARNING: line over 80 characters
#448: FILE: target/i386/cpu-dump.c:433:
+        qemu_fprintf(f, "CR0=%08x CR2=%016" PRIx64 " CR3=%016" PRIx64 " CR4=%08x\n",

ERROR: space required before the open parenthesis '('
#453: FILE: target/i386/cpu-dump.c:438:
+        for(i = 0; i < 4; i++)

ERROR: braces {} are necessary for all arms of this statement
#453: FILE: target/i386/cpu-dump.c:438:
+        for(i = 0; i < 4; i++)
[...]

ERROR: space required before the open parenthesis '('
#469: FILE: target/i386/cpu-dump.c:454:
+        for(i = 0; i < 4; i++) {

ERROR: braces {} are necessary for all arms of this statement
#476: FILE: target/i386/cpu-dump.c:461:
+        if ((unsigned)env->cc_op < CC_OP_NB)
[...]
+        else
[...]

WARNING: line over 80 characters
#477: FILE: target/i386/cpu-dump.c:462:
+            snprintf(cc_op_name, sizeof(cc_op_name), "%s", cc_op_str[env->cc_op]);

ERROR: space required before the open parenthesis '('
#497: FILE: target/i386/cpu-dump.c:482:
+        for(i = 0; i < 8; i++) {

ERROR: spaces required around that '=' (ctx:VxV)
#507: FILE: target/i386/cpu-dump.c:492:
+        for(i=0;i<8;i++) {
              ^

ERROR: space required after that ';' (ctx:VxV)
#507: FILE: target/i386/cpu-dump.c:492:
+        for(i=0;i<8;i++) {
                ^

ERROR: spaces required around that '<' (ctx:VxV)
#507: FILE: target/i386/cpu-dump.c:492:
+        for(i=0;i<8;i++) {
                  ^

ERROR: space required after that ';' (ctx:VxV)
#507: FILE: target/i386/cpu-dump.c:492:
+        for(i=0;i<8;i++) {
                    ^

ERROR: space required before the open parenthesis '('
#507: FILE: target/i386/cpu-dump.c:492:
+        for(i=0;i<8;i++) {

ERROR: braces {} are necessary for all arms of this statement
#512: FILE: target/i386/cpu-dump.c:497:
+            if ((i & 1) == 1)
[...]
+            else
[...]

ERROR: braces {} are necessary for all arms of this statement
#517: FILE: target/i386/cpu-dump.c:502:
+        if (env->hflags & HF_CS64_MASK)
[...]
+        else
[...]

ERROR: spaces required around that '=' (ctx:VxV)
#521: FILE: target/i386/cpu-dump.c:506:
+        for(i=0;i<nb;i++) {
              ^

ERROR: space required after that ';' (ctx:VxV)
#521: FILE: target/i386/cpu-dump.c:506:
+        for(i=0;i<nb;i++) {
                ^

ERROR: spaces required around that '<' (ctx:VxV)
#521: FILE: target/i386/cpu-dump.c:506:
+        for(i=0;i<nb;i++) {
                  ^

ERROR: space required after that ';' (ctx:VxV)
#521: FILE: target/i386/cpu-dump.c:506:
+        for(i=0;i<nb;i++) {
                     ^

ERROR: space required before the open parenthesis '('
#521: FILE: target/i386/cpu-dump.c:506:
+        for(i=0;i<nb;i++) {

ERROR: braces {} are necessary for all arms of this statement
#528: FILE: target/i386/cpu-dump.c:513:
+            if ((i & 1) == 1)
[...]
+            else
[...]

total: 25 errors, 5 warnings, 1078 lines checked

Patch 6/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/10 Checking commit 41dd5f6ce813 (i386: move TCG cpu class initialization out of helper.c)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#466: 
new file mode 100644

total: 0 errors, 1 warnings, 610 lines checked

Patch 7/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
8/10 Checking commit 22999b75bce2 (module: introduce MODULE_INIT_ACCEL_CPU)
9/10 Checking commit c947a1fbb439 (i386: split cpu.c and defer x86 models registration)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#90: 
new file mode 100644

WARNING: line over 80 characters
#549: FILE: target/i386/accel/tcg/tcg-cpu-type.c:101:
+    memory_region_add_subregion_overlap(cpu->cpu_as_root, 0, cpu->cpu_as_mem, 0);

total: 0 errors, 2 warnings, 1501 lines checked

Patch 9/10 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
10/10 Checking commit 79d85c44139c (module: add priority to module_init)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20201109172755.16500-1-cfontana@suse.de/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com