HV: bug fix in operating softirq

Current code is missing to handle the following race condition:

   Before:

     sti
      |
      V
handle softirq with
a while loop
      |          <----- if a new softirq generated at this point,
      V                 it will be missed to be handled.
     cli
      |
      V
return with unclear softirq bitmap

    After:

again:
     sti
      |
      V
handle softirq with
a while loop
      |
      V
     cli
      |
      V
check if a new softirq generated, if yes,
jump back to above again lable point,
and do a while loop again.
      |
      V
return with clear softirq bitmap

Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Zheng, Gen
2018-06-13 16:06:17 +08:00
committed by lijinxia
parent 8f3b36b224
commit a06f2d68dc
2 changed files with 11 additions and 12 deletions

View File

@@ -32,9 +32,7 @@ void vcpu_thread(struct vcpu *vcpu)
do {
/* handling pending softirq */
CPU_IRQ_ENABLE();
exec_softirq();
CPU_IRQ_DISABLE();
/* Check and process pending requests(including interrupt) */
ret = acrn_handle_pending_request(vcpu);