Quantcast

[xen master] x86/pv: Align %rsp before pushing the failsafe stack frame

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

[xen master] x86/pv: Align %rsp before pushing the failsafe stack frame

patchbot
commit cbcaccb5e991155a4ae85a032e990614c3dc6960
Author:     Andrew Cooper <[hidden email]>
AuthorDate: Fri May 5 17:38:19 2017 +0100
Commit:     Andrew Cooper <[hidden email]>
CommitDate: Tue May 9 19:00:20 2017 +0100

    x86/pv: Align %rsp before pushing the failsafe stack frame
   
    Architecturally, all 64bit stacks are aligned on a 16 byte boundary before an
    exception frame is pushed.  The failsafe frame should not special in this
    regard.
   
    Signed-off-by: Andrew Cooper <[hidden email]>
    Reviewed-by: Jan Beulich <[hidden email]>
    Release-acked-by: Julien Grall <[hidden email]>
---
 xen/arch/x86/domain.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index ef8c05a..13cdc50 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1743,9 +1743,8 @@ static void load_segments(struct vcpu *n)
         struct pv_vcpu *pv = &n->arch.pv_vcpu;
         struct cpu_user_regs *regs = guest_cpu_user_regs();
         unsigned long *rsp =
-            (n->arch.flags & TF_kernel_mode) ?
-            (unsigned long *)regs->rsp :
-            (unsigned long *)pv->kernel_sp;
+            (unsigned long *)(((n->arch.flags & TF_kernel_mode)
+                               ? regs->rsp : pv->kernel_sp) & ~0xf);
         unsigned long cs_and_mask, rflags;
 
         /* Fold upcall mask and architectural IOPL into RFLAGS.IF. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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