SConstruct (12034:4b685699cdaa) SConstruct (12056:1ad5b3161819)
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015, 2016 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 1087 unchanged lines hidden (view full) ---

1096# we rely on exists since version 2.6.36 of the kernel, but somehow
1097# the KVM_API_VERSION does not reflect the change. We test for one of
1098# the types as a fall back.
1099have_kvm = conf.CheckHeader('linux/kvm.h', '<>')
1100if not have_kvm:
1101 print "Info: Compatible header file <linux/kvm.h> not found, " \
1102 "disabling KVM support."
1103
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015, 2016 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

--- 1087 unchanged lines hidden (view full) ---

1096# we rely on exists since version 2.6.36 of the kernel, but somehow
1097# the KVM_API_VERSION does not reflect the change. We test for one of
1098# the types as a fall back.
1099have_kvm = conf.CheckHeader('linux/kvm.h', '<>')
1100if not have_kvm:
1101 print "Info: Compatible header file <linux/kvm.h> not found, " \
1102 "disabling KVM support."
1103
1104# Check if the TUN/TAP driver is available.
1105have_tuntap = conf.CheckHeader('linux/if_tun.h', '<>')
1106if not have_tuntap:
1107 print "Info: Compatible header file <linux/if_tun.h> not found."
1108
1104# x86 needs support for xsave. We test for the structure here since we
1105# won't be able to run new tests by the time we know which ISA we're
1106# targeting.
1107have_kvm_xsave = conf.CheckTypeSize('struct kvm_xsave',
1108 '#include <linux/kvm.h>') != 0
1109
1110# Check if the requested target ISA is compatible with the host
1111def is_isa_kvm_compatible(isa):

--- 116 unchanged lines hidden (view full) ---

1228 False),
1229 BoolVariable('USE_SSE2',
1230 'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts',
1231 False),
1232 BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks', have_posix_clock),
1233 BoolVariable('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
1234 BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False),
1235 BoolVariable('USE_KVM', 'Enable hardware virtualized (KVM) CPU models', have_kvm),
1109# x86 needs support for xsave. We test for the structure here since we
1110# won't be able to run new tests by the time we know which ISA we're
1111# targeting.
1112have_kvm_xsave = conf.CheckTypeSize('struct kvm_xsave',
1113 '#include <linux/kvm.h>') != 0
1114
1115# Check if the requested target ISA is compatible with the host
1116def is_isa_kvm_compatible(isa):

--- 116 unchanged lines hidden (view full) ---

1233 False),
1234 BoolVariable('USE_SSE2',
1235 'Compile for SSE2 (-msse2) to get IEEE FP on x86 hosts',
1236 False),
1237 BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks', have_posix_clock),
1238 BoolVariable('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
1239 BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False),
1240 BoolVariable('USE_KVM', 'Enable hardware virtualized (KVM) CPU models', have_kvm),
1241 BoolVariable('USE_TUNTAP',
1242 'Enable using a tap device to bridge to the host network',
1243 have_tuntap),
1236 BoolVariable('BUILD_GPU', 'Build the compute-GPU model', False),
1237 EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None',
1238 all_protocols),
1239 EnumVariable('BACKTRACE_IMPL', 'Post-mortem dump implementation',
1240 backtrace_impls[-1], backtrace_impls)
1241 )
1242
1243# These variables get exported to #defines in config/*.hh (see src/SConscript).

--- 228 unchanged lines hidden (view full) ---

1472 if not have_kvm:
1473 print "Warning: Can not enable KVM, host seems to lack KVM support"
1474 env['USE_KVM'] = False
1475 elif not is_isa_kvm_compatible(env['TARGET_ISA']):
1476 print "Info: KVM support disabled due to unsupported host and " \
1477 "target ISA combination"
1478 env['USE_KVM'] = False
1479
1244 BoolVariable('BUILD_GPU', 'Build the compute-GPU model', False),
1245 EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None',
1246 all_protocols),
1247 EnumVariable('BACKTRACE_IMPL', 'Post-mortem dump implementation',
1248 backtrace_impls[-1], backtrace_impls)
1249 )
1250
1251# These variables get exported to #defines in config/*.hh (see src/SConscript).

--- 228 unchanged lines hidden (view full) ---

1480 if not have_kvm:
1481 print "Warning: Can not enable KVM, host seems to lack KVM support"
1482 env['USE_KVM'] = False
1483 elif not is_isa_kvm_compatible(env['TARGET_ISA']):
1484 print "Info: KVM support disabled due to unsupported host and " \
1485 "target ISA combination"
1486 env['USE_KVM'] = False
1487
1488 if env['USE_TUNTAP']:
1489 if not have_tuntap:
1490 print "Warning: Can't connect EtherTap with a tap device."
1491 env['USE_TUNTAP'] = False
1492
1480 if env['BUILD_GPU']:
1481 env.Append(CPPDEFINES=['BUILD_GPU'])
1482
1483 # Warn about missing optional functionality
1484 if env['USE_KVM']:
1485 if not main['HAVE_PERF_ATTR_EXCLUDE_HOST']:
1486 print "Warning: perf_event headers lack support for the " \
1487 "exclude_host attribute. KVM instruction counts will " \

--- 45 unchanged lines hidden ---
1493 if env['BUILD_GPU']:
1494 env.Append(CPPDEFINES=['BUILD_GPU'])
1495
1496 # Warn about missing optional functionality
1497 if env['USE_KVM']:
1498 if not main['HAVE_PERF_ATTR_EXCLUDE_HOST']:
1499 print "Warning: perf_event headers lack support for the " \
1500 "exclude_host attribute. KVM instruction counts will " \

--- 45 unchanged lines hidden ---