[xen stable-4.6] x86/entry: Fix passing 6th argument for compat hypercalls

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen stable-4.6] x86/entry: Fix passing 6th argument for compat hypercalls

patchbot
commit 0b38930452adce72244e23418a72126a2f8814a8
Author:     Jason Andryuk <[hidden email]>
AuthorDate: Tue Mar 20 14:51:23 2018 +0100
Commit:     Jan Beulich <[hidden email]>
CommitDate: Tue Mar 20 14:51:23 2018 +0100

    x86/entry: Fix passing 6th argument for compat hypercalls
   
    Commit ec05090403ef4d760fbe701e31afd0f0edc414d5 ("x86/entry: Erase guest
    GPR state on entry to Xen") zero-ed %rbp, compat arg 6, but it is not
    restored before passing to hypercalls.  We need to pass the saved compat
    arg 6 to the hypercall in r9, the 6th function argument.
   
    Signed-off-by: Jason Andryuk <[hidden email]>
    Reviewed-by: Jan Beulich <[hidden email]>
---
 xen/arch/x86/x86_64/compat/entry.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/x86_64/compat/entry.S b/xen/arch/x86/x86_64/compat/entry.S
index bc1f509672..b99b142e45 100644
--- a/xen/arch/x86/x86_64/compat/entry.S
+++ b/xen/arch/x86/x86_64/compat/entry.S
@@ -56,7 +56,7 @@ UNLIKELY_END(msi_check)
         xchgl %ecx,%esi              /* Arg 2, Arg 4 */
         movl  %edx,%edx              /* Arg 3        */
         movl  %edi,%r8d              /* Arg 5        */
-        movl  %ebp,%r9d              /* Arg 6        */
+        movl  UREGS_rbp(%rsp),%r9d   /* Arg 6        */
         movl  UREGS_rbx(%rsp),%edi   /* Arg 1        */
 #define SHADOW_BYTES 0  /* No on-stack shadow state */
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.6

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog