Skip to content

Commit 1c57adc

Browse files
zhenggenjren1
authored andcommitted
hv: bug fix on synchronizing with APs
Using eax will truncate the high 32bit part of 64bit virtual address. And the type of sync is unsigned long, so using rbx instead of ebx. Signed-off-by: Zheng, Gen <gen.zheng@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
1 parent b37c049 commit 1c57adc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hypervisor/arch/x86/cpu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,11 @@ static void print_hv_banner(void)
732732

733733
static void pcpu_sync_sleep(unsigned long *sync, int mask_bit)
734734
{
735-
int wake_sync = (1 << mask_bit);
735+
uint64_t wake_sync = (1UL << mask_bit);
736736

737737
if (get_monitor_cap()) {
738738
/* Wait for the event to be set using monitor/mwait */
739-
asm volatile ("1: cmpl %%ebx,(%%eax)\n"
739+
asm volatile ("1: cmpq %%rbx,(%%rax)\n"
740740
" je 2f\n"
741741
" monitor\n"
742742
" mwait\n"
@@ -748,7 +748,7 @@ static void pcpu_sync_sleep(unsigned long *sync, int mask_bit)
748748
: "cc");
749749
} else {
750750
/* Wait for the event to be set using pause */
751-
asm volatile ("1: cmpl %%ebx,(%%eax)\n"
751+
asm volatile ("1: cmpq %%rbx,(%%rax)\n"
752752
" je 2f\n"
753753
" pause\n"
754754
" jmp 1b\n"

0 commit comments

Comments
 (0)