From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 2 21:43:44 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0374E16A4B3 for ; Thu, 2 Oct 2003 21:43:44 -0700 (PDT) Received: from arginine.spc.org (arginine.spc.org [195.206.69.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD52943FEA for ; Thu, 2 Oct 2003 21:43:41 -0700 (PDT) (envelope-from bms@spc.org) Received: from localhost (localhost [127.0.0.1]) by arginine.spc.org (Postfix) with ESMTP id C893D654DF; Fri, 3 Oct 2003 05:43:40 +0100 (BST) Received: from arginine.spc.org ([127.0.0.1]) by localhost (arginine.spc.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 90345-02-3; Fri, 3 Oct 2003 05:43:40 +0100 (BST) Received: from saboteur.dek.spc.org (unknown [81.3.72.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by arginine.spc.org (Postfix) with ESMTP id 155F5654DD; Fri, 3 Oct 2003 05:43:40 +0100 (BST) Received: by saboteur.dek.spc.org (Postfix, from userid 1001) id 8FB9231; Fri, 3 Oct 2003 05:43:35 +0100 (BST) Date: Fri, 3 Oct 2003 05:43:35 +0100 From: Bruce M Simpson To: Grumble Message-ID: <20031003044335.GI5194@saboteur.dek.spc.org> Mail-Followup-To: Grumble , freebsd-hackers@freebsd.org References: <3F7C209F.7000205@kma.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F7C209F.7000205@kma.eu.org> cc: freebsd-hackers@freebsd.org Subject: Re: Why is PCE not set in CR4? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2003 04:43:44 -0000 On Thu, Oct 02, 2003 at 02:57:03PM +0200, Grumble wrote: > Is vm86 related to virtual-8086 mode? Probably not... What does vm86 > stand for? Virtual machine? vm86 is something of a catchall for vm86-related functions. One of the things it implements is a means of getting in and out of Virtual 8086 mode from a userland process. doscmd(1) uses this, as does my s3switch port for getting into an S3 card's video BIOS to execute the functions required to enable the video-out port. A few other knobs exist in there for dealing with i386-specific things, such as permitting access to an IO port range for a user process (by changing the appropriate state in the TSS). > I am tempted to remove perfmon from the kernel, and write a kernel > module for Athlon and another one for NetBurst. I would ask you to please consider patching perfmon to do what you need it to do. > Can a kernel module catch #UD (Invalid Opcode) and #GP (General > Protection) exceptions generated from within the kernel module > itself? Can I use sigaction(2)? > Can a kernel module catch a specific #GP exception generated from > user land? Can I register a signal handler with sigaction(2)? What'll happen is that DDB will most likely catch the exception, unless you specifically patch trap.c to catch those exceptions. You should also look at the special exception handlers in identcpu.c. > BTW, are performance-monitoring counters saved and restored on a > context switch? Look at i386's definition of cpu_switch(). You'll need to find some unused space in the TSS and do it yourself. BMS