From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 16/17] kvm-userspace: Provide compat wrapper for set_debugreg Date: Wed, 08 Oct 2008 22:25:56 +0200 Message-ID: <48ED1754.5050706@web.de> References: <20081006091415.095241851@mchn012c.ww002.siemens.net> <20081006091418.034225550@mchn012c.ww002.siemens.net> <48EB535A.8020305@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig3EA7084409637B111F3A6991" Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from fmmailgate03.web.de ([217.72.192.234]:50254 "EHLO fmmailgate03.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753872AbYJHU2X (ORCPT ); Wed, 8 Oct 2008 16:28:23 -0400 In-Reply-To: <48EB535A.8020305@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig3EA7084409637B111F3A6991 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Avi Kivity wrote: > Jan Kiszka wrote: >> Older set_debugreg macros did not allow to pass the register number as= >> constant (without additional typcasting). Catch this as the latest kvm= >> debug changes make use of this property. >> >> Signed-off-by: Jan Kiszka >> --- >> kernel/external-module-compat-comm.h | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> Index: b/kernel/external-module-compat-comm.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 >> --- a/kernel/external-module-compat-comm.h >> +++ b/kernel/external-module-compat-comm.h >> @@ -539,6 +539,16 @@ struct pci_dev *pci_get_bus_and_slot(uns >> =20 >> #endif >> =20 >> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) && defined(__x86_64__= ) >> + >> +#undef set_debugreg >> +#define set_debugreg(value, register) \ >> + __asm__("movq %0,%%db" #register \ >> + : /* no output */ \ >> + :"r" ((unsigned long)value)) >> + >> +#endif >> + >> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) >> =20 >> =20 >=20 > Should be in the x86 specific file (kernel/x86/external-module.h) >=20 Indeed. ----------- Older set_debugreg macros did not allow to pass the register number as constant (without additional typcasting). Catch this as the latest kvm debug changes make use of this property. Signed-off-by: Jan Kiszka --- kernel/x86/external-module-compat.h | 10 ++++++++++ 1 file changed, 10 insertions(+) Index: b/kernel/x86/external-module-compat.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 --- a/kernel/x86/external-module-compat.h +++ b/kernel/x86/external-module-compat.h @@ -334,3 +334,13 @@ struct kvm_desc_ptr { #define FEATURE_CONTROL_LOCKED (1<<0) #define FEATURE_CONTROL_VMXON_ENABLED (1<<2) #endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) && defined(__x86_64__) + +#undef set_debugreg +#define set_debugreg(value, register) \ + __asm__("movq %0,%%db" #register \ + : /* no output */ \ + :"r" ((unsigned long)value)) + +#endif --------------enig3EA7084409637B111F3A6991 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkjtF1QACgkQniDOoMHTA+k/tgCfY5fTk1StvgOsKrZE/4PqUAQj yXgAn3oF0J6YZHGdzp2JRRcIvT4DRArI =IvFs -----END PGP SIGNATURE----- --------------enig3EA7084409637B111F3A6991--