diff options
author | msmith <msmith@FreeBSD.org> | 1998-08-18 07:47:12 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-08-18 07:47:12 +0000 |
commit | 95c3baa7ee4b5dd88be242a814c7fbe0c238c5e1 (patch) | |
tree | fe45982843022a23d3080db53e654e3e1426b6a7 /sys/kern/subr_smp.c | |
parent | 5bb2852b1133eb81dde95b08b0e5bc7272f7b62f (diff) | |
download | FreeBSD-src-95c3baa7ee4b5dd88be242a814c7fbe0c238c5e1.zip FreeBSD-src-95c3baa7ee4b5dd88be242a814c7fbe0c238c5e1.tar.gz |
Presently there is only one `currentldt' variable for all cpus
in a SMP system. Unexpected things could happen if each cpu
has a different ldt setting and one cpu tries to use value
of currentldt set by another cpu.
The fix is to move currentldt to the per-cpu area. It includes
patches I filed in PR i386/6219 which are also user ldt related.
PR: i386/7591, i386/6219
Submitted by: Luoqi Chen <luoqi@watermarkgroup.com>
Diffstat (limited to 'sys/kern/subr_smp.c')
-rw-r--r-- | sys/kern/subr_smp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/subr_smp.c b/sys/kern/subr_smp.c index 8052740..d36835d 100644 --- a/sys/kern/subr_smp.c +++ b/sys/kern/subr_smp.c @@ -22,12 +22,13 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: mp_machdep.c,v 1.76 1998/05/17 22:12:08 tegge Exp $ + * $Id: mp_machdep.c,v 1.77 1998/08/16 00:41:40 bde Exp $ */ #include "opt_smp.h" #include "opt_vm86.h" #include "opt_cpu.h" +#include "opt_user_ldt.h" #ifdef SMP #include <machine/smptests.h> @@ -466,6 +467,9 @@ init_secondary(void) lgdt(&r_gdt); /* does magic intra-segment return */ lidt(&r_idt); lldt(_default_ldt); +#ifdef USER_LDT + currentldt = _default_ldt; +#endif my_tr = NGDT + cpuid; gsel_tss = GSEL(my_tr, SEL_KPL); |