Skip to content

RFC arm cleanup experiment for kvm-only build

Claudio Fontana qemu-devel 12 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v14 RFC Latest80 patches 13 repliesIn review
  2. v13 RFC80 patches 0 repliesSuperseded
  3. v12 RFC65 patches 79 repliesSuperseded
Earlier versions · 9
VersionPostedPatchesRepliesStatus
v11 RFC55 patches54 repliesSuperseded
v10 RFC49 patches10 repliesSuperseded
v9 RFC50 patches3 repliesSuperseded
v8 RFC44 patches0 repliesSuperseded
v7 RFC42 patches1 replySuperseded
v6 RFC38 patches1 replySuperseded
v5 RFC36 patches2 repliesSuperseded
v4 RFC33 patches3 repliesSuperseded
v3 RFC23 patches0 repliesSuperseded

v12 -> v13 from the cover letter

* "target/arm: tcg: add stubs for some helpers for non-tcg builds"
- renamed helper-stubs.c to tcg-stubs.c

* "target/arm: move arm_sctlr away from tcg helpers"
- split change in two steps to separate the TARGET_AARCH64-only part

- added a new patch that uses is_a64(env) instead of TARGET_AARCH64, assuming the protected part is AArch64-only code.

* "target/arm: split a15 cpu model and 32bit class functions to cpu32.c"
- split the patch into three :

