Module Name:    src
Committed By:   maxv
Date:           Wed Feb  8 10:08:26 UTC 2017

Modified Files:
        src/sys/arch/amd64/amd64: gdt.c
        src/sys/arch/amd64/include: gdt.h
        src/sys/arch/i386/i386: gdt.c
        src/sys/arch/i386/include: gdt.h
        src/sys/arch/x86/x86: ipi.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/amd64/amd64/gdt.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/amd64/include/gdt.h
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/i386/i386/gdt.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/include/gdt.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/x86/x86/ipi.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/gdt.c
diff -u src/sys/arch/amd64/amd64/gdt.c:1.35 src/sys/arch/amd64/amd64/gdt.c:1.36
--- src/sys/arch/amd64/amd64/gdt.c:1.35	Wed Feb  8 09:39:32 2017
+++ src/sys/arch/amd64/amd64/gdt.c	Wed Feb  8 10:08:26 2017
@@ -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 @@ gdt_init_cpu(struct cpu_info *ci)
 	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

Index: src/sys/arch/amd64/include/gdt.h
diff -u src/sys/arch/amd64/include/gdt.h:1.9 src/sys/arch/amd64/include/gdt.h:1.10
--- src/sys/arch/amd64/include/gdt.h:1.9	Wed Feb  8 09:39:32 2017
+++ src/sys/arch/amd64/include/gdt.h	Wed Feb  8 10:08:26 2017
@@ -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 @@ struct pmap;
 
 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;

Index: src/sys/arch/i386/i386/gdt.c
diff -u src/sys/arch/i386/i386/gdt.c:1.58 src/sys/arch/i386/i386/gdt.c:1.59
--- src/sys/arch/i386/i386/gdt.c:1.58	Wed Feb  8 09:39:32 2017
+++ src/sys/arch/i386/i386/gdt.c	Wed Feb  8 10:08:26 2017
@@ -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 @@ gdt_init_cpu(struct cpu_info *ci)
 #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

Index: src/sys/arch/i386/include/gdt.h
diff -u src/sys/arch/i386/include/gdt.h:1.14 src/sys/arch/i386/include/gdt.h:1.15
--- src/sys/arch/i386/include/gdt.h:1.14	Sat Aug 20 16:05:48 2016
+++ src/sys/arch/i386/include/gdt.h	Wed Feb  8 10:08:26 2017
@@ -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 @@ struct pmap;
 
 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);

Index: src/sys/arch/x86/x86/ipi.c
diff -u src/sys/arch/x86/x86/ipi.c:1.26 src/sys/arch/x86/x86/ipi.c:1.27
--- src/sys/arch/x86/x86/ipi.c:1.26	Sun Jul 20 15:48:54 2014
+++ src/sys/arch/x86/x86/ipi.c	Wed Feb  8 10:08:26 2017
@@ -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 @@ void (* const ipifunc[X86_NIPI])(struct 
 	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 */

Reply via email to