Diff between 96b4ad68e5d1497f755dd7be7b42090d7ff337b0 and a0a03828fbc49db9f0926cee87d53d627d69bac2

Changed Files

File Additions Deletions Status
tools/test-runner.c +13 -1 modified

Full Patch

diff --git a/tools/test-runner.c b/tools/test-runner.c
index 407a985..163b610 100644
--- a/tools/test-runner.c
+++ b/tools/test-runner.c
@@ -195,7 +195,7 @@ static char *const qemu_argv[] = {
 	"-no-user-config",
 	"-monitor", "none",
 	"-display", "none",
-	"-machine", "type=q35,accel=kvm",
+	"-machine", "type=q35,accel=kvm:tcg",
 	"-m", "192M",
 	"-nographic",
 	"-vga", "none",
@@ -215,6 +215,16 @@ static char *const qemu_envp[] = {
 	NULL
 };
 
+static void check_virtualization(void)
+{
+	uint32_t ecx;
+
+	__asm__ __volatile__("cpuid" : "=c" (ecx) : "a" (1) : "memory");
+
+	if (!!(ecx & (1 << 5)))
+		printf("Found support for Virtual Machine eXtensions\n");
+}
+
 static void start_qemu(void)
 {
 	char cwd[PATH_MAX], initcmd[PATH_MAX], testargs[PATH_MAX];
@@ -222,6 +232,8 @@ static void start_qemu(void)
 	char **argv;
 	int i, pos;
 
+	check_virtualization();
+
 	if (!getcwd(cwd, sizeof(cwd)))
 		strcat(cwd, "/");