summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2013-10-02 06:08:45 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2013-10-02 06:08:45 -0400
commit05ed2deda679a2651ead92e93bec55c90705a738 (patch)
treeb5900746bad46c88155cbe8ea4ed930292fd3a71 /SConstruct
parent2bcced58978bc698527f9c8cb4c6ca682c270d2f (diff)
downloadgem5-05ed2deda679a2651ead92e93bec55c90705a738.tar.xz
kvm: Only include KVM support for supported kernels
This patch adds a check to ensure that the KVM API provided by the running kernel is what we are expecting.
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct10
1 files changed, 7 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index 863a6caba..298433dd5 100755
--- a/SConstruct
+++ b/SConstruct
@@ -936,10 +936,14 @@ if not have_fenv:
print "Warning: Header file <fenv.h> not found."
print " This host has no IEEE FP rounding mode control."
-# Check if we should enable KVM-based hardware virtualization
-have_kvm = conf.CheckHeader('linux/kvm.h', '<>')
+# Check if we should enable KVM-based hardware virtualization. The API
+# we rely on exists since version 2.6.36 of the kernel, but somehow
+# the KVM_API_VERSION does not reflect the change. We test for one of
+# the types as a fall back.
+have_kvm = conf.CheckHeader('linux/kvm.h', '<>') and \
+ conf.CheckTypeSize('struct kvm_xsave', '#include <linux/kvm.h>') != 0
if not have_kvm:
- print "Info: Header file <linux/kvm.h> not found, " \
+ print "Info: Compatible header file <linux/kvm.h> not found, " \
"disabling KVM support."
# Check if the requested target ISA is compatible with the host