Hi everyon, I am new to Xen Development, so I don''t know if it is a bug or my lack of knowledge regarding Xen dev. I am running Fedora 16 x86-64 XFCE with the latest xen unstable and when I run the following code the machine reboots. #include <xenctrl.h> int main(int argc, char **argv) { xc_interface *xch; xch = xc_interface_open(NULL, NULL, 0); printf("version: %d\n", xc_gnttab_get_version(xch, 1)); xc_interface_close(xch); return 0; } Can anyone help? Thank you for your time. Cheers, Francisco
On Thu, 2012-01-26 at 12:04 +0000, Francisco Rocha wrote:> Hi everyon, > > I am new to Xen Development, so I don''t know if it is a bug or my lack of knowledge regarding Xen dev. > > I am running Fedora 16 x86-64 XFCE with the latest xen unstable and when I run the following code the machine reboots.Ouch, it certainly shouldn''t do that! Do you get any serial console message or stack trace etc? You might find it helpful to pass the "noreboot" option on the hypervisor command line so that you have a chance to see the error message. Ian.> > #include <xenctrl.h> > > > int main(int argc, char **argv) > { > xc_interface *xch; > xch = xc_interface_open(NULL, NULL, 0); > > printf("version: %d\n", xc_gnttab_get_version(xch, 1)); > > xc_interface_close(xch); > > return 0; > } > > Can anyone help? Thank you for your time. > > Cheers, > Francisco > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel
I have set the noreboot option for Xen and it does not reboot but the machine freezes. I am unable to get output. Which logs should I check? Thank you, Francisco ________________________________________ From: Ian Campbell [Ian.Campbell@citrix.com] Sent: 01 February 2012 14:36 To: Francisco Rocha Cc: xen-devel@lists.xensource.com Subject: Re: [Xen-devel] xc_gnttab_get_version question/bug On Thu, 2012-01-26 at 12:04 +0000, Francisco Rocha wrote:> Hi everyon, > > I am new to Xen Development, so I don''t know if it is a bug or my lack of knowledge regarding Xen dev. > > I am running Fedora 16 x86-64 XFCE with the latest xen unstable and when I run the following code the machine reboots.Ouch, it certainly shouldn''t do that! Do you get any serial console message or stack trace etc? You might find it helpful to pass the "noreboot" option on the hypervisor command line so that you have a chance to see the error message. Ian.> > #include <xenctrl.h> > > > int main(int argc, char **argv) > { > xc_interface *xch; > xch = xc_interface_open(NULL, NULL, 0); > > printf("version: %d\n", xc_gnttab_get_version(xch, 1)); > > xc_interface_close(xch); > > return 0; > } > > Can anyone help? Thank you for your time. > > Cheers, > Francisco > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel
Please do not top post. On Tue, 2012-02-14 at 12:30 +0000, Francisco Rocha wrote:> I have set the noreboot option for Xen and it does not reboot but the machine freezes. > I am unable to get output. Which logs should I check?It might be that a serial console is needed to actually see anything. "console=vga,keep" might also help. However I just tried your test program and got: (XEN) Assertion ''!in_atomic()'' failed at softirq.c:61 (XEN) ----[ Xen-4.2-unstable x86_64 debug=y Not tainted ]---- (XEN) CPU: 2 (XEN) RIP: e008:[<ffff82c4801254ff>] do_softirq+0xd/0x28 (XEN) RFLAGS: 0000000000010202 CONTEXT: hypervisor (XEN) rax: 0000000000000001 rbx: ffff8300dffb8000 rcx: ffff82c4802d0800 (XEN) rdx: 0000003c9f1bc680 rsi: 0000000000000000 rdi: 0000000000000001 (XEN) rbp: ffff83011f4aff08 rsp: ffff83011f4aff08 r8: 00000000deadbeef (XEN) r9: 00000000deadbeef r10: 00000000deadbeef r11: 0000000000000000 (XEN) r12: 0000000000000000 r13: 0000000000000000 r14: 0000000000000000 (XEN) r15: 0000000000000000 cr0: 000000008005003b cr4: 00000000000026f0 (XEN) cr3: 000000011f45e000 cr2: 00000000de567a64 (XEN) ds: 007b es: 007b fs: 00d8 gs: 0000 ss: 0000 cs: e008 (XEN) Xen stack trace from rsp=ffff83011f4aff08: (XEN) 00007cfee0b500c7 ffff82c480220f16 0000000000000000 0000000000000000 (XEN) 0000000000000000 0000000000000000 00000000dfc75f90 00000000deadbeef (XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000 (XEN) 0000000000000000 00000000deadbeef 00000000c10082c0 0000000000000002 (XEN) 0000000000000000 0000010000000000 00000000c10023a7 0000000000000061 (XEN) 0000000000000246 00000000dfc75f80 0000000000000069 000000000000beef (XEN) 000000000000beef 000000000000beef 000000000000beef 0000000000000002 (XEN) ffff8300dffb8000 0000003c9f1bc680 0000000000000000 (XEN) Xen call trace: (XEN) [<ffff82c4801254ff>] do_softirq+0xd/0x28 (XEN) (XEN) (XEN) **************************************** (XEN) Panic on CPU 2: (XEN) Assertion ''!in_atomic()'' failed at softirq.c:61 (XEN) **************************************** (XEN) (XEN) Manual reset required (''noreboot'' specified) I''ve no idea where this might be coming from though.
On Tue, 2012-02-14 at 12:44 +0000, Ian Campbell wrote:> I''ve no idea where this might be coming from though.Turns out I do... The following fixes it for me. Ought to be backported IMHO. Ian. # HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1329223776 0 # Node ID 86ebf7589758da1d026175ac46b3f9bda75f0937 # Parent 43f94d0d384b1c00b5d8fc9a90d6d48165cd854d xen: add missing unlock from gnttab_get_version Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reported-by: Francisco Rocha <f.e.liberal-rocha@newcastle.ac.uk> diff -r 43f94d0d384b -r 86ebf7589758 xen/common/grant_table.c --- a/xen/common/grant_table.c Tue Feb 14 12:40:13 2012 +0000 +++ b/xen/common/grant_table.c Tue Feb 14 12:49:36 2012 +0000 @@ -2321,6 +2321,8 @@ gnttab_get_version(XEN_GUEST_HANDLE(gntt op.version = d->grant_table->gt_version; spin_unlock(&d->grant_table->lock); + rcu_unlock_domain(d); + if ( copy_to_guest(uop, &op, 1) ) return -EFAULT;
________________________________________ From: Ian Campbell [Ian.Campbell@citrix.com] Sent: 14 February 2012 12:52 To: Francisco Rocha Cc: xen-devel@lists.xensource.com; Keir (Xen.org) Subject: Re: [Xen-devel] xc_gnttab_get_version question/bug On Tue, 2012-02-14 at 12:44 +0000, Ian Campbell wrote:> I''ve no idea where this might be coming from though.Turns out I do... The following fixes it for me. Ought to be backported IMHO. Ian. Thank you, it also solves the problem for me. Francisco # HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1329223776 0 # Node ID 86ebf7589758da1d026175ac46b3f9bda75f0937 # Parent 43f94d0d384b1c00b5d8fc9a90d6d48165cd854d xen: add missing unlock from gnttab_get_version Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Reported-by: Francisco Rocha <f.e.liberal-rocha@newcastle.ac.uk> diff -r 43f94d0d384b -r 86ebf7589758 xen/common/grant_table.c --- a/xen/common/grant_table.c Tue Feb 14 12:40:13 2012 +0000 +++ b/xen/common/grant_table.c Tue Feb 14 12:49:36 2012 +0000 @@ -2321,6 +2321,8 @@ gnttab_get_version(XEN_GUEST_HANDLE(gntt op.version = d->grant_table->gt_version; spin_unlock(&d->grant_table->lock); + rcu_unlock_domain(d); + if ( copy_to_guest(uop, &op, 1) ) return -EFAULT;