From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [RFC PATCH] kvm-unit-tests : Basic architecture of VMX nested test case Date: Wed, 24 Jul 2013 12:24:11 +0200 Message-ID: <51EFAB4B.80706@web.de> References: <1374087242-6125-1-git-send-email-yzt356@gmail.com> <51E78295.2010700@redhat.com> <20130718072652.GB11772@redhat.com> <51E7C7D2.5040303@redhat.com> <20130718110639.GA26173@redhat.com> <51E7DAD3.8000906@redhat.com> <20130718195712.GN13732@redhat.com> <51E8DFCC.8060108@redhat.com> <20130719094027.GY13732@redhat.com> <51E92BE2.1080600@redhat.com> <51EF76E2.2030201@redhat.com> <51EF78B9.9090908@redhat.com> <51EF9B88.5040001@redhat.com> <51EFA688.9040504@web.de> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2WEROAETTOSPEKOKVFSJX" Cc: Paolo Bonzini , Gleb Natapov , kvm To: Arthur Chunqi Li Return-path: Received: from mout.web.de ([212.227.15.4]:53290 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751333Ab3GXKYN (ORCPT ); Wed, 24 Jul 2013 06:24:13 -0400 Received: from mchn199C.mchp.siemens.de ([95.157.58.223]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0Ls9JH-1Ty6iJ2CS7-013zLM for ; Wed, 24 Jul 2013 12:24:12 +0200 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2WEROAETTOSPEKOKVFSJX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 2013-07-24 12:16, Arthur Chunqi Li wrote: > On Wed, Jul 24, 2013 at 6:03 PM, Jan Kiszka wrote: >> On 2013-07-24 11:56, Arthur Chunqi Li wrote: >>> So what about this one. I merged all the exit reason to "ret" and >>> remove the flag detection after vmlaunch/vmresume (because I think >>> this detection is useless). Currently we support only one guest, so >>> variant "launched" is located in vmx_run(). If we want to support >>> multiple guest, we could move it to some structures (e.g. >>> environment_ctxt). Now I just put it here. >>> >>> static int vmx_run() >>> { >>> u32 ret =3D 0; >>> bool launched =3D 0; >>> >>> asm volatile( >>> "mov %%rsp, %%rsi\n\t" >>> "mov %2, %%edi\n\t" >>> "call vmcs_write\n\t" >>> >>> "0: " >>> LOAD_GPR_C >>> "cmp $0, %1\n\t" >>> "jne 1f\n\t" >>> "vmlaunch\n\t" >>> SAVE_GPR_C >>> /* vmlaunch error, return VMX_TEST_LAUNCH_ERR */ >>> "mov %3, %0\n\t" >>> "jmp 2f\n\t" >>> "1: " >>> "vmresume\n\t" >>> SAVE_GPR_C >>> /* vmresume error, return VMX_TEST_RESUME_ERR */ >>> "mov %4, %0\n\t" >>> "jmp 2f\n\t" >> >> Where do you store the flags now? You may want to differentiate / test= >> if ZF of CF is set. > I store the flags as a global variant. You mean I need to detect ZF/CF > after vmlaunch/vmresume? Yes - if you want to check correct emulation of those instructions completely. Jan ------enig2WEROAETTOSPEKOKVFSJX 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/ iEYEARECAAYFAlHvq0sACgkQitSsb3rl5xTzQACgrVjm4IjxmAoYMuPRn8ltyJGN 5qUAn36Sc13k71vV+5YB8nSdsZp/Q64c =HoNI -----END PGP SIGNATURE----- ------enig2WEROAETTOSPEKOKVFSJX--