[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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




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.c        Thu Sep 28 12:26:59 2006 -0400
+++ b/arch/powerpc/platforms/xen/hcall.c        Sun 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@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.