* [PATCH 1/6] kvm: pass error code to handler
@ 2010-07-16 2:12 Lai Jiangshan
2010-07-18 14:04 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Lai Jiangshan @ 2010-07-16 2:12 UTC (permalink / raw)
To: LKML, kvm, Avi Kivity, Marcelo Tosatti
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.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 856e427..b40731e 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -3521,7 +3521,8 @@ 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 & 0x2);
}
static u64 ept_rsvd_mask(u64 spte, int level)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/6] kvm: pass error code to handler
2010-07-16 2:12 [PATCH 1/6] kvm: pass error code to handler Lai Jiangshan
@ 2010-07-18 14:04 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2010-07-18 14:04 UTC (permalink / raw)
To: Lai Jiangshan; +Cc: LKML, kvm, Marcelo Tosatti
On 07/16/2010 05:12 AM, 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.
>
>
Please describe the fail scenario more accurately in the change log?
Can it happen now, or only with the next patches in the series?
> @@ -3521,7 +3521,8 @@ 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& 0x2);
> }
>
>
Symbolic constant please.
I don't really like how kvm_mmu_page_fault() is overloaded, for !tdp the
parameter is a gva, for tdp it is a gpa. We need to break it into two
(but later).
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-07-18 14:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16 2:12 [PATCH 1/6] kvm: pass error code to handler Lai Jiangshan
2010-07-18 14:04 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox