aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwanaliasr1@gmail.com>2012-01-07 17:08:02 +0100
committerErwan Velu <erwanaliasr1@gmail.com>2012-01-07 17:08:02 +0100
commit287de3be5708ee186a1b1f9fffbdeab66b261383 (patch)
treeeed632bd7458bd6bdc8d6ae8eee5c41ccaa03f39
parent8f44f565ce1ff017d8e1b071fcd73d8ac409ff57 (diff)
downloadsyslinux-287de3be5708ee186a1b1f9fffbdeab66b261383.tar.gz
syslinux-287de3be5708ee186a1b1f9fffbdeab66b261383.tar.xz
syslinux-287de3be5708ee186a1b1f9fffbdeab66b261383.zip
ifcpu: Adding hypervisor support
This simple hack add the ability to detect the hypervisor presence.
-rw-r--r--com32/modules/ifcpu.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/com32/modules/ifcpu.c b/com32/modules/ifcpu.c
index a28acc4e..0aa63327 100644
--- a/com32/modules/ifcpu.c
+++ b/com32/modules/ifcpu.c
@@ -49,11 +49,12 @@ static void usage(void)
" dry-run : just do the detection, don't boot \n"
"\n"
"cpu_features could be:\n"
- " 64 : Processor is x86_64 compatible (lm cpu flag)\n"
- " hvm : Processor features hardware virtualization (hvm or svm cpu flag)\n"
- " multicore : Processor must be multi-core \n"
- " smp : System must be multi-processor \n"
- " pae : Processor features Physical Address Extension (PAE)\n"
+ " 64 : Processor is x86_64 compatible (lm cpu flag)\n"
+ " hvm : Processor features hardware virtualization (hvm or svm cpu flag)\n"
+ " multicore : Processor must be multi-core \n"
+ " smp : System must be multi-processor \n"
+ " pae : Processor features Physical Address Extension (PAE)\n"
+ " hypervisor : Processor is running under an hypervisor\n"
"\n"
"if you want to match many cpu features, just separate them with a single space.\n");
}
@@ -114,30 +115,34 @@ int main(int argc, char *argv[])
args[n++] = &argv[i + 1];
} else if (!strcmp(argv[i], "64")) {
if (debug)
- printf(" 64bit : %s on this system\n",
+ printf(" 64bit : %s on this system\n",
show_bool(cpu.flags.lm));
hardware_matches = cpu.flags.lm && hardware_matches;
} else if (!strcmp(argv[i], "pae")) {
if (debug)
- printf(" pae : %s on this system\n",
+ printf(" pae : %s on this system\n",
show_bool(cpu.flags.pae));
hardware_matches = cpu.flags.pae && hardware_matches;
} else if (!strcmp(argv[i], "hvm")) {
if (debug)
- printf(" hvm : %s on this system\n",
+ printf(" hvm : %s on this system\n",
show_bool((cpu.flags.vmx || cpu.flags.svm)));
hardware_matches = (cpu.flags.vmx || cpu.flags.svm)
&& hardware_matches;
} else if (!strcmp(argv[i], "multicore")) {
if (debug)
- printf(" multicore : %d cores on this system\n", cpu.num_cores);
+ printf(" multicore : %d cores on this system\n", cpu.num_cores);
if (cpu.num_cores > 1)
multicore = true;
hardware_matches = multicore && hardware_matches;
} else if (!strcmp(argv[i], "smp")) {
if (debug)
- printf(" smp : %s on this system\n", show_bool(cpu.flags.smp));
+ printf(" smp : %s on this system\n", show_bool(cpu.flags.smp));
hardware_matches = cpu.flags.smp && hardware_matches;
+ } else if (!strcmp(argv[i], "hypervisor")) {
+ if (debug)
+ printf(" hypervisor : %s on this system\n", show_bool(cpu.flags.hypervisor));
+ hardware_matches = cpu.flags.hypervisor && hardware_matches;
} else if (!strcmp(argv[i], "dry-run")) {
dryrun = true;
} else if (!strcmp(argv[i], "debug")) {