mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: "David Hildenbrand" <david@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>, kvm <kvm@vger.kernel.org>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
	"Liran Alon" <liran.alon@oracle.com>
Subject: Re: [PATCH v5 2/2] KVM: X86: Add Force Emulation Prefix for "emulate the next instruction"
Date: Thu, 5 Apr 2018 10:51:31 +0200	[thread overview]
Message-ID: <6ae58c5e-a909-6cd4-7aaa-669758d71570@redhat.com> (raw)
In-Reply-To: <CANRm+Cz55bkFrd=pHt7ca+7-HP03Ap7hupSVQQSVckTYnX3+HQ@mail.gmail.com>

On 05/04/2018 02:04, Wanpeng Li wrote:
>>> emulate_instruction(vcpu, 0) can handle invalid instruction.
>> But David's observation is still better because your code doesn't handle usermode exits.
> My code handles it, return emulate_instruction(vcpu, 0) ==
> EMULATE_DONE, it will return 0 since EMULATE_USER_EXIT == EMULATE_DONE
> fails.
> 
>> I've fixed this up.
> Thanks. The codes similar to my v3 but more beauty. :) I change to
> this view since Radim's comments to v3
> https://www.spinics.net/lists/kvm/msg166999.html

And after I actually woke up I think I disagree with Radim.  Tests can
trap the #UD to test emulation at CPL0 and skip or fail the test for
instructions unknown to the emulator.  It's much better than sending an
emulation failure to userspace, which would abort the guest.

Paolo

      reply	other threads:[~2018-04-05  8:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-03 23:28 [PATCH v5 0/2] " Wanpeng Li
2018-04-03 23:28 ` [PATCH v5 1/2] KVM: X86: Introduce handle_ud() Wanpeng Li
2018-04-04 11:54   ` David Hildenbrand
2018-04-04 13:28     ` Wanpeng Li
2018-04-04 17:12     ` Paolo Bonzini
2018-04-04 17:43       ` David Hildenbrand
2018-04-03 23:28 ` [PATCH v5 2/2] KVM: X86: Add Force Emulation Prefix for "emulate the next instruction" Wanpeng Li
2018-04-04 11:59   ` David Hildenbrand
2018-04-04 13:35     ` Wanpeng Li
2018-04-04 17:09       ` Paolo Bonzini
2018-04-05  0:04         ` Wanpeng Li
2018-04-05  8:51           ` Paolo Bonzini [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=6ae58c5e-a909-6cd4-7aaa-669758d71570@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=david@redhat.com \
    --cc=kernellwp@gmail.com \
    --cc=konrad.wilk@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liran.alon@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®