acrn-hypervisor/hypervisor/include/common
Yifan Liu ffc142d9be hv: sched_event: Change nqueued from int8_t to int32_t
This patch changes the type of nqueued in struct sched_event from int8_t
to int32_t.

In commit d575edf79, the 1 bit flag in struct sched_event has been
changed to int8_t counter to resolve race condition. Signal_event
will decrease the counter and wait_event will increase it and loop if
the counter is greater than 0.

In most cases the uses of signal_event and wait_event are consistent,
except VCPU_EVENT_VIRTUAL_INTERRUPT. In our logic, we signal this event
whenever there is an virtual interrupt, but we wait on it only in
hlt_vmexit_handler, and we reset this event before VMEnter.

In most cases this worked fine. However it has been found that in
certain GPU stress testing scenario, the signaling of this event
happened too frequently to the point where this int8_t counter underflowed
(i.e., hit -128 and then became 127). Then in subsequent
hlt_vmexit_handler, hv waited on this event and stuck there as the
counter was too large.

This patch changes the type from int8_t to int32_t to avoid underflow.

Tracked-On: #7567
Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
2022-05-25 09:37:04 +08:00
..
delay.h hv/mod_timer: separate delay functions from the timer module 2021-05-18 16:43:28 +08:00
efi_mmap.h hv: set default MAX_EFI_MMAP_ENTRIES to 350 2021-11-08 09:49:24 +08:00
event.h hv: sched_event: Change nqueued from int8_t to int32_t 2022-05-25 09:37:04 +08:00
hypercall.h Remove "All rights reserved" string headers 2022-04-06 13:21:02 +08:00
irq.h Remove "All rights reserved" string headers 2022-04-06 13:21:02 +08:00
ptdev.h Remove "All rights reserved" string headers 2022-04-06 13:21:02 +08:00
schedule.h Remove "All rights reserved" string headers 2022-04-06 13:21:02 +08:00
softirq.h Remove "All rights reserved" string headers 2022-04-06 13:21:02 +08:00
ticks.h doc: update timer HLD doc after modularization 2021-06-09 17:11:25 -04:00
timer.h Remove "All rights reserved" string headers 2022-04-06 13:21:02 +08:00