hv: support minimum set of TLFS

This patch implements the minimum set of TLFS functionality. It
includes 6 vCPUID leaves and 3 vMSRs.

- 0x40000001 Hypervisor Vendor-Neutral Interface Identification
- 0x40000002 Hypervisor System Identity
- 0x40000003 Hypervisor Feature Identification
- 0x40000004 Implementation Recommendations
- 0x40000005 Hypervisor Implementation Limits
- 0x40000006 Implementation Hardware Features

- HV_X64_MSR_GUEST_OS_ID Reporting the guest OS identity
- HV_X64_MSR_HYPERCALL Establishing the hypercall interface
- HV_X64_MSR_VP_INDEX Retrieve the vCPU ID from hypervisor

Tracked-On: #3832
Signed-off-by: wenwumax <wenwux.ma@intel.com>
Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
wenwumax
2019-10-15 09:11:21 +08:00
committed by wenlingz
parent 009d835bba
commit 048155d3d6
7 changed files with 261 additions and 0 deletions

View File

@@ -26,6 +26,9 @@
#include <cpu_caps.h>
#include <e820.h>
#include <vm_config.h>
#ifdef CONFIG_HYPERV_ENABLED
#include <hyperv.h>
#endif
struct vm_hw_info {
/* vcpu array of this VM */
@@ -100,6 +103,9 @@ struct vm_arch {
void *tmp_pg_array; /* Page array for tmp guest paging struct */
struct acrn_vioapic vioapic; /* Virtual IOAPIC base address */
struct acrn_vpic vpic; /* Virtual PIC */
#ifdef CONFIG_HYPERV_ENABLED
struct acrn_hyperv hyperv;
#endif
enum vm_vlapic_state vlapic_state; /* Represents vLAPIC state across vCPUs*/
/* reference to virtual platform to come here (as needed) */