diff options
author | Peter Maydell | 2022-02-04 17:55:03 +0100 |
---|---|---|
committer | Peter Maydell | 2022-02-21 14:30:20 +0100 |
commit | 0baa21be497ddbd8f4eea920464aaa096004733b (patch) | |
tree | b635d46704ecf0006b0beee5e29898e3ff6a096b /target/arm | |
parent | target/arm: Use aarch64_cpu_register() for 'host' CPU type (diff) | |
download | qemu-0baa21be497ddbd8f4eea920464aaa096004733b.tar.gz qemu-0baa21be497ddbd8f4eea920464aaa096004733b.tar.xz qemu-0baa21be497ddbd8f4eea920464aaa096004733b.zip |
target/arm: Make KVM -cpu max exactly like -cpu host
Currently for KVM the intention is that '-cpu max' and '-cpu host'
are the same thing, but because we did this with two separate
pieces of code they have got a little bit out of sync. Specifically,
'max' has a 'sve-max-vq' property, and 'host' does not.
Bring the two together by having the initfn for 'max' actually
call the initfn for 'host'. This will result in 'max' no longer
exposing the 'sve-max-vq' property when using KVM.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Reviewed-by: Alexander Graf <agraf@csgraf.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220204165506.2846058-4-peter.maydell@linaro.org
Diffstat (limited to 'target/arm')
-rw-r--r-- | target/arm/cpu64.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 590ac56271..ae2e431247 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -682,22 +682,22 @@ void aarch64_add_pauth_properties(Object *obj) } } -#if defined(CONFIG_KVM) || defined(CONFIG_HVF) static void aarch64_host_initfn(Object *obj) { +#if defined(CONFIG_KVM) ARMCPU *cpu = ARM_CPU(obj); - -#ifdef CONFIG_KVM kvm_arm_set_cpu_features_from_host(cpu); if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64)) { aarch64_add_sve_properties(obj); aarch64_add_pauth_properties(obj); } -#else +#elif defined(CONFIG_HVF) + ARMCPU *cpu = ARM_CPU(obj); hvf_arm_set_cpu_features_from_host(cpu); +#else + g_assert_not_reached(); #endif } -#endif /* -cpu max: if KVM is enabled, like -cpu host (best possible with this host); * otherwise, a CPU with as many features enabled as our emulation supports. @@ -709,7 +709,9 @@ static void aarch64_max_initfn(Object *obj) ARMCPU *cpu = ARM_CPU(obj); if (kvm_enabled()) { - kvm_arm_set_cpu_features_from_host(cpu); + /* With KVM, '-cpu max' is identical to '-cpu host' */ + aarch64_host_initfn(obj); + return; } else { uint64_t t; uint32_t u; |