From: Marcelo Tosatti <mtosatti@redhat.com>
To: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Avi Kivity <avi@redhat.com>,
kvm@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] kvm,ept: pass error code to handler
Date: Fri, 11 Jun 2010 16:46:48 -0300 [thread overview]
Message-ID: <20100611194648.GB12317@amt.cnet> (raw)
In-Reply-To: <4C121E50.6050402@cn.fujitsu.com>
On Fri, Jun 11, 2010 at 07:30:24PM +0800, Lai Jiangshan wrote:
> handle_ept_violation() does not pass error code to
> the handler tdp_page_fault().
>
> It means tdp_page_fault() handles the page fault with ignoring
> the error code, It will not handle the page fault completely correctly,
> and may causes endless page fault.
>
> {
> But because there is another bad code in the kvm, This endless page faulting
> never occur. The bad code: kvm always set pte writable.
>
> negative * negative = positive, WTF!!
>
> Next patch will fix this bad code.
> }
>
> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
> ---
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index c7565ea..6362dcc 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3470,7 +3470,7 @@ static int handle_ept_violation(struct kvm_vcpu *vcpu)
>
> gpa = vmcs_read64(GUEST_PHYSICAL_ADDRESS);
> trace_kvm_page_fault(gpa, exit_qualification);
> - return kvm_mmu_page_fault(vcpu, gpa & PAGE_MASK, 0);
> + return kvm_mmu_page_fault(vcpu, gpa & PAGE_MASK, exit_qualification);
exit_qualification & 0x2, because bit 1 (write fault) of exit
qualification is the only one that matches x86's pagefault error codes.
prev parent reply other threads:[~2010-06-11 19:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-11 11:30 [PATCH 1/2] kvm,ept: pass error code to handler Lai Jiangshan
2010-06-11 19:46 ` Marcelo Tosatti [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=20100611194648.GB12317@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=laijs@cn.fujitsu.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox