gdbsx - xg_attach:Unable to pause domain:1; failed to attach to domain:1 errno:13
Hi Mukesh:
I tried your gdbsx stub but hit a couple errors.
I didn't find an explanation with google; nor on the xen-devel mailing list yet. Thought I'd ask ya.
I installed Ubuntu-14.04 Server with OpenXenManager on my Xenon workstation and have A Xenon blade also with Ubunto-14.04 and OpenXen. Seems to run about the same on both Machines.
This afternoon I pulled the Xen source with git from xenbits.xen.org and build it.
The version of gdbsx that I built on my workstation is having problems attaching to Domain-0. I tried this on the host. Do I need to create a shell to a Domain-0 instance or something?
root@piet-openxen:~# ./gdbsx -c 1 64
ERROR:xg_attach:Unable to pause domain:1
ERROR: failed to attach to domain:1 errno:13 [Permission Denied] root@piet-openxen:~# xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 14734 12 r----- 8562.9
New_PV_Driver 1 1023 4 -b---- 50.3
root@piet-openxen:~#root@piet-openxen-blade:~# xl pause 1
root@piet-openxen-blade:~# ./gdbsx -a 1 32 9999
ERROR:xg_attach:Unable to pause domain:1
ERROR: failed to attach to domain:1 errno:13 [Permission Denied] root@piet-openxen-blade:~# xl list
Name ID Mem VCPUs State Time(s)
Domain-0 0 14734 12 r----- 8651.7
New_PV_Driver 1 1023 4 --p--- 242.8
root@piet-openxen-blade:~# root@piet-openxen-blade:~# ./gdbsx -a 1 32 9999 -d
xg_init:E
xg_init:X:fd:3
xg_attach:E:domid:1
_check_hyp:XENCAPS:xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
ERROR:xg_attach:Unable to pause domain:1
ERROR: failed to attach to domain:1 errno:13
root@piet-openxen-blade:~#-piet
--
Pete/Piet Delaney
O: +1 408 935-1813
C: +1 408 646-8557
H: +1 408 243-8872
Home Email: [email protected]<mailto:[email protected]>
[Unity_Email_Sig]
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 10 lines · On Tue, 26 Aug 2014 02:14:30 +0000 Pete Delaney <[email protected]>…
Hi Mukesh:
I tried your gdbsx stub but hit a couple errors.
I didn't find an explanation with google; nor on the xen-devel mailing list yet. Thought I'd ask ya.I installed Ubuntu-14.04 Server with OpenXenManager on my Xenon workstation and have A Xenon blade also with Ubunto-14.04 and OpenXen. Seems to run about the same on both Machines.
Quoted 6 lines
This afternoon I pulled the Xen source with git from xenbits.xen.org and build it.
The version of gdbsx that I built on my workstation is having problems attaching to Domain-0. I tried this on the host. Do I need to create a shell to a Domain-0 instance or something?
gdbsx runs on dom0 and attaches to a domU.
Quoted 4 lines
root@piet-openxen:~# ./gdbsx -c 1 64
ERROR:xg_attach:Unable to pause domain:1
ERROR: failed to attach to domain:1 errno:13
[Permission Denied]Hmm... I just tried and it worked for me, so things are ok it seems on latest xen/linux. The errno EPERM indicates something might not be properly setup. Are you able to run other xen commands like xl list, etc? I see you are running as root, are you running gdbsx on dom0?
Mukesh
Hi Mukesh:
Quoted 4 lines
Hmm... I just tried and it worked for me, so things are ok it seems on latest xen/linux. The errno EPERM indicates something might not be properly setup.
Are you able to run other xen commands like xl list, etc?
I see you are running as root, are you running gdbsx on dom0?
Gdbsx runs on dom0, which I believe is the same as running on the host when it's booting for Xen support in the grub selection. On the host the Xen commands are available as I showed in my initial email, I used the "xl list" and "xl pause" commands:
Quoted 7 lines
root@piet-openxen:~# xl list Name ID Mem VCPUs State Time(s) Domain-0 0 14734 12 r----- 8562.9 New_PV_Driver 1 1023 4 -b---- 50.3 root@piet-openxen:~#root@piet-openxen-blade:~# xl pause 1
I was running as root on the host/dom0.
Wondering if the host kernel has to be configured to support gdb attaching with gdbsx.
Sorry about the reply exchange layout; I can' only run outlook here at work. I like the thunderbird reply scheme much more.
-piet
--
Pete/Piet Delaney
O: +1 408 935-1813
C: +1 408 646-8557
H: +1 408 243-8872
Home Email: [email protected]
-----Original Message-----
From: Mukesh Rathor [mailto:[email protected]]
Sent: Tuesday, August 26, 2014 3:48 PM
To: Pete Delaney
Cc: [email protected]; [email protected]; Elaine Huang
Subject: Re: gdbsx - xg_attach:Unable to pause domain:1; failed to attach to domain:1 errno:13
Quoted 10 lines · On Tue, 26 Aug 2014 02:14:30 +0000 Pete Delaney <[email protected]>…
Hi Mukesh:
I tried your gdbsx stub but hit a couple errors.
I didn't find an explanation with google; nor on the xen-devel mailing list yet. Thought I'd ask ya.I installed Ubuntu-14.04 Server with OpenXenManager on my Xenon workstation and have A Xenon blade also with Ubunto-14.04 and OpenXen. Seems to run about the same on both Machines.
Quoted 6 lines
This afternoon I pulled the Xen source with git from xenbits.xen.org and build it.
The version of gdbsx that I built on my workstation is having problems attaching to Domain-0. I tried this on the host. Do I need to create a shell to a Domain-0 instance or something?
gdbsx runs on dom0 and attaches to a domU.
Quoted 3 lines
root@piet-openxen:~# ./gdbsx -c 1 64
ERROR:xg_attach:Unable to pause domain:1
ERROR: failed to attach to domain:1 errno:13 [Permission Denied]Hmm... I just tried and it worked for me, so things are ok it seems on latest xen/linux. The errno EPERM indicates something might not be properly setup. Are you able to run other xen commands like xl list, etc? I see you are running as root, are you running gdbsx on dom0?
Mukesh
Quoted 22 lines · On Wed, 27 Aug 2014 03:02:54 +0000 Pete Delaney <[email protected]>…
Hi Mukesh:
Quoted 5 lines
Hmm... I just tried and it worked for me, so things are ok it seems on latest xen/linux. The errno EPERM indicates something might not be properly setup. Are you able to run other xen commands like xl list, etc? I see you are running as root, are you running gdbsx on dom0?
Gdbsx runs on dom0, which I believe is the same as running on the host when it's booting for Xen support in the grub selection. On the host the Xen commands are available as I showed in my initial email, I used the "xl list" and "xl pause" commands:
Quoted 8 lines
root@piet-openxen:~# xl list Name ID Mem VCPUs State Time(s) Domain-0 0 14734 12 r----- 8562.9 New_PV_Driver 1 1023 4 -b---- 50.3 root@piet-openxen:~#
Quoted 4 lines
Quoted 1 line
root@piet-openxen-blade:~# xl pause 1I was running as root on the host/dom0.
Hmm... that all seems ok then. Can you check your permissions on :
/proc/xen/privcmd
Other possibilites:
- do you have xsm enabled?
- can you put a printk in xen file common/domctl.c:
case XEN_DOMCTL_pausedomain:
ret = -EINVAL;
+ printk(">>>>>>>>> Pause domain:%d current:%d\n", d->domain_id,
+ current->domain->domain_id);
if ( d != current->domain )
ret = domain_pause_by_systemcontroller(d);
break;if you don't see this printk then the problem is in dom0 linux, prob some permissions either on the privcmd file or somewhere in FS path.
Quoted 2 lines
Wondering if the host kernel has to be configured to support gdb attaching with gdbsx.
Nop, at this point you are just not able to establish connection with xen. gdb is not involved.
-Mukesh
Hi Mukesh:
Thanks for your help on enabling gdbsx...
Quoted 5 lines
Hmm... that all seems ok then. Can you check your permissions on :
/proc/xen/privcmd
root@piet-openxen-blade:~# ls -l /proc/xen/privcmd
-rw------- 1 root root 0 Aug 11 13:37 /proc/xen/privcmd
Privcmd seems to be a hypervisor call available from userland
For Xen developers:
http://sanifool.com/2013/02/08/invoking-an-hypercall-from-userland-via-privcmd/
Quoted 3 lines
Other possibilities:
- do you have xsm enabled?
Don't think so. I've heard this security stuff can get in the way.
Doing a 'xl list -Z' doesn't show any security labels. [Wish I had Synergy Installed]
Quoted 1 line
- can you put a printk in xen file
common/domctl.c:
Sure but first I likely need to start using the openxen code that I compiled from src.
I'm currently using openxen installed via a Ubuntu 14.04 package.
Mind explaining the best way to proceed on switching to the openxen
That I compiled from source? I thought some of it might be installed at /usr/local/
And perhaps just changing a search path or two will be sufficient.
I suspect I'll need to put a new xen kernel on /boot and update the grub config.
Review
Quoted 13 lines
case XEN_DOMCTL_pausedomain: ret = -EINVAL;(quoted diff) +2
-0+ printk(">>>>>>>>> Pause domain:%d current:%d\n", d->domain_id, + current->domain->domain_id); if ( d != current->domain ) ret = domain_pause_by_systemcontroller(d); break;
Ok, I added your suggested prink() call above.
? if you don't see this printk then the problem is in dom0 linux, prob some permissions either on the privcmd file or somewhere in FS path.
? > Wondering if the host kernel has to be configured to support gdb
? > attaching with gdbsx.
? Nop, at this point you are just not able to establish connection with xen. gdb is not involved.
Great, perhaps I just need to do is install the openxen I just compiled.
Your suggestions on exactly how to do that would be greatly appreciated.
? -Mukesh
-piet
--
Pete/Piet Delaney
O: +1 408 935-1813
C: +1 408 646-8557
H: +1 408 243-8872
Home Email: [email protected]
-----Original Message-----
From: Mukesh Rathor [mailto:[email protected]]
Sent: Wednesday, August 27, 2014 11:25 AM
To: Pete Delaney
Cc: [email protected]; [email protected]; Elaine Huang
Subject: Re: gdbsx - xg_attach:Unable to pause domain:1; failed to attach to domain:1 errno:13
On Wed, 27 Aug 2014 03:02:54 +0000
Quoted 44 lines · Pete Delaney <[email protected]<mailto:[email protected]>> wrote:
Hi Mukesh:
Quoted 9 lines
Hmm... I just tried and it worked for me, so things are ok it
seems on latest xen/linux. The errno EPERM indicates something
might not be properly setup. Are you able to run other xen
commands like xl list, etc? I see you are running as root, are
you running gdbsx on dom0?
Gdbsx runs on dom0, which I believe is the same as running on the host
when it's booting for Xen support in the grub selection. On the host
the Xen commands are available as I showed in my initial email, I used
the "xl list" and "xl pause" commands:
Quoted 15 lines
root@piet-openxen:~# xl listName ID Mem
VCPUs State Time(s)
Domain-0 0 14734
12 r----- 8562.9
New_PV_Driver1 10234 -b---- 50.3
root@piet-openxen:~#
Quoted 7 lines
Quoted 1 line
root@piet-openxen-blade:~# xl pause 1I was running as root on the host/dom0.
Hmm... that all seems ok then. Can you check your permissions on :
/proc/xen/privcmd
Other possibilites:
- do you have xsm enabled?
- can you put a printk in xen file common/domctl.c:
case XEN_DOMCTL_pausedomain:
ret = -EINVAL;+ printk(">>>>>>>>> Pause domain:%d current:%d\n", d->domain_id,
+ current->domain->domain_id);
if ( d != current->domain )
ret = domain_pause_by_systemcontroller(d);
break;if you don't see this printk then the problem is in dom0 linux, prob some permissions either on the privcmd file or somewhere in FS path.
Quoted 3 lines
Wondering if the host kernel has to be configured to support gdb
attaching with gdbsx.
Nop, at this point you are just not able to establish connection with xen. gdb is not involved.
-Mukesh
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 66 lines · On Tue, 16 Sep 2014 22:58:37 +0000 Pete Delaney <[email protected]>…
Hi Mukesh:
Thanks for your help on enabling gdbsx...
Quoted 5 lines
Hmm... that all seems ok then. Can you check your permissions on :
/proc/xen/privcmdroot@piet-openxen-blade:~# ls -l /proc/xen/privcmd-rw------- 1 root root 0 Aug 11 13:37
/proc/xen/privcmdPrivcmd seems to be a hypervisor call available from userland
For Xen developers:
http://sanifool.com/2013/02/08/invoking-an-hypercall-from-userland-via-privcmd/Quoted 3 lines
Other possibilities:
- do you have xsm enabled?
Don't think so. I've heard this security stuff can get in the way.
Doing a 'xl list -Z' doesn't show any security
labels. [Wish I had
Synergy Installed]Quoted 1 line
- can you put a printk in xen file
common/domctl.c:Sure but first I likely need to start using the openxen code that I compiled from src.
I'm currently using openxen installed via a Ubuntu 14.04 package.
Mind explaining the best way to proceed on switching to the openxen
That I compiled from source? I thought some of it might be installed at
/usr/local/
Quoted 6 lines
And perhaps just changing a search path or two will be sufficient.
I suspect I'll need to put a new xen kernel on /boot and update the grub config.
Correct. Just git clone xen tree to match your version, then edit the file to add printk, then build xen. copy xen to target machine over to /boot. Then edit grub kernel line to boot new xen.
Mukesh
Evening Mukesh:
Re:
> Correct. Just git clone xen tree to match your version, then edit the file to add printk, then build xen. > copy xen to target machine over to /boot. Then edit grub kernel line to boot new xen.
Kernel log showing I'm running Xen version 4.4.0 (preserve-AD) on Ubuntu 14.04.
Git shows a stable-4.4 and a staging-4.4 release tag. The stable-4.4 is the last on the branch,
and follows a 4.4.2-pre. Release 4.4.1 is between staging-4.4 and stable-4.4;
so it's not clear looking at the git history and the kernel log which are matching
xen version is. I suspect it's not that important.
My guess is to use the last commit; looks good (checking control blocks when using FIFO events);
that git tag stable-4.4 is the best match for Ubuntu 14.04's reported version 4.4.0 (preserve-AD).
In the mean time I'll cherry pick your suggested printk patch to stable-4.4.
-piet
--
Pete/Piet Delaney
O: +1 408 935-1813
C: +1 408 646-8557
H: +1 408 243-8872
Home Email: [email protected]
-----Original Message-----
From: Mukesh Rathor [mailto:[email protected]]
Sent: Tuesday, September 16, 2014 7:16 PM
To: Pete Delaney
Cc: [email protected]; [email protected]; Elaine Huang; Tedi Tedijanto
Subject: Re: gdbsx - xg_attach:Unable to pause domain:1; failed to attach to domain:1 errno:13
On Tue, 16 Sep 2014 22:58:37 +0000
Quoted 144 lines · Pete Delaney <[email protected]<mailto:[email protected]>> wrote:
Hi Mukesh:
Thanks for your help on enabling gdbsx...
Quoted 9 lines
Hmm... that all seems ok then. Can you check your permissions on :
/proc/xen/privcmdroot@piet-openxen-blade:~# ls -l /proc/xen/privcmd-rw------- 1 root root 0 Aug 11 13:37
/proc/xen/privcmdPrivcmd seems to be a hypervisor call available from userland
For Xen developers:
http://sanifool.com/2013/02/08/invoking-an-hypercall-from-userland-via
-privcmd/
Quoted 5 lines
Other possibilities:
- do you have xsm enabled?
Don't think so. I've heard this security stuff can get in the way.
Doing a 'xl list -Z' doesn't show any security
labels. [Wish I had
Synergy Installed]
Quoted 1 line
- can you put a printk in xen file
common/domctl.c:Sure but first I likely need to start using the openxen code that I
compiled from src.
I'm currently using openxen installed via a Ubuntu 14.04 package.
Mind explaining the best way to proceed on switching to the openxen
That I compiled from source? I thought some of it might be installed
at
/usr/local/And perhaps just changing a search path or two will be sufficient.
Quoted 3 lines
I suspect I'll need to put a new xen kernel on /boot and update the
grub config.
Correct. Just git clone xen tree to match your version, then edit the file to add printk, then build xen. copy xen to target machine over to /boot. Then edit grub kernel line to boot new xen.
Mukesh
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Hi Mukesh:
> Correct. Just git clone xen tree to match your version, then edit the file to add printk, then build xen. copy xen to target machine over to /boot. Then edit grub kernel line to boot new xen.
I after building Xen I tried a 'make install-xen' but got a problem with EFI_VENDOR not being defined.
See attached snapshot.
Looks like 'make install-xen' installed a xen kerneL in /boot
piet@piet-t3600:/boot$ ls -lt | more
total 94131
lrwxrwxrwx 1 root root 16 Sep 17 17:35 xen-4.4.gz -> xen-4.4.2-pre.gz
lrwxrwxrwx 1 root root 16 Sep 17 17:35 xen-4.gz -> xen-4.4.2-pre.gz
lrwxrwxrwx 1 root root 16 Sep 17 17:35 xen.gz -> xen-4.4.2-pre.gz
-rw-r--r-- 1 root root 844203 Sep 17 16:26 xen-4.4.2-pre.gz
-rw-r--r-- 1 root root 15440366 Sep 17 16:26 xen-syms-4.4.2-pre
-rw-r--r-- 1 root root 28743841 Aug 8 16:59 initrd.img-3.13.0-32-generic
drwxr-xr-x 5 root root 1024 Aug 8 16:58 grubdded to the /boot partition:The grub default is "Ubuntu GNU/Linux, with Xen hypervisor" (see attached grub.cfg).
I'm rather rusty on the new and improved grub syntax. I'd prefer not bricking my Ubuntu workstation. :)
The various menu entry's under the Xen submenu look very similar. Currently is offering a 3.13.0-32 kernel
And a 3.13.0-24 kernel (modules are in /lib/modules).
Looks to me like I can easily provide a different multiboot line:
Currently:
multiboot /xen-4.4-amd64.gz placeholder ${xen_rm_opts}Change it to:
multiboot /xen-4.4.2-pre.gz placeholder ${xen_rm_opts}]If xen fails to boot I should still be able to boot the original Ubuntu-14.04 stock linux kernels.
It's not obvious how to easily make it possible to select between the two Xen images without
Potentially messing up system installation scripts.
-piet
--
Pete/Piet Delaney
O: +1 408 935-1813
C: +1 408 646-8557
H: +1 408 243-8872
Home Email: [email protected]
-----Original Message-----
From: Mukesh Rathor [mailto:[email protected]]
Sent: Tuesday, September 16, 2014 7:16 PM
To: Pete Delaney
Cc: [email protected]; [email protected]; Elaine Huang; Tedi Tedijanto
Subject: Re: gdbsx - xg_attach:Unable to pause domain:1; failed to attach to domain:1 errno:13
On Tue, 16 Sep 2014 22:58:37 +0000
Quoted 144 lines · Pete Delaney <[email protected]<mailto:[email protected]>> wrote:
Hi Mukesh:
Thanks for your help on enabling gdbsx...
Quoted 9 lines
Hmm... that all seems ok then. Can you check your permissions on :
/proc/xen/privcmdroot@piet-openxen-blade:~# ls -l /proc/xen/privcmd-rw------- 1 root root 0 Aug 11 13:37
/proc/xen/privcmdPrivcmd seems to be a hypervisor call available from userland
For Xen developers:
http://sanifool.com/2013/02/08/invoking-an-hypercall-from-userland-via
-privcmd/
Quoted 5 lines
Other possibilities:
- do you have xsm enabled?
Don't think so. I've heard this security stuff can get in the way.
Doing a 'xl list -Z' doesn't show any security
labels. [Wish I had
Synergy Installed]
Quoted 1 line
- can you put a printk in xen file
common/domctl.c:Sure but first I likely need to start using the openxen code that I
compiled from src.
I'm currently using openxen installed via a Ubuntu 14.04 package.
Mind explaining the best way to proceed on switching to the openxen
That I compiled from source? I thought some of it might be installed
at
/usr/local/And perhaps just changing a search path or two will be sufficient.
Quoted 3 lines
I suspect I'll need to put a new xen kernel on /boot and update the
grub config.
Correct. Just git clone xen tree to match your version, then edit the file to add printk, then build xen. copy xen to target machine over to /boot. Then edit grub kernel line to boot new xen.
Mukesh
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 48 lines · On Thu, 18 Sep 2014 02:11:26 +0000 Pete Delaney <[email protected]>…
Hi Mukesh:
> Correct. Just git clone xen tree to match your > version, then edit the file to add printk, then > build xen. copy xen to target machine over > to /boot. Then edit grub kernel line to boot new > xen.
I after building Xen I tried a 'make install-xen' but got a problem with
EFI_VENDORnot being defined.See attached snapshot.
Looks like 'make install-xen' installed a xen kerneL in /boot
piet@piet-t3600:/boot$ ls -lt | moretotal 94131 lrwxrwxrwx 1 root root 16 Sep 17 17:35 xen-4.4.gz ->xen-4.4.2-pre.gz
lrwxrwxrwx 1 root root 16 Sep 17 17:35 xen-4.gz ->xen-4.4.2-pre.gz
lrwxrwxrwx 1 root root 16 Sep 17 17:35 xen.gz ->xen-4.4.2-pre.gz
-rw-r--r-- 1 root root 844203 Sep 17 16:26 xen-4.4.2-pre.gz -rw-r--r-- 1 root root 15440366 Sep 17 16:26 xen-syms-4.4.2-pre -rw-r--r-- 1 root root 28743841 Aug 8 16:59initrd.img-3.13.0-32-generic
drwxr-xr-x 5 root root 1024 Aug 8 16:58 grubdded to
the /boot partition:
Quoted 7 lines
The grub default is "Ubuntu GNU/Linux, with Xen hypervisor" (see attached grub.cfg).
I'm rather rusty on the new and improved grub syntax. I'd prefer not bricking my Ubuntu workstation. :)
Yeah, I'm not a big fan either. Actually, I just realized you could use strace to figure where the call is failing. So, lets try that. Can you run with strace and lmk what you find?
I'll be offline till thursday, btw.
- mukesh