From ccc0b01fec831b7b18a2c92459d2f2a856ca68bb Mon Sep 17 00:00:00 2001 From: "Zheng, Gen" Date: Wed, 18 Apr 2018 14:10:19 +0800 Subject: [PATCH] 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 Reviewed-by: Zhao Yakui --- arch/x86/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/cpu.c b/arch/x86/cpu.c index c44701639..a460d55a1 100644 --- a/arch/x86/cpu.c +++ b/arch/x86/cpu.c @@ -732,11 +732,11 @@ static void print_hv_banner(void) static void pcpu_sync_sleep(unsigned long *sync, int mask_bit) { - int wake_sync = (1 << mask_bit); + uint64_t wake_sync = (1UL << mask_bit); if (get_monitor_cap()) { /* Wait for the event to be set using monitor/mwait */ - asm volatile ("1: cmpl %%ebx,(%%eax)\n" + asm volatile ("1: cmpq %%rbx,(%%rax)\n" " je 2f\n" " monitor\n" " mwait\n" @@ -748,7 +748,7 @@ static void pcpu_sync_sleep(unsigned long *sync, int mask_bit) : "cc"); } else { /* Wait for the event to be set using pause */ - asm volatile ("1: cmpl %%ebx,(%%eax)\n" + asm volatile ("1: cmpq %%rbx,(%%rax)\n" " je 2f\n" " pause\n" " jmp 1b\n"