Re: [PATCH 03/11] KVM: x86: retry non-page-table writing instruction

2011-08-22 Thread Marcelo Tosatti
On Tue, Aug 23, 2011 at 04:21:05AM +0800, Xiao Guangrong wrote: > On 08/23/2011 03:59 AM, Marcelo Tosatti wrote: > > >> + if (!vcpu->arch.mmu.direct_map && !mmu_is_nested(vcpu)) > >> + gpa = kvm_mmu_gva_to_gpa_write(vcpu, cr2, NULL); > > > > Why write? > > > > Since the fault is caus

Re: [PATCH 03/11] KVM: x86: retry non-page-table writing instruction

2011-08-22 Thread Xiao Guangrong
On 08/23/2011 03:59 AM, Marcelo Tosatti wrote: >> +if (!vcpu->arch.mmu.direct_map && !mmu_is_nested(vcpu)) >> +gpa = kvm_mmu_gva_to_gpa_write(vcpu, cr2, NULL); > > Why write? > Since the fault is caused by page table written, and the 'gpa' can be written after instruction is re

Re: [PATCH 03/11] KVM: x86: retry non-page-table writing instruction

2011-08-22 Thread Marcelo Tosatti
On Tue, Aug 16, 2011 at 02:42:07PM +0800, Xiao Guangrong wrote: > If the emulation is caused by #PF and it is non-page_table writing > instruction, > it means the VM-EXIT is caused by shadow page protected, we can zap the shadow > page and retry this instruction directly > > The idea is from Avi

[PATCH 03/11] KVM: x86: retry non-page-table writing instruction

2011-08-15 Thread Xiao Guangrong
If the emulation is caused by #PF and it is non-page_table writing instruction, it means the VM-EXIT is caused by shadow page protected, we can zap the shadow page and retry this instruction directly The idea is from Avi Signed-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_emulate.h |