Skip to content

Commit

Permalink
x86/entry: fix jump into restore_all_guest without %rbx correctly set
Browse files Browse the repository at this point in the history
e047b8d went too far when limiting obtaining the vCPU pointer.  While the
code in ist_dispatch_done does indeed only need the vCPU pointer when PV32 is
enabled, the !PV32 path will end up jumping into restore_all_guest which does
require rbx == vCPU pointer.

Fix by moving the fetching of the vCPU pointer to be done outside of the PV32
code block.

Fixes: e047b8d ('x86/entry: replace two GET_CURRENT() uses')
Reported-by: Edwin Torok <[email protected]>
Signed-off-by: Roger Pau Monné <[email protected]>
Reviewed-by: Andrew Cooper <[email protected]>
  • Loading branch information
royger authored and andyhhp committed Jan 26, 2024
1 parent dbdd7e8 commit c378ff8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xen/arch/x86/x86_64/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -1139,8 +1139,9 @@ FUNC(handle_ist_exception)
movl $EVENT_CHECK_VECTOR,%edi
call send_IPI_self
1:
#ifdef CONFIG_PV32
/* For restore_all_guest. */
mov STACK_CPUINFO_FIELD(current_vcpu)(%r14), %rbx
#ifdef CONFIG_PV32
movq VCPU_domain(%rbx),%rax
cmpb $0,DOMAIN_is_32bit_pv(%rax)
je restore_all_guest
Expand Down

0 comments on commit c378ff8

Please sign in to comment.