All of lore.kernel.org
 help / color / mirror / Atom feed
* general protection fault: 0000 [#1]
@ 2008-03-05 16:13 john bryant
  2008-03-05 18:12 ` Santos, Jose Renato G
  0 siblings, 1 reply; 13+ messages in thread
From: john bryant @ 2008-03-05 16:13 UTC (permalink / raw)
  To: xen-users@lists.xensource.com, xen-devel@lists.xensource.com,
	oprofile-list


[-- Attachment #1.1: Type: text/plain, Size: 1743 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 2221 bytes --]

[-- Attachment #2: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #3: Type: text/plain, Size: 170 bytes --]

_______________________________________________
oprofile-list mailing list
oprofile-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: general protection fault: 0000 [#1]
  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-06  8:42   ` Jan Beulich
  0 siblings, 2 replies; 13+ messages in thread
From: Santos, Jose Renato G @ 2008-03-05 18:12 UTC (permalink / raw)
  To: john bryant, xen-users@lists.xensource.com,
	xen-devel@lists.xensource.com, oprofile-list


[-- Attachment #1.1: Type: text/plain, Size: 2585 bytes --]

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.


[-- Attachment #1.2: Type: text/html, Size: 4333 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: general protection fault: 0000 [#1]
  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  8:42   ` Jan Beulich
  1 sibling, 1 reply; 13+ messages in thread
From: john bryant @ 2008-03-05 19:04 UTC (permalink / raw)
  To: Santos, Jose Renato G
  Cc: xen-devel@lists.xensource.com, xen-users@lists.xensource.com,
	oprofile-list@lists.sourceforge.net


[-- Attachment #1.1: Type: text/plain, Size: 3105 bytes --]

Thanks Renato.
I have tried kernel module in normal linux, i still get *"general
protection"* error. Question - Are all kernel modules run in CPL0. For this
particular error, i have taken a traditional "hello world" module and
inserted rdmsr call inside  the init program. So, does it execute in CPL0
(in normal linux) ?

Thanks again
-John

On Wed, Mar 5, 2008 at 1:12 PM, Santos, Jose Renato G <
joserenato.santos@hp.com> wrote:

>  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.
>
>

[-- Attachment #1.2: Type: text/html, Size: 5096 bytes --]

[-- Attachment #2: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #3: Type: text/plain, Size: 170 bytes --]

_______________________________________________
oprofile-list mailing list
oprofile-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: general protection fault: 0000 [#1]
  2008-03-05 19:04   ` john bryant
@ 2008-03-05 20:13     ` Santos, Jose Renato G
  2008-03-06  0:51       ` john bryant
  0 siblings, 1 reply; 13+ messages in thread
From: Santos, Jose Renato G @ 2008-03-05 20:13 UTC (permalink / raw)
  To: john bryant
  Cc: xen-devel@lists.xensource.com, xen-users@lists.xensource.com,
	oprofile-list@lists.sourceforge.net


[-- Attachment #1.1: Type: text/plain, Size: 3685 bytes --]

Yep. Kernel modules are part of the kernel and should run in ring 0 for native Linux.
Renato

________________________________
From: john bryant [mailto:bryant.johan@gmail.com]
Sent: Wednesday, March 05, 2008 11:04 AM
To: Santos, Jose Renato G
Cc: xen-users@lists.xensource.com; xen-devel@lists.xensource.com; oprofile-list@lists.sourceforge.net
Subject: Re: general protection fault: 0000 [#1]

Thanks Renato.
I have tried kernel module in normal linux, i still get "general protection" error. Question - Are all kernel modules run in CPL0. For this particular error, i have taken a traditional "hello world" module and inserted rdmsr call inside  the init program. So, does it execute in CPL0 (in normal linux) ?

Thanks again
-John

On Wed, Mar 5, 2008 at 1:12 PM, Santos, Jose Renato G <joserenato.santos@hp.com<mailto:joserenato.santos@hp.com>> wrote:
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> [mailto: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<mailto:xen-users@lists.xensource.com>; xen-devel@lists.xensource.com<mailto:xen-devel@lists.xensource.com>; oprofile-list@lists.sourceforge.net<mailto: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.



[-- Attachment #1.2: Type: text/html, Size: 6602 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: general protection fault: 0000 [#1]
  2008-03-05 20:13     ` Santos, Jose Renato G
@ 2008-03-06  0:51       ` john bryant
  0 siblings, 0 replies; 13+ messages in thread
From: john bryant @ 2008-03-06  0:51 UTC (permalink / raw)
  To: Santos, Jose Renato G
  Cc: xen-devel@lists.xensource.com, xen-users@lists.xensource.com,
	oprofile-list@lists.sourceforge.net


[-- Attachment #1.1: Type: text/plain, Size: 4425 bytes --]

Thanks again renato.

I have tried playing with xenoprof ( or oprofile). For certain kind of
application, i needed to get accurate information on events; thus need
information from various sources to validate my claims.
I see that rdmsr/wrmsr is virtualized in Xen Guest/Dom0 as they run in ring
1.  If i embed rdpmc- do i need to virtualize it also. My understanding is
that rdpmc is enabled using X86_CR4_PCE bit to be accessed from any ring
(0,1or 3). So, do i need to go through an emulation-path as explained in
following conversation (in Xen forum):
http://lists.xensource.com/archives/html/xen-devel/2007-09/msg00092.html

Thanks

-John

On Wed, Mar 5, 2008 at 3:13 PM, Santos, Jose Renato G <
joserenato.santos@hp.com> wrote:

>  Yep. Kernel modules are part of the kernel and should run in ring 0 for
> native Linux.
> Renato
>
>  ------------------------------
> *From:* john bryant [mailto:bryant.johan@gmail.com]
> *Sent:* Wednesday, March 05, 2008 11:04 AM
> *To:* Santos, Jose Renato G
> *Cc:* xen-users@lists.xensource.com; xen-devel@lists.xensource.com;
> oprofile-list@lists.sourceforge.net
> *Subject:* Re: general protection fault: 0000 [#1]
>
> Thanks Renato.
> I have tried kernel module in normal linux, i still get *"general
> protection"* error. Question - Are all kernel modules run in CPL0. For
> this particular error, i have taken a traditional "hello world" module and
> inserted rdmsr call inside  the init program. So, does it execute in CPL0
> (in normal linux) ?
>
> Thanks again
> -John
>
> On Wed, Mar 5, 2008 at 1:12 PM, Santos, Jose Renato G <
> joserenato.santos@hp.com> wrote:
>
> >  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.
> >
> >
>

[-- Attachment #1.2: Type: text/html, Size: 7657 bytes --]

[-- Attachment #2: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #3: Type: text/plain, Size: 170 bytes --]

_______________________________________________
oprofile-list mailing list
oprofile-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oprofile-list

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: general protection fault: 0000 [#1]
  2008-03-05 18:12 ` Santos, Jose Renato G
  2008-03-05 19:04   ` john bryant
@ 2008-03-06  8:42   ` Jan Beulich
  2008-03-06  9:31     ` Keir Fraser
  2008-03-06 17:25     ` RE: general protection fault: 0000 [#1] Santos, Jose Renato G
  1 sibling, 2 replies; 13+ messages in thread
From: Jan Beulich @ 2008-03-06  8:42 UTC (permalink / raw)
  To: john bryant, Jose Renato G Santos
  Cc: xen-devel@lists.xensource.com, xen-users@lists.xensource.com,
	oprofile-list@lists.sourceforge.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.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: RE: general protection fault: 0000 [#1]
  2008-03-06  8:42   ` Jan Beulich
@ 2008-03-06  9:31     ` Keir Fraser
  2008-03-09  2:50       ` about network live connection during migration tgh
  2008-03-09  6:56       ` arp reply for migration tgh
  2008-03-06 17:25     ` RE: general protection fault: 0000 [#1] Santos, Jose Renato G
  1 sibling, 2 replies; 13+ messages in thread
From: Keir Fraser @ 2008-03-06  9:31 UTC (permalink / raw)
  To: Jan Beulich, Jose Renato G Santos; +Cc: xen-devel@lists.xensource.com

The current let-anyone-RDMSR is pretty dodgy, to be honest. I think we
should whitelist with a default of returning 0 for the contents (rather than
#GP, which would be a bit harsh response for a PV kernel).

 -- Keir

On 6/3/08 08:42, "Jan Beulich" <jbeulich@novell.com> wrote:

> 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).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: RE: general protection fault: 0000 [#1]
  2008-03-06  8:42   ` Jan Beulich
  2008-03-06  9:31     ` Keir Fraser
@ 2008-03-06 17:25     ` Santos, Jose Renato G
  1 sibling, 0 replies; 13+ messages in thread
From: Santos, Jose Renato G @ 2008-03-06 17:25 UTC (permalink / raw)
  To: Jan Beulich, john bryant
  Cc: xen-devel@lists.xensource.com, xen-users@lists.xensource.com,
	oprofile-list@lists.sourceforge.net



> -----Original Message-----
> From: Jan Beulich [mailto:jbeulich@novell.com]
> Sent: Thursday, March 06, 2008 12:42 AM
> To: john bryant; Santos, Jose Renato G
> Cc: oprofile-list@lists.sourceforge.net;
> xen-devel@lists.xensource.com; xen-users@lists.xensource.com
> Subject: [Xen-devel] RE: general protection fault: 0000 [#1]
>
> 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().
>

  To use performance counters you also have to write MSRs, not
  only read them. I am not familiar with MSR emulation in Xen but
  I think it should not allow guests to arbitrary write to them.
  Anyway, I did not know you could actualy read any MSR in Xen.
  Thanks for pointing this out.

> 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).
>

  Most performance counters are model specific, although more recent
  CPUs have now a subset of counters that more general and expected to
  be supported across new models of the same architecture
  (architectural counters)

  Renato


> 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.
>
>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* about network live connection during migration
  2008-03-06  9:31     ` Keir Fraser
@ 2008-03-09  2:50       ` tgh
  2008-03-09  9:28         ` Daniel Stodden
  2008-03-09  6:56       ` arp reply for migration tgh
  1 sibling, 1 reply; 13+ messages in thread
From: tgh @ 2008-03-09  2:50 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel@lists.xensource.com

hi
  I try to understand to the mechanism of live migration, and I read the 
code ,and have some confusion about the network live connection during 
the migration,could you help me, i read the paper about the live 
migration,it explaine that in a single switched LAN,host sends 
unsolicited ARP,and in router case, broadcastARP will not be accecpted 
,and migratedOS need to sends to the interfaces in the ARPcache,while in 
a switched net,migrated OS holds the same MAC address,and network switch 
could detect the change of location,   i am confused about where the 
code for all of these , could you give me some more detailed explanation 
or tell me where the code for these

Thanks in advance

^ permalink raw reply	[flat|nested] 13+ messages in thread

* arp reply for migration
  2008-03-06  9:31     ` Keir Fraser
  2008-03-09  2:50       ` about network live connection during migration tgh
@ 2008-03-09  6:56       ` tgh
  2008-03-09  9:41         ` Daniel Stodden
  1 sibling, 1 reply; 13+ messages in thread
From: tgh @ 2008-03-09  6:56 UTC (permalink / raw)
  To: Keir Fraser, xen-devel

hi
  I read the live migration paper,and in the paper,"...generate an 
unsolicited ARP reply from the migrated host",and which is the migrated 
host? source physical node,or destination physical node,or VM?and i 
guess ,it is destination physical node, is it right? if it is, then when 
is the ARP reply generated ?after the guestOS has been resumed or when ? 
i did not find the code for it ? could you help me

Thanks

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: about network live connection during migration
  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
  0 siblings, 1 reply; 13+ messages in thread
From: Daniel Stodden @ 2008-03-09  9:28 UTC (permalink / raw)
  To: tgh; +Cc: xen-devel@lists.xensource.com

On Sun, 2008-03-09 at 10:50 +0800, tgh wrote:
> hi
>   I try to understand to the mechanism of live migration, and I read the 
> code ,and have some confusion about the network live connection during 
> the migration,could you help me, i read the paper about the live 
> migration,it explaine that in a single switched LAN,host sends 
> unsolicited ARP,and in router case, broadcastARP will not be accecpted 
> ,and migratedOS need to sends to the interfaces in the ARPcache,while in 
> a switched net,migrated OS holds the same MAC address,and network switch 
> could detect the change of location,   i am confused about where the 
> code for all of these , could you give me some more detailed explanation 
> or tell me where the code for these

The unsolicited ARP is generated by the network frontend whenever it is
brought up, as would be the case upon resume. look out for something i
believe is called fake_arp (?) in netfront. This is a very simple
operation, btw.

Unicasting to peers listed in the ARP cache is, to my knowledge, not
performed. I believe the paper just outlines what the alternatives would
look like.

regards,
daniel

-- 
Daniel Stodden
LRR     -      Lehrstuhl für Rechnertechnik und Rechnerorganisation
Institut für Informatik der TU München             D-85748 Garching
http://www.lrr.in.tum.de/~stodden         mailto:stodden@cs.tum.edu
PGP Fingerprint: F5A4 1575 4C56 E26A 0B33  3D80 457E 82AE B0D8 735B

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: arp reply for migration
  2008-03-09  6:56       ` arp reply for migration tgh
@ 2008-03-09  9:41         ` Daniel Stodden
  0 siblings, 0 replies; 13+ messages in thread
From: Daniel Stodden @ 2008-03-09  9:41 UTC (permalink / raw)
  To: tgh; +Cc: xen-devel, Keir Fraser

On Sun, 2008-03-09 at 14:56 +0800, tgh wrote:
> hi
>   I read the live migration paper,and in the paper,"...generate an 
> unsolicited ARP reply from the migrated host",and which is the migrated 
> host? source physical node,or destination physical node,or VM?and i 
> guess ,it is destination physical node, is it right? if it is, then when 
> is the ARP reply generated ?after the guestOS has been resumed or when ? 
> i did not find the code for it ? could you help me

It is certainly sent fron the destination host, i.e. after migration.

The purpose is to let peers (i.e. hosts to which connections (e.g. on
the ip layer) are maintained across the migration phase) know that the
destination hardware address (i.e. on the mac layer) has changed. 

Even if you don't change the mac address, as the paper suggests, you
would still need to send -something- in order to let switches learn that
the migrated guest has been moved to a different physical port on that
switch.

If you don't understand this, I suggest to get yourself a book on the
topic. See e.g. page 62 in

http://books.google.com/books?id=-btNds68w84C

regards,
daniel

-- 
Daniel Stodden
LRR     -      Lehrstuhl für Rechnertechnik und Rechnerorganisation
Institut für Informatik der TU München             D-85748 Garching
http://www.lrr.in.tum.de/~stodden         mailto:stodden@cs.tum.edu
PGP Fingerprint: F5A4 1575 4C56 E26A 0B33  3D80 457E 82AE B0D8 735B

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: about network live connection during migration
  2008-03-09  9:28         ` Daniel Stodden
@ 2008-03-10  9:50           ` tgh
  0 siblings, 0 replies; 13+ messages in thread
From: tgh @ 2008-03-10  9:50 UTC (permalink / raw)
  To: Daniel Stodden; +Cc: xen-devel@lists.xensource.com

Thank you
and you say ,"The unsolicited ARP is generated by the network frontend 
whenever it is brought up, as would be the case upon resume."
that is , the guestos should be aware of its suspend-and-resume ,but xen 
maybe support the transparent migration for the guestos, that is ,the 
guestos does not know itself has been suspended ,is it?

but may be some action did the same thing  in the net backend, is it ?
and fake_arp() has not been found, it is helpful ,even though ,i have 
not found the code

could you or someone help me
i am still interested in the  code  for  sending  The unsolicited ARP 
after migration

Thanks


 

Daniel Stodden 写道:
> On Sun, 2008-03-09 at 10:50 +0800, tgh wrote:
>   
>> hi
>>   I try to understand to the mechanism of live migration, and I read the 
>> code ,and have some confusion about the network live connection during 
>> the migration,could you help me, i read the paper about the live 
>> migration,it explaine that in a single switched LAN,host sends 
>> unsolicited ARP,and in router case, broadcastARP will not be accecpted 
>> ,and migratedOS need to sends to the interfaces in the ARPcache,while in 
>> a switched net,migrated OS holds the same MAC address,and network switch 
>> could detect the change of location,   i am confused about where the 
>> code for all of these , could you give me some more detailed explanation 
>> or tell me where the code for these
>>     
>
> The unsolicited ARP is generated by the network frontend whenever it is
> brought up, as would be the case upon resume. look out for something i
> believe is called fake_arp (?) in netfront. This is a very simple
> operation, btw.
>
> Unicasting to peers listed in the ARP cache is, to my knowledge, not
> performed. I believe the paper just outlines what the alternatives would
> look like.
>
> regards,
> daniel
>
>   

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-03-10  9:50 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.