Skip to content

Commit 540841a

Browse files
lifeixacrnsi
authored andcommitted
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>
1 parent 0eb0854 commit 540841a

File tree

1 file changed

+2
-2
lines changed
  • hypervisor/arch/x86/guest

1 file changed

+2
-2
lines changed

hypervisor/arch/x86/guest/vcpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void vcpu_set_eoi_exit_bitmap(struct acrn_vcpu *vcpu, uint32_t vector)
168168
{
169169
pr_dbg("%s", __func__);
170170

171-
if (!bitmap_test_and_set_nolock((uint16_t)(vector & 0x3fU),
171+
if (!bitmap_test_and_set_lock((uint16_t)(vector & 0x3fU),
172172
&(vcpu->arch.eoi_exit_bitmap[(vector & 0xffU) >> 6U]))) {
173173
vcpu_make_request(vcpu, ACRN_REQUEST_EOI_EXIT_BITMAP_UPDATE);
174174
}
@@ -178,7 +178,7 @@ void vcpu_clear_eoi_exit_bitmap(struct acrn_vcpu *vcpu, uint32_t vector)
178178
{
179179
pr_dbg("%s", __func__);
180180

181-
if (bitmap_test_and_clear_nolock((uint16_t)(vector & 0x3fU),
181+
if (bitmap_test_and_clear_lock((uint16_t)(vector & 0x3fU),
182182
&(vcpu->arch.eoi_exit_bitmap[(vector & 0xffU) >> 6U]))) {
183183
vcpu_make_request(vcpu, ACRN_REQUEST_EOI_EXIT_BITMAP_UPDATE);
184184
}

0 commit comments

Comments
 (0)