Patches in v14 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/80target/arm: move translate modules to tcg/target/arm/meson.build target/arm/tcg/a32-uncond.decode target/arm/tcg/a32.decode +17 more+26 -180 replies
2/80target/arm: move helpers to tcg/meson.build target/arm/meson.build target/arm/tcg/crypto_helper.c +19 more+26 -230 replies
3/80arm: tcg: only build under CONFIG_TCGtarget/arm/tcg/meson.build+3 -30 replies
4/80target/arm: tcg: add sysemu and user subdirstarget/arm/tcg/meson.build target/arm/tcg/sysemu/meson.build target/arm/tcg/user/meson.build+7 -01 reply
5/80target/arm: tcg: split mte_helper user-only and sysemu codetarget/arm/tcg/mte_helper.c target/arm/tcg/mte_helper.h target/arm/tcg/sysemu/meson.build +3 more+272 -1900 replies
6/80target/arm: tcg: move sysemu-only parts of debug_helpertarget/arm/tcg/debug_helper.c target/arm/tcg/sysemu/debug_helper.c target/arm/tcg/sysemu/meson.build+34 -270 replies
7/80target/arm: tcg: split tlb_helper user-only and sysemu-only partstarget/arm/tcg/sysemu/meson.build target/arm/tcg/sysemu/tlb_helper.c target/arm/tcg/tlb_helper.c +3 more+138 -930 replies
8/80target/arm: tcg: split m_helper user-only and sysemu-only partstarget/arm/tcg/m_helper.c target/arm/tcg/m_helper.h target/arm/tcg/sysemu/m_helper.c +3 more+2780 -27610 replies
9/80target/arm: only build psci for TCGtarget/arm/meson.build+4 -01 reply
10/80target/arm: split off cpu-sysemu.ctarget/arm/cpu-sysemu.c target/arm/cpu.c target/arm/internals.h +1 more+113 -840 replies
11/80target/arm: tcg: fix comment style before move to cpu-mmutarget/arm/tcg/helper.c+101 -511 reply
12/80target/arm: move physical address translation to cpu-mmutarget/arm/cpu-mmu-sysemu.c target/arm/cpu-mmu.c target/arm/cpu-mmu.h +8 more+2557 -24800 replies
13/80target/arm: fix style in preparation of new cpregs moduletarget/arm/cpu.h target/arm/tcg/helper.c+239 -1251 reply
14/80target/arm: split cpregs from tcg/helper.chw/arm/pxa2xx.c hw/arm/pxa2xx_pic.c hw/intc/arm_gicv3_cpuif.c +17 more+9004 -89371 reply
15/80target/arm: move cpu definitions to common cpu moduletarget/arm/cpu-common.c target/arm/meson.build target/arm/tcg/helper.c+42 -291 reply
16/80target/arm: only perform TCG cpu and machine inits if TCG enabledtarget/arm/cpu.c target/arm/kvm.c target/arm/machine.c+40 -300 replies
17/80target/arm: tcg: add stubs for some helpers for non-tcg buildstarget/arm/tcg/meson.build target/arm/tcg/tcg-stubs.c+19 -00 replies
18/80target/arm: move cpsr_read, cpsr_write to cpu_commontarget/arm/cpu-common.c target/arm/cpu-sysemu.c target/arm/cpu-user.c +3 more+251 -2200 replies
19/80target/arm: add temporary stub for arm_rebuild_hflagshw/arm/boot.c target/arm/arm-powerctl.c target/arm/tcg/tcg-stubs.c+14 -40 replies
20/80target/arm: move arm_hcr_el2_eff from tcg/ to common_cputarget/arm/cpu-common.c target/arm/tcg/helper.c+68 -680 replies
21/80target/arm: split vfp state setting from tcg helperstarget/arm/cpu-vfp.c target/arm/cpu-vfp.h target/arm/meson.build +3 more+276 -2080 replies
22/80target/arm: move arm_mmu_idx* to cpu-mmutarget/arm/cpu-mmu.c target/arm/tcg/helper.c+95 -950 replies
23/80target/arm: move sve_zcr_len_for_el to common_cputarget/arm/cpu-common.c target/arm/tcg/helper.c+43 -330 replies
24/80target/arm: move arm_sctlr away from tcg helperstarget/arm/cpu-common.c target/arm/tcg/helper.c+11 -110 replies
25/80target/arm: move arm_cpu_list to common_cputarget/arm/cpu-common.c target/arm/tcg/helper.c+42 -410 replies
26/80target/arm: move aarch64_sync_32_to_64 (and vv) to cpu codetarget/arm/cpu-sysemu.c target/arm/cpu-user.c target/arm/tcg/helper.c+229 -2290 replies
27/80target/arm: new cpu32 ARM 32 bit CPU Classtarget/arm/cpu-qom.h target/arm/cpu.c target/arm/cpu32.c +4 more+159 -560 replies
28/80target/arm: split 32bit and 64bit arm dump statetarget/arm/cpu.c target/arm/cpu32.c target/arm/cpu32.h +1 more+227 -2270 replies
29/80target/arm: move a15 cpu model away from the TCG-only modelstarget/arm/cpu32.c target/arm/cpu32.h target/arm/cpu_tcg.c+77 -670 replies
30/80target/arm: fixup sve_exception_el code style before movetarget/arm/tcg/helper.c+6 -30 replies
31/80target/arm: move sve_exception_el out of TCG helperstarget/arm/cpu-sysemu.c target/arm/cpu-user.c target/arm/tcg/helper.c+67 -640 replies
32/80target/arm: fix comments style of fp_exception_el before moving ittarget/arm/tcg/helper.c+8 -40 replies
33/80target/arm: move fp_exception_el out of TCG helperstarget/arm/cpu-sysemu.c target/arm/cpu-user.c target/arm/tcg/helper.c+105 -1000 replies
34/80target/arm: remove now useless ifndef from fp_exception_eltarget/arm/cpu-sysemu.c+0 -20 replies
35/80target/arm: make further preparation for the exception code to movetarget/arm/tcg/helper.c+9 -30 replies
36/80target/arm: fix style of arm_cpu_do_interrupt functions before movetarget/arm/tcg/helper.c+11 -60 replies
37/80target/arm: move exception code out of tcg/helper.ctarget/arm/cpu-sysemu.c target/arm/tcg/helper.c target/arm/tcg/sysemu/meson.build +2 more+775 -7340 replies
38/80target/arm: rename handle_semihosting to tcg_handle_semihostingtarget/arm/cpu-sysemu.c target/arm/tcg/sysemu/tcg-cpu.c target/arm/tcg/tcg-cpu.h+3 -30 replies
39/80target/arm: replace CONFIG_TCG with tcg_enabledtarget/arm/cpu-sysemu.c+15 -150 replies
40/80target/arm: move TCGCPUOps to tcg/tcg-cpu.ctarget/arm/cpu-sysemu.c target/arm/cpu.c target/arm/cpu.h +6 more+244 -2140 replies
41/80target/arm: move cpu_tcg to tcg/tcg-cpu-models.ctarget/arm/meson.build target/arm/tcg/meson.build target/arm/tcg/tcg-cpu-models.c+2 -120 replies
42/80target/arm: wrap call to aarch64_sve_change_el in tcg_enabled()target/arm/cpu-sysemu.c+7 -50 replies
43/80target/arm: remove kvm include file for PSCI and arm-powerctltarget/arm/arm-powerctl.h target/arm/psci.c+0 -30 replies
44/80target/arm: move kvm-const.h, kvm.c, kvm64.c, kvm_arm.h to kvm/MAINTAINERS hw/arm/sbsa-ref.c hw/arm/virt-acpi-build.c +25 more+24 -220 replies
45/80MAINTAINERS: update arm kvm maintained files to all in target/arm/kvm/MAINTAINERS+1 -10 replies
46/80target/arm: cleanup cpu includestarget/arm/cpu.c target/arm/cpu32.c target/arm/cpu64.c +1 more+3 -460 replies
47/80target/arm: remove broad "else" statements when checking accelstarget/arm/cpu.c target/arm/cpu64.c target/arm/machine.c+16 -200 replies
48/80target/arm: remove kvm-stub.ctarget/arm/kvm-stub.c+0 -240 replies
49/80tests/qtest: skip bios-tables-test test_acpi_oem_fields_virt for KVMtests/qtest/bios-tables-test.c+7 -00 replies
50/80tests: restrict TCG-only arm-cpu-features tests to TCG buildstests/qtest/arm-cpu-features.c+15 -00 replies
51/80tests: do not run test-hmp on all machines for ARM KVM-onlytests/qtest/test-hmp.c+20 -00 replies
52/80tests: device-introspect-test: cope with ARM TCG-only devicestests/qtest/device-introspect-test.c+18 -06 replies
53/80tests: do not run qom-test on all machines for ARM KVM-onlytests/qtest/qom-test.c+20 -00 replies
54/80Revert "target/arm: Restrict v8M IDAU to TCG"target/arm/cpu.c target/arm/tcg/tcg-cpu-models.c+7 -81 reply
55/80target/arm: create kvm cpu accel classtarget/arm/cpu-sysemu.c target/arm/cpu.c target/arm/internals.h +2 more+137 -740 replies
56/80target/arm: move kvm post init initialization to kvm cpu acceltarget/arm/cpu.c target/arm/kvm/kvm-cpu.c+1 -40 replies
57/80target/arm: add tcg cpu accel classtarget/arm/cpu.c target/arm/tcg/sysemu/tcg-cpu.c target/arm/tcg/tcg-cpu-models.c +2 more+92 -480 replies
58/80target/arm: move TCG gt timer creation code in tcg/target/arm/cpu.c target/arm/tcg/sysemu/tcg-cpu.c target/arm/tcg/tcg-cpu.h+45 -260 replies
59/80target/arm: cpu-sve: new moduletarget/arm/cpu-sve.c target/arm/cpu-sve.h target/arm/cpu.c +4 more+408 -3350 replies
60/80target/arm: cpu-sve: rename functions according to module prefixtarget/arm/cpu-sve.c target/arm/cpu-sve.h target/arm/cpu.c +2 more+23 -230 replies
61/80target/arm: cpu-sve: split TCG and KVM functionalitytarget/arm/cpu-sve.c target/arm/kvm/kvm-sve.c target/arm/kvm/kvm-sve.h +4 more+296 -1120 replies
62/80target/arm: cpu-sve: make cpu_sve_finalize_features return booltarget/arm/cpu-sve.c target/arm/cpu-sve.h target/arm/cpu.c+11 -110 replies
63/80target/arm: make is_aa64 and arm_el_is_aa64 a macro for !TARGET_AARCH64target/arm/cpu.h+24 -130 replies
64/80target/arm: restrict rebuild_hflags_a64 to TARGET_AARCH64target/arm/helper-a64.h target/arm/helper.h target/arm/tcg/helper.c+14 -10 replies
65/80target/arm: arch_dump: restrict ELFCLASS64 to AArch64target/arm/arch_dump.c target/arm/cpu.c target/arm/cpu64.c+11 -60 replies
66/80target/arm: cpu-exceptions, cpu-exceptions-aa64: new modulestarget/arm/cpu-exceptions-aa64.c target/arm/cpu-exceptions-aa64.h target/arm/cpu-exceptions.c +3 more+755 -6720 replies
67/80target/arm: tcg: restrict ZCR cpregs to TARGET_AARCH64target/arm/tcg/cpregs.c+6 -20 replies
68/80target/arm: tcg-sve: import narrow_vq and change_el functionslinux-user/syscall.c target/arm/cpu-exceptions-aa64.c target/arm/cpu.h +5 more+101 -940 replies
69/80target/arm: tcg-sve: rename the narrow_vq and change_el functionslinux-user/syscall.c target/arm/cpu-exceptions-aa64.c target/arm/tcg/cpregs.c +3 more+10 -100 replies
70/80target/arm: move sve_zcr_len_for_el to TARGET_AARCH64-only cpu-svetarget/arm/arch_dump.c target/arm/cpu-common.c target/arm/cpu-sve.c +5 more+48 -450 replies
71/80cpu-sve: rename sve_zcr_len_for_el to cpu_sve_get_zcr_len_for_eltarget/arm/arch_dump.c target/arm/cpu-sve.c target/arm/cpu-sve.h +4 more+12 -120 replies
72/80target/arm: cpu-common: wrap a64-only check with is_a64target/arm/cpu-common.c+7 -30 replies
73/80target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authenticationtarget/arm/cpu.c target/arm/cpu.h target/arm/cpu64.c +3 more+101 -360 replies
74/80target/arm: cpu-pauth: change arm_cpu_pauth_finalize name and sigtarget/arm/cpu.c target/arm/tcg/cpu-pauth.c target/arm/tcg/cpu-pauth.h+6 -40 replies
75/80target/arm: move arm_cpu_finalize_features into cpu64target/arm/cpu.c target/arm/cpu64.c target/arm/monitor.c+40 -340 replies
76/80target/arm: cpu64: rename arm_cpu_finalize_featurestarget/arm/cpu-sve.h target/arm/cpu.c target/arm/cpu.h +3 more+7 -90 replies
77/80target/arm: cpu64: some final cleanup on aarch64_cpu_finalize_featurestarget/arm/cpu64.c+16 -170 replies
78/80XXX target/arm: experiment refactoring cpu "max"target/arm/cpu.h target/arm/cpu64.c target/arm/kvm/kvm-cpu.c +2 more+241 -2170 replies
79/80target/arm: tcg: remove superfluous CONFIG_TCG checktarget/arm/tcg/vfp_helper.c+0 -60 replies
80/80target/arm: remove v7m stub function for !CONFIG_TCGtarget/arm/cpu-mmu.c+5 -90 replies

