public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Arthur Chunqi Li <yzt356@gmail.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Gleb Natapov <gleb@redhat.com>, kvm <kvm@vger.kernel.org>
Subject: Re: [RFC PATCH] kvm-unit-tests : Basic architecture of VMX nested test case
Date: Wed, 24 Jul 2013 12:24:11 +0200	[thread overview]
Message-ID: <51EFAB4B.80706@web.de> (raw)
In-Reply-To: <CABpY8MK=S1box81H5i9YQSJ5=2GhiTjEpjdKZkkDFRf8JKFO9w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]

On 2013-07-24 12:16, Arthur Chunqi Li wrote:
> On Wed, Jul 24, 2013 at 6:03 PM, Jan Kiszka <jan.kiszka@web.de> 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 = 0;
>>>     bool launched = 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



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

  reply	other threads:[~2013-07-24 10:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 18:54 [RFC PATCH] kvm-unit-tests : Basic architecture of VMX nested test case Arthur Chunqi Li
2013-07-18  5:52 ` Paolo Bonzini
2013-07-18  7:26   ` Gleb Natapov
2013-07-18 10:47     ` Paolo Bonzini
2013-07-18 11:06       ` Gleb Natapov
2013-07-18 12:08         ` Paolo Bonzini
2013-07-18 14:11           ` Arthur Chunqi Li
2013-07-18 19:57           ` Gleb Natapov
2013-07-19  6:42             ` Paolo Bonzini
2013-07-19  9:40               ` Gleb Natapov
2013-07-19 12:06                 ` Paolo Bonzini
2013-07-24  6:11                   ` Arthur Chunqi Li
2013-07-24  6:40                     ` Paolo Bonzini
2013-07-24  6:46                       ` Arthur Chunqi Li
2013-07-24  6:48                         ` Paolo Bonzini
2013-07-24  8:48                           ` Arthur Chunqi Li
2013-07-24  8:53                             ` Jan Kiszka
2013-07-24  9:16                             ` Paolo Bonzini
2013-07-24  9:56                               ` Arthur Chunqi Li
2013-07-24 10:03                                 ` Jan Kiszka
2013-07-24 10:16                                   ` Arthur Chunqi Li
2013-07-24 10:24                                     ` Jan Kiszka [this message]
2013-07-24 11:20                                       ` Arthur Chunqi Li
2013-07-24 11:25                                         ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51EFAB4B.80706@web.de \
    --to=jan.kiszka@web.de \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=yzt356@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox