hv: add hardware_detect_support to detect which hardware we support

Now just add some basic feature/capability detect (not all). Vapic
didn't add here for if we must support vapic then the code which
for vapic not supported must remove, like mmio apic r/w.

Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Li, Fei1
2018-04-17 11:40:01 +08:00
committed by Jack Ren
parent 10c3a98577
commit 1b1f723c7b
6 changed files with 114 additions and 38 deletions

View File

@@ -150,10 +150,6 @@ int hv_main(int cpu_id)
ASSERT((uint64_t) cpu_id == get_cpu_id(),
"cpu_id/tsc_aux mismatch");
/* Check if virtualization extensions are supported */
ret = cpu_has_cap(X86_FEATURE_VMX);
ASSERT(ret == 1, "VMX not supported!");
/* Enable virtualization extensions */
ret = exec_vmxon_instr();
ASSERT(ret == 0, "Unable to enable VMX!");