Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86 Localify. By the way, we should use a different...



details:   https://anonhg.NetBSD.org/src/rev/b129732bafbd
branches:  trunk
changeset: 355998:b129732bafbd
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Aug 27 08:38:32 2017 +0000

description:
Localify. By the way, we should use a different stack for NMIs.

diffstat:

 sys/arch/x86/include/cpu.h |   5 +----
 sys/arch/x86/x86/cpu.c     |  18 +++++++++++-------
 2 files changed, 12 insertions(+), 11 deletions(-)

diffs (71 lines):

diff -r 67f44900990b -r b129732bafbd sys/arch/x86/include/cpu.h
--- a/sys/arch/x86/include/cpu.h        Sun Aug 27 06:18:16 2017 +0000
+++ b/sys/arch/x86/include/cpu.h        Sun Aug 27 08:38:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.76 2017/08/12 07:21:57 maxv Exp $    */
+/*     $NetBSD: cpu.h,v 1.77 2017/08/27 08:38:32 maxv Exp $    */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -205,9 +205,6 @@
 #endif /* __x86_64__ */
 #endif /* XEN et.al */
 
-       char *ci_doubleflt_stack;
-       char *ci_ddbipi_stack;
-
 #ifndef XEN
        struct evcnt ci_ipi_events[X86_NIPI];
 #else   /* XEN */
diff -r 67f44900990b -r b129732bafbd sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Sun Aug 27 06:18:16 2017 +0000
+++ b/sys/arch/x86/x86/cpu.c    Sun Aug 27 08:38:32 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.132 2017/07/28 14:12:26 riastradh Exp $      */
+/*     $NetBSD: cpu.c,v 1.133 2017/08/27 08:38:32 maxv Exp $   */
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.132 2017/07/28 14:12:26 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.133 2017/08/27 08:38:32 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"                /* for MPDEBUG */
@@ -977,14 +977,16 @@
 cpu_set_tss_gates(struct cpu_info *ci)
 {
        struct segment_descriptor sd;
+       void *doubleflt_stack;
 
-       ci->ci_doubleflt_stack = (char *)uvm_km_alloc(kernel_map, USPACE, 0,
+       doubleflt_stack = (void *)uvm_km_alloc(kernel_map, USPACE, 0,
            UVM_KMF_WIRED);
-       tss_init(&ci->ci_doubleflt_tss, ci->ci_doubleflt_stack,
-           IDTVEC(tss_trap08));
+       tss_init(&ci->ci_doubleflt_tss, doubleflt_stack, IDTVEC(tss_trap08));
+
        setsegment(&sd, &ci->ci_doubleflt_tss, sizeof(struct i386tss) - 1,
            SDT_SYS386TSS, SEL_KPL, 0, 0);
        ci->ci_gdt[GTRAPTSS_SEL].sd = sd;
+
        setgate(&idt[8], NULL, 0, SDT_SYSTASKGT, SEL_KPL,
            GSEL(GTRAPTSS_SEL, SEL_KPL));
 
@@ -996,9 +998,11 @@
         * XXX overwriting the gate set in db_machine_init.
         * Should rearrange the code so that it's set only once.
         */
-       ci->ci_ddbipi_stack = (char *)uvm_km_alloc(kernel_map, USPACE, 0,
+       void *ddbipi_stack;
+
+       ddbipi_stack = (void *)uvm_km_alloc(kernel_map, USPACE, 0,
            UVM_KMF_WIRED);
-       tss_init(&ci->ci_ddbipi_tss, ci->ci_ddbipi_stack,
+       tss_init(&ci->ci_ddbipi_tss, ddbipi_stack,
            x2apic_mode ? Xx2apic_intrddbipi : Xintrddbipi);
 
        setsegment(&sd, &ci->ci_ddbipi_tss, sizeof(struct i386tss) - 1,



Home | Main Index | Thread Index | Old Index