From: Paolo Bonzini <pbonzini@redhat.com>
To: peng.hao2@zte.com.cn, sean.j.christopherson@intel.com
Cc: wang.yi59@zte.com.cn, rkrcmar@redhat.com, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
zhong.weidong@zte.com.cn, xu.xi8@zte.com.cn,
jiang.biao2@zte.com.cn
Subject: Re: [PATCH] KVM: x86: fix failure of injecting exceptions inx86_emulate_instruction
Date: Fri, 21 Sep 2018 07:13:54 +0200 [thread overview]
Message-ID: <7eb41388-993b-34c3-ae3e-c10607af904a@redhat.com> (raw)
In-Reply-To: <201809211008185136372@zte.com.cn>
On 21/09/2018 04:08, peng.hao2@zte.com.cn wrote:
>>> Unqueued, sorry. The hypercall test from kvm-unit-tests fails. A
>>> VMCALL on the "edge" of canonical address space, i.e. at 0x7ffffffffffd,
>>> raises a general protection fault before this patch and a double fault
>>> afterwards.
>> Peng Hao submitted a very similar patch[1], the difference being that
>> it also modified x86_emulate_instruction() to ignore the result of
>> inject_emulated_exception(). I have no idea if that change is correct
>> but it may be related to the aforementioned unit test failing.
> The return value of inject_emulated_exception for #PF represents whether in nested vcpu,
> not about the success or failure. Because we are not in nested vcpu, inject_emulated_exception
> must return false. And for other exceptions, inject_emulated_exception just return false.
> After propagating exceptions to guest, we just should return to guest mode and let guest handle.
Yes, your patch should work, and the x86_emulate_instruction code that
is there now is clearly wrong (though I'm not sure how the double-fault
comes up, #GP + #UD shouldn't generate one because #UD is a benign
exception).
Peng Hao, do you have a testcase? Eduardo's kvm-unit-tests patch from
Nov 2017 doesn't reproduce the bug anymore for me.
Thanks,
Paolo
parent reply other threads:[~2018-09-21 5:14 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <201809211008185136372@zte.com.cn>]
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=7eb41388-993b-34c3-ae3e-c10607af904a@redhat.com \
--to=pbonzini@redhat.com \
--cc=hpa@zytor.com \
--cc=jiang.biao2@zte.com.cn \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peng.hao2@zte.com.cn \
--cc=rkrcmar@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=wang.yi59@zte.com.cn \
--cc=x86@kernel.org \
--cc=xu.xi8@zte.com.cn \
--cc=zhong.weidong@zte.com.cn \
/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®