changeset cb74b075186e in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=cb74b075186e
description:
        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:

 SConstruct |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r 55cddee143f0 -r cb74b075186e SConstruct
--- a/SConstruct        Wed Oct 02 06:08:43 2013 -0400
+++ b/SConstruct        Wed Oct 02 06:08:45 2013 -0400
@@ -936,10 +936,14 @@
     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
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to