All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ladi Prosek <lprosek@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: KVM list <kvm@vger.kernel.org>, Radim Krcmar <rkrcmar@redhat.com>
Subject: Re: [PATCH 1/5] KVM: x86: introduce ISA specific SMM entry/exit callbacks
Date: Thu, 14 Sep 2017 09:14:35 +0200	[thread overview]
Message-ID: <CABdb736Ro3b6dfEw3XNh-LoBHHb=FM=3cK3ZbpJd8egHq-z2Lg@mail.gmail.com> (raw)
In-Reply-To: <89091967-4ffe-9e26-88aa-f6f716f0e0a8@redhat.com>

On Wed, Sep 13, 2017 at 11:44 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 13/09/2017 16:06, Ladi Prosek wrote:
>> +     bool left_smm;  /* post_leave_smm() needs to be called after emulation */
>
> This is already stored (more or less) in hflags.  Would it work to
> invoke the hook from kvm_smm_changed instead?

I would have to reorder some of the calls under "if (writeback)" in
x86_emulate_instruction to make it work. The hook needs to be called
after all vcpu state has been synced. For example now kvm_rip_write
runs after kvm_set_hflags so it would overwrite the rip restored by
the hook.

The left_smm field is indeed not necessary though. What if I leave it
as a separate statement in x86_emulate_instruction to make the
ordering requirement explicit, but use hflags to detect that we've
left SMM?

Thanks!
Ladi

  reply	other threads:[~2017-09-14  7:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-13 14:06 [PATCH 0/5] KVM: nested virt SMM fixes Ladi Prosek
2017-09-13 14:06 ` [PATCH 1/5] KVM: x86: introduce ISA specific SMM entry/exit callbacks Ladi Prosek
2017-09-13 21:44   ` Paolo Bonzini
2017-09-14  7:14     ` Ladi Prosek [this message]
2017-09-14  9:47       ` Paolo Bonzini
2017-09-13 14:06 ` [PATCH 2/5] KVM: nVMX: fix SMI injection in guest mode Ladi Prosek
2017-09-13 14:06 ` [PATCH 3/5] KVM: nVMX: save nested EPT information in SMRAM state save map Ladi Prosek
2017-09-13 14:06 ` [PATCH 4/5] KVM: nSVM: refactor nested_svm_vmrun Ladi Prosek
2017-09-13 14:06 ` [PATCH 5/5] KVM: nSVM: fix SMI injection in guest mode Ladi Prosek

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='CABdb736Ro3b6dfEw3XNh-LoBHHb=FM=3cK3ZbpJd8egHq-z2Lg@mail.gmail.com' \
    --to=lprosek@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.