Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Remove gdt_reload_cpu. GDTR takes a VA as base, and...



details:   https://anonhg.NetBSD.org/src/rev/4b3cc6fdca33
branches:  trunk
changeset: 821500:4b3cc6fdca33
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Feb 08 10:08:26 2017 +0000

description:
Remove gdt_reload_cpu. GDTR takes a VA as base, and in our x86
implementation this VA is per-cpu and does not change; there is therefore
no need to remotely reload GDTR.

diffstat:

 sys/arch/amd64/amd64/gdt.c   |  19 ++-----------------
 sys/arch/amd64/include/gdt.h |   3 +--
 sys/arch/i386/i386/gdt.c     |  17 ++---------------
 sys/arch/i386/include/gdt.h  |   3 +--
 sys/arch/x86/x86/ipi.c       |   6 +++---
 5 files changed, 9 insertions(+), 39 deletions(-)

diffs (139 lines):

diff -r e5d3c4c9ef5d -r 4b3cc6fdca33 sys/arch/amd64/amd64/gdt.c
--- a/sys/arch/amd64/amd64/gdt.c        Wed Feb 08 09:58:42 2017 +0000
+++ b/sys/arch/amd64/amd64/gdt.c        Wed Feb 08 10:08:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.c,v 1.35 2017/02/08 09:39:32 maxv Exp $    */
+/*     $NetBSD: gdt.c,v 1.36 2017/02/08 10:08:26 maxv Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.35 2017/02/08 09:39:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.36 2017/02/08 10:08:26 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -208,21 +208,6 @@
        lgdt(&region);
 }
 
-#ifdef MULTIPROCESSOR
-void
-gdt_reload_cpu(struct cpu_info *ci)
-{
-       struct region_descriptor region;
-
-#ifndef XEN
-       setregion(&region, ci->ci_gdt, MAXGDTSIZ - 1);
-#else
-       setregion(&region, ci->ci_gdt, gdt_size - 1);
-#endif
-       lgdt(&region);
-}
-#endif
-
 #if !defined(XEN) || defined(USER_LDT)
 /*
  * Grow the GDT. The GDT is present on each CPU, so we need to iterate over all
diff -r e5d3c4c9ef5d -r 4b3cc6fdca33 sys/arch/amd64/include/gdt.h
--- a/sys/arch/amd64/include/gdt.h      Wed Feb 08 09:58:42 2017 +0000
+++ b/sys/arch/amd64/include/gdt.h      Wed Feb 08 10:08:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.h,v 1.9 2017/02/08 09:39:32 maxv Exp $     */
+/*     $NetBSD: gdt.h,v 1.10 2017/02/08 10:08:26 maxv Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,6 @@
 
 void gdt_init(void);
 void gdt_init_cpu(struct cpu_info *);
-void gdt_reload_cpu(struct cpu_info *);
 void gdt_alloc_cpu(struct cpu_info *);
 
 struct x86_64_tss;
diff -r e5d3c4c9ef5d -r 4b3cc6fdca33 sys/arch/i386/i386/gdt.c
--- a/sys/arch/i386/i386/gdt.c  Wed Feb 08 09:58:42 2017 +0000
+++ b/sys/arch/i386/i386/gdt.c  Wed Feb 08 10:08:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.c,v 1.58 2017/02/08 09:39:32 maxv Exp $    */
+/*     $NetBSD: gdt.c,v 1.59 2017/02/08 10:08:26 maxv Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.58 2017/02/08 09:39:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.59 2017/02/08 10:08:26 maxv Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -231,19 +231,6 @@
 #endif
 }
 
-#if defined(MULTIPROCESSOR) && !defined(XEN)
-void
-gdt_reload_cpu(struct cpu_info *ci)
-{
-       struct region_descriptor region;
-       size_t max_len;
-
-       max_len = MAXGDTSIZ * sizeof(gdtstore[0]);
-       setregion(&region, ci->ci_gdt, max_len - 1);
-       lgdt(&region);
-}
-#endif
-
 /*
  * Grow the GDT. The GDT is present on each CPU, so we need to iterate over all
  * of them. We already have the virtual memory, we only need to grow the
diff -r e5d3c4c9ef5d -r 4b3cc6fdca33 sys/arch/i386/include/gdt.h
--- a/sys/arch/i386/include/gdt.h       Wed Feb 08 09:58:42 2017 +0000
+++ b/sys/arch/i386/include/gdt.h       Wed Feb 08 10:08:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gdt.h,v 1.14 2016/08/20 16:05:48 maxv Exp $    */
+/*     $NetBSD: gdt.h,v 1.15 2017/02/08 10:08:26 maxv Exp $    */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -36,7 +36,6 @@
 
 void gdt_init(void);
 void gdt_init_cpu(struct cpu_info *);
-void gdt_reload_cpu(struct cpu_info *);
 void gdt_alloc_cpu(struct cpu_info *);
 int tss_alloc(const struct i386tss *);
 void tss_free(int);
diff -r e5d3c4c9ef5d -r 4b3cc6fdca33 sys/arch/x86/x86/ipi.c
--- a/sys/arch/x86/x86/ipi.c    Wed Feb 08 09:58:42 2017 +0000
+++ b/sys/arch/x86/x86/ipi.c    Wed Feb 08 10:08:26 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipi.c,v 1.26 2014/07/20 15:48:54 uebayasi Exp $        */
+/*     $NetBSD: ipi.c,v 1.27 2017/02/08 10:08:26 maxv Exp $    */
 
 /*-
  * Copyright (c) 2000, 2008, 2009 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.26 2014/07/20 15:48:54 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipi.c,v 1.27 2017/02/08 10:08:26 maxv Exp $");
 
 #include "opt_mtrr.h"
 
@@ -85,7 +85,7 @@
        x86_ipi_generic,        /* X86_IPI_GENERIC */
        x86_ipi_synch_fpu,      /* X86_IPI_SYNCH_FPU */
        x86_ipi_reload_mtrr,    /* X86_IPI_MTRR */
-       gdt_reload_cpu,         /* X86_IPI_GDT */
+       NULL,                   /* X86_IPI_GDT */
        x86_ipi_xcall,          /* X86_IPI_XCALL */
        acpi_cpu_sleep,         /* X86_IPI_ACPI_CPU_SLEEP */
        x86_ipi_kpreempt        /* X86_IPI_KPREEMPT */



Home | Main Index | Thread Index | Old Index