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 Replace %rax -> %rdi, so that check_swa...



details:   https://anonhg.NetBSD.org/src/rev/87164abbd1ee
branches:  trunk
changeset: 830072:87164abbd1ee
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Feb 25 08:28:55 2018 +0000

description:
Replace %rax -> %rdi, so that check_swapgs clobbers only one register.

diffstat:

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

diffs (20 lines):

diff -r f28c1edaae35 -r 87164abbd1ee sys/arch/amd64/amd64/amd64_trap.S
--- a/sys/arch/amd64/amd64/amd64_trap.S Sun Feb 25 08:27:15 2018 +0000
+++ b/sys/arch/amd64/amd64/amd64_trap.S Sun Feb 25 08:28:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: amd64_trap.S,v 1.34 2018/02/25 08:09:07 maxv Exp $     */
+/*     $NetBSD: amd64_trap.S,v 1.35 2018/02/25 08:28:55 maxv Exp $     */
 
 /*
  * Copyright (c) 1998, 2007, 2008, 2017 The NetBSD Foundation, Inc.
@@ -393,8 +393,8 @@
        leaq    do_iret(%rip),%rdi
        cmpq    %rdi,TF_RIP(%rsp)
        jne     5f
-       movq    TF_RSP(%rsp),%rax       /* Must read %rsp, may be a pad word */
-       testb   $SEL_UPL,8(%rax)        /* Check %cs of outer iret frame */
+       movq    TF_RSP(%rsp),%rdi       /* Must read %rsp, may be a pad word */
+       testb   $SEL_UPL,8(%rdi)        /* Check %cs of outer iret frame */
        je      2b                      /* jump if iret was to kernel  */
        jmp     1b                      /* to user - must restore %gs */
 5:



Home | Main Index | Thread Index | Old Index