WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel] Enabling hypercalls from VT-i domain

To: DOI Tsunehisa <Doi.Tsunehisa@xxxxxxxxxxxxxx>, xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] Enabling hypercalls from VT-i domain
From: Tristan Gingold <Tristan.Gingold@xxxxxxxx>
Date: Wed, 2 Aug 2006 13:02:48 +0200
Delivery-date: Wed, 02 Aug 2006 03:58:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <44D07FAF.7020606@xxxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <44D07FAF.7020606@xxxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.5
Le Mercredi 02 Août 2006 12:34, DOI Tsunehisa a écrit :
> Hi all,
>
>   My name is Tsunehisa Doi.
>
>   We are porting Steven Smith's para drivers for full-VM to IPF.
> In the xen-unstable.hg (cs: 10883-10885), it's enabling the hypercall
> from HVM domain. Thus, I will post the enabling patch for IPF. This
> patch includes:
>
>   + cleanup the hypercall handling code for VT-i domain
>     - delete the dead code in vmx_hypercall.c and vmx_ivt.S
>     - the code is not used now, I think.
>       * It's called with `break 0x1100' instruction. (current 0x1000)
>       * The hypercall table for VT-i domain doesn't match the
>         hypercall number.
>       * The register used for hypercall are different with current
>         version. (r16-r20 vs. r2,r4-r18)
>   + enabling hypercalls from VT-i domain
>     - modify the checker to permit hypercalls from VT-i domain.
>
> Thanks,
> - Tsunehisa Doi
Hi and welcome!

diff -r aafdb9899c41 -r e8de7b1474c0 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c     Wed Aug 02 17:48:27 2006 +0900
+++ b/xen/arch/ia64/xen/hypercall.c     Wed Aug 02 17:52:43 2006 +0900
@@ -319,7 +319,7 @@ ia64_hypercall (struct pt_regs *regs)
 
        /* Hypercalls are only allowed by kernel.
           Kernel checks memory accesses.  */
-       if (privlvl != 2) {
+       if ((regs->cr_ipsr & IA64_PSR_VM) ? (privlvl != 0) : (privlvl != 2)) {
            /* FIXME: Return a better error value ?
               Reflection ? Illegal operation ?  */
            regs->r8 = -1;

You'd better to use the VMX_DOMAIN macro here.
I think you'd better not to call ia64_hypercall from VTi side if cpl != 0.

Tristan.

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