Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 The call to svs_lwp_switch can clobber ...



details:   https://anonhg.NetBSD.org/src/rev/285505dc5bbf
branches:  trunk
changeset: 360741:285505dc5bbf
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Mar 28 19:56:40 2018 +0000

description:
The call to svs_lwp_switch can clobber %rdi/%rsi, so restore them before
calling speculation_barrier.

diffstat:

 sys/arch/amd64/amd64/locore.S |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 8be1d81b507c -r 285505dc5bbf sys/arch/amd64/amd64/locore.S
--- a/sys/arch/amd64/amd64/locore.S     Wed Mar 28 19:50:57 2018 +0000
+++ b/sys/arch/amd64/amd64/locore.S     Wed Mar 28 19:56:40 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.S,v 1.160 2018/03/28 16:02:49 maxv Exp $        */
+/*     $NetBSD: locore.S,v 1.161 2018/03/28 19:56:40 maxv Exp $        */
 
 /*
  * Copyright-o-rama!
@@ -1096,6 +1096,10 @@
        callq   _C_LABEL(svs_lwp_switch)
 .Lskip_svs:
        popq    %rdx
+
+       /* Restore rdi/rsi for speculation_barrier */
+       movq    %r13,%rdi
+       movq    %r12,%rsi
 #endif
 
        pushq   %rdx



Home | Main Index | Thread Index | Old Index