Loader tunable 'machdep.disable_mtrrs'.
Sysctl of same name to reflect status. Submitted by: jhb Approved by: re (murray) MFC after: 1 day
This commit is contained in:
parent
df81b3e662
commit
d7545b110c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106842
@ -32,6 +32,7 @@
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/memrange.h>
|
||||
#include <sys/smp.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/specialreg.h>
|
||||
@ -60,6 +61,11 @@ static char *mem_owner_bios = "BIOS";
|
||||
|
||||
#define mrcopyflags(curr, new) (((curr) & ~MDF_ATTRMASK) | ((new) & MDF_ATTRMASK))
|
||||
|
||||
static int mtrrs_disabled;
|
||||
TUNABLE_INT("machdep.disable_mtrrs", &mtrrs_disabled);
|
||||
SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RD,
|
||||
&mtrrs_disabled, 0, "Disable i686 MTRRs.");
|
||||
|
||||
static void i686_mrinit(struct mem_range_softc *sc);
|
||||
static int i686_mrset(struct mem_range_softc *sc,
|
||||
struct mem_range_desc *mrd,
|
||||
@ -601,7 +607,7 @@ static void
|
||||
i686_mem_drvinit(void *unused)
|
||||
{
|
||||
/* Try for i686 MTRRs */
|
||||
if ((cpu_feature & CPUID_MTRR) &&
|
||||
if (!mtrrs_disabled && (cpu_feature & CPUID_MTRR) &&
|
||||
((cpu_id & 0xf00) == 0x600 || (cpu_id & 0xf00) == 0xf00) &&
|
||||
((strcmp(cpu_vendor, "GenuineIntel") == 0) ||
|
||||
(strcmp(cpu_vendor, "AuthenticAMD") == 0))) {
|
||||
|
@ -256,6 +256,10 @@
|
||||
|
||||
Disable the use of the PCI BIOS (i386 only)
|
||||
|
||||
set machdep.disable_mtrrs=1
|
||||
|
||||
Disable the use of i686 MTRRs (i386 only)
|
||||
|
||||
set net.inet.tcp.tcbhashsize=<value> TCBHASHSIZE
|
||||
|
||||
Overrides the compile-time set value of TCBHASHSIZE or
|
||||
|
@ -476,6 +476,8 @@ Note that
|
||||
the NBUF parameter will override this limit.
|
||||
Modifies
|
||||
.Va VM_BCACHE_SIZE_MAX .
|
||||
.It Va machdep.disable_mtrrs
|
||||
Disable the use of i686 MTRRs (x86 only).
|
||||
.It Va machdep.pccard.pcic_irq
|
||||
Overrides the IRQ normally assigned to a PCCARD controller.
|
||||
Typically the first available interrupt will be allocated,
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/memrange.h>
|
||||
#include <sys/smp.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/specialreg.h>
|
||||
@ -60,6 +61,11 @@ static char *mem_owner_bios = "BIOS";
|
||||
|
||||
#define mrcopyflags(curr, new) (((curr) & ~MDF_ATTRMASK) | ((new) & MDF_ATTRMASK))
|
||||
|
||||
static int mtrrs_disabled;
|
||||
TUNABLE_INT("machdep.disable_mtrrs", &mtrrs_disabled);
|
||||
SYSCTL_INT(_machdep, OID_AUTO, disable_mtrrs, CTLFLAG_RD,
|
||||
&mtrrs_disabled, 0, "Disable i686 MTRRs.");
|
||||
|
||||
static void i686_mrinit(struct mem_range_softc *sc);
|
||||
static int i686_mrset(struct mem_range_softc *sc,
|
||||
struct mem_range_desc *mrd,
|
||||
@ -601,7 +607,7 @@ static void
|
||||
i686_mem_drvinit(void *unused)
|
||||
{
|
||||
/* Try for i686 MTRRs */
|
||||
if ((cpu_feature & CPUID_MTRR) &&
|
||||
if (!mtrrs_disabled && (cpu_feature & CPUID_MTRR) &&
|
||||
((cpu_id & 0xf00) == 0x600 || (cpu_id & 0xf00) == 0xf00) &&
|
||||
((strcmp(cpu_vendor, "GenuineIntel") == 0) ||
|
||||
(strcmp(cpu_vendor, "AuthenticAMD") == 0))) {
|
||||
|
Loading…
Reference in New Issue
Block a user