# HG changeset patch # User john.levon@sun.com # Date 1209521783 25200 # Node ID 9a5c6e3620d83f9354e3eedbc4ef24a7a5ad752e # Parent f477f895f78752bb9fa2e6ee6c1d09b6a8cd3230 Allow direct hypercalls For PV guests, there''s no reason to force use of the indirect hypercall mechanism. Allow it. Also allow TRAP_INSTR to be used from assembly. Signed-off-by: John Levon <john.levon@sun.com> diff --git a/xen/include/public/arch-x86/xen-x86_32.h b/xen/include/public/arch-x86/xen-x86_32.h --- a/xen/include/public/arch-x86/xen-x86_32.h +++ b/xen/include/public/arch-x86/xen-x86_32.h @@ -36,13 +36,15 @@ * Clobbered: Argument registers (e.g., 2-arg hypercall clobbers %ebx,%ecx) */ -#if __XEN_INTERFACE_VERSION__ < 0x00030203 /* - * Legacy hypercall interface: + * Direct hypercall interface: * As above, except the entry sequence to the hypervisor is: * mov $hypercall-number*32,%eax ; int $0x82 */ +#if !defined(_ASM) #define TRAP_INSTR "int $0x82" +#else +#define TRAP_INSTR int $0x82 #endif /* diff --git a/xen/include/public/arch-x86/xen-x86_64.h b/xen/include/public/arch-x86/xen-x86_64.h --- a/xen/include/public/arch-x86/xen-x86_64.h +++ b/xen/include/public/arch-x86/xen-x86_64.h @@ -36,16 +36,18 @@ * Clobbered: argument registers (e.g., 2-arg hypercall clobbers %rdi,%rsi) */ -#if __XEN_INTERFACE_VERSION__ < 0x00030203 /* - * Legacy hypercall interface: + * Direct hypercall interface: * As above, except the entry sequence to the hypervisor is: * mov $hypercall-number*32,%eax ; syscall * Clobbered: %rcx, %r11, argument registers (as above) */ +#if !defined(_ASM) #define TRAP_INSTR "syscall" +#else +#define TRAP_INSTR syscall #endif - + /* * 64-bit segment selectors * These flat segments are in the Xen-private section of every GDT. Since these _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 30/4/08 13:56, "john.levon@sun.com" <john.levon@sun.com> wrote:> # HG changeset patch > # User john.levon@sun.com > # Date 1209521783 25200 > # Node ID 9a5c6e3620d83f9354e3eedbc4ef24a7a5ad752e > # Parent f477f895f78752bb9fa2e6ee6c1d09b6a8cd3230 > Allow direct hypercalls > > For PV guests, there''s no reason to force use of the indirect hypercall > mechanism. Allow it. Also allow TRAP_INSTR to be used from assembly. > > Signed-off-by: John Levon <john.levon@sun.com>Well, I suppose there is no reason. But since the instructions are not going to change you could just as well just open-code them, or define your own macro. _ASM isn''t even a macro name that we use anywhere else in the public headers. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, 2008-04-30 at 05:56 -0700, john.levon@sun.com wrote:> For PV guests, there''s no reason to force use of the indirect hypercall > mechanism. Allow it.It was originally intended to provide some flexibility to the hypervisor in how hypercalls were performed, encouraging new guests to use it seems rather counter to this -- why do you want to use them? Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, May 01, 2008 at 04:03:43PM +0100, Keir Fraser wrote:> > # HG changeset patch > > # User john.levon@sun.com > > # Date 1209521783 25200 > > # Node ID 9a5c6e3620d83f9354e3eedbc4ef24a7a5ad752e > > # Parent f477f895f78752bb9fa2e6ee6c1d09b6a8cd3230 > > Allow direct hypercalls > > > > For PV guests, there''s no reason to force use of the indirect hypercall > > mechanism. Allow it. Also allow TRAP_INSTR to be used from assembly. > > > > Signed-off-by: John Levon <john.levon@sun.com> > > Well, I suppose there is no reason. But since the instructions are not going > to change you could just as well just open-code them, or define your own > macro. _ASM isn''t even a macro name that we use anywhere else in the public > headers.We''re doing our best to try and merge our tree with your upstream. I don''t quite understand why you''re refusing such simple, non-intrusive changes. Is it really good coding practice to needlessly duplicate stuff? regards, john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, May 01, 2008 at 04:16:33PM +0100, Ian Campbell wrote:> On Wed, 2008-04-30 at 05:56 -0700, john.levon@sun.com wrote: > > For PV guests, there''s no reason to force use of the indirect hypercall > > mechanism. Allow it. > > It was originally intended to provide some flexibility to the hypervisor > in how hypercalls were performed, encouraging new guests to use it seems > rather counter to this -- why do you want to use them?There''s no current advantage in using the hypercall page, nor is there one on the horizon AFAIK. There is a (most likely small) disadvantage. regards, john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel