From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v4 0/2] Basic nested VMX test suite Date: Wed, 17 Jul 2013 12:46:15 +0200 Message-ID: <51E675F7.6060305@web.de> References: <1374041153-32235-1-git-send-email-yzt356@gmail.com> <20130717062151.GJ8981@redhat.com> <51E64D59.5050307@redhat.com> <20130717090320.GS11772@redhat.com> <51E66FB4.9080100@redhat.com> <20130717103153.GA19599@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2NSWUIIEWTULCHJLMOVSO" Cc: Paolo Bonzini , Arthur Chunqi Li , kvm To: Gleb Natapov Return-path: Received: from mout.web.de ([212.227.15.4]:59368 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752436Ab3GQKqY (ORCPT ); Wed, 17 Jul 2013 06:46:24 -0400 Received: from mchn199C.mchp.siemens.de ([109.43.0.83]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MejSy-1UoKTV46QK-00ODtW for ; Wed, 17 Jul 2013 12:46:22 +0200 In-Reply-To: <20130717103153.GA19599@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2NSWUIIEWTULCHJLMOVSO Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-07-17 12:31, Gleb Natapov wrote: >>>> I think the current version is mostly fine, but I'd prefer to move t= he >>>> inline functions to vmx.h, and the tests to a separate file. Perhap= s >>>> lib/x86/vmx.h, lib/x86/vmx.c, and x86/vmx.c. >>>> >>>> All knowledge of setjmp and longjmp should then be hidden in >>>> lib/x86/vmx.c, perhaps by putting >>>> >>>> if (setjmp(env) =3D=3D 0) { >>>> vmx_run(); >>>> return 1; >>>> } else >>>> return 0; >>>> >>>> or something like that in a new lib/x86/vmx.c function. >>>> >>> Use of setjmp to redirect control flow here is absolutely unnecessary= =2E HW >>> provides you with capability to return control flow back where you wa= nt >>> it but you ignore it and save/restore context by yourself. Why?! Just= tell >>> HW to return to the point you want to return to! >> >> This is not super-optimized kernel code, this has to be readable first= >> and foremost. In C, the way to do global jumps and save/restore conte= xt >> is setjmp/longjmp. > If you do it right there will be _not point in doing_ global jumps. The= > control flow will be linear, the code will be much more readable. Indeed. Arthur is already working on a setjmp/longjmp free version, let's wait for the outcome. Jan ------enig2NSWUIIEWTULCHJLMOVSO 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.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlHmdfcACgkQitSsb3rl5xT4pwCgigiqbzQ2r0G5/KRxfItyGjmt aSkAmgLiU7wHz7Rk14RP2kA6zR8oGYzS =hHzG -----END PGP SIGNATURE----- ------enig2NSWUIIEWTULCHJLMOVSO--