summaryrefslogtreecommitdiff
path: root/target/arm/cpu64.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2022-02-04 16:55:03 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-02-21 13:30:20 +0000
commit0baa21be497ddbd8f4eea920464aaa096004733b (patch)
treeb635d46704ecf0006b0beee5e29898e3ff6a096b /target/arm/cpu64.c
parent73cc9ee6bfadcdbd079cf4871179ef5760146d1c (diff)
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/cpu64.c')
-rw-r--r--target/arm/cpu64.c14
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;