Reviews trailers per patch

44 of 80 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonAlex BennéePhilippe Mathieu-Daudé
1/80R-b R-b
2/80R-b R-b
3/80R-b R-b
4/80R-b R-b
5/80R-b R-b
6/80R-b R-b
7/80R-b R-b
8/80R-b R-b
9/80R-b R-b
10/80R-b R-b
11/80R-b R-b
12/80R-b R-b
13/80R-b R-b
14/80R-b R-b
15/80R-b R-b
16/80R-b
17/80R-b
18/80R-b
19/80R-b
20/80R-b
21/80R-b
22/80R-b
23/80
24/80
25/80R-b
26/80R-b
27/80
28/80
29/80
30/80R-b
31/80R-b
32/80
33/80
34/80
35/80
36/80R-b
37/80
38/80
39/80
40/80
41/80R-b
42/80R-b
43/80R-b
44/80R-b
45/80
46/80A-b
47/80
48/80R-b
49/80
50/80
51/80
52/80
53/80
54/80R-b R-b
55/80R-b
56/80R-b
57/80
58/80R-b
59/80
60/80
61/80
62/80
63/80
64/80
65/80R-b
66/80
67/80R-b
68/80R-b
69/80R-b
70/80R-b
71/80R-b
72/80
73/80
74/80
75/80
76/80
77/80
78/80
79/80R-b
80/80

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v14 thread

Cover letter [RFC v14 00/80] arm cleanup experiment for kvm-only build

Here a new version of the series that enables kvm-only builds.

The goal here is to enable the KVM-only build, but there is some additional cleanup too.

Comments welcome, thanks,

Ciao, C

v13 -> v14: minor fixes

* rebased on latest master + i386_cleanup fixing a minor conflict

* "target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authentication"
- fix bug in intermediate series state, during the patch split (return value did not match function signature).

v12 -> v13:

* "target/arm: tcg: add stubs for some helpers for non-tcg builds"
- renamed helper-stubs.c to tcg-stubs.c

* "target/arm: move arm_sctlr away from tcg helpers"
- split change in two steps to separate the TARGET_AARCH64-only part

- added a new patch that uses is_a64(env) instead of TARGET_AARCH64, assuming the protected part is AArch64-only code.

