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-devel

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

To: "Hollis Blanchard" <hollisb@xxxxxxxxxx>
Subject: RE: [Xen-devel] 32/64-bit hypercall interface
From: "Nakajima, Jun" <jun.nakajima@xxxxxxxxx>
Date: Tue, 4 Oct 2005 14:51:03 -0700
Cc: Jeremy Katz <katzj@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Pratt <Ian.Pratt@xxxxxxxxxxxx>
Delivery-date: Tue, 04 Oct 2005 22:22:23 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcXJBTizwxR+FdbJTEuhkfeqQj9CoAAIe7GQ
Thread-topic: [Xen-devel] 32/64-bit hypercall interface
Hollis Blanchard wrote:
> On Monday 03 October 2005 16:24, Nakajima, Jun wrote:
>> Hollis Blanchard wrote:
>>> As mentioned previously, this is the approach Linux uses
>>> (linux/fs/compat_ioctl.c), and it seems less than ideal to me. Since
>>> we have the ability to fix it now (i.e. make the 32-bit and 64-bit
>>> ABI identical), shouldn't we do that rather than this
>>> copying/munging layer?
>> 
>> 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.
> 
> I am not talking about the standard ABI used by the compiler (ppc32
> and ppc64 use different ABIs as well). I am talking about the
> hypervisor/tools and hypervisor/kernel ABI.
> 
> If the hypervisor ABI does not contain types that change size, it
> will be identical for both 32- and 64-bit users.
> 
Okay, I understand what you need. How about the data layout? That's not
so trivial to have the identical ones. 
For example, the following one would have different data layout on
32-bit and 64-bit. 

typedef struct vcpu_time_info {
    /*
     * Updates to the following values are preceded and followed by an
     * increment of 'version'. The guest can therefore detect updates by
     * looking for changes to 'version'. If the least-significant bit of
     * the version number is set then an update is in progress and the
guest
     * must wait to read a consistent set of values.
     * The correct way to interact with the version number is similar to
     * Linux's seqlock: see the implementations of
read_seqbegin/read_seqretry.
     */
    u32 version;
    u64 tsc_timestamp;   /* TSC at last update of time vals.  */
    u64 system_time;     /* Time, in nanosecs, since boot.    */
    /*
     * Current system time:
     *   system_time + ((tsc - tsc_timestamp) << tsc_shift) *
tsc_to_system_mul
     * CPU frequency (Hz):
     *   ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
     */
    u32 tsc_to_system_mul;
    s8  tsc_shift;
} vcpu_time_info_t;


> If you meant something else when you said "generic ABI difference,"
> could you explain?

I meant basically the "standard ABI", such as, parameter passing, i.e.
which registers are used to pass which arguments. x86_64 xenlinux runs
in ring3, and hypercalls are not so different from system calls in terms
of the mechanism/implementation. Then when we use fast system calls, we
can use the compiler convention to minimize save/restore of the
registers.

Jun
---
Intel Open Source Technology Center

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