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

Re: [Xen-devel] [PATCH 1/9] x86/hypercall: Move some of the hvm hypercall infrastructure into hypercall.h



On 02/08/16 15:54, Jan Beulich wrote:
>>>> On 02.08.16 at 16:26, <julien.grall@xxxxxxx> wrote:
>> On 02/08/16 15:17, Jan Beulich wrote:
>>>>>> On 02.08.16 at 16:04, <julien.grall@xxxxxxx> wrote:
>>>> On 02/08/16 14:28, Jan Beulich wrote:
>>>>>>>> On 02.08.16 at 15:14, <andrew.cooper3@xxxxxxxxxx> wrote:
>>>>>> On 02/08/16 13:50, Jan Beulich wrote:
>>>>>>>>>> On 18.07.16 at 11:51, <andrew.cooper3@xxxxxxxxxx> wrote:
>>>>>>>>  #include <public/arch-x86/xen-mca.h> /* for do_mca */
>>>>>>>> -#include <xen/types.h>
>>>>>>>> +
>>>>>>>> +typedef unsigned long hypercall_fn_t(
>>>>>>>> +    unsigned long, unsigned long, unsigned long,
>>>>>>>> +    unsigned long, unsigned long, unsigned long);
>>>>>>> Wouldn't this better go into xen/hypercall.h?
>>>>>> It is architecture specific.
>>>>>>
>>>>>> ARM's version is
>>>>>>
>>>>>> typedef register_t (*arm_hypercall_fn_t)(
>>>>>>     register_t, register_t, register_t, register_t, register_t);
>>>>> Which is bogus - they're lucky we so far don't have any 6-argument
>>>>> hypercalls. Or the other way around - we could limit hypercalls to
>>>>> just five arguments (for now) on x86 too, allowing things to get
>>>>> unified. Anyway - that probably goes too far right now, so feel free
>>>>> to add my ack to the patch.
>>>> I am not sure why you think we are lucky on ARM. The hypercall has been
>>>> defined on ARM to support up to 5 arguments (public/arch-arm.h):
>>>>
>>>> "A hypercall can take up to 5 arguments. These are passed in
>>>> registers, the first argument in x0/r0 (for arm64/arm32 guests
>>>> respectively irrespective of whether the underlying hypervisor is
>>>> 32- or 64-bit), the second argument in x1/r1, the third in x2/r2,
>>>> the forth in x3/r3 and the fifth in x4/r4."
>>>>
>>>> So the prototype matches the ABI.
>>> Well, I find it quite odd for hypercall argument counts to differ
>>> between arches. I.e. I'd conclude the ABI was mis-specified.
>> Is it documented somewhere for the x86 code? Looking at Linux, the 
>> privcmd call is only passing 5 arguments on both ARM and x86.
> arch-x86/xen-x86_32.h has
>
>  * Hypercall interface:
>  *  Input:  %ebx, %ecx, %edx, %esi, %edi, %ebp (arguments 1-6)
>  *  Output: %eax
>
> while arch-x86/xen-x86_64.h has
>
>  * Hypercall interface:
>  *  Input:  %rdi, %rsi, %rdx, %r10, %r8, %r9 (arguments 1-6)
>  *  Output: %rax

The only actual 6 argument hypercall is the v4v hypercall, better known
as __HYPERVISOR_xc_reserved_op at index 39, but that isn't implemented
anywhere upstream.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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