HV: Remove the mixed usage of inline assembly in wait_sync_change

When monitor/mwait is not supported, it still uses the inline assembly in
wait_sync_change. As it is not allowed based on MISRA-C, the asm wrapper
is used for pause scenario in wait_sync_change.

Tracked-On: #3442
Suggested-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
This commit is contained in:
Zhao Yakui 2019-07-22 10:25:55 +08:00 committed by ACRN System Integration
parent baf7d90fdf
commit 7b22456786
1 changed files with 3 additions and 10 deletions

View File

@ -447,16 +447,9 @@ void wait_sync_change(volatile const uint64_t *sync, uint64_t wake_sync)
}
}
} else {
/* Wait for the event to be set using pause */
asm volatile ("1: cmpq %%rbx,(%%rax)\n"
" je 2f\n"
" pause\n"
" jmp 1b\n"
"2:\n"
:
: "a" (sync), "d"(0), "c"(0),
"b"(wake_sync)
: "cc");
while ((*sync) != wake_sync) {
asm_pause();
}
}
}