Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 The uarea must always be page-aligned.



details:   https://anonhg.NetBSD.org/src/rev/1a5b6ef435b7
branches:  trunk
changeset: 828953:1a5b6ef435b7
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Jan 11 11:15:34 2018 +0000

description:
The uarea must always be page-aligned.

diffstat:

 sys/arch/x86/x86/vm_machdep.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 6fefe0ea678a -r 1a5b6ef435b7 sys/arch/x86/x86/vm_machdep.c
--- a/sys/arch/x86/x86/vm_machdep.c     Thu Jan 11 10:38:13 2018 +0000
+++ b/sys/arch/x86/x86/vm_machdep.c     Thu Jan 11 11:15:34 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vm_machdep.c,v 1.30 2017/12/31 08:29:38 maxv Exp $     */
+/*     $NetBSD: vm_machdep.c,v 1.31 2018/01/11 11:15:34 maxv Exp $     */
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.30 2017/12/31 08:29:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.31 2018/01/11 11:15:34 maxv Exp $");
 
 #include "opt_mtrr.h"
 
@@ -178,9 +178,10 @@
         * returns normally.
         */
        uv = uvm_lwp_getuarea(l2);
+       KASSERT(uv % PAGE_SIZE == 0);
 
 #ifdef __x86_64__
-       pcb2->pcb_rsp0 = (uv + USPACE - 16) & ~0xf;
+       pcb2->pcb_rsp0 = (uv + USPACE - 16);
        tf = (struct trapframe *)pcb2->pcb_rsp0 - 1;
 #else
        pcb2->pcb_esp0 = (uv + USPACE - 16);



Home | Main Index | Thread Index | Old Index