mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-17 17:01:52 +00:00
hv: bug fix on operating spin_lock
In vioapic emulating code, the vioapic spinlock is taken twice in the same context. Signed-off-by: Zheng, Gen <gen.zheng@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com> Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
This commit is contained in:
parent
ff05a6e8b9
commit
6788c09c39
@ -266,6 +266,8 @@ vioapic_read(struct vioapic *vioapic, uint32_t addr)
|
|||||||
/*
|
/*
|
||||||
* version 0x20+ ioapic has EOI register. And cpu could write vector to this
|
* version 0x20+ ioapic has EOI register. And cpu could write vector to this
|
||||||
* register to clear related IRR.
|
* register to clear related IRR.
|
||||||
|
* Due to the race between vcpus, ensure to do VIOAPIC_LOCK(vioapic) &
|
||||||
|
* VIOAPIC_UNLOCK(vioapic) by caller.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
vioapic_write_eoi(struct vioapic *vioapic, uint32_t vector)
|
vioapic_write_eoi(struct vioapic *vioapic, uint32_t vector)
|
||||||
@ -278,7 +280,6 @@ vioapic_write_eoi(struct vioapic *vioapic, uint32_t vector)
|
|||||||
pr_err("vioapic_process_eoi: invalid vector %u", vector);
|
pr_err("vioapic_process_eoi: invalid vector %u", vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
VIOAPIC_LOCK(vioapic);
|
|
||||||
pincount = vioapic_pincount(vm);
|
pincount = vioapic_pincount(vm);
|
||||||
for (pin = 0U; pin < pincount; pin++) {
|
for (pin = 0U; pin < pincount; pin++) {
|
||||||
rte = vioapic->rtbl[pin];
|
rte = vioapic->rtbl[pin];
|
||||||
@ -298,9 +299,11 @@ vioapic_write_eoi(struct vioapic *vioapic, uint32_t vector)
|
|||||||
vioapic_send_intr(vioapic, pin);
|
vioapic_send_intr(vioapic, pin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VIOAPIC_UNLOCK(vioapic);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Due to the race between vcpus, ensure to do VIOAPIC_LOCK(vioapic) &
|
||||||
|
* VIOAPIC_UNLOCK(vioapic) by caller.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
vioapic_write(struct vioapic *vioapic, uint32_t addr, uint32_t data)
|
vioapic_write(struct vioapic *vioapic, uint32_t addr, uint32_t data)
|
||||||
{
|
{
|
||||||
@ -387,12 +390,9 @@ vioapic_write(struct vioapic *vioapic, uint32_t addr, uint32_t data)
|
|||||||
"ioapic pin%hhu: recalculate vlapic trigger-mode reg",
|
"ioapic pin%hhu: recalculate vlapic trigger-mode reg",
|
||||||
pin);
|
pin);
|
||||||
|
|
||||||
VIOAPIC_UNLOCK(vioapic);
|
|
||||||
|
|
||||||
foreach_vcpu(i, vioapic->vm, vcpu) {
|
foreach_vcpu(i, vioapic->vm, vcpu) {
|
||||||
vcpu_make_request(vcpu, ACRN_REQUEST_TMR_UPDATE);
|
vcpu_make_request(vcpu, ACRN_REQUEST_TMR_UPDATE);
|
||||||
}
|
}
|
||||||
VIOAPIC_LOCK(vioapic);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user