From owner-freebsd-hackers Thu Dec 6 10:14:43 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from uis.umassp.edu (uis.umassp.edu [192.195.196.232]) by hub.freebsd.org (Postfix) with ESMTP id 89DB437B43A for ; Thu, 6 Dec 2001 10:14:32 -0800 (PST) Received: from tull.umassp.edu ([208.131.192.92]) by uis.umassp.edu (Netscape Messaging Server 3.6) with ESMTP id AAA7F6; Thu, 6 Dec 2001 13:14:17 -0500 Received: from tull.umassp.edu (localhost [127.0.0.1]) by localhost (8.12.0.Beta7/8.12.0.Beta7/Debian 8.12.0.Beta7-1) with ESMTP id fB6IDwtu008890; Thu, 6 Dec 2001 13:13:58 -0500 Received: from localhost (bri@localhost) by tull.umassp.edu (8.12.0.Beta7/8.12.0.Beta7/Debian 8.12.0.Beta7-1) with ESMTP id fB6IDu7J008886; Thu, 6 Dec 2001 13:13:57 -0500 Date: Thu, 6 Dec 2001 13:13:55 -0500 (EST) From: "Brian S. Julin" To: Nicolas Souchu Cc: freebsd-hackers@freebsd.org, KGI Devel Subject: Re: kld VM pager In-Reply-To: <20011206164253.J13566@cedar.alcove-fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'll take a shot at qualifying what is is that KGI wants: Yes, we definitely want page-fault handlers if we can possibly get them: 1) For fossil cards where the aperture is smaller than the VRAM, with impossible-or-dangerous-to-expose-to-userpace aperture control. Also this provides naive applications with often desired contiguous direct buffer access. 2) For fossil planar mode cards with dangerous-to-expose-to-userspace plane-mask controls, to allow for direct access to different planes/plane-masks such that naive applications need not explicitly use an IOCTL to set the plane masks. * 3) For resources of lower access privilage which are move around inside an aperture of higher privilage (e.g. if an area of VRAM controlled by a normal application must be relocated in VRAM by a session leader.) 4) For policing access to RAM, usually DMA-capable RAM, such that the application can write accelerator commands to a page and submit the page to the kernel, which then revokes write privilages until the page has been proofread and swapped for a clean page such that it can be executed asyncronously, while the application obliviously continues to write commands. Page faults and blocking behavior are needed in this case in order to provide a ring-buffer-like feel to applications that use the ring-buffer paradigm for command FIFOs, and doubtless they will become useful in implementing a display-list paradigm as well. In a perfect world, a user application would be able to explicitly say where it wants pages mapped (and which command-queue pages are ready for execution) by altering some shared memory that serves as a control interface to the VM, and as long as the application's request is sane, the requested mapping would occur on the next page fault on the existing mapping, explicitly through IOCTL, or asyncronously as desired (obviously we need to work on advisory locking for the VM control/status interface.) The items listed above could all use such a mechanism to acheive secure access, but in addition to that, the sugar of emulated ring buffers and emulated contiguous apertures using page faults are minor technical enhancements that are major API improvements, as they ease porting applications that were coded to graphics systems that had those features. Under Linux a few mods to speed up the VM are needed, as we can demand that the userpace application not attempt anything esoteric under penality of death by the kernel and thus remove some cruft, but basically other than that we can define our own VM fault handler that remaps things as we please... what's the story under FreeBSD? * Why support such cretinous hardware? Laptops. Especially of the non-x86 variety. -- Brian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message