Skip to content

Commit

Permalink
target/i386/kvm.c: Handle renaming of KVM_HINTS_DEDICATED
Browse files Browse the repository at this point in the history
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>
Message-Id: <20180525132755.21839-5-peter.maydell@linaro.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
pm215 authored and bonzini committed Jun 1, 2018
1 parent f5bba4c commit 2af1aca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion target/i386/kvm.c
Expand Up @@ -47,6 +47,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
Expand Down Expand Up @@ -386,7 +391,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;
}

Expand Down

0 comments on commit 2af1aca

Please sign in to comment.