From owner-freebsd-bugs Fri Apr 30 9:10:20 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 8255F1588C for ; Fri, 30 Apr 1999 09:10:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id JAA64930; Fri, 30 Apr 1999 09:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Fri, 30 Apr 1999 09:10:03 -0700 (PDT) Message-Id: <199904301610.JAA64930@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Luoqi Chen Subject: Re: kern/11287: rfork(RFMEM...) doesn't share LDTs set by i386_set_ldt, breaking wine Reply-To: Luoqi Chen Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/11287; it has been noted by GNATS. From: Luoqi Chen To: freebsd-gnats-submit@freebsd.org, nox@jelal.kn-bremen.de Cc: Subject: Re: kern/11287: rfork(RFMEM...) doesn't share LDTs set by i386_set_ldt, breaking wine Date: Fri, 30 Apr 1999 12:05:13 -0400 User LDT sharing should really be done in the machine dependent layer. I have an implementation based on -current (I don't have any machine running -stable), you may want to take a look at, the patch is at http://www.freebsd.org/~luoqi There are still two problems with this implementation: - It is incomplete for SMP. We need something similar to TLB shootdown when modifying the ldt table. - It doesn't work correctly in the following case: 1. process A initially doesn't have a user ldt table 2. process A forks process B (RFMEM) 3. process B calls i386_set_ldt() now process B has a user ldt table, but inaccessible to A. I can see 3 solutions to this problem: 1. Allocate a user ldt table for all processes. This is not really an acceptable solution, it penalize everyone else for the benefit of a few. 2. Define another rfork flag RFLDT. The problem with solution is the flag is too machine-specific. 3. Any process wants to share user ldt with its descendants should call i386_set_ldt() prior to any fork. This is a workaround in the user application, but should work well. -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message