mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 23:13:26 +00:00
hv: vlapic: EOI exit bitmap should set or clear atomically
For per-vCPU, EOI exit bitmap is a global parameter which should set or clear atomically since there's no lock to protect this critical variable. Tracked-On: #1842 Signed-off-by: Li, Fei1 <fei1.li@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
parent
0eb0854858
commit
540841ac5d
@ -168,7 +168,7 @@ void vcpu_set_eoi_exit_bitmap(struct acrn_vcpu *vcpu, uint32_t vector)
|
||||
{
|
||||
pr_dbg("%s", __func__);
|
||||
|
||||
if (!bitmap_test_and_set_nolock((uint16_t)(vector & 0x3fU),
|
||||
if (!bitmap_test_and_set_lock((uint16_t)(vector & 0x3fU),
|
||||
&(vcpu->arch.eoi_exit_bitmap[(vector & 0xffU) >> 6U]))) {
|
||||
vcpu_make_request(vcpu, ACRN_REQUEST_EOI_EXIT_BITMAP_UPDATE);
|
||||
}
|
||||
@ -178,7 +178,7 @@ void vcpu_clear_eoi_exit_bitmap(struct acrn_vcpu *vcpu, uint32_t vector)
|
||||
{
|
||||
pr_dbg("%s", __func__);
|
||||
|
||||
if (bitmap_test_and_clear_nolock((uint16_t)(vector & 0x3fU),
|
||||
if (bitmap_test_and_clear_lock((uint16_t)(vector & 0x3fU),
|
||||
&(vcpu->arch.eoi_exit_bitmap[(vector & 0xffU) >> 6U]))) {
|
||||
vcpu_make_request(vcpu, ACRN_REQUEST_EOI_EXIT_BITMAP_UPDATE);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user