This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: regarding privilege levels of pentium 4
- From: ArtÅras Moskvinas <arturas dot moskvinas at gmail dot com>
- To: ranjith kumar <ranjit_kumar_b4u at yahoo dot co dot uk>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 01 Oct 2006 01:28:49 +0300
- Subject: Re: regarding privilege levels of pentium 4
- References: <20060930220855.41172.qmail@web27405.mail.ukl.yahoo.com>
> --- Sven Eschenberg <eschenb@cs.uni-frankfurt.de>
> wrote:
>
>> Hi Ranjith,
>>
>> I might be wrong on this, but I think the question
>> is, if the Operating
>> System permits it or under which circumstances. It's
>> neither a question
>> of what gcc or the hardware does, but what the OS
>> you are using allows
>> to which processes.
> Thanks. I am sending more details of my problem.
>
> The OS I am using : Linux.
> The language in which the program is written : C(I am
> attaching the program)
> The compiler : gcc 3.2.3
> Processor : Pentium 4
> I know password for root login. I logged in as root
> and compiled my program. When compiled no errors were
> reported. But when I run the program it simply shows
> "Segmentation fault".
>
> My goal is to measure performance parameters (for
> example the number of branch instructions that were
> mispredicted), on Pentium 4, using "RDMSR" and "WRMSR"
> instructions. Also I want to disble interrupts while
> running my program.
> The problem is that those instructions can be run only
> at privilege level zero.
You should consider using Kernel mode linux (kernel recompilation
needed) or write kernel module:
kernel mode linux:
http://web.yl.is.s.u-tokyo.ac.jp/~tosh/kml/
Arturas M.