summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-11-11 17:14:26 +0000
committerjhb <jhb@FreeBSD.org>2003-11-11 17:14:26 +0000
commit79be2e97e913be8167bc45e3013288386c4ac2be (patch)
tree9d7448fb3036ea300e78b22d059972b257139eda /sys
parent8ffd3da8754be2635fb1bd8e42c87ecff2dd2ae9 (diff)
downloadFreeBSD-src-79be2e97e913be8167bc45e3013288386c4ac2be.zip
FreeBSD-src-79be2e97e913be8167bc45e3013288386c4ac2be.tar.gz
Disable probing of HTT CPUs by default for the MP Table case. HTT CPUs
should only be used if they are enabled in the BIOS. Now that we support enumerating CPUs using the ACPI MADT, any HTT machine using ACPI should respect the BIOS setting. For HTT machines with ACPI disabled in the kernel, the MPTABLE_FORCE_HTT kernel option can be used to try to probe HTT CPUs like have done in the past for the MP Table case. This option should only be enabled if HTT is enabled in the BIOS.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/mptable.c7
-rw-r--r--sys/conf/options.i3861
-rw-r--r--sys/conf/options.pc981
-rw-r--r--sys/i386/conf/NOTES13
-rw-r--r--sys/i386/i386/mptable.c7
5 files changed, 29 insertions, 0 deletions
diff --git a/sys/amd64/amd64/mptable.c b/sys/amd64/amd64/mptable.c
index 6ddca05..7222748 100644
--- a/sys/amd64/amd64/mptable.c
+++ b/sys/amd64/amd64/mptable.c
@@ -27,6 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_mptable_force_htt.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -159,7 +160,9 @@ static u_char intentry_trigger(int_entry_ptr intr);
static int lookup_bus_type(char *name);
static void mptable_count_items(void);
static void mptable_count_items_handler(u_char *entry, void *arg);
+#ifdef MPTABLE_FORCE_HTT
static void mptable_hyperthread_fixup(u_int id_mask);
+#endif
static void mptable_parse_apics_and_busses(void);
static void mptable_parse_apics_and_busses_handler(u_char *entry,
void *arg);
@@ -297,7 +300,9 @@ mptable_probe_cpus(void)
} else {
cpu_mask = 0;
mptable_walk_table(mptable_probe_cpus_handler, &cpu_mask);
+#ifdef MPTABLE_FORCE_HTT
mptable_hyperthread_fixup(cpu_mask);
+#endif
}
return (0);
}
@@ -781,6 +786,7 @@ mptable_parse_ints(void)
mptable_walk_table(mptable_parse_ints_handler, NULL);
}
+#ifdef MPTABLE_FORCE_HTT
/*
* Perform a hyperthreading "fix-up" to enumerate any logical CPU's
* that aren't already listed in the table.
@@ -837,6 +843,7 @@ mptable_hyperthread_fixup(u_int id_mask)
id_mask &= ~(1 << id);
}
}
+#endif /* MPTABLE_FORCE_HTT */
/*
* Support code for routing PCI interrupts using the MP Table.
diff --git a/sys/conf/options.i386 b/sys/conf/options.i386
index 8289ec5..441f490 100644
--- a/sys/conf/options.i386
+++ b/sys/conf/options.i386
@@ -7,6 +7,7 @@ BROKEN_KEYBOARD_RESET opt_reset.h
COMPAT_OLDISA
I586_PMC_GUPROF opt_i586_guprof.h
MAXMEM
+MPTABLE_FORCE_HTT
NO_MIXED_MODE
PERFMON
DISABLE_PSE opt_pmap.h
diff --git a/sys/conf/options.pc98 b/sys/conf/options.pc98
index 469fb82..b60f228 100644
--- a/sys/conf/options.pc98
+++ b/sys/conf/options.pc98
@@ -7,6 +7,7 @@ BROKEN_KEYBOARD_RESET opt_reset.h
COMPAT_OLDISA
I586_PMC_GUPROF opt_i586_guprof.h
MAXMEM
+MPTABLE_FORCE_HTT
NO_MIXED_MODE
PERFMON
DISABLE_PSE opt_pmap.h
diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES
index 53cb8b2..d41bf3c 100644
--- a/sys/i386/conf/NOTES
+++ b/sys/i386/conf/NOTES
@@ -39,9 +39,22 @@ profile 2
# MP table or MADT may claim to do so. That is why mixed mode is
# enabled by default.
#
+# HTT CPUs should only be used if they are enabled in the BIOS. For
+# the ACPI case, ACPI only correctly tells us about any HTT CPUs if
+# they are enabled. However, most HTT systems do not list HTT CPUs
+# in the MP Table if they are enabled, thus we guess at the HTT CPUs
+# for the MP Table case. However, we shouldn't try to guess and use
+# these CPUs if HTTT is disabled. Thus, HTT guessing is only enabled
+# for the MP Table if the user explicitly asks for it via the
+# MPTABLE_FORCE_HTT option. Do NOT use this option if you have HTT
+# disabled in your BIOS.
+#
# Mandatory:
device apic # I/O apic
+
+# Optional:
+options MPTABLE_FORCE_HTT # Enable HTT CPUs with the MP Table
options NO_MIXED_MODE # Disable use of mixed mode
diff --git a/sys/i386/i386/mptable.c b/sys/i386/i386/mptable.c
index 6ddca05..7222748 100644
--- a/sys/i386/i386/mptable.c
+++ b/sys/i386/i386/mptable.c
@@ -27,6 +27,7 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_mptable_force_htt.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
@@ -159,7 +160,9 @@ static u_char intentry_trigger(int_entry_ptr intr);
static int lookup_bus_type(char *name);
static void mptable_count_items(void);
static void mptable_count_items_handler(u_char *entry, void *arg);
+#ifdef MPTABLE_FORCE_HTT
static void mptable_hyperthread_fixup(u_int id_mask);
+#endif
static void mptable_parse_apics_and_busses(void);
static void mptable_parse_apics_and_busses_handler(u_char *entry,
void *arg);
@@ -297,7 +300,9 @@ mptable_probe_cpus(void)
} else {
cpu_mask = 0;
mptable_walk_table(mptable_probe_cpus_handler, &cpu_mask);
+#ifdef MPTABLE_FORCE_HTT
mptable_hyperthread_fixup(cpu_mask);
+#endif
}
return (0);
}
@@ -781,6 +786,7 @@ mptable_parse_ints(void)
mptable_walk_table(mptable_parse_ints_handler, NULL);
}
+#ifdef MPTABLE_FORCE_HTT
/*
* Perform a hyperthreading "fix-up" to enumerate any logical CPU's
* that aren't already listed in the table.
@@ -837,6 +843,7 @@ mptable_hyperthread_fixup(u_int id_mask)
id_mask &= ~(1 << id);
}
}
+#endif /* MPTABLE_FORCE_HTT */
/*
* Support code for routing PCI interrupts using the MP Table.
OpenPOWER on IntegriCloud