Date: Mon, 4 May 1998 04:00:01 -0700 (PDT) From: Luoqi Chen <luoqi@chen.ml.org> To: freebsd-bugs@FreeBSD.ORG Subject: Re: i386/6219: wine causes system crash Message-ID: <199805041100.EAA28536@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/6219; it has been noted by GNATS.
From: Luoqi Chen <luoqi@chen.ml.org>
To: freebsd-gnats-submit@freebsd.org
Cc: Subject: Re: i386/6219: wine causes system crash
Date: Mon, 4 May 1998 06:52:49 -0400 (EDT)
I made some mistake in the patch I submitted. Please use the following patch
instead. -lq
Index: machdep.c
===================================================================
RCS file: /fun/cvs/src/sys/i386/i386/machdep.c,v
retrieving revision 1.294
diff -u -r1.294 machdep.c
--- machdep.c 1998/04/06 15:46:17 1.294
+++ machdep.c 1998/05/04 10:40:30
@@ -768,14 +768,15 @@
u_long stack;
{
struct trapframe *regs = p->p_md.md_regs;
-
-#ifdef USER_LDT
struct pcb *pcb = &p->p_addr->u_pcb;
+#ifdef USER_LDT
/* was i386_user_cleanup() in NetBSD */
if (pcb->pcb_ldt) {
- if (pcb == curpcb)
- lldt(GSEL(GUSERLDT_SEL, SEL_KPL));
+ if (pcb == curpcb) {
+ lldt(_default_ldt);
+ currentldt = _default_ldt;
+ }
kmem_free(kernel_map, (vm_offset_t)pcb->pcb_ldt,
pcb->pcb_ldt_len * sizeof(union descriptor));
pcb->pcb_ldt_len = (int)pcb->pcb_ldt = 0;
@@ -790,6 +791,14 @@
regs->tf_ds = _udatasel;
regs->tf_es = _udatasel;
regs->tf_cs = _ucodesel;
+
+ /* reset %fs and %gs as well */
+ pcb->pcb_fs = _udatasel;
+ pcb->pcb_gs = _udatasel;
+ if (pcb == curpcb) {
+ __asm("mov %0,%%fs" : : "r" (_udatasel));
+ __asm("mov %0,%%gs" : : "r" (_udatasel));
+ }
/*
* Initialize the math emulator (if any) for the current process.
Index: vm_machdep.c
===================================================================
RCS file: /fun/cvs/src/sys/i386/i386/vm_machdep.c,v
retrieving revision 1.105
diff -u -r1.105 vm_machdep.c
--- vm_machdep.c 1998/03/23 19:52:42 1.105
+++ vm_machdep.c 1998/04/14 01:30:21
@@ -703,8 +703,10 @@
#endif
#ifdef USER_LDT
if (pcb->pcb_ldt != 0) {
- if (pcb == curpcb)
- lldt(GSEL(GUSERLDT_SEL, SEL_KPL));
+ if (pcb == curpcb) {
+ lldt(_default_ldt);
+ currentldt = _default_ldt;
+ }
kmem_free(kernel_map, (vm_offset_t)pcb->pcb_ldt,
pcb->pcb_ldt_len * sizeof(union descriptor));
pcb->pcb_ldt_len = (int)pcb->pcb_ldt = 0;
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199805041100.EAA28536>
