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 Stop sharing the double-fault stack. It...



details:   https://anonhg.NetBSD.org/src/rev/7609ece2ec8c
branches:  trunk
changeset: 828799:7609ece2ec8c
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Jan 02 18:54:26 2018 +0000

description:
Stop sharing the double-fault stack. It is embedded in .data, and we won't
want that in the future. This has always been wrong anyway, even if it is
unlikely that two CPUs will double fault at the same time.

diffstat:

 sys/arch/amd64/amd64/machdep.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (42 lines):

diff -r e67a07f1cb23 -r 7609ece2ec8c sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Tue Jan 02 18:41:14 2018 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Tue Jan 02 18:54:26 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.280 2017/12/31 08:29:38 maxv Exp $       */
+/*     $NetBSD: machdep.c,v 1.281 2018/01/02 18:54:26 maxv Exp $       */
 
 /*
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -110,7 +110,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.280 2017/12/31 08:29:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.281 2018/01/02 18:54:26 maxv Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -290,8 +290,6 @@
 phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX];
 int mem_cluster_cnt;
 
-char x86_64_doubleflt_stack[4096];
-
 int cpu_dump(void);
 int cpu_dumpsize(void);
 u_long cpu_dump_mempagecnt(void);
@@ -511,11 +509,13 @@
        /* tss->tss_ist[0] is filled by cpu_intr_init */
 
        /* double fault */
-       tss->tss_ist[1] = (uint64_t)x86_64_doubleflt_stack + PAGE_SIZE - 16;
+       p = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, UVM_KMF_WIRED);
+       tss->tss_ist[1] = p + PAGE_SIZE - 16;
 
        /* NMI */
        p = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, UVM_KMF_WIRED);
        tss->tss_ist[2] = p + PAGE_SIZE - 16;
+
        ci->ci_tss_sel = tss_alloc(tss);
 }
 



Home | Main Index | Thread Index | Old Index