Module Name: src Committed By: maxv Date: Tue Jan 2 18:54:26 UTC 2018
Modified Files: src/sys/arch/amd64/amd64: machdep.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.280 -r1.281 src/sys/arch/amd64/amd64/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/amd64/amd64/machdep.c diff -u src/sys/arch/amd64/amd64/machdep.c:1.280 src/sys/arch/amd64/amd64/machdep.c:1.281 --- src/sys/arch/amd64/amd64/machdep.c:1.280 Sun Dec 31 08:29:38 2017 +++ src/sys/arch/amd64/amd64/machdep.c Tue Jan 2 18:54:26 2018 @@ -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 @@ struct pool x86_dbregspl; 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 @@ cpu_init_tss(struct cpu_info *ci) /* 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); }