Changeset 287de3be5708ee186a1b1f9fffbdeab66b261383
- Timestamp:
- 01/07/12 16:08:02 (5 months ago)
- Author:
- Erwan Velu <erwanaliasr1@…>
- Children:
- 442c60166a9165e4253fd091aba92c04c699017d
- Parents:
- 8f44f565ce1ff017d8e1b071fcd73d8ac409ff57
- git-committer:
- Erwan Velu <erwanaliasr1@gmail.com> / 2012-01-07T17:08:02Z+0100
- Message:
-
ifcpu: Adding hypervisor support
This simple hack add the ability to detect the hypervisor presence.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r88e09d
|
r287de3
|
|
| 50 | 50 | "\n" |
| 51 | 51 | "cpu_features could be:\n" |
| 52 | | " 64 : Processor is x86_64 compatible (lm cpu flag)\n" |
| 53 | | " hvm : Processor features hardware virtualization (hvm or svm cpu flag)\n" |
| 54 | | " multicore : Processor must be multi-core \n" |
| 55 | | " smp : System must be multi-processor \n" |
| 56 | | " pae : Processor features Physical Address Extension (PAE)\n" |
| | 52 | " 64 : Processor is x86_64 compatible (lm cpu flag)\n" |
| | 53 | " hvm : Processor features hardware virtualization (hvm or svm cpu flag)\n" |
| | 54 | " multicore : Processor must be multi-core \n" |
| | 55 | " smp : System must be multi-processor \n" |
| | 56 | " pae : Processor features Physical Address Extension (PAE)\n" |
| | 57 | " hypervisor : Processor is running under an hypervisor\n" |
| 57 | 58 | "\n" |
| 58 | 59 | "if you want to match many cpu features, just separate them with a single space.\n"); |
| … |
… |
|
| 115 | 116 | } else if (!strcmp(argv[i], "64")) { |
| 116 | 117 | if (debug) |
| 117 | | printf(" 64bit : %s on this system\n", |
| | 118 | printf(" 64bit : %s on this system\n", |
| 118 | 119 | show_bool(cpu.flags.lm)); |
| 119 | 120 | hardware_matches = cpu.flags.lm && hardware_matches; |
| 120 | 121 | } else if (!strcmp(argv[i], "pae")) { |
| 121 | 122 | if (debug) |
| 122 | | printf(" pae : %s on this system\n", |
| | 123 | printf(" pae : %s on this system\n", |
| 123 | 124 | show_bool(cpu.flags.pae)); |
| 124 | 125 | hardware_matches = cpu.flags.pae && hardware_matches; |
| 125 | 126 | } else if (!strcmp(argv[i], "hvm")) { |
| 126 | 127 | if (debug) |
| 127 | | printf(" hvm : %s on this system\n", |
| | 128 | printf(" hvm : %s on this system\n", |
| 128 | 129 | show_bool((cpu.flags.vmx || cpu.flags.svm))); |
| 129 | 130 | hardware_matches = (cpu.flags.vmx || cpu.flags.svm) |
| … |
… |
|
| 131 | 132 | } else if (!strcmp(argv[i], "multicore")) { |
| 132 | 133 | if (debug) |
| 133 | | printf(" multicore : %d cores on this system\n", cpu.num_cores); |
| | 134 | printf(" multicore : %d cores on this system\n", cpu.num_cores); |
| 134 | 135 | if (cpu.num_cores > 1) |
| 135 | 136 | multicore = true; |
| … |
… |
|
| 137 | 138 | } else if (!strcmp(argv[i], "smp")) { |
| 138 | 139 | if (debug) |
| 139 | | printf(" smp : %s on this system\n", show_bool(cpu.flags.smp)); |
| | 140 | printf(" smp : %s on this system\n", show_bool(cpu.flags.smp)); |
| 140 | 141 | hardware_matches = cpu.flags.smp && hardware_matches; |
| | 142 | } else if (!strcmp(argv[i], "hypervisor")) { |
| | 143 | if (debug) |
| | 144 | printf(" hypervisor : %s on this system\n", show_bool(cpu.flags.hypervisor)); |
| | 145 | hardware_matches = cpu.flags.hypervisor && hardware_matches; |
| 141 | 146 | } else if (!strcmp(argv[i], "dry-run")) { |
| 142 | 147 | dryrun = true; |