All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Mike Haboustak <haboustak@gmail.com>
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 4.9] x86/kvm/vmx: do not use vm-exit instruction length for fast MMIO when running nested
Date: Mon, 7 Jan 2019 10:35:18 +0100	[thread overview]
Message-ID: <20190107093518.GA9554@kroah.com> (raw)
In-Reply-To: <20190106185724.3vhot2b6nwfrhowg@hbstk>

On Sun, Jan 06, 2019 at 01:57:24PM -0500, Mike Haboustak wrote:
> [ Backport of upstream commit d391f1207067268261add0485f0f34503539c5b0 ]
> 
> I was investigating an issue with seabios >= 1.10 which stopped working
> for nested KVM on Hyper-V. The problem appears to be in
> handle_ept_violation() function: when we do fast mmio we need to skip
> the instruction so we do kvm_skip_emulated_instruction(). This, however,
> depends on VM_EXIT_INSTRUCTION_LEN field being set correctly in VMCS.
> However, this is not the case.
> 
> Intel's manual doesn't mandate VM_EXIT_INSTRUCTION_LEN to be set when
> EPT MISCONFIG occurs. While on real hardware it was observed to be set,
> some hypervisors follow the spec and don't set it; we end up advancing
> IP with some random value.
> 
> I checked with Microsoft and they confirmed they don't fill
> VM_EXIT_INSTRUCTION_LEN on EPT MISCONFIG.
> 
> Fix the issue by doing instruction skip through emulator when running
> nested.
> 
> Fixes: 68c3b4d1676d870f0453c31d5a52e7e65c7448ae
> Suggested-by: Radim Krčmář <rkrcmar@redhat.com>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
> [mhaboustak: backport to 4.9.y]
> Signed-off-by: Mike Haboustak <haboustak@gmail.com>
> ---
>  arch/x86/kvm/vmx.c | 19 +++++++++++++++++--
>  arch/x86/kvm/x86.c |  3 ++-
>  2 files changed, 19 insertions(+), 3 deletions(-)

Now queued up, thanks.

greg k-h

      reply	other threads:[~2019-01-07  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 13:03 Please include d391f120706726826 in v4.9.y [x86/kvm/vmx]: do not use vm-exit instruction length for fast MMIO when running nested Mike Haboustak
2018-05-26 13:22 ` Greg KH
2019-01-06 18:56   ` Mike Haboustak
2019-01-06 18:57   ` [PATCH 4.9] x86/kvm/vmx: " Mike Haboustak
2019-01-07  9:35     ` Greg KH [this message]

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=20190107093518.GA9554@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=haboustak@gmail.com \
    --cc=stable@vger.kernel.org \
    /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.