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: Tristan Gingold <Tristan.Gingold@xxxxxxxx>
Subject: Re: [Xen-ia64-devel] Enabling hypercalls from VT-i domain
From: Doi.Tsunehisa@xxxxxxxxxxxxxx
Date: Wed, 02 Aug 2006 21:23:47 +0900
Cc: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 02 Aug 2006 05:24:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: Your message of Wed, 02 Aug 2006 13:02:48 +0200. <200608021302.48791.Tristan.Gingold@xxxxxxxx>
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><200608021302.48791.Tristan.Gingold@xxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi Tristan,

  Thank you for your comment.

You (Tristan.Gingold) said:
> Le Mercredi 02 Aot 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 agree. I should use the VMX_DOMAIN macro except for '(regs->.. 
IA64_PSR_VM)'.
I'll modify it.

> I think you'd better not to call ia64_hypercall from VTi side if cpl != 0.

  I worry about this point. The ia64_hypercall is called from ia64_handle_break
without cpl != 2 checking, thus it's checked a privilege level of the caller for
para-domain, I think. I believe that the both codes should be symmetrical.

  What do you think about this point ?

Thanks,
-- Tsunehisa Doi

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