Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-18 Thread Gleb Natapov
On Tue, Jun 18, 2013 at 04:13:02PM +0200, Paolo Bonzini wrote: > Il 09/06/2013 14:27, Gleb Natapov ha scritto: > > On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: > >> On 06/09/2013 07:56 PM, Gleb Natapov wrote: > >>> On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote:

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-18 Thread Paolo Bonzini
Il 09/06/2013 14:27, Gleb Natapov ha scritto: > On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 07:56 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: > On Sun, Jun 09,

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-18 Thread Paolo Bonzini
Il 09/06/2013 14:27, Gleb Natapov ha scritto: On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:56 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-18 Thread Gleb Natapov
On Tue, Jun 18, 2013 at 04:13:02PM +0200, Paolo Bonzini wrote: Il 09/06/2013 14:27, Gleb Natapov ha scritto: On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:56 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 08:27 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 07:56 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: > On Sun, Jun 09,

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: > On 06/09/2013 07:56 PM, Gleb Natapov wrote: > > On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: > >> On 06/09/2013 07:36 PM, Gleb Natapov wrote: > >>> On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: >

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 07:56 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 07:36 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On 06/09/2013 06:19 PM, Gleb Natapov wrote: > On Sun, Jun 09,

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: > On 06/09/2013 07:36 PM, Gleb Natapov wrote: > > On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: > >> On 06/09/2013 06:19 PM, Gleb Natapov wrote: > >>> On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: >

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 07:36 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 06:19 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On 06/09/2013 05:39 PM, Gleb Natapov wrote: > On Sun, Jun 09,

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: > On 06/09/2013 06:19 PM, Gleb Natapov wrote: > > On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: > >> On 06/09/2013 05:39 PM, Gleb Natapov wrote: > >>> On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: >

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 06:19 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 05:39 PM, Gleb Natapov wrote: >>> On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: > +static int

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: > On 06/09/2013 05:39 PM, Gleb Natapov wrote: > > On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: > >> On 06/09/2013 04:45 PM, Gleb Natapov wrote: > >> > >>> +static int emulator_fix_hypercall(struct x86_emulate_ctxt

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 05:39 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 04:45 PM, Gleb Natapov wrote: >> >>> +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) >>> +{ >>> + struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); >>> +

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: > On 06/09/2013 04:45 PM, Gleb Natapov wrote: > > > +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) > > +{ > > + struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); > > + return kvm_exec_with_stopped_vcpu(vcpu->kvm, > >

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:45 PM, Gleb Natapov wrote: > +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) > +{ > + struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); > + return kvm_exec_with_stopped_vcpu(vcpu->kvm, > + emulator_fix_hypercall_cb, ctxt); > +} > + > + >

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:59 PM, Gleb Natapov wrote: > On Sun, Jun 09, 2013 at 04:56:42PM +0800, Xiao Guangrong wrote: >> On 06/09/2013 04:45 PM, Gleb Natapov wrote: >>> On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: From: Xiao Guangrong Currently, memory synchronization is

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 04:56:42PM +0800, Xiao Guangrong wrote: > On 06/09/2013 04:45 PM, Gleb Natapov wrote: > > On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: > >> From: Xiao Guangrong > >> > >> Currently, memory synchronization is missed in emulator_fix_hypercall, > >> please

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:45 PM, Gleb Natapov wrote: > On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: >> From: Xiao Guangrong >> >> Currently, memory synchronization is missed in emulator_fix_hypercall, >> please see the commit 758ccc89b83 >> (KVM: x86: drop calling kvm_mmu_zap_all in

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: > From: Xiao Guangrong > > Currently, memory synchronization is missed in emulator_fix_hypercall, > please see the commit 758ccc89b83 > (KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall) > > This patch fixes it by

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Currently, memory synchronization is missed in emulator_fix_hypercall, please see the commit 758ccc89b83 (KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall)

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:45 PM, Gleb Natapov wrote: On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Currently, memory synchronization is missed in emulator_fix_hypercall, please see the commit 758ccc89b83 (KVM: x86: drop calling

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 04:56:42PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Currently, memory synchronization is missed in

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:59 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 04:56:42PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: On Sat, Jun 08, 2013 at 11:15:37AM +0800, Xiao Guangrong wrote: From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Currently, memory

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 04:45 PM, Gleb Natapov wrote: +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) +{ + struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); + return kvm_exec_with_stopped_vcpu(vcpu-kvm, + emulator_fix_hypercall_cb, ctxt); +} + + /* *

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) +{ + struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); + return kvm_exec_with_stopped_vcpu(vcpu-kvm, +

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 05:39 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) +{ + struct kvm_vcpu *vcpu = emul_to_vcpu(ctxt); + return

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On 06/09/2013 05:39 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: +static int emulator_fix_hypercall(struct x86_emulate_ctxt *ctxt) +{

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 06:19 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On 06/09/2013 05:39 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On 06/09/2013 04:45 PM, Gleb Natapov wrote: +static int

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On 06/09/2013 06:19 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On 06/09/2013 05:39 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 05:29:37PM +0800, Xiao Guangrong wrote: On

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 07:36 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On 06/09/2013 06:19 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On 06/09/2013 05:39 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On 06/09/2013 06:19 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 06:01:45PM +0800, Xiao Guangrong wrote: On

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 07:56 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On 06/09/2013 06:19 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Gleb Natapov
On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:56 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:25:17PM +0800, Xiao Guangrong wrote: On

Re: [PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-09 Thread Xiao Guangrong
On 06/09/2013 08:27 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 08:17:19PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:56 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at 07:44:03PM +0800, Xiao Guangrong wrote: On 06/09/2013 07:36 PM, Gleb Natapov wrote: On Sun, Jun 09, 2013 at

[PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-07 Thread Xiao Guangrong
From: Xiao Guangrong Currently, memory synchronization is missed in emulator_fix_hypercall, please see the commit 758ccc89b83 (KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall) This patch fixes it by introducing kvm_vcpus_hang_on_page_start() and kvm_vcpus_hang_on_page_end which

[PATCH] KVM: x86: fix missed memory synchronization when patch hypercall

2013-06-07 Thread Xiao Guangrong
From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Currently, memory synchronization is missed in emulator_fix_hypercall, please see the commit 758ccc89b83 (KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall) This patch fixes it by introducing kvm_vcpus_hang_on_page_start() and