Skip to content

Commit 98a5cfd

Browse files
committed
x86/xen: fix xen_hypercall_hvm() to not clobber %rbx
xen_hypercall_hvm(), which is used when running as a Xen PVH guest at most only once during early boot, is clobbering %rbx. Depending on whether the caller relies on %rbx to be preserved across the call or not, this clobbering might result in an early crash of the system. This can be avoided by using an already saved register instead of %rbx. Fixes: b4845bb ("x86/xen: add central hypercall functions") Signed-off-by: Juergen Gross <jgross@suse.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Juergen Gross <jgross@suse.com>
1 parent bda50f7 commit 98a5cfd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/xen/xen-head.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ SYM_FUNC_START(xen_hypercall_hvm)
117117
pop %ebx
118118
pop %eax
119119
#else
120-
lea xen_hypercall_amd(%rip), %rbx
121-
cmp %rax, %rbx
120+
lea xen_hypercall_amd(%rip), %rcx
121+
cmp %rax, %rcx
122122
#ifdef CONFIG_FRAME_POINTER
123123
pop %rax /* Dummy pop. */
124124
#endif

0 commit comments

Comments
 (0)