Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Fix a think-o / paste-o in the max user address che...



details:   https://anonhg.NetBSD.org/src/rev/79710ac28fe4
branches:  trunk
changeset: 998074:79710ac28fe4
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Apr 06 20:25:26 2019 +0000

description:
Fix a think-o / paste-o in the max user address check, pointed out
by maxv@.

diffstat:

 sys/arch/amd64/amd64/copy.S |  22 +++++++++++-----------
 sys/arch/i386/i386/copy.S   |  20 ++++++++++----------
 2 files changed, 21 insertions(+), 21 deletions(-)

diffs (173 lines):

diff -r 8a0483d1952d -r 79710ac28fe4 sys/arch/amd64/amd64/copy.S
--- a/sys/arch/amd64/amd64/copy.S       Sat Apr 06 18:30:20 2019 +0000
+++ b/sys/arch/amd64/amd64/copy.S       Sat Apr 06 20:25:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: copy.S,v 1.31 2019/04/06 03:06:24 thorpej Exp $        */
+/*     $NetBSD: copy.S,v 1.32 2019/04/06 20:25:26 thorpej Exp $        */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -386,15 +386,15 @@
 
 /**************************************************************************/
 
-#define        UFETCHSTORE_PROLOGUE                                            \
-       movq    $VM_MAXUSER_ADDRESS-1,%r11                      ;       \
+#define        UFETCHSTORE_PROLOGUE(x)                                         \
+       movq    $VM_MAXUSER_ADDRESS-x,%r11                      ;       \
        cmpq    %r11,%rdi                                       ;       \
        ja      _C_LABEL(copy_efault)
 
 /* LINTSTUB: int _ufetch_8(const uint8_t *uaddr, uint8_t *valp); */
 ENTRY(_ufetch_8)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(1)
 
        SMAP_DISABLE
 .L_ufetch_8_start:
@@ -411,7 +411,7 @@
 /* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */
 ENTRY(_ufetch_16)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(2)
 
        SMAP_DISABLE
 .L_ufetch_16_start:
@@ -428,7 +428,7 @@
 /* LINTSTUB: int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); */
 ENTRY(_ufetch_32)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(4)
 
        SMAP_DISABLE
 .L_ufetch_32_start:
@@ -445,7 +445,7 @@
 /* LINTSTUB: int _ufetch_64(const uint64_t *uaddr, uint64_t *valp); */
 ENTRY(_ufetch_64)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(8)
 
        SMAP_DISABLE
 .L_ufetch_64_start:
@@ -462,7 +462,7 @@
 /* LINTSTUB: int _ustore_8(uint8_t *uaddr, uint8_t val); */
 ENTRY(_ustore_8)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(1)
 
        SMAP_DISABLE
 .L_ustore_8_start:
@@ -478,7 +478,7 @@
 /* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint16_t val); */
 ENTRY(_ustore_16)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(2)
 
        SMAP_DISABLE
 .L_ustore_16_start:
@@ -494,7 +494,7 @@
 /* LINTSTUB: int _ustore_32(uint32_t *uaddr, uint32_t val); */
 ENTRY(_ustore_32)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(4)
 
        SMAP_DISABLE
 .L_ustore_32_start:
@@ -510,7 +510,7 @@
 /* LINTSTUB: int _ustore_64(uint64_t *uaddr, uint64_t val); */
 ENTRY(_ustore_64)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(8)
 
        SMAP_DISABLE
 .L_ustore_64_start:
diff -r 8a0483d1952d -r 79710ac28fe4 sys/arch/i386/i386/copy.S
--- a/sys/arch/i386/i386/copy.S Sat Apr 06 18:30:20 2019 +0000
+++ b/sys/arch/i386/i386/copy.S Sat Apr 06 20:25:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: copy.S,v 1.29 2019/04/06 03:06:25 thorpej Exp $        */
+/*     $NetBSD: copy.S,v 1.30 2019/04/06 20:25:27 thorpej Exp $        */
 
 /*
  * Copyright (c) 1998, 2000, 2004, 2008 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <machine/asm.h>
-__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.29 2019/04/06 03:06:25 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.30 2019/04/06 20:25:27 thorpej Exp $");
 
 #include "assym.h"
 
@@ -500,15 +500,15 @@
 
 /**************************************************************************/
 
-#define        UFETCHSTORE_PROLOGUE                                            \
+#define        UFETCHSTORE_PROLOGUE(x)                                         \
        movl    4(%esp),%edx                                    ;       \
-       cmpl    $VM_MAXUSER_ADDRESS-4,%edx                      ;       \
+       cmpl    $VM_MAXUSER_ADDRESS-x,%edx                      ;       \
        ja      _C_LABEL(ufetchstore_efault)
 
 /* LINTSTUB: int _ufetch_8(const uint8_t *uaddr, uint8_t *valp); */
 ENTRY(_ufetch_8)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(1)
 
        SMAP_DISABLE
 .L_ufetch_8_start:
@@ -526,7 +526,7 @@
 /* LINTSTUB: int _ufetch_16(const uint16_t *uaddr, uint16_t *valp); */
 ENTRY(_ufetch_16)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(2)
 
        SMAP_DISABLE
 .L_ufetch_16_start:
@@ -544,7 +544,7 @@
 /* LINTSTUB: int _ufetch_32(const uint32_t *uaddr, uint32_t *valp); */
 ENTRY(_ufetch_32)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(4)
 
        SMAP_DISABLE
 .L_ufetch_32_start:
@@ -562,7 +562,7 @@
 /* LINTSTUB: int _ustore_8(uint8_t *uaddr, uint8_t val); */
 ENTRY(_ustore_8)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(1)
        movb    8(%esp),%al
 
        SMAP_DISABLE
@@ -579,7 +579,7 @@
 /* LINTSTUB: int _ustore_16(uint16_t *uaddr, uint16_t val); */
 ENTRY(_ustore_16)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(2)
        movw    8(%esp),%ax
 
        SMAP_DISABLE
@@ -596,7 +596,7 @@
 /* LINTSTUB: int _ustore_32(uint32_t *uaddr, uint32_t val); */
 ENTRY(_ustore_32)
        DEFERRED_SWITCH_CHECK
-       UFETCHSTORE_PROLOGUE
+       UFETCHSTORE_PROLOGUE(4)
        movl    8(%esp),%eax
 
        SMAP_DISABLE



Home | Main Index | Thread Index | Old Index