diff options
author | Mike Smith <msmith@FreeBSD.org> | 1998-08-18 07:47:12 +0000 |
---|---|---|
committer | Mike Smith <msmith@FreeBSD.org> | 1998-08-18 07:47:12 +0000 |
commit | 287e61c39fb0133a57095482898b40905f19fb84 (patch) | |
tree | aa054c200e9c52df01fbb8f2a1cb1bfd8693b8be /sys/kern/subr_smp.c | |
parent | 95332616afd04cc0fa5a570cfb6b6015e25ffc87 (diff) | |
download | src-287e61c39fb0133a57095482898b40905f19fb84.tar.gz src-287e61c39fb0133a57095482898b40905f19fb84.zip |
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>
Notes
Notes:
svn path=/head/; revision=38422
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 805274054baa..d36835d6f2ec 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); |