Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Remove 'ci_svs_kpdirpa', unused. While here fix a f...
details: https://anonhg.NetBSD.org/src/rev/caccd133bc09
branches: trunk
changeset: 999275:caccd133bc09
user: maxv <maxv%NetBSD.org@localhost>
date: Mon May 27 17:32:36 2019 +0000
description:
Remove 'ci_svs_kpdirpa', unused. While here fix a few comments here and
there, reduces a future diff.
diffstat:
sys/arch/amd64/amd64/genassym.cf | 3 +--
sys/arch/x86/include/cpu.h | 4 ++--
sys/arch/x86/x86/cpu.c | 11 ++++-------
sys/arch/x86/x86/pmap.c | 17 ++++++++---------
sys/arch/x86/x86/svs.c | 10 +++-------
sys/arch/x86/x86/x86_tlb.c | 8 ++++----
6 files changed, 22 insertions(+), 31 deletions(-)
diffs (182 lines):
diff -r 383fe3ff7149 -r caccd133bc09 sys/arch/amd64/amd64/genassym.cf
--- a/sys/arch/amd64/amd64/genassym.cf Mon May 27 16:54:38 2019 +0000
+++ b/sys/arch/amd64/amd64/genassym.cf Mon May 27 17:32:36 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.74 2019/02/15 08:54:01 nonaka Exp $
+# $NetBSD: genassym.cf,v 1.75 2019/05/27 17:32:36 maxv Exp $
#
# Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -236,7 +236,6 @@
define CPU_INFO_TSS offsetof(struct cpu_info, ci_tss)
ifdef SVS
define CPU_INFO_UPDIRPA offsetof(struct cpu_info, ci_svs_updirpa)
-define CPU_INFO_KPDIRPA offsetof(struct cpu_info, ci_svs_kpdirpa)
define CPU_INFO_RSP0 offsetof(struct cpu_info, ci_svs_rsp0)
define CPU_INFO_URSP0 offsetof(struct cpu_info, ci_svs_ursp0)
define CPU_INFO_KRSP0 offsetof(struct cpu_info, ci_svs_krsp0)
diff -r 383fe3ff7149 -r caccd133bc09 sys/arch/x86/include/cpu.h
--- a/sys/arch/x86/include/cpu.h Mon May 27 16:54:38 2019 +0000
+++ b/sys/arch/x86/include/cpu.h Mon May 27 17:32:36 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.105 2019/02/15 08:54:01 nonaka Exp $ */
+/* $NetBSD: cpu.h,v 1.106 2019/05/27 17:32:36 maxv Exp $ */
/*
* Copyright (c) 1990 The Regents of the University of California.
@@ -245,7 +245,7 @@
#ifdef SVS
pd_entry_t * ci_svs_updir;
paddr_t ci_svs_updirpa;
- paddr_t ci_svs_kpdirpa;
+ paddr_t ci_unused;
kmutex_t ci_svs_mtx;
pd_entry_t * ci_svs_rsp0_pte;
vaddr_t ci_svs_rsp0;
diff -r 383fe3ff7149 -r caccd133bc09 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c Mon May 27 16:54:38 2019 +0000
+++ b/sys/arch/x86/x86/cpu.c Mon May 27 17:32:36 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.168 2019/03/09 08:42:26 maxv Exp $ */
+/* $NetBSD: cpu.c,v 1.169 2019/05/27 17:32:36 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.168 2019/03/09 08:42:26 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.169 2019/05/27 17:32:36 maxv Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -584,15 +584,12 @@
lcr0(rcr0() | CR0_WP);
- /*
- * On a P6 or above, enable global TLB caching if the
- * hardware supports it.
- */
+ /* If global TLB caching is supported, enable it */
if (cpu_feature[0] & CPUID_PGE)
#ifdef SVS
if (!svs_enabled)
#endif
- cr4 |= CR4_PGE; /* enable global TLB caching */
+ cr4 |= CR4_PGE;
/*
* If we have FXSAVE/FXRESTOR, use them.
diff -r 383fe3ff7149 -r caccd133bc09 sys/arch/x86/x86/pmap.c
--- a/sys/arch/x86/x86/pmap.c Mon May 27 16:54:38 2019 +0000
+++ b/sys/arch/x86/x86/pmap.c Mon May 27 17:32:36 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.331 2019/03/12 08:29:52 gson Exp $ */
+/* $NetBSD: pmap.c,v 1.332 2019/05/27 17:32:36 maxv Exp $ */
/*
* Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.331 2019/03/12 08:29:52 gson Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.332 2019/05/27 17:32:36 maxv Exp $");
#include "opt_user_ldt.h"
#include "opt_lockdebug.h"
@@ -1116,15 +1116,14 @@
#if !defined(XENPV)
/*
- * Begin to enable global TLB entries if they are supported.
- * The G bit has no effect until the CR4_PGE bit is set in CR4,
- * which happens in cpu_init(), which is run on each cpu
- * (and happens later)
+ * Begin to enable global TLB entries if they are supported: add PTE_G
+ * attribute to already mapped kernel pages.
+ *
+ * The G bit has no effect until the CR4_PGE bit is set in CR4, which
+ * happens later in cpu_init().
*/
if (cpu_feature[0] & CPUID_PGE) {
- pmap_pg_g = PTE_G; /* enable software */
-
- /* add PTE_G attribute to already mapped kernel pages */
+ pmap_pg_g = PTE_G;
pmap_remap_global();
}
#endif
diff -r 383fe3ff7149 -r caccd133bc09 sys/arch/x86/x86/svs.c
--- a/sys/arch/x86/x86/svs.c Mon May 27 16:54:38 2019 +0000
+++ b/sys/arch/x86/x86/svs.c Mon May 27 17:32:36 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: svs.c,v 1.26 2019/05/15 17:31:41 maxv Exp $ */
+/* $NetBSD: svs.c,v 1.27 2019/05/27 17:32:36 maxv Exp $ */
/*
* Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.26 2019/05/15 17:31:41 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svs.c,v 1.27 2019/05/27 17:32:36 maxv Exp $");
#include "opt_svs.h"
@@ -432,8 +432,6 @@
pmap_update(pmap_kernel());
- ci->ci_svs_kpdirpa = pmap_pdirpa(pmap_kernel(), 0);
-
mutex_init(&ci->ci_svs_mtx, MUTEX_DEFAULT, IPL_VM);
svs_page_add(ci, (vaddr_t)&pcpuarea->idt);
@@ -547,11 +545,9 @@
KASSERT(kpreempt_disabled());
KASSERT(pmap != pmap_kernel());
- ci->ci_svs_kpdirpa = pmap_pdirpa(pmap, 0);
-
/* Update the info in the UTLS page */
utls = (struct svs_utls *)ci->ci_svs_utls;
- utls->kpdirpa = ci->ci_svs_kpdirpa;
+ utls->kpdirpa = pmap_pdirpa(pmap, 0);
mutex_enter(&ci->ci_svs_mtx);
diff -r 383fe3ff7149 -r caccd133bc09 sys/arch/x86/x86/x86_tlb.c
--- a/sys/arch/x86/x86/x86_tlb.c Mon May 27 16:54:38 2019 +0000
+++ b/sys/arch/x86/x86/x86_tlb.c Mon May 27 17:32:36 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_tlb.c,v 1.7 2019/04/21 06:37:21 maxv Exp $ */
+/* $NetBSD: x86_tlb.c,v 1.8 2019/05/27 17:32:36 maxv Exp $ */
/*-
* Copyright (c) 2008-2012 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.7 2019/04/21 06:37:21 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.8 2019/05/27 17:32:36 maxv Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -200,10 +200,10 @@
/* Find out what we need to invalidate. */
if (tp->tp_count == (uint16_t)-1) {
if (tp->tp_pte & PTE_G) {
- /* Invalidating user and kernel TLB entries. */
+ /* Invalidating all TLB entries. */
tlbflushg();
} else {
- /* Invalidating user TLB entries only. */
+ /* Invalidating non-global TLB entries only. */
tlbflush();
}
} else {
Home |
Main Index |
Thread Index |
Old Index