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: xen-ia64-devel <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] Enabling hypercalls from VT-i domain
From: DOI Tsunehisa <Doi.Tsunehisa@xxxxxxxxxxxxxx>
Date: Wed, 02 Aug 2006 21:45:52 +0900
Cc: Tristan Gingold <Tristan.Gingold@xxxxxxxx>
Delivery-date: Wed, 02 Aug 2006 05:49:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200608021223.k72CNlp14669@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
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> <200608021223.k72CNlp14669@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)
Hi all,

  I modified the code using VMX_DOMAIN macro.

Thanks,
-- Tsunehisa Doi

Doi.Tsunehisa@xxxxxxxxxxxxxx wrote:
> 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
Signed-off-by: Tsunehisa Doi <Doi.Tsunehisa@xxxxxxxxxxxxxx>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@xxxxxxxxxxxxxx>
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>

diff -r aafdb9899c41 -r 483311d15abc 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 21:35: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 (VMX_DOMAIN(v) ? (privlvl != 0) : (privlvl != 2)) {
            /* FIXME: Return a better error value ?
               Reflection ? Illegal operation ?  */
            regs->r8 = -1;
_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel