[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] system: Try hardware accelerators (KVM, HVF) before software one
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH] system: Try hardware accelerators (KVM, HVF) before software one (TCG) |
Date: |
Fri, 3 Jan 2025 16:05:58 +0100 |
As Daniel suggested [*]:
> We should consider to rank HVF above TCG, on the basis
> that HW acceleration is faster and should provide a
> host<->guest security boundary that we don't claim for TCG
[*] https://lore.kernel.org/qemu-devel/Z07YASl2Pd3CPtjE@redhat.com/
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
system/vl.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/system/vl.c b/system/vl.c
index 0843b7ab49b..e20391281f8 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -2379,7 +2379,6 @@ static void configure_accelerators(const char *progname)
/* Select the default accelerator */
bool have_tcg = accel_find("tcg");
bool have_kvm = accel_find("kvm");
- bool have_hvf = accel_find("hvf");
if (have_tcg && have_kvm) {
if (g_str_has_suffix(progname, "kvm")) {
@@ -2390,10 +2389,10 @@ static void configure_accelerators(const char *progname)
}
} else if (have_kvm) {
accelerators = "kvm";
+ } else if (accel_find("hvf")) {
+ accelerators = "hvf";
} else if (have_tcg) {
accelerators = "tcg";
- } else if (have_hvf) {
- accelerators = "hvf";
} else {
error_report("No accelerator selected and"
" no default accelerator available");
--
2.47.1