public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nadav Har'El <nyh@math.technion.ac.il>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: Gleb Natapov <gleb@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
	"Nakajima, Jun" <jun.nakajima@intel.com>
Subject: Re: [PATCH] KVM: nVMX: Reset RFLAGS on VM-exit
Date: Sun, 3 Mar 2013 21:15:05 +0200	[thread overview]
Message-ID: <20130303191505.GA32596@fermat.math.technion.ac.il> (raw)
In-Reply-To: <51333CDC.4040609@web.de>

On Sun, Mar 03, 2013, Jan Kiszka wrote about "[PATCH] KVM: nVMX: Reset RFLAGS on VM-exit":
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Ouch, how could this work so well that far? We need to clear RFLAGS to
> the reset value as specified by the SDM. Particularly, IF must be off
> after VM-exit!

nested_vmx_succeed() or nested_vmx_fail*() were already clearing some of
the fields that I understood was necessary to clear. But they did not clear
the IF - I never realised (and didn't verify now) that this is part of the
spec. And since L1 KVM anyways enters L2 with interrupts disabled, nested KVM
would not see a difference.

> +	vmx_set_rflags(vcpu, 0x02);

There's a macro X86_EFLAGS_BIT1 which you can use for this 0x02.


-- 
Nadav Har'El                        |         Sunday, Mar 3 2013, 22 Adar 5773
nyh@math.technion.ac.il             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |"I don't use drugs, my dreams are
http://nadav.harel.org.il           |frightening enough." -- M. C. Escher

  reply	other threads:[~2013-03-03 19:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-03 12:06 [PATCH] KVM: nVMX: Reset RFLAGS on VM-exit Jan Kiszka
2013-03-03 19:15 ` Nadav Har'El [this message]
2013-03-03 19:23   ` 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=20130303191505.GA32596@fermat.math.technion.ac.il \
    --to=nyh@math.technion.ac.il \
    --cc=gleb@redhat.com \
    --cc=jan.kiszka@web.de \
    --cc=jun.nakajima@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.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