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
|