* "target/arm: split a15 cpu model and 32bit class functions to cpu32.c"
- split the patch into three :

"target/arm: new cpu32 ARM 32 bit CPU Class" "target/arm: split 32bit and 64bit arm dump state" "target/arm: move a15 cpu model away from the TCG-only models"

* "target/arm: tcg: add stubs for some helpers for non-tcg builds"
- removed the fp_exception_el stub
- added three patches:

"target/arm: fix comments style of fp_exception_el before moving it" "target/arm: move fp_exception_el out of TCG helpers" "target/arm: remove now useless ifndef from fp_exception_el"

* "target/arm: move exception code out of tcg/helper.c"
- add new preparation patch:
"target/arm: make further preparation for the exception code to move"

- added new post-move patch:
"target/arm: rename handle_semihosting to tcg_handle_semihosting"

* "target/arm: move kvm-const.h, kvm.c, kvm64.c, kvm_arm.h to kvm/"
- added new patch that updates arm kvm maintainer to all of kvm:
"MAINTAINERS: update arm kvm maintained files to all in target/arm/kvm/"

* "target/arm: remove broad "else" statements when checking accels"
- use "else if" in cpu_pre_save when checking accelerators

* "target/arm: cpu-sve: new module"
- change commit message
- split the renames into new patch:
"target/arm: cpu-sve: rename functions according to module prefix"

* "target/arm: cpu-sve: split TCG and KVM functionality"
- split the name change to a new patch :
"target/arm: cpu-sve: make cpu_sve_finalize_features return bool"

* "target/arm: restrict rebuild_hflags_a64 to TARGET_AARCH64"
- use QEMU_ERROR if function not elided
- mention the need of this for future changes

* "target/arm: cpu-exceptions: new module"
- move less code. Only the actual exception handling code is moved.
- mention that -aa64.c requires the previous A64 restrictions

* "target/arm: tcg-sve: import narrow_vq and change_el functions"
- update stale comment.

* "target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authentication"
- separate rename and sig change in a separate patch:
"target/arm: cpu-pauth: change arm_cpu_pauth_finalize name and sig"

* "cpu-sve: rename sve_zcr_len_for_el to cpu_sve_get_zcr_len_for_el"
- reordered to just after the move of the function

* "target/arm: move arm_cpu_finalize_features into cpu64"
- split rename and additional post-move changes into separate patches:
"target/arm: cpu64: rename arm_cpu_finalize_features" "target/arm: cpu64: some final cleanup on aarch64_cpu_finalize_features"

* "target/arm: remove v7m stub function for !CONFIG_TCG"
- use tcg_enabled() instead of CONFIG_TCG

v11 ->v12:

* reordered additions to meson files, sorting alphabetically.

* renamed the accel-specific cpu_sve modules to tcg_sve and kvm_sve.

* added sve_zcr_len_for_el() to cpu_sve, then renamed. It is now made TARGET_AARCH64-only, thanks to preceding changes.

* added aarch64_sve_narrow_vq() and _change_el() to tcg_sve, then renamed.

* "target/arm: tcg: add sysemu and user subdirs"
- remove redundant meson check for CONFIG_SOFTMMU and CONFIG_USER_ONLY

* "cpu-mmu: fix comment style"
* "target/arm: cpregs: fix style (mostly just comments)"
* "target/arm: cpu: fix style"
- reordered comment and style changes to before the code moves.

* "target/arm: split cpregs from tcg/helper.c"
- take also the cpregs definitions ARM_CP_.. from cpu.h into cpregs.h

* "kvm: add stubs for some helpers"
- move the stubs in tcg/ , to be used by all non-TCG accels

* "target/arm: move arm_sctlr away from tcg helpers"
- added #ifdef TARGET_AARCH64 for the specific part of the function

* "target/arm: move aarch64_sync_32_to_64 (and vv) to cpu code"
- removed whitespace

* "target/arm: split a15 cpu model and 32bit class functions to cpu32.c"
- fixed missing dispatch for aarch64/aarch32

* "target/arm: refactor exception and cpu code"
- split into multiple patches

* "target/arm: move kvm-const.h, kvm.c, kvm64.c, kvm_arm.h to kvm/"
- split into multiple patches

* "target/arm: remove broad "else" statements when checking accels"
- added "else if"s when checking for accelerators

* "target/arm: arch_dump: restrict ELFCLASS64 to AArch64"
- split into multiple patches

v10 ->v11:

* "target/arm: tcg: split mte_helper user-only and sysemu code" (new)
* "target/arm: tcg: move sysemu-only parts of debug_helper" (new)
* "target/arm: tcg: split tlb_helper user-only and sysemu-only parts" (new)
* "target/arm: tcg: split m_helper user-only and sysemu-only parts: (new)
* "target/arm: tcg: remove superfluous CONFIG_TCG check" (new)
* "target/arm: remove v7m stub function for !CONFIG_TCG" (new)
* "target/arm: add tcg cpu accel class"

- removed the asserts for tcg_arm_init_accel_cpu, as they break for "enable-all" builds which include both TCG and KVM.

v9 -> v10:

* "target/arm: create kvm cpu accel class"
- add accel_cpu::cpu_reset to kvm-cpu

* "target/arm: add tcg cpu accel class"
- add accel_cpu::cpu_reset to tcg-cpu

* 'XXX target/arm: experiment refactoring cpu "max"'
- new tentative RFC for discussion

v8 -> v9:
* added: "make is_aa64 and arm_el_is_aa64 a macro for !TARGET_AARCH64"
* added: "arch_dump: restrict ELFCLASS64 to AArch64"
* added: "cpu-exceptions: new module"
* added: "tcg: restrict ZCR cpregs to TARGET_AARCH64"
* added: "cpu-pauth: new module for ARMv8.3 Pointer Authentication"
* added: "refactor arm_cpu_finalize_features into cpu64"

v7 -> v8:
* added split of SVE CPU properties code from cpu into cpu-sve.
* added split of cpu-sve into tcg/cpu-sve and kvm/cpu-sve.

v6 -> v7:
* added tcg accel-cpu, experiment with improving the setting of the TCGOps, as discussed at:
https://lists.gnu.org/archive/html/qemu-devel/2021-03/msg04315.html

v5 -> v6:
* rebased on latest master, adapted to arm changes

* needed to restore the cortex-a15 cpu,
moving it away from the TCG-only cpu file. This is a partial revert of commit "target/arm: Restrict TCG cpus to TCG accel"

* added first patches that create the kvm cpu accel class

v4 -> v5:
* fixed other remaining tests for kvm-only build
* rebased on latest target/arm changes (painful)
* reverted Philippe's IDAU v8m change

v3 -> v4:

* added style cleanup patches

* added header cleanup

* added basic move of simple KVM-only code to kvm/

* fixed some qtest failures due to existing:

  if (kvm_enabled) {
  
  } else {

  }

which needed explicit if qtest_enabled() in addition to tcg_enabled() check

* include 32bit cpus for AArch64 too.

v2 -> v3:

* "target/arm: tcg: add sysemu and user subsirs"
- new standalone patch to create the empty tcg/sysemu and tcg/user subdirs.

* "target/arm: only build psci for TCG"
- do not move psci inside tcg/ directory, because HVF might use it soon.

    (Peter)

* "target/arm: move physical address translation"
- change the module name from "get-phys-addr" to "cpu-mmu", which includes aa64_va_parameter in this patch, and that will also contain the get_mmu_idx* functions later in the series.

* "target/arm: split cpregs from tcg/helper.c"
- moved raw_read and raw_write to cpregs.h

* "target/arm: only perform TCG cpu and machine inits if TCG enabled"
- add an explanatory comment before the kvm function for cpreg list init
- change the use of g_renew to g_new, since we do not do the double initialization of cpreg list anymore.

* "target/arm: add temporary stub for arm_rebuild_hflags"
- use a if (tcg_enabled()) instead of #ifdef

* "target/arm: split vfp state setting from tcg helpers"
- explain better what goes where in the commit

* "target/arm: move arm_mmu_idx*"
- move the functions to cpu-mmu instead of get-phys-addr

* "target/arm: move sve_zcr_len_for_el to common_cpu"

- add a comment about those functions being in theory TARGET_AARCH64 specific, but making the change would spawn a large number of additional #ifdefs. This state predates this change .

* "target/arm: move aarch64_sync_32_to_64 (and vv) to cpu code"

- explain better why these functions are needed for KVM too

* "target/arm: move sve_exception_el out of TCG helpers"

- bring over the sve_exception_el code, making it available for KVM too.

* "target/arm: wrap call to aarch64_sve_change_el in tcg_enabled()"

- mention in the commit that this enables finally a build with configure --enable-kvm --disable-tcg

v1 -> v2: reworked of the whole series

In this v2, only the first two patches remain, the rest is reworked.

Main reasons for the rework were:

1) moving out cpregs to its own module, leave the tcg-only part in tcg/

2) split of arm cpu32, cpu64 and cpu models. This is still not perfect, but I think it's an improvement.

3) import less stuff, that is actually unused or can be stubbed on KVM (thanks to the precious feedback on the previous RFCv1).

...

Main issues:

1) basically needs the "configure only machines compatible with KVM" from Philippe, so we can avoid some of the stubs.

2) tests/ work fine building with tcg or with tcg + kvm,
but for making a kvm-only build pass the tests, more work is needed in tests/ figuring out which tests are TCG-only and which need to be tweaked.

Thanks a lot for your comments!

. / . / . / . / . / . /

Hi all,

this is an experiment, a cleanup based on and requiring the series "i386 cleanup PART 2":

https://lists.gnu.org/archive/html/qemu-devel/2021-02/msg05935.html

The goal is to split the code between TCG-only and non-TCG code, fixing the KVM-only build (configure --disable-tcg),

and laying the ground for further cleanups and the use of the new accel objects in the hierarchy to specialize the cpu according to the accelerator.

This is known to be an early state, with probably a lot of work still needed.

I thought it could be useful to share early, especially in light of the combination of this with Philippe's work on building only the machines and devices compatible with KVM for arm.

Comments welcome, thanks,

Claudio

Claudio Fontana (80):
target/arm: move translate modules to tcg/
target/arm: move helpers to tcg/
arm: tcg: only build under CONFIG_TCG
target/arm: tcg: add sysemu and user subdirs
target/arm: tcg: split mte_helper user-only and sysemu code target/arm: tcg: move sysemu-only parts of debug_helper target/arm: tcg: split tlb_helper user-only and sysemu-only parts target/arm: tcg: split m_helper user-only and sysemu-only parts target/arm: only build psci for TCG
target/arm: split off cpu-sysemu.c
target/arm: tcg: fix comment style before move to cpu-mmu target/arm: move physical address translation to cpu-mmu target/arm: fix style in preparation of new cpregs module target/arm: split cpregs from tcg/helper.c
target/arm: move cpu definitions to common cpu module target/arm: only perform TCG cpu and machine inits if TCG enabled target/arm: tcg: add stubs for some helpers for non-tcg builds target/arm: move cpsr_read, cpsr_write to cpu_common target/arm: add temporary stub for arm_rebuild_hflags target/arm: move arm_hcr_el2_eff from tcg/ to common_cpu target/arm: split vfp state setting from tcg helpers target/arm: move arm_mmu_idx* to cpu-mmu
target/arm: move sve_zcr_len_for_el to common_cpu target/arm: move arm_sctlr away from tcg helpers target/arm: move arm_cpu_list to common_cpu
target/arm: move aarch64_sync_32_to_64 (and vv) to cpu code target/arm: new cpu32 ARM 32 bit CPU Class
target/arm: split 32bit and 64bit arm dump state target/arm: move a15 cpu model away from the TCG-only models target/arm: fixup sve_exception_el code style before move target/arm: move sve_exception_el out of TCG helpers target/arm: fix comments style of fp_exception_el before moving it target/arm: move fp_exception_el out of TCG helpers target/arm: remove now useless ifndef from fp_exception_el target/arm: make further preparation for the exception code to move target/arm: fix style of arm_cpu_do_interrupt functions before move target/arm: move exception code out of tcg/helper.c target/arm: rename handle_semihosting to tcg_handle_semihosting target/arm: replace CONFIG_TCG with tcg_enabled target/arm: move TCGCPUOps to tcg/tcg-cpu.c
target/arm: move cpu_tcg to tcg/tcg-cpu-models.c target/arm: wrap call to aarch64_sve_change_el in tcg_enabled() target/arm: remove kvm include file for PSCI and arm-powerctl target/arm: move kvm-const.h, kvm.c, kvm64.c, kvm_arm.h to kvm/
MAINTAINERS: update arm kvm maintained files to all in target/arm/kvm/ target/arm: cleanup cpu includes
target/arm: remove broad "else" statements when checking accels target/arm: remove kvm-stub.c
tests/qtest: skip bios-tables-test test_acpi_oem_fields_virt for KVM
tests: restrict TCG-only arm-cpu-features tests to TCG builds
tests: do not run test-hmp on all machines for ARM KVM-only
tests: device-introspect-test: cope with ARM TCG-only devices
tests: do not run qom-test on all machines for ARM KVM-only Revert "target/arm: Restrict v8M IDAU to TCG"
target/arm: create kvm cpu accel class
target/arm: move kvm post init initialization to kvm cpu accel target/arm: add tcg cpu accel class
target/arm: move TCG gt timer creation code in tcg/ target/arm: cpu-sve: new module
target/arm: cpu-sve: rename functions according to module prefix target/arm: cpu-sve: split TCG and KVM functionality target/arm: cpu-sve: make cpu_sve_finalize_features return bool target/arm: make is_aa64 and arm_el_is_aa64 a macro for

    !TARGET_AARCH64

target/arm: restrict rebuild_hflags_a64 to TARGET_AARCH64 target/arm: arch_dump: restrict ELFCLASS64 to AArch64 target/arm: cpu-exceptions, cpu-exceptions-aa64: new modules target/arm: tcg: restrict ZCR cpregs to TARGET_AARCH64 target/arm: tcg-sve: import narrow_vq and change_el functions target/arm: tcg-sve: rename the narrow_vq and change_el functions target/arm: move sve_zcr_len_for_el to TARGET_AARCH64-only cpu-sve
cpu-sve: rename sve_zcr_len_for_el to cpu_sve_get_zcr_len_for_el target/arm: cpu-common: wrap a64-only check with is_a64 target/arm: cpu-pauth: new module for ARMv8.3 Pointer Authentication target/arm: cpu-pauth: change arm_cpu_pauth_finalize name and sig target/arm: move arm_cpu_finalize_features into cpu64 target/arm: cpu64: rename arm_cpu_finalize_features target/arm: cpu64: some final cleanup on aarch64_cpu_finalize_features XXX target/arm: experiment refactoring cpu "max" target/arm: tcg: remove superfluous CONFIG_TCG check target/arm: remove v7m stub function for !CONFIG_TCG

 meson.build                                   |    3 +-
 target/arm/arm-powerctl.h                     |    2 -
 target/arm/cpregs.h                           |  515 ++
 target/arm/cpu-exceptions-aa64.h              |   28 +
 target/arm/cpu-mmu.h                          |  119 +
 target/arm/cpu-qom.h                          |    3 -
 target/arm/cpu-sve.h                          |   40 +
 target/arm/cpu-vfp.h                          |   29 +
 target/arm/cpu.h                              |  533 +-
 target/arm/cpu32.h                            |   32 +
 target/arm/helper-a64.h                       |    2 +
 target/arm/helper.h                           |    1 -
 target/arm/internals.h                        |   46 +-
 target/arm/{ => kvm}/kvm-consts.h             |    0
 target/arm/kvm/kvm-sve.h                      |   28 +
 target/arm/{ => kvm}/kvm_arm.h                |    0
 target/arm/kvm/trace.h                        |    1 +
 target/arm/tcg/cpu-pauth.h                    |   34 +
 target/arm/tcg/m_helper.h                     |   21 +
 target/arm/tcg/mte_helper.h                   |   53 +
 target/arm/{ => tcg}/op_addsub.h              |    0
 target/arm/tcg/tcg-cpu.h                      |   40 +
 target/arm/tcg/tcg-sve.h                      |   29 +
 target/arm/tcg/tlb_helper.h                   |   17 +
 target/arm/tcg/trace.h                        |    1 +
 target/arm/{ => tcg}/translate-a64.h          |    0
 target/arm/{ => tcg}/translate.h              |    0
 target/arm/{ => tcg}/vec_internal.h           |    0
 target/arm/trace.h                            |    1 -
 target/arm/{ => tcg}/a32-uncond.decode        |    0
 target/arm/{ => tcg}/a32.decode               |    0
 target/arm/{ => tcg}/m-nocp.decode            |    0
 target/arm/{ => tcg}/neon-dp.decode           |    0
 target/arm/{ => tcg}/neon-ls.decode           |    0
 target/arm/{ => tcg}/neon-shared.decode       |    0
 target/arm/{ => tcg}/sve.decode               |    0
 target/arm/{ => tcg}/t16.decode               |    0
 target/arm/{ => tcg}/t32.decode               |    0
 target/arm/{ => tcg}/vfp-uncond.decode        |    0
 target/arm/{ => tcg}/vfp.decode               |    0
 hw/arm/boot.c                                 |    5 +-
 hw/arm/pxa2xx.c                               |    1 +
 hw/arm/pxa2xx_pic.c                           |    1 +
 hw/arm/sbsa-ref.c                             |    2 +-
 hw/arm/virt-acpi-build.c                      |    2 +-
 hw/arm/virt.c                                 |    2 +-
 hw/arm/xlnx-versal.c                          |    2 +-
 hw/arm/xlnx-zynqmp.c                          |    2 +-
 hw/cpu/a15mpcore.c                            |    2 +-
 hw/intc/arm_gic_kvm.c                         |    2 +-
 hw/intc/arm_gicv3_cpuif.c                     |    1 +
 hw/intc/arm_gicv3_its_kvm.c                   |    2 +-
 hw/intc/arm_gicv3_kvm.c                       |    3 +-
 linux-user/syscall.c                          |    6 +-
 target/arm/arch_dump.c                        |   15 +-
 target/arm/arm-powerctl.c                     |    8 +-
 target/arm/cpregs.c                           |  377 +
 target/arm/cpu-common.c                       |  358 +
 target/arm/cpu-exceptions-aa64.c              |  277 +
 target/arm/cpu-exceptions.c                   |  445 ++
 target/arm/cpu-mmu-sysemu.c                   | 2307 ++++++
 target/arm/cpu-mmu.c                          |  215 +
 target/arm/cpu-sve.c                          |  323 +
 target/arm/cpu-sysemu.c                       |  482 ++
 target/arm/cpu-user.c                         |   46 +
 target/arm/cpu-vfp.c                          |   97 +
 target/arm/cpu.c                              |  765 +-
 target/arm/cpu32.c                            |  260 +
 target/arm/cpu64.c                            |  713 +-
 target/arm/cpustate-list.c                    |  146 +
 target/arm/gdbstub.c                          |    1 +
 target/arm/kvm-stub.c                         |   24 -
 target/arm/kvm/kvm-cpu.c                      |  128 +
 target/arm/kvm/kvm-sve.c                      |  118 +
 target/arm/{ => kvm}/kvm.c                    |   18 +-
 target/arm/{ => kvm}/kvm64.c                  |    0
 target/arm/machine.c                          |   39 +-
 target/arm/monitor.c                          |   10 +-
 target/arm/psci.c                             |    1 -
 target/arm/{helper.c => tcg/cpregs.c}         | 6180 +----------------
 target/arm/tcg/cpu-pauth.c                    |   66 +
 target/arm/tcg/cpu-vfp.c                      |  146 +
 target/arm/{ => tcg}/crypto_helper.c          |    0
 target/arm/{ => tcg}/debug_helper.c           |   27 -
 target/arm/{ => tcg}/helper-a64.c             |    3 +-
 target/arm/tcg/helper.c                       | 1286 ++++
 target/arm/{ => tcg}/iwmmxt_helper.c          |    0
 target/arm/tcg/m_helper.c                     |   93 +
 target/arm/{ => tcg}/mte_helper.c             |  191 +-
 target/arm/{ => tcg}/neon_helper.c            |    0
 target/arm/{ => tcg}/op_helper.c              |    1 +
 target/arm/{ => tcg}/pauth_helper.c           |    2 +-
 target/arm/{ => tcg}/sve_helper.c             |    0
 target/arm/tcg/sysemu/debug_helper.c          |   33 +
 target/arm/{ => tcg/sysemu}/m_helper.c        |  200 +-
 target/arm/tcg/sysemu/mte_helper.c            |  159 +
 target/arm/tcg/sysemu/tcg-cpu.c               |  119 +
 target/arm/tcg/sysemu/tlb_helper.c            |   84 +
 .../arm/{cpu_tcg.c => tcg/tcg-cpu-models.c}   |  162 +-
 target/arm/tcg/tcg-cpu.c                      |  502 ++
 target/arm/tcg/tcg-stubs.c                    |   21 +
 target/arm/tcg/tcg-sve.c                      |  167 +
 target/arm/{ => tcg}/tlb_helper.c             |   97 +-
 target/arm/{ => tcg}/translate-a64.c          |    1 +
 target/arm/{ => tcg}/translate-sve.c          |    0
 target/arm/{ => tcg}/translate.c              |    1 +
 target/arm/tcg/user/m_helper.c                |   97 +
 target/arm/tcg/user/mte_helper.c              |   57 +
 target/arm/tcg/user/tlb_helper.c              |   32 +
 target/arm/{ => tcg}/vec_helper.c             |    0
 target/arm/{ => tcg}/vfp_helper.c             |  216 +-
 tests/qtest/arm-cpu-features.c                |   15 +
 tests/qtest/bios-tables-test.c                |    7 +
 tests/qtest/device-introspect-test.c          |   18 +
 tests/qtest/qom-test.c                        |   20 +
 tests/qtest/test-hmp.c                        |   20 +
 target/arm/{ => tcg}/translate-neon.c.inc     |    0
 target/arm/{ => tcg}/translate-vfp.c.inc      |    0
 MAINTAINERS                                   |    2 +-
 target/arm/kvm/meson.build                    |    6 +
 target/arm/kvm/trace-events                   |    4 +
 target/arm/meson.build                        |   59 +-
 target/arm/tcg/meson.build                    |   50 +
 target/arm/tcg/sysemu/meson.build             |    7 +
 target/arm/{ => tcg}/trace-events             |    3 -
 target/arm/tcg/user/meson.build               |    5 +
 126 files changed, 10209 insertions(+), 8734 deletions(-)
 create mode 100644 target/arm/cpregs.h
 create mode 100644 target/arm/cpu-exceptions-aa64.h
 create mode 100644 target/arm/cpu-mmu.h
 create mode 100644 target/arm/cpu-sve.h
 create mode 100644 target/arm/cpu-vfp.h
 create mode 100644 target/arm/cpu32.h
 rename target/arm/{ => kvm}/kvm-consts.h (100%)
 create mode 100644 target/arm/kvm/kvm-sve.h
 rename target/arm/{ => kvm}/kvm_arm.h (100%)
 create mode 100644 target/arm/kvm/trace.h
 create mode 100644 target/arm/tcg/cpu-pauth.h
 create mode 100644 target/arm/tcg/m_helper.h
 create mode 100644 target/arm/tcg/mte_helper.h
 rename target/arm/{ => tcg}/op_addsub.h (100%)
 create mode 100644 target/arm/tcg/tcg-cpu.h
 create mode 100644 target/arm/tcg/tcg-sve.h
 create mode 100644 target/arm/tcg/tlb_helper.h
 create mode 100644 target/arm/tcg/trace.h
 rename target/arm/{ => tcg}/translate-a64.h (100%)
 rename target/arm/{ => tcg}/translate.h (100%)
 rename target/arm/{ => tcg}/vec_internal.h (100%)
 delete mode 100644 target/arm/trace.h
 rename target/arm/{ => tcg}/a32-uncond.decode (100%)
 rename target/arm/{ => tcg}/a32.decode (100%)
 rename target/arm/{ => tcg}/m-nocp.decode (100%)
 rename target/arm/{ => tcg}/neon-dp.decode (100%)
 rename target/arm/{ => tcg}/neon-ls.decode (100%)
 rename target/arm/{ => tcg}/neon-shared.decode (100%)
 rename target/arm/{ => tcg}/sve.decode (100%)
 rename target/arm/{ => tcg}/t16.decode (100%)
 rename target/arm/{ => tcg}/t32.decode (100%)
 rename target/arm/{ => tcg}/vfp-uncond.decode (100%)
 rename target/arm/{ => tcg}/vfp.decode (100%)
 create mode 100644 target/arm/cpregs.c
 create mode 100644 target/arm/cpu-common.c
 create mode 100644 target/arm/cpu-exceptions-aa64.c
 create mode 100644 target/arm/cpu-exceptions.c
 create mode 100644 target/arm/cpu-mmu-sysemu.c
 create mode 100644 target/arm/cpu-mmu.c
 create mode 100644 target/arm/cpu-sve.c
 create mode 100644 target/arm/cpu-sysemu.c
 create mode 100644 target/arm/cpu-user.c
 create mode 100644 target/arm/cpu-vfp.c
 create mode 100644 target/arm/cpu32.c
 create mode 100644 target/arm/cpustate-list.c
 delete mode 100644 target/arm/kvm-stub.c
 create mode 100644 target/arm/kvm/kvm-cpu.c
 create mode 100644 target/arm/kvm/kvm-sve.c
 rename target/arm/{ => kvm}/kvm.c (98%)
 rename target/arm/{ => kvm}/kvm64.c (100%)
 rename target/arm/{helper.c => tcg/cpregs.c} (59%)
 create mode 100644 target/arm/tcg/cpu-pauth.c
 create mode 100644 target/arm/tcg/cpu-vfp.c
 rename target/arm/{ => tcg}/crypto_helper.c (100%)
 rename target/arm/{ => tcg}/debug_helper.c (92%)
 rename target/arm/{ => tcg}/helper-a64.c (99%)
 create mode 100644 target/arm/tcg/helper.c
 rename target/arm/{ => tcg}/iwmmxt_helper.c (100%)
 create mode 100644 target/arm/tcg/m_helper.c
 rename target/arm/{ => tcg}/mte_helper.c (77%)
 rename target/arm/{ => tcg}/neon_helper.c (100%)
 rename target/arm/{ => tcg}/op_helper.c (99%)
 rename target/arm/{ => tcg}/pauth_helper.c (99%)
 rename target/arm/{ => tcg}/sve_helper.c (100%)
 create mode 100644 target/arm/tcg/sysemu/debug_helper.c
 rename target/arm/{ => tcg/sysemu}/m_helper.c (94%)
 create mode 100644 target/arm/tcg/sysemu/mte_helper.c
 create mode 100644 target/arm/tcg/sysemu/tcg-cpu.c
 create mode 100644 target/arm/tcg/sysemu/tlb_helper.c
 rename target/arm/{cpu_tcg.c => tcg/tcg-cpu-models.c} (86%)
 create mode 100644 target/arm/tcg/tcg-cpu.c
 create mode 100644 target/arm/tcg/tcg-stubs.c
 create mode 100644 target/arm/tcg/tcg-sve.c
 rename target/arm/{ => tcg}/tlb_helper.c (56%)
 rename target/arm/{ => tcg}/translate-a64.c (99%)
 rename target/arm/{ => tcg}/translate-sve.c (100%)
 rename target/arm/{ => tcg}/translate.c (99%)
 create mode 100644 target/arm/tcg/user/m_helper.c
 create mode 100644 target/arm/tcg/user/mte_helper.c
 create mode 100644 target/arm/tcg/user/tlb_helper.c
 rename target/arm/{ => tcg}/vec_helper.c (100%)
 rename target/arm/{ => tcg}/vfp_helper.c (84%)
 rename target/arm/{ => tcg}/translate-neon.c.inc (100%)
 rename target/arm/{ => tcg}/translate-vfp.c.inc (100%)
 create mode 100644 target/arm/kvm/meson.build
 create mode 100644 target/arm/kvm/trace-events
 create mode 100644 target/arm/tcg/meson.build
 create mode 100644 target/arm/tcg/sysemu/meson.build
 rename target/arm/{ => tcg}/trace-events (85%)
 create mode 100644 target/arm/tcg/user/meson.build
Signature · 1 line
2.26.2