summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorPhilip Guenthe <guenther@cvs.openbsd.org>2011-03-18 03:10:48 +0000
committerPhilip Guenthe <guenther@cvs.openbsd.org>2011-03-18 03:10:48 +0000
commitcb2a03ae7c14c0ba6eda4c60909345d9df1bf6a2 (patch)
tree5e70ba55c21945ef6f1077bf811700cbd20bd648 /sys/arch/amd64
parent8fb6fd493095ed4c350adb2a0e7e90b97716f920 (diff)
Old-style MTRRs were never used on amd64, so remove the remaining traces
of them, as well as some other unused proc md_flags bits: MDP_COMPAT and MDP_SYSCALL. ok mikeb@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/cpu.c3
-rw-r--r--sys/arch/amd64/amd64/ipifuncs.c3
-rw-r--r--sys/arch/amd64/amd64/machdep.c5
-rw-r--r--sys/arch/amd64/amd64/sys_machdep.c3
-rw-r--r--sys/arch/amd64/amd64/vm_machdep.c6
-rw-r--r--sys/arch/amd64/include/mtrr.h153
-rw-r--r--sys/arch/amd64/include/proc.h7
-rw-r--r--sys/arch/amd64/include/sysarch.h18
8 files changed, 8 insertions, 190 deletions
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c
index 2f98f6c4888..6f05b311123 100644
--- a/sys/arch/amd64/amd64/cpu.c
+++ b/sys/arch/amd64/amd64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.40 2010/11/27 13:03:04 kettenis Exp $ */
+/* $OpenBSD: cpu.c,v 1.41 2011/03/18 03:10:47 guenther Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -85,7 +85,6 @@
#include <machine/specialreg.h>
#include <machine/segments.h>
#include <machine/gdt.h>
-#include <machine/mtrr.h>
#include <machine/pio.h>
#if NLAPIC > 0
diff --git a/sys/arch/amd64/amd64/ipifuncs.c b/sys/arch/amd64/amd64/ipifuncs.c
index 6ab5a412390..caec5b0b428 100644
--- a/sys/arch/amd64/amd64/ipifuncs.c
+++ b/sys/arch/amd64/amd64/ipifuncs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipifuncs.c,v 1.15 2010/11/13 04:16:42 guenther Exp $ */
+/* $OpenBSD: ipifuncs.c,v 1.16 2011/03/18 03:10:47 guenther Exp $ */
/* $NetBSD: ipifuncs.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
@@ -53,7 +53,6 @@
#include <machine/i82093var.h>
#include <machine/i82489reg.h>
#include <machine/i82489var.h>
-#include <machine/mtrr.h>
#include <machine/fpu.h>
#include <ddb/db_output.h>
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 82c3b7534a3..bff89202e01 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.130 2011/01/13 20:34:04 mikeb Exp $ */
+/* $OpenBSD: machdep.c,v 1.131 2011/03/18 03:10:47 guenther Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -106,7 +106,6 @@
#include <machine/reg.h>
#include <machine/specialreg.h>
#include <machine/fpu.h>
-#include <machine/mtrr.h>
#include <machine/biosvar.h>
#include <machine/mpbiosvar.h>
#include <machine/reg.h>
@@ -228,8 +227,6 @@ paddr_t avail_end;
void (*delay_func)(int) = i8254_delay;
void (*initclock_func)(void) = i8254_initclocks;
-struct mtrr_funcs *mtrr_funcs;
-
/*
* Format of boot information passed to us by 32-bit /boot
*/
diff --git a/sys/arch/amd64/amd64/sys_machdep.c b/sys/arch/amd64/amd64/sys_machdep.c
index 96136014876..7679f27b3b9 100644
--- a/sys/arch/amd64/amd64/sys_machdep.c
+++ b/sys/arch/amd64/amd64/sys_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_machdep.c,v 1.8 2008/06/26 05:42:09 ray Exp $ */
+/* $OpenBSD: sys_machdep.c,v 1.9 2011/03/18 03:10:47 guenther Exp $ */
/* $NetBSD: sys_machdep.c,v 1.1 2003/04/26 18:39:32 fvdl Exp $ */
/*-
@@ -53,7 +53,6 @@
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/sysarch.h>
-#include <machine/mtrr.h>
#if defined(PERFCTRS) && 0
#include <machine/pmc.h>
diff --git a/sys/arch/amd64/amd64/vm_machdep.c b/sys/arch/amd64/amd64/vm_machdep.c
index 19a669d5514..845878f5f98 100644
--- a/sys/arch/amd64/amd64/vm_machdep.c
+++ b/sys/arch/amd64/amd64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.24 2010/11/13 04:16:42 guenther Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.25 2011/03/18 03:10:47 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 2003/04/26 18:39:33 fvdl Exp $ */
/*-
@@ -61,7 +61,6 @@
#include <machine/reg.h>
#include <machine/specialreg.h>
#include <machine/fpu.h>
-#include <machine/mtrr.h>
void setredzone(struct proc *);
@@ -154,9 +153,6 @@ cpu_exit(struct proc *p)
if (p->p_addr->u_pcb.pcb_fpcpu != NULL)
fpusave_proc(p, 0);
- if (p->p_md.md_flags & MDP_USEDMTRR)
- mtrr_clean(p);
-
pmap_deactivate(p);
sched_exit(p);
}
diff --git a/sys/arch/amd64/include/mtrr.h b/sys/arch/amd64/include/mtrr.h
deleted file mode 100644
index 4cf4376a9db..00000000000
--- a/sys/arch/amd64/include/mtrr.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/* $OpenBSD: mtrr.h,v 1.2 2008/06/26 05:42:09 ray Exp $ */
-/* $NetBSD: mtrr.h,v 1.1 2003/02/26 21:26:11 fvdl Exp $ */
-
-/*-
- * Copyright (c) 2000 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Bill Sommerfeld
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _X86_MTRR_H_
-#define _X86_MTRR_H_
-
-#define MTRR_I686_FIXED_IDX64K 0
-#define MTRR_I686_FIXED_IDX16K 1
-#define MTRR_I686_FIXED_IDX4K 3
-
-#define MTRR_I686_NVAR 8
-
-#define MTRR_I686_64K_START 0x00000
-#define MTRR_I686_16K_START 0x80000
-#define MTRR_I686_4K_START 0xc0000
-
-#define MTRR_I686_NFIXED_64K 1
-#define MTRR_I686_NFIXED_16K 2
-#define MTRR_I686_NFIXED_4K 8
-#define MTRR_I686_NFIXED 11
-#define MTRR_I686_NFIXED_SOFT_64K (MTRR_I686_NFIXED_64K * 8)
-#define MTRR_I686_NFIXED_SOFT_16K (MTRR_I686_NFIXED_16K * 8)
-#define MTRR_I686_NFIXED_SOFT_4K (MTRR_I686_NFIXED_4K * 8)
-#define MTRR_I686_NFIXED_SOFT (MTRR_I686_NFIXED * 8)
-
-#define MTRR_I686_ENABLE_MASK 0x0800
-#define MTRR_I686_FIXED_ENABLE_MASK 0x0400
-
-#define MTRR_I686_CAP_VCNT_MASK 0x00ff
-#define MTRR_I686_CAP_FIX_MASK 0x0100
-#define MTRR_I686_CAP_WC_MASK 0x0400
-
-#define MTRR_TYPE_UC 0
-#define MTRR_TYPE_WC 1
-#define MTRR_TYPE_UNDEF1 2
-#define MTRR_TYPE_UNDEF2 3
-#define MTRR_TYPE_WT 4
-#define MTRR_TYPE_WP 5
-#define MTRR_TYPE_WB 6
-
-struct mtrr_state {
- uint32_t msraddr;
- uint64_t msrval;
-};
-
-#define MTRR_PRIVATE 0x0001 /* 'own' range, reset at exit */
-#define MTRR_FIXED 0x0002 /* use fixed range mtrr */
-#define MTRR_VALID 0x0004 /* entry is valid */
-
-#define MTRR_CANTSET MTRR_FIXED
-
-#define MTRR_I686_MASK_VALID (1 << 11)
-
-/*
- * AMD K6 MTRRs.
- *
- * There are two of these MTRR-like registers in the UWCRR.
- */
-
-#define MTRR_K6_ADDR_SHIFT 17
-#define MTRR_K6_ADDR (0x7fffU << MTRR_K6_ADDR_SHIFT)
-#define MTRR_K6_MASK_SHIFT 2
-#define MTRR_K6_MASK (0x7fffU << MTRR_K6_MASK_SHIFT)
-#define MTRR_K6_WC (1U << 1) /* write-combine */
-#define MTRR_K6_UC (1U << 0) /* uncached */
-
-#define MTRR_K6_NVAR 2
-
-#ifdef _KERNEL
-
-#define mtrr_base_value(mtrrp) \
- (((uint64_t)(mtrrp)->base) | ((uint64_t)(mtrrp)->type))
-#define mtrr_mask_value(mtrrp) \
- ((~((mtrrp)->len - 1) & 0x0000000ffffff000))
-
-
-#define mtrr_len(val) \
- ((~((val) & 0x0000000ffffff000)+1) & 0x0000000ffffff000)
-#define mtrr_base(val) ((val) & 0x0000000ffffff000)
-#define mtrr_type(val) ((uint8_t)((val) & 0x00000000000000ff))
-#define mtrr_valid(val) (((val) & MTRR_I686_MASK_VALID) != 0)
-
-struct proc;
-struct mtrr;
-
-void i686_mtrr_init_first(void);
-void k6_mtrr_init_first(void);
-
-struct mtrr_funcs {
- void (*init_cpu)(struct cpu_info *ci);
- void (*reload_cpu)(struct cpu_info *ci);
- void (*clean)(struct proc *p);
- int (*set)(struct mtrr *, int *n, struct proc *p, int flags);
- int (*get)(struct mtrr *, int *n, struct proc *p, int flags);
- void (*commit)(void);
- void (*dump)(const char *tag);
-};
-
-extern struct mtrr_funcs i686_mtrr_funcs;
-extern struct mtrr_funcs k6_mtrr_funcs;
-extern struct mtrr_funcs *mtrr_funcs;
-
-#define mtrr_init_cpu(ci) mtrr_funcs->init_cpu(ci)
-#define mtrr_reload_cpu(ci) mtrr_funcs->reload_cpu(ci)
-#define mtrr_clean(p) mtrr_funcs->clean(p)
-#define mtrr_set(mp,n,p,f) mtrr_funcs->set(mp,n,p,f)
-#define mtrr_get(mp,n,p,f) mtrr_funcs->get(mp,n,p,f)
-#define mtrr_dump(s) mtrr_funcs->dump(s)
-#define mtrr_commit() mtrr_funcs->commit()
-
-#define MTRR_GETSET_USER 0x0001
-#define MTRR_GETSET_KERNEL 0x0002
-
-#endif /* _KERNEL */
-
-struct mtrr {
- uint64_t base; /* physical base address */
- uint64_t len;
- uint8_t type;
- int flags;
- pid_t owner; /* valid if MTRR_PRIVATE set in flags */
-};
-
-#endif /* _X86_MTRR_H_ */
diff --git a/sys/arch/amd64/include/proc.h b/sys/arch/amd64/include/proc.h
index 46ca006f6b4..07679dfa575 100644
--- a/sys/arch/amd64/include/proc.h
+++ b/sys/arch/amd64/include/proc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proc.h,v 1.4 2010/11/13 04:16:42 guenther Exp $ */
+/* $OpenBSD: proc.h,v 1.5 2011/03/18 03:10:47 guenther Exp $ */
/* $NetBSD: proc.h,v 1.1 2003/04/26 18:39:46 fvdl Exp $ */
/*
@@ -48,9 +48,6 @@ struct mdproc {
/* md_flags */
#define MDP_USEDFPU 0x0001 /* has used the FPU */
-#define MDP_COMPAT 0x0002 /* x86 compatibility process */
-#define MDP_SYSCALL 0x0004 /* entered kernel via syscall ins */
-#define MDP_USEDMTRR 0x0008 /* has set volatile MTRRs */
-#define MDP_IRET 0x0010 /* return via iret, not sysret */
+#define MDP_IRET 0x0002 /* return via iret, not sysret */
#endif /* _AMD64_PROC_H */
diff --git a/sys/arch/amd64/include/sysarch.h b/sys/arch/amd64/include/sysarch.h
index 5d7c23c11c1..69f5d9046ff 100644
--- a/sys/arch/amd64/include/sysarch.h
+++ b/sys/arch/amd64/include/sysarch.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysarch.h,v 1.5 2010/10/26 05:49:10 guenther Exp $ */
+/* $OpenBSD: sysarch.h,v 1.6 2011/03/18 03:10:47 guenther Exp $ */
/* $NetBSD: sysarch.h,v 1.1 2003/04/26 18:39:48 fvdl Exp $ */
#ifndef _AMD64_SYSARCH_H_
@@ -14,8 +14,6 @@
#define AMD64_PMC_INFO 8
#define AMD64_PMC_STARTSTOP 9
#define AMD64_PMC_READ 10
-#define AMD64_GET_MTRR 11
-#define AMD64_SET_MTRR 12
struct amd64_iopl_args {
int iopl;
@@ -62,21 +60,9 @@ struct amd64_pmc_read_args {
u_int64_t time;
};
-struct amd64_get_mtrr_args {
- struct mtrr *mtrrp;
- int *n;
-};
-
-struct amd64_set_mtrr_args {
- struct mtrr *mtrrp;
- int *n;
-};
-
#ifdef _KERNEL
int amd64_iopl(struct proc *, void *, register_t *);
-int amd64_get_mtrr(struct proc *, void *, register_t *);
-int amd64_set_mtrr(struct proc *, void *, register_t *);
#else
int amd64_iopl(int);
int amd64_get_ioperm(u_long *);
@@ -84,8 +70,6 @@ int amd64_set_ioperm(u_long *);
int amd64_pmc_info(struct amd64_pmc_info_args *);
int amd64_pmc_startstop(struct amd64_pmc_startstop_args *);
int amd64_pmc_read(struct amd64_pmc_read_args *);
-int amd64_set_mtrr(struct mtrr *, int *);
-int amd64_get_mtrr(struct mtrr *, int *);
int sysarch(int, void *);
#endif