hv:enable APICv features based on CPU capability

this patch is to detect and enable only APICv features which
are actually supported by the processor, instead fo tuning on
all features by default.

Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
Yonghua Huang
2018-03-22 01:17:24 +08:00
committed by Jack Ren
parent f01a8eef58
commit 7d8803f5ea
7 changed files with 123 additions and 62 deletions

View File

@@ -225,7 +225,9 @@ int hv_main(int cpu_id);
bool check_tsc_adjust_support(void);
bool check_ibrs_ibpb_support(void);
bool check_stibp_support(void);
bool is_apicv_enabled(void);
bool is_vapic_supported(void);
bool is_vapic_intr_delivery_supported(void);
bool is_vapic_virt_reg_supported(void);
/* Read control register */
#define CPU_CR_READ(cr, result_ptr) \

View File

@@ -128,6 +128,7 @@ void apicv_inject_pir(struct vlapic *vlapic);
int apic_access_exit_handler(struct vcpu *vcpu);
int apicv_write_exit_handler(struct vcpu *vcpu);
int apicv_virtualized_eoi_exit_handler(struct vcpu *vcpu);
int apic_tpr_below_threshold_exit_handler(struct vcpu *vcpu);
void calcvdest(struct vm *vm, uint64_t *dmask, uint32_t dest, bool phys);
#endif /* _VLAPIC_H_ */