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

[Xen-devel] RE: 32/64-bit hypercall interface



ak@xxxxxxx wrote:
> "Nakajima, Jun" <jun.nakajima@xxxxxxxxx> writes:
>> 
>> The 32-bit and 64-bit hypercall ABI cannot be identical on x86
>> because of the generic ABI difference between 32-bit and 64-bit.
> 
> You use a custom ABI for hypercalls anyways, so you can define
> it to be the same with some care. That is the approach that is
> used by some newer subsystems in the Linux kernel.
> 
In 32-bit, there are a couple of different instructions used for system
calls, e.g. "int N", sysenter, and syscall. Some x86 CPUs support only
sysenter, and some syscall, and "int N" is always available and it is
the one used for 32-bit hypercalls. In 64-bit, the situation is much
better, and we are using syscall for hypercalls, which is always
available and can be more efficient than "int N". 

I don't think we should use "int N" sacrificing the good feature for
64-bit when we can handle 32-bit hypercalls using a compatibility layer.
I also think using the existing ABI convention is much better whenever
possible and appropriate because we don't need to re-invent the wheel.
After all, the only difference between system call and hyper call
basically is the system/hypercall number.

> In my experience even people with the best intentions tend to get that
> wrong at some point because there are some subtle issues so having the
> additional safety net of a compat layer is still a good idea. It would
> only emulate the ones that went wrong.
> 
> -Andi

I agree. 

Jun
---
Intel Open Source Technology Center

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


 


Rackspace

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