Re: exception handling in kernel code

2006-08-23 Thread Stanislav Sedov
On Tue, 22 Aug 2006 12:36:40 +0200 "Attilio Rao" <[EMAIL PROTECTED]> mentioned: > > Mmm, I think that a better approach would be refering to different > MSRs tables for pentium, p6 and Pentium 4 (if I remind correctly they > are which show differences). It is more extensible, portable and > possib

Re: exception handling in kernel code

2006-08-22 Thread Attilio Rao
2006/8/14, Stanislav Sedov <[EMAIL PROTECTED]>: On Mon, 14 Aug 2006 09:32:57 -0400 John Baldwin <[EMAIL PROTECTED]> mentioned: > > You can make use of pcb_onfault to recover from a page fault, but that's > about it. Kernel code is expected to not generate exceptions. :) > Thanks a lot! I'll try

Re: exception handling in kernel code

2006-08-16 Thread Stanislav Sedov
Ok, I've finally done it. The module itself is located at http://mbsd.msk.ru/dist/msr-0.1.tar.bz2 port - http://mbsd.msk.ru/dist/devmsr.tar.bz2 Port PR - ports/102158 Now we can use x86info to get all available information about cpu. I could not test amd64 and smp version, so any information (su

Re: exception handling in kernel code

2006-08-15 Thread John Baldwin
On Tuesday 15 August 2006 03:43, Kostik Belousov wrote: > On Mon, Aug 14, 2006 at 11:12:23PM +0600, Stanislav Sedov wrote: > > On Mon, 14 Aug 2006 11:15:22 -0700 > > John-Mark Gurney <[EMAIL PROTECTED]> mentioned: > > > > > > You should make a MD API for reading these out (if one doesn't already >

Re: exception handling in kernel code

2006-08-15 Thread Kostik Belousov
On Mon, Aug 14, 2006 at 11:12:23PM +0600, Stanislav Sedov wrote: > On Mon, 14 Aug 2006 11:15:22 -0700 > John-Mark Gurney <[EMAIL PROTECTED]> mentioned: > > > > You should make a MD API for reading these out (if one doesn't already > > exist) that handle the faulting for you, and then have your dri

Re: exception handling in kernel code

2006-08-14 Thread John-Mark Gurney
Stanislav Sedov wrote this message on Mon, Aug 14, 2006 at 23:12 +0600: > On Mon, 14 Aug 2006 11:15:22 -0700 > John-Mark Gurney <[EMAIL PROTECTED]> mentioned: > > > > You should make a MD API for reading these out (if one doesn't already > > exist) that handle the faulting for you, and then have y

Re: exception handling in kernel code

2006-08-14 Thread Stanislav Sedov
On Mon, 14 Aug 2006 11:15:22 -0700 John-Mark Gurney <[EMAIL PROTECTED]> mentioned: > > You should make a MD API for reading these out (if one doesn't already > exist) that handle the faulting for you, and then have your driver hook > into this api... > > I had to do something similar for accessin

Re: exception handling in kernel code

2006-08-14 Thread John Baldwin
On Monday 14 August 2006 09:47, Stanislav Sedov wrote: > On Mon, 14 Aug 2006 09:32:57 -0400 > John Baldwin <[EMAIL PROTECTED]> mentioned: > > > > You can make use of pcb_onfault to recover from a page fault, but that's > > about it. Kernel code is expected to not generate exceptions. :) > > > >

Re: exception handling in kernel code

2006-08-14 Thread John-Mark Gurney
Stanislav Sedov wrote this message on Mon, Aug 14, 2006 at 19:47 +0600: > I've implemented driver to allow user-level code to read MSRs (Model > specific registers) (like linux's /dev/cpu/msr). It's required for > some programs like x86info. > > As long as not all MSRs documented and reading/writi

Re: exception handling in kernel code

2006-08-14 Thread Stanislav Sedov
On Mon, 14 Aug 2006 09:32:57 -0400 John Baldwin <[EMAIL PROTECTED]> mentioned: > > You can make use of pcb_onfault to recover from a page fault, but that's > about it. Kernel code is expected to not generate exceptions. :) > Thanks a lot! I'll try it. To clarify: I've implemented driver to al

Re: exception handling in kernel code

2006-08-14 Thread John Baldwin
On Monday 14 August 2006 02:46, Stanislav Sedov wrote: > Hi! > > I'm trying to write kernel code where exceptions are unavoidable. > To clarify , I need to recover after GP (general protection) exception > on i386 cpu and return an error in that case. > Unfortunately, looking in trap.c kernel code

exception handling in kernel code

2006-08-14 Thread Stanislav Sedov
Hi! I'm trying to write kernel code where exceptions are unavoidable. To clarify , I need to recover after GP (general protection) exception on i386 cpu and return an error in that case. Unfortunately, looking in trap.c kernel code I can't find any exception handling mechanism except inserting hoo