Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Oct 2003 05:43:35 +0100
From:      Bruce M Simpson <bms@spc.org>
To:        Grumble <invalid@kma.eu.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Why is PCE not set in CR4?
Message-ID:  <20031003044335.GI5194@saboteur.dek.spc.org>
In-Reply-To: <3F7C209F.7000205@kma.eu.org>
References:  <3F7C209F.7000205@kma.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031003044335.GI5194>