mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-22 13:37:10 +00:00
hv: Add is_xapic_enabled API to check vLAPIC moe
is_xapic_enabled API returns true if vLAPIC is in xAPIC mode. In all other cases, it returns false. Tracked-On: #3253 Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
7cb71a317e
commit
a3fdc7a496
@ -1998,6 +1998,16 @@ bool is_x2apic_enabled(const struct acrn_vlapic *vlapic)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool is_xapic_enabled(const struct acrn_vlapic *vlapic)
|
||||
{
|
||||
bool ret = false;
|
||||
if ((vlapic_get_apicbase(vlapic) & APICBASE_LAPIC_MODE) == APICBASE_XAPIC) {
|
||||
ret = true;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline uint32_t x2apic_msr_to_regoff(uint32_t msr)
|
||||
{
|
||||
|
||||
|
@ -212,6 +212,7 @@ void vlapic_calc_dest_lapic_pt(struct acrn_vm *vm, uint64_t *dmask, bool is_broa
|
||||
uint32_t dest, bool phys);
|
||||
bool is_lapic_pt_enabled(struct acrn_vm *vm);
|
||||
bool is_x2apic_enabled(const struct acrn_vlapic *vlapic);
|
||||
bool is_xapic_enabled(const struct acrn_vlapic *vlapic);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user