All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: john bryant <bryant.johan@gmail.com>,
	Jose Renato G Santos <joserenato.santos@hp.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	"xen-users@lists.xensource.com" <xen-users@lists.xensource.com>,
	"oprofile-list@lists.sourceforge.net"
	<oprofile-list@lists.sourceforge.net>
Subject: RE: general protection fault: 0000 [#1]
Date: Thu, 06 Mar 2008 08:42:16 +0000	[thread overview]
Message-ID: <47CFBC78.76E4.0078.0@novell.com> (raw)
In-Reply-To: <C7B67062D31B9E459128006BAAD0DC3D0753E5C76E@G6W0269.americas.hpqcorp.net>

Actually, it's not exactly that way - as long as an MSR can be read by
Xen (i.e. is implemented), guests are permitted to read them (see the
default case in the rdmsr handling part of emulate_privileged_op().

However, I have a hard time understanding what need profiling code
would have to access MSR 0x119 (which, according to my docs, is
PentiumPro/II/III specific).

Jan

>>> "Santos, Jose Renato G" <joserenato.santos@hp.com> 05.03.08 19:12 >>>
No. In Xen, kernel and modules for PV guests run in ring 1, Xen provide virtualization for some MSRs enabling access to them from ring 1, but this is not available for performance counter MSRs. For OProfile we have a Xen component (xenoprof) that acess the performance counters. Oprofile kernel module for Xen is modified to  use hypercalls in order to get the performance counters programmed instead of accessing MSRs directly.

Regards

Renato
________________________________
From: oprofile-list-bounces@lists.sourceforge.net [mailto:oprofile-list-bounces@lists.sourceforge.net] On Behalf Of john bryant
Sent: Wednesday, March 05, 2008 8:14 AM
To: xen-users@lists.xensource.com; xen-devel@lists.xensource.com; oprofile-list@lists.sourceforge.net 
Subject: general protection fault: 0000 [#1]

hi,

I have written a small kernel module to profile an event in xen. When i invoke "rdmsr", I get general protection error. As far as i understand, any kernel module is in CPL0, then rdmsr should work in kernel module. Any help ?  Below is log from syslog

-John

general protection fault: 0000 [#1]
SMP
Modules linked in: hello_printk autofs4 hidp l2cap bluetooth sunrpc ipv6 binfmt_misc dm_mirror dm_multipath dm_mod video thermal processor fan container button battery ac lp nvram tsdev evdev i2c_i801 i2c_core piix tg3 r8169 parport_pc parport serio_raw serial_core usbhid rtc ahci libata shpchp pci_hotplug ext3 jbd ehci_hcd ohci_hcd uhci_hcd usbcore
CPU:    0
EIP:    0061:[<ee07e023>]    Not tainted VLI
EFLAGS: 00010296   (2.6.16.33-xen #337)
EIP is at hello_init+0x23/0x8d [hello_printk]
eax: 00000000   ebx: 00000119   ecx: 00000119   edx: ff1bbfb4
esi: d9de86b0   edi: d9de8400   ebp: d9de86d8   esp: d9eafe1c
ds: 007b   es: 007b   ss: 0069
Process insmod (pid: 11521, threadinfo=d9eae000 task=c0713030)
Stack: <0>ee1df034 ca680746 0000b06e c0135f05 c013d301 ee1df400 d9de86b0 d9de8400
       c0137381 ee1df448 c03916c1 ee1df40c 00000000 00000008 00000003 00000000
       ee1df40c ee1df448 ee1df400 00000000 00000000 00000000 00000000 00000000
Call Trace:
 [<c0135f05>] __link_module+0x0/0x1f
 [<c013d301>] stop_machine_run+0x2e/0x34
 [<c0137381>] sys_init_module+0x13e/0x1afb
 [<c011e45a>] printk+0x0/0x1f
 [<c0162dc1>] do_sync_read+0xc3/0xff
 [<c0130e9e>] autoremove_wake_function+0x0/0x37
 [<c01540e7>] do_brk+0x21b/0x220
 [<c01c4ca4>] _atomic_dec_and_lock+0x40/0x5c
 [<c0179452>] dput+0xc3/0x12a
 [<c0163fe5>] __fput+0x137/0x18c
 [<c017d1e0>] mntput_no_expire+0x13/0x6c
 [<c0105289>] syscall_call+0x7/0xb
Code:  Bad EIP value.

  parent reply	other threads:[~2008-03-06  8:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-05 16:13 general protection fault: 0000 [#1] john bryant
2008-03-05 18:12 ` Santos, Jose Renato G
2008-03-05 19:04   ` john bryant
2008-03-05 20:13     ` Santos, Jose Renato G
2008-03-06  0:51       ` john bryant
2008-03-06  8:42   ` Jan Beulich [this message]
2008-03-06  9:31     ` Keir Fraser
2008-03-09  2:50       ` about network live connection during migration tgh
2008-03-09  9:28         ` Daniel Stodden
2008-03-10  9:50           ` tgh
2008-03-09  6:56       ` arp reply for migration tgh
2008-03-09  9:41         ` Daniel Stodden
2008-03-06 17:25     ` RE: general protection fault: 0000 [#1] Santos, Jose Renato G

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47CFBC78.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=bryant.johan@gmail.com \
    --cc=joserenato.santos@hp.com \
    --cc=oprofile-list@lists.sourceforge.net \
    --cc=xen-devel@lists.xensource.com \
    --cc=xen-users@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.