From: "Jan Beulich" Subject: [PATCH 1/3] linux/x86-64: don't use explicit moves in 4- and 5-argument hypercall macros Date: Tue, 29 Jan 2008 10:46:05 +0000 Message-ID: <479F11FD.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org .., allowing the compiler to schedule the moves earlier or even avoid an extra move. As usual, written and tested on 2.6.24 and made apply to the 2.6.18 tree without further testing. Signed-off-by: Jan Beulich Index: head-2008-01-28/include/asm-x86_64/mach-xen/asm/hypercall.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-01-28.orig/include/asm-x86_64/mach-xen/asm/hypercall.h = 2008-01-29 09:53:01.000000000 +0100 +++ head-2008-01-28/include/asm-x86_64/mach-xen/asm/hypercall.h 2008-01-29 = 10:03:28.000000000 +0100 @@ -103,29 +103,29 @@ #define _hypercall4(type, name, a1, a2, a3, a4) \ ({ \ long __res, __ign1, __ign2, __ign3; \ + register long __arg4 asm("r10") =3D (long)(a4); \ asm volatile ( \ - "movq %7,%%r10; " \ HYPERCALL_STR(name) \ : "=3Da" (__res), "=3DD" (__ign1), "=3DS" (__ign2), \ - "=3Dd" (__ign3) \ + "=3Dd" (__ign3), "+r" (__arg4) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ - "3" ((long)(a3)), "g" ((long)(a4)) \ - : "memory", "r10" ); \ + "3" ((long)(a3)) \ + : "memory" ); \ (type)__res; \ }) =20 #define _hypercall5(type, name, a1, a2, a3, a4, a5) \ ({ \ long __res, __ign1, __ign2, __ign3; \ + register long __arg4 asm("r10") =3D (long)(a4); \ + register long __arg5 asm("r8") =3D (long)(a5); \ asm volatile ( \ - "movq %7,%%r10; movq %8,%%r8; " \ HYPERCALL_STR(name) \ : "=3Da" (__res), "=3DD" (__ign1), "=3DS" (__ign2), \ - "=3Dd" (__ign3) \ + "=3Dd" (__ign3), "+r" (__arg4), "+r" (__arg5) \ : "1" ((long)(a1)), "2" ((long)(a2)), \ - "3" ((long)(a3)), "g" ((long)(a4)), \ - "g" ((long)(a5)) \ - : "memory", "r10", "r8" ); \ + "3" ((long)(a3)) \ + : "memory" ); \ (type)__res; \ }) =20