aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-05-25 12:44:33 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-05-25 14:08:39 +0100
commit35270a75a6b795d9fff2a032fc30559ae0d033c0 (patch)
tree2d460b370b592120fea9eeb459652741cdb65321
parent5372d969fd0b16c3ecd227b663c0f808ebc08e3f (diff)
downloadqemu-arm-35270a75a6b795d9fff2a032fc30559ae0d033c0.tar.gz
target/i386/kvm.c: Handle renaming of KVM_HINTS_DEDICATED
In kernel header commit 633711e8287, the define KVM_HINTS_DEDICATED was renamed to KVM_HINTS_REALTIME. Work around this compatibility break by (a) using the new constant name, and (b) defining it if the headers don't. Part (b) can be removed once we've updated our copy of the kernel headers to a version that defines KVM_HINTS_REALTIME. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--target/i386/kvm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index 6511329d11..c2699f2f44 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -48,6 +48,11 @@
#include "exec/memattrs.h"
#include "trace.h"
+/* Work around this kernel header constant changing its name */
+#ifndef KVM_HINTS_REALTIME
+#define KVM_HINTS_REALTIME KVM_HINTS_DEDICATED
+#endif
+
//#define DEBUG_KVM
#ifdef DEBUG_KVM
@@ -387,7 +392,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t function,
ret &= ~(1U << KVM_FEATURE_PV_UNHALT);
}
} else if (function == KVM_CPUID_FEATURES && reg == R_EDX) {
- ret |= 1U << KVM_HINTS_DEDICATED;
+ ret |= 1U << KVM_HINTS_REALTIME;
found = 1;
}