Re: [XenPPC] xm save: adding couple domctl operations to access htab

2006-10-08 Thread poff

> I don't know if I'm off base but have you added appropriate code to 
> linux? specifically arch/powerpc/platforms/xen/hcall.c ?

Yes, this was the problem, but I had been looking at xen/arch/powerpc/hcalls.c,
not realizing that you were pointing-out a different file...
In face hcall.c resides on linux side while hcalls.c is part of xen.
Also was surprise to me that linux was involved in this way...

Somehow when Jimi spelled-out more detail, I finally realized a 2nd file was 
involved.

Anyway, thanks for trying ;-)

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


Re: [XenPPC] xm save: adding couple domctl operations to access htab

2006-10-01 Thread Jimi Xenidis


On Oct 1, 2006, at 3:33 PM, Jimi Xenidis wrote:



On Oct 1, 2006, at 1:20 PM, poff wrote:


I don't know if I'm off base but have you added appropriate code to
linux? specifically arch/powerpc/platforms/xen/hcall.c ?


An existing hypercall, viz #36, do_domctl, provides several  
commands to access guest domains.
For example, XEN_DOMCTL_getmemlist and XEN_DOMCTL_max_mem. Thought  
I would add another to
copy the htab, XEN_DOMCTL_gethtab. So I think no modification is  
needed to hcall.c


Sadly, there is:
Some architectures require that the linux kernel has knowledge of  
all hcalls, and PPc is one of them


you will notice in:
  arch/powerpc/platforms/xen/hcall.c: xenppc_privcmd_domctl()
there is a huge switch statement for all the domctl OPs.

If your case is not in the switch then you are subject to:
default:
		printk(KERN_ERR "%s: unknown domctl cmd %d\n", __func__,  
kern_op.cmd);

return -ENOSYS;
}
and hence your ENOSYS


BTW: This message may not reach your dom0 console, you can either see  
it by running the dmesg command --or-- add "debug" to your dom0  
kernel options.  Adding "sysrq=1" may be may also be a good thing  
since init scripts usually disable sysrq.


-JX




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


Re: [XenPPC] xm save: adding couple domctl operations to access htab

2006-10-01 Thread Jimi Xenidis


On Oct 1, 2006, at 1:20 PM, poff wrote:


I don't know if I'm off base but have you added appropriate code to
linux? specifically arch/powerpc/platforms/xen/hcall.c ?


An existing hypercall, viz #36, do_domctl, provides several  
commands to access guest domains.
For example, XEN_DOMCTL_getmemlist and XEN_DOMCTL_max_mem. Thought  
I would add another to
copy the htab, XEN_DOMCTL_gethtab. So I think no modification is  
needed to hcall.c


Sadly, there is:
Some architectures require that the linux kernel has knowledge of all  
hcalls, and PPc is one of them


you will notice in:
  arch/powerpc/platforms/xen/hcall.c: xenppc_privcmd_domctl()
there is a huge switch statement for all the domctl OPs.

If your case is not in the switch then you are subject to:
default:
printk(KERN_ERR "%s: unknown domctl cmd %d\n", __func__, 
kern_op.cmd);
return -ENOSYS;
}
and hence your ENOSYS

Since you are modeling the OP from XEN_DOMCTL_getmemlist, if you are  
reusing the data structure as well (which would make sense then the  
following diff should solve your problem:


diff -r c52ba3176a28 arch/powerpc/platforms/xen/hcall.c
--- a/arch/powerpc/platforms/xen/hcall.cThu Sep 28 12:26:59 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.cSun Oct 01 15:30:45 2006 -0400
@@ -273,6 +273,7 @@ static int xenppc_privcmd_domctl(privcmd
case XEN_DOMCTL_getdomaininfo:
break;
case XEN_DOMCTL_getmemlist:
+   case XEN_DOMCTL_gethtab:
ret = xencomm_create(
xen_guest_handle(kern_op.u.getmemlist.buffer),
kern_op.u.getmemlist.max_pfns * sizeof(unsigned long),

BTW: since we are trying to stick with Xen names  
"XEN_DOMCTL_getshadowlist" might be better, but at this point it is a  
name and can be debated later.


-JX



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


Re: [XenPPC] xm save: adding couple domctl operations to access htab

2006-10-01 Thread poff
> I don't know if I'm off base but have you added appropriate code to 
> linux? specifically arch/powerpc/platforms/xen/hcall.c ?

An existing hypercall, viz #36, do_domctl, provides several commands to access 
guest domains.
For example, XEN_DOMCTL_getmemlist and XEN_DOMCTL_max_mem. Thought I would add 
another to
copy the htab, XEN_DOMCTL_gethtab. So I think no modification is needed to 
hcall.c

The problem is hcall_xen() never sees the do_domctl hypercall when it includes 
the new command...
On the tools side, do_xen_hypercall() receives the do_domctl, calls 
do_privcmd() which calls ioctl().

Looks like the tools is issuing the hypercall, but xen does not receive it...
The tools application does receive the ENOSYS error, but cannot see where it is 
generated.


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


Re: [XenPPC] xm save: adding couple domctl operations to access htab

2006-09-30 Thread Tony Breeds
On Sat, Sep 30, 2006 at 05:29:40PM -0400, poff wrote:
> When saving a domain, its htab must be copied, real page numbers replaced 
> with physical,
> then written to disk. To copy the htab, I've tried for many hours to add a 
> domctl operation,
> #define XEN_DOMCTL_gethtab  29, using code and structures similar to 
> XEN_DOMCTL_getmemlist.
> 
> This new command makes it through do_xen_hypercall(), however, always get 
> ENOSYS returned...
> On the Xen side, hcall_xen() I print all the command numbers for do_domctl 
> ops, but this
> new command never arrives. Of course, have added a 'case XEN_DOMCTL_gethtab' 
> in domctl.c,
> and also printk before ENOSYS, but this code is never run.
> 
> 1) Is this a reasonable approach to copying the htab?
> 
> 2) Any clues?

I don't know if I'm off base but have you added appropriate code to 
linux? specifically arch/powerpc/platforms/xen/hcall.c ?

Yours Tony

   linux.conf.au   http://linux.conf.au/ || http://lca2007.linux.org.au/
   Jan 15-20 2007  The Australian Linux Technical Conference!


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


[XenPPC] xm save: adding couple domctl operations to access htab

2006-09-30 Thread poff
When saving a domain, its htab must be copied, real page numbers replaced with 
physical,
then written to disk. To copy the htab, I've tried for many hours to add a 
domctl operation,
#define XEN_DOMCTL_gethtab  29, using code and structures similar to 
XEN_DOMCTL_getmemlist.

This new command makes it through do_xen_hypercall(), however, always get 
ENOSYS returned...
On the Xen side, hcall_xen() I print all the command numbers for do_domctl ops, 
but this
new command never arrives. Of course, have added a 'case XEN_DOMCTL_gethtab' in 
domctl.c,
and also printk before ENOSYS, but this code is never run.

1) Is this a reasonable approach to copying the htab?

2) Any clues?



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