From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: Andrew Jones <drjones@redhat.com>, Alexander Graf <agraf@csgraf.de>
Subject: [PATCH 3/6] target/arm: Make KVM -cpu max exactly like -cpu host
Date: Fri, 4 Feb 2022 16:55:03 +0000 [thread overview]
Message-ID: <20220204165506.2846058-4-peter.maydell@linaro.org> (raw)
In-Reply-To: <20220204165506.2846058-1-peter.maydell@linaro.org>
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>
---
target/arm/cpu64.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 590ac562714..ae2e431247f 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;
--
2.25.1
next prev parent reply other threads:[~2022-02-04 17:12 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-04 16:55 [PATCH 0/6] target/arm: -cpu host/max KVM and HVF fixes Peter Maydell
2022-02-04 16:55 ` [PATCH 1/6] target/arm: Move '-cpu host' code to cpu64.c Peter Maydell
2022-02-06 0:11 ` Richard Henderson
2022-02-04 16:55 ` [PATCH 2/6] target/arm: Use aarch64_cpu_register() for 'host' CPU type Peter Maydell
2022-02-06 0:14 ` Richard Henderson
2022-02-04 16:55 ` Peter Maydell [this message]
2022-02-06 0:16 ` [PATCH 3/6] target/arm: Make KVM -cpu max exactly like -cpu host Richard Henderson
2022-02-04 16:55 ` [PATCH 4/6] target/arm: Unindent unnecessary else-clause Peter Maydell
2022-02-06 0:20 ` Richard Henderson
2022-02-04 16:55 ` [PATCH 5/6] target/arm: Fix '-cpu max' for HVF Peter Maydell
2022-02-06 0:21 ` Richard Henderson
2022-02-04 16:55 ` [PATCH 6/6] target/arm: Support PAuth extension for hvf Peter Maydell
2022-02-06 0:26 ` Richard Henderson
2022-02-06 10:41 ` Peter Maydell
2022-02-06 18:46 ` [PATCH 0/6] target/arm: -cpu host/max KVM and HVF fixes Philippe Mathieu-Daudé via
2022-02-09 10:30 ` Andrew Jones
2022-02-09 12:49 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220204165506.2846058-4-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=agraf@csgraf.de \
--cc=drjones@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).