Re: [PATCH V2 WIP 2/2] vhost-scsi: new device supporting the tcm_vhost Linux kernel module

2013-03-12 Thread Stefan Hajnoczi
On Tue, Mar 12, 2013 at 02:29:42PM +0800, Asias He wrote: > diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c > index 39c1966..4a97ca1 100644 > --- a/hw/virtio-pci.c > +++ b/hw/virtio-pci.c These changes break the build for non-Linux hosts. Please introduce a CONFIG_VHOST_SCSI and #ifdef appropriate

Re: [PATCH 1/2] tcm_vhost: Wait for pending requests in vhost_scsi_flush()

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 02:31, Asias He ha scritto: > On Mon, Mar 11, 2013 at 12:36:37PM +0100, Paolo Bonzini wrote: >> Il 11/03/2013 06:09, Asias He ha scritto: >>> This patch makes vhost_scsi_flush() wait for all the pending requests >>> issued before the flush operation to be finished. >> >> There is no p

Re: [PATCH 2/4] tcm_vhost: Introduce tcm_vhost_check_endpoint()

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 03:42, Asias He ha scritto: > This helper is useful to check if vs->vs_endpoint is setup by > vhost_scsi_set_endpoint() > > Signed-off-by: Asias He > Reviewed-by: Stefan Hajnoczi > --- > drivers/vhost/tcm_vhost.c | 12 > 1 file changed, 12 insertions(+) > > diff --gi

Re: [PATCH 0/4] tcm_vhost lock and flush fix

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 03:42, Asias He ha scritto: > Asias He (4): > tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint() > tcm_vhost: Introduce tcm_vhost_check_endpoint() > tcm_vhost: Fix vs->vs_endpoint checking in vhost_scsi_handle_vq() > tcm_vhost: Flush vhost_work in vhost_scsi_flush() >

[PATCH 0/2] KVM: Optimize mmio spte zapping when creating/moving memslot

2013-03-12 Thread Takuya Yoshikawa
This is only for mmio spte zapping, not for all zap_all() cases. Takuya Yoshikawa (2): KVM: MMU: Mark sp mmio cached when creating mmio spte KVM: x86: Optimize mmio spte zapping when creating/moving memslot arch/x86/include/asm/kvm_host.h |2 ++ arch/x86/kvm/mmu.c | 21 +++

[PATCH 1/2] KVM: MMU: Mark sp mmio cached when creating mmio spte

2013-03-12 Thread Takuya Yoshikawa
This will be used not to zap unrelated mmu pages when creating/moving a memory slot later. Signed-off-by: Takuya Yoshikawa --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c |3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm

[PATCH 2/2] KVM: x86: Optimize mmio spte zapping when creating/moving memslot

2013-03-12 Thread Takuya Yoshikawa
When we create or move a memory slot, we need to zap mmio sptes. Currently, zap_all() is used for this and this is causing two problems: - extra page faults after zapping mmu pages - long mmu_lock hold time during zapping mmu pages For the latter, Marcelo reported a disastrous mmu_lock hold time

[PATCH] KVM: x86: Drop unused return code from VCPU reset callback

2013-03-12 Thread Jan Kiszka
Neither vmx nor svm nor the common part may generate an error on kvm_vcpu_reset. So drop the return code. Signed-off-by: Jan Kiszka --- Will use this for refactoring INIT/SIPI handling. arch/x86/include/asm/kvm_host.h |2 +- arch/x86/kvm/svm.c |4 +--- arch/x86/kvm/vmx.c

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-12 Thread Jan Kiszka
On 2013-03-11 20:30, Gleb Natapov wrote: > On Mon, Mar 11, 2013 at 08:01:30PM +0100, Jan Kiszka wrote: >> On 2013-03-11 19:51, Gleb Natapov wrote: > On Intel: > CPU 1 CPU 2 in a guest mode > send INIT > send SIPI > INIT vm

Re: [PATCH] KVM: x86: Drop unused return code from VCPU reset callback

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 10:20, Jan Kiszka ha scritto: > Neither vmx nor svm nor the common part may generate an error on > kvm_vcpu_reset. So drop the return code. > > Signed-off-by: Jan Kiszka > --- > > Will use this for refactoring INIT/SIPI handling. > > arch/x86/include/asm/kvm_host.h |2 +- > a

[PATCH 14/17] cpu: Pass CPUState to cpu_interrupt()

2013-03-12 Thread Andreas Färber
Move it to qom/cpu.h to avoid issues with include order. Change pc_acpi_smi_interrupt() opaque to X86CPU. Signed-off-by: Andreas Färber --- cpus.c |2 +- exec.c |2 +- hw/alpha_typhoon.c | 10 -- hw/apic.c| 21 +++

Re: [PATCH V2 0/6] tcm_vhost hotplug/hotunplug support and locking/flushing fix

2013-03-12 Thread Michael S. Tsirkin
On Tue, Mar 12, 2013 at 10:31:09AM +0800, Asias He wrote: > On Mon, Mar 11, 2013 at 02:03:27PM +0200, Michael S. Tsirkin wrote: > > On Fri, Mar 08, 2013 at 10:21:41AM +0800, Asias He wrote: > > > Changes in v2: > > > - Remove code duplication in tcm_vhost_{hotplug,hotunplug} > > > - Fix racing of v

Re: [PATCH 3/4] tcm_vhost: Fix vs->vs_endpoint checking in vhost_scsi_handle_vq()

2013-03-12 Thread Michael S. Tsirkin
On Tue, Mar 12, 2013 at 10:42:50AM +0800, Asias He wrote: > vs->vs_endpoint is protected by the vs->dev.mutex. Use > tcm_vhost_check_endpoint() to do check. The helper does the needed > locking for us. > > Signed-off-by: Asias He > Reviewed-by: Stefan Hajnoczi This takes dev mutex on data path

Re: [PATCH 0/4] tcm_vhost lock and flush fix

2013-03-12 Thread Michael S. Tsirkin
On Tue, Mar 12, 2013 at 09:26:42AM +0100, Paolo Bonzini wrote: > Il 12/03/2013 03:42, Asias He ha scritto: > > Asias He (4): > > tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint() > > tcm_vhost: Introduce tcm_vhost_check_endpoint() > > tcm_vhost: Fix vs->vs_endpoint checking in vhost_s

Re: virtio-s390: document GPR4/GPR2 cookie values

2013-03-12 Thread Rusty Russell
Cornelia Huck writes: > On Thu, 7 Mar 2013 20:02:21 +0200 > "Michael S. Tsirkin" wrote: > >> virtio-s390 on kvm can use a cookie value passed to guest > > s/virtio-s390/virtio-ccw/ (to avoid confusion with s390-virtio, which > was never specced) > >> to optimize channel/VQ lookups. >> Document th

Re: [PATCH 1/4] tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint()

2013-03-12 Thread Michael S. Tsirkin
On Tue, Mar 12, 2013 at 10:42:48AM +0800, Asias He wrote: > tv_tpg->tv_tpg_vhost_count should be protected by tv_tpg->tv_tpg_mutex. > > Signed-off-by: Asias He > Reviewed-by: Stefan Hajnoczi > --- > drivers/vhost/tcm_vhost.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/drivers/

Re: [PATCH 0/4] tcm_vhost lock and flush fix

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 12:12, Michael S. Tsirkin ha scritto: > On Tue, Mar 12, 2013 at 09:26:42AM +0100, Paolo Bonzini wrote: >> Il 12/03/2013 03:42, Asias He ha scritto: >>> Asias He (4): >>> tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint() >>> tcm_vhost: Introduce tcm_vhost_check_endpoint() >

Re: VMX: x86: handle host TSC calibration failure

2013-03-12 Thread Gleb Natapov
On Mon, Mar 11, 2013 at 11:10:24PM -0300, Marcelo Tosatti wrote: > > If the host TSC calibration fails, tsc_khz is zero (see tsc_init.c). > Handle such case properly in KVM (instead of dividing by zero). > > https://bugzilla.redhat.com/show_bug.cgi?id=859282 > > Signed-off-by: Marcelo Tosatti >

Re: [PATCH] KVM: x86: Drop unused return code from VCPU reset callback

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 10:20:24AM +0100, Jan Kiszka wrote: > Neither vmx nor svm nor the common part may generate an error on > kvm_vcpu_reset. So drop the return code. > > Signed-off-by: Jan Kiszka Applied, thanks. -- Gleb. -- To unsubscribe from this list: send the lin

Re: [PATCH] x86: kvm: reset the bootstrap processor when it gets an INIT

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 10:25:35AM +0100, Jan Kiszka wrote: > On 2013-03-11 20:30, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 08:01:30PM +0100, Jan Kiszka wrote: > >> On 2013-03-11 19:51, Gleb Natapov wrote: > > On Intel: > > CPU 1 CPU 2 in a guest mode > >

[PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Jan Kiszka
A VCPU sending INIT or SIPI to some other VCPU races for setting the remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED was overwritten by kvm_emulate_halt and, thus, got lost. This introduces APIC events for those two signals, keeping them in kvm_apic until kvm_apic_accept_e

Re: [PATCH 2/2] KVM: x86: Optimize mmio spte zapping when creating/moving memslot

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 05:45:30PM +0900, Takuya Yoshikawa wrote: > When we create or move a memory slot, we need to zap mmio sptes. > Currently, zap_all() is used for this and this is causing two problems: > - extra page faults after zapping mmu pages > - long mmu_lock hold time during zapping m

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 12:44, Jan Kiszka ha scritto: > A VCPU sending INIT or SIPI to some other VCPU races for setting the > remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED > was overwritten by kvm_emulate_halt and, thus, got lost. > > This introduces APIC events for those two sig

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 01:06:59PM +0100, Paolo Bonzini wrote: > > @@ -6171,6 +6169,7 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu > > *vcpu, > > int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, > > struct kvm_mp_state *mp_state) > > { > > + kv

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 13:06, Paolo Bonzini ha scritto: > > @@ -6178,7 +6177,13 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu > > *vcpu, > > int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, > > struct kvm_mp_state *mp_state) > > { > > - vcpu->arch.mp_s

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Jan Kiszka
On 2013-03-12 13:29, Paolo Bonzini wrote: > Il 12/03/2013 13:06, Paolo Bonzini ha scritto: >>> @@ -6178,7 +6177,13 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu >>> *vcpu, >>> int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, >>> struct kvm_mp_sta

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 01:46:53PM +0100, Jan Kiszka wrote: > On 2013-03-12 13:29, Paolo Bonzini wrote: > > Il 12/03/2013 13:06, Paolo Bonzini ha scritto: > >>> @@ -6178,7 +6177,13 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct > >>> kvm_vcpu *vcpu, > >>> int kvm_arch_vcpu_ioctl_set_mpstate(struct

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Jan Kiszka
On 2013-03-12 13:49, Gleb Natapov wrote: > On Tue, Mar 12, 2013 at 01:46:53PM +0100, Jan Kiszka wrote: >> On 2013-03-12 13:29, Paolo Bonzini wrote: >>> Il 12/03/2013 13:06, Paolo Bonzini ha scritto: > @@ -6178,7 +6177,13 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct > kvm_vcpu *vcpu, >

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 01:52:00PM +0100, Jan Kiszka wrote: > On 2013-03-12 13:49, Gleb Natapov wrote: > > On Tue, Mar 12, 2013 at 01:46:53PM +0100, Jan Kiszka wrote: > >> On 2013-03-12 13:29, Paolo Bonzini wrote: > >>> Il 12/03/2013 13:06, Paolo Bonzini ha scritto: > > @@ -6178,7 +6177,13 @@ i

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Jan Kiszka
On 2013-03-12 13:06, Paolo Bonzini wrote: > Il 12/03/2013 12:44, Jan Kiszka ha scritto: >> A VCPU sending INIT or SIPI to some other VCPU races for setting the >> remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED >> was overwritten by kvm_emulate_halt and, thus, got lost. >>

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Jan Kiszka
On 2013-03-12 13:58, Jan Kiszka wrote: > On 2013-03-12 13:06, Paolo Bonzini wrote: >> Il 12/03/2013 12:44, Jan Kiszka ha scritto: >>> A VCPU sending INIT or SIPI to some other VCPU races for setting the >>> remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED >>> was overwritten

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 13:46, Jan Kiszka ha scritto: >>> @@ -6178,7 +6177,13 @@ int kvm_arch_vcpu_ioctl_get_mpstate(struct >>> kvm_vcpu *vcpu, >>> int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, >>>struct kvm_mp_state *mp_state) >>>

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 12:44:41PM +0100, Jan Kiszka wrote: > A VCPU sending INIT or SIPI to some other VCPU races for setting the > remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED > was overwritten by kvm_emulate_halt and, thus, got lost. > > This introduces APIC events f

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 14:01, Jan Kiszka ha scritto: >>> >> For example, should kvm_arch_interrupt_allowed return zero if the VCPU >>> >> is in the INIT_RECEIVED state? >> > >> > Yeah, that probably makes sense beyond async_pf. > Wait: If you perform a proper reset on INIT already, we would clear IF > thus

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Jan Kiszka
On 2013-03-12 14:13, Paolo Bonzini wrote: > Il 12/03/2013 14:01, Jan Kiszka ha scritto: >> For example, should kvm_arch_interrupt_allowed return zero if the VCPU >> is in the INIT_RECEIVED state? Yeah, that probably makes sense beyond async_pf. >> Wait: If you perform a proper res

Re: [PATCH 04/29] arm64: KVM: system register definitions for 64bit guests

2013-03-12 Thread Christopher Covington
Hi Marc, Here are a few minor questions and suggestions. On 03/04/2013 10:47 PM, Marc Zyngier wrote: > Define the saved/restored registers for 64bit guests. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/include/asm/kvm_asm.h | 68 > > 1 file chang

Re: [PATCH 06/29] arm64: KVM: fault injection into a guest

2013-03-12 Thread Christopher Covington
Hi Marc, I noticed you went through the trouble of defining several constants in an earlier patch. Perhaps you could put them to use here? On 03/04/2013 10:47 PM, Marc Zyngier wrote: > Implement the injection of a fault (undefined, data abort or > prefetch abort) into a 64bit guest. > > Signed-o

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Jan Kiszka
On 2013-03-12 14:12, Gleb Natapov wrote: > On Tue, Mar 12, 2013 at 12:44:41PM +0100, Jan Kiszka wrote: >> A VCPU sending INIT or SIPI to some other VCPU races for setting the >> remote VCPU's mp_state. When we were unlucky, KVM_MP_STATE_INIT_RECEIVED >> was overwritten by kvm_emulate_halt and, thus

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Jan Kiszka
On 2013-03-12 14:25, Gleb Natapov wrote: > On Tue, Mar 12, 2013 at 02:16:29PM +0100, Jan Kiszka wrote: >> On 2013-03-12 14:13, Paolo Bonzini wrote: >>> Il 12/03/2013 14:01, Jan Kiszka ha scritto: For example, should kvm_arch_interrupt_allowed return zero if the VCPU is in the INIT

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 02:27:11PM +0100, Jan Kiszka wrote: > On 2013-03-12 14:25, Gleb Natapov wrote: > > On Tue, Mar 12, 2013 at 02:16:29PM +0100, Jan Kiszka wrote: > >> On 2013-03-12 14:13, Paolo Bonzini wrote: > >>> Il 12/03/2013 14:01, Jan Kiszka ha scritto: > For example, should kvm_

Re: [PATCH 04/29] arm64: KVM: system register definitions for 64bit guests

2013-03-12 Thread Christopher Covington
I now realize I accidentally appended some of the contents of the kvm_arm.h patch (03/29) and corresponding comment to my reply to the kvm_asm.h patch (04/29). If it's not clear what I meant, please let me know. Christopher -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Cent

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 02:21:17PM +0100, Jan Kiszka wrote: > On 2013-03-12 14:12, Gleb Natapov wrote: > > On Tue, Mar 12, 2013 at 12:44:41PM +0100, Jan Kiszka wrote: > >> A VCPU sending INIT or SIPI to some other VCPU races for setting the > >> remote VCPU's mp_state. When we were unlucky, KVM_MP_

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 14:41, Gleb Natapov ha scritto: > Not sure I understand. I am saying the code should be: > > if (test_and_clear_bit(KVM_APIC_INIT, &apic->pending_events)) { > vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED; > kvm_lapic_reset(vcpu); > kvm_vcpu_reset(vcpu); > } > if

Re: [PATCH 04/29] arm64: KVM: system register definitions for 64bit guests

2013-03-12 Thread Marc Zyngier
On 12/03/13 13:20, Christopher Covington wrote: Hi Christopher, > Here are a few minor questions and suggestions. > > On 03/04/2013 10:47 PM, Marc Zyngier wrote: >> Define the saved/restored registers for 64bit guests. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/include/asm/kvm_asm.

Re: [PATCH] KVM: x86: Convert INIT and SIPI signals into synchronously handled events

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 02:43:38PM +0100, Paolo Bonzini wrote: > Il 12/03/2013 14:41, Gleb Natapov ha scritto: > > Not sure I understand. I am saying the code should be: > > > > if (test_and_clear_bit(KVM_APIC_INIT, &apic->pending_events)) { > > vcpu->arch.mp_state = KVM_MP_STATE_INIT_RECEIVED

KVM call minutes 2013-03-12

2013-03-12 Thread Juan Quintela
Hi today we got a very small call, talking about GSOC projects. Please go to the wiki page if you have any project that you want to mentor. Stephan explains GSOC. Overview of mentoring for Google Summer of Code 2013: * Post project ideas here: http://wiki.qemu.org/Google_Summer_of_Code_2013

Re: [PATCH 06/29] arm64: KVM: fault injection into a guest

2013-03-12 Thread Marc Zyngier
On 12/03/13 13:20, Christopher Covington wrote: Hi Christopher, > I noticed you went through the trouble of defining several constants in an > earlier patch. Perhaps you could put them to use here? > > On 03/04/2013 10:47 PM, Marc Zyngier wrote: >> Implement the injection of a fault (undefined,

Re: Win2003 disk corruption with kvm-1.0. and virtio

2013-03-12 Thread Sylvain Bauza
Long lasting bug and huge update, but I think I got the root cause. FYI, Windows 2003 is having a write cache enabled by default on disk drivers. Even with virtio (see driver details, policies). As a consequence, any DLL which is open could be corrupted if we try a simple 'qemu-img convert' ag

Re: [PATCH 12/29] arm64: KVM: kvm_arch and kvm_vcpu_arch definitions

2013-03-12 Thread Christopher Covington
Hi Marc, On 03/04/2013 10:47 PM, Marc Zyngier wrote: > Provide the architecture dependent structures for VM and > vcpu abstractions. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/include/asm/kvm_host.h | 178 > ++ > 1 file changed, 178 insertions(+) >

Re: [PATCH 14/29] arm64: KVM: guest one-reg interface

2013-03-12 Thread Christopher Covington
Hi Marc, On 03/04/2013 10:47 PM, Marc Zyngier wrote: > Let userspace play with the guest registers. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/guest.c | 240 > + > 1 file changed, 240 insertions(+) > create mode 100644 arch/arm64/kvm

Re: [PATCH 14/29] arm64: KVM: guest one-reg interface

2013-03-12 Thread Marc Zyngier
On 12/03/13 17:31, Christopher Covington wrote: > Hi Marc, > > On 03/04/2013 10:47 PM, Marc Zyngier wrote: >> Let userspace play with the guest registers. >> >> Signed-off-by: Marc Zyngier >> --- >> arch/arm64/kvm/guest.c | 240 >> + >> 1 file cha

Re: win2k guest vm won't boot under Fedora 18 KVM

2013-03-12 Thread Earl Marwil
On 03/11/2013 02:27 AM, Gleb Natapov wrote: > On Mon, Mar 11, 2013 at 09:09:13AM +0100, Stefan Hajnoczi wrote: >> On Sat, Mar 09, 2013 at 12:43:32PM -0700, Earl Marwil wrote: >>> Hi, >>> >>> I'm looking for some guidance on how to get to the root cause of an >>> issue that I am observing with a wi

Re: win2k guest vm won't boot under Fedora 18 KVM

2013-03-12 Thread Gleb Natapov
On Tue, Mar 12, 2013 at 01:09:44PM -0600, Earl Marwil wrote: > > On 03/11/2013 02:27 AM, Gleb Natapov wrote: > > On Mon, Mar 11, 2013 at 09:09:13AM +0100, Stefan Hajnoczi wrote: > >> On Sat, Mar 09, 2013 at 12:43:32PM -0700, Earl Marwil wrote: > >>> Hi, > >>> > >>> I'm looking for some guidance on

Re: [PATCH v7 0/3] AER-KVM: Error containment of VFIO devices assigned to KVM guests

2013-03-12 Thread Alex Williamson
On Sat, 2013-03-09 at 01:52 -0600, Vijay Mohan Pandarathil wrote: > Add support for error containment when a VFIO device assigned to a KVM > guest encounters an error. This is for PCIe devices/drivers that support AER > functionality. When the host OS is notified of an error in a device either > th

Re: Win2003 disk corruption with kvm-1.0. and virtio

2013-03-12 Thread Jorge Armando Medina
On 12/03/13 09:48, Sylvain Bauza wrote: > Long lasting bug and huge update, but I think I got the root cause. > FYI, Windows 2003 is having a write cache enabled by default on disk > drivers. Even with virtio (see driver details, policies). Hi there, That option did you use in driver policy? Tha

Re: [PATCH 14/29] arm64: KVM: guest one-reg interface

2013-03-12 Thread Christopher Covington
Hi Marc, On 03/12/2013 02:05 PM, Marc Zyngier wrote: > On 12/03/13 17:31, Christopher Covington wrote: >> Hi Marc, >> >> On 03/04/2013 10:47 PM, Marc Zyngier wrote: >>> Let userspace play with the guest registers. >>> >>> Signed-off-by: Marc Zyngier >>> --- >>> arch/arm64/kvm/guest.c | 240 >>>

KVM: MMU: make kvm_mmu_available_pages robust against n_used_mmu_pages > n_max_mmu_pages

2013-03-12 Thread Marcelo Tosatti
As noticed by Ulrich Obergfell , the mmu counters are for beancounting purposes only - so n_used_mmu_pages and n_max_mmu_pages could be relaxed (example: before f0f5933a1626c8df7b), resulting in n_used_mmu_pages > n_max_mmu_pages. Make code robust against n_used_mmu_pages > n_max_mmu_pages. Sign

Re: [PATCH 0/2] KVM: Optimize mmio spte zapping when creating/moving memslot

2013-03-12 Thread Marcelo Tosatti
On Tue, Mar 12, 2013 at 05:43:33PM +0900, Takuya Yoshikawa wrote: > This is only for mmio spte zapping, not for all zap_all() cases. > > Takuya Yoshikawa (2): > KVM: MMU: Mark sp mmio cached when creating mmio spte > KVM: x86: Optimize mmio spte zapping when creating/moving memslot > > arch/

Re: [PATCH 2/2] KVM: x86: Optimize mmio spte zapping when creating/moving memslot

2013-03-12 Thread Marcelo Tosatti
On Tue, Mar 12, 2013 at 02:06:22PM +0200, Gleb Natapov wrote: > On Tue, Mar 12, 2013 at 05:45:30PM +0900, Takuya Yoshikawa wrote: > > When we create or move a memory slot, we need to zap mmio sptes. > > Currently, zap_all() is used for this and this is causing two problems: > > - extra page faults

Re: [PATCH V2 WIP 2/2] vhost-scsi: new device supporting the tcm_vhost Linux kernel module

2013-03-12 Thread Asias He
On Tue, Mar 12, 2013 at 09:20:24AM +0100, Stefan Hajnoczi wrote: > On Tue, Mar 12, 2013 at 02:29:42PM +0800, Asias He wrote: > > diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c > > index 39c1966..4a97ca1 100644 > > --- a/hw/virtio-pci.c > > +++ b/hw/virtio-pci.c > > These changes break the build fo

Re: [PATCH 1/4] tcm_vhost: Add missed lock in vhost_scsi_clear_endpoint()

2013-03-12 Thread Asias He
On Tue, Mar 12, 2013 at 01:13:44PM +0200, Michael S. Tsirkin wrote: > On Tue, Mar 12, 2013 at 10:42:48AM +0800, Asias He wrote: > > tv_tpg->tv_tpg_vhost_count should be protected by tv_tpg->tv_tpg_mutex. > > > > Signed-off-by: Asias He > > Reviewed-by: Stefan Hajnoczi > > --- > > drivers/vhost/

Re: [PATCH 2/4] tcm_vhost: Introduce tcm_vhost_check_endpoint()

2013-03-12 Thread Asias He
On Tue, Mar 12, 2013 at 09:26:18AM +0100, Paolo Bonzini wrote: > Il 12/03/2013 03:42, Asias He ha scritto: > > This helper is useful to check if vs->vs_endpoint is setup by > > vhost_scsi_set_endpoint() > > > > Signed-off-by: Asias He > > Reviewed-by: Stefan Hajnoczi > > --- > > drivers/vhost/t

Re: [PATCH 3/4] tcm_vhost: Fix vs->vs_endpoint checking in vhost_scsi_handle_vq()

2013-03-12 Thread Asias He
On Tue, Mar 12, 2013 at 01:11:19PM +0200, Michael S. Tsirkin wrote: > On Tue, Mar 12, 2013 at 10:42:50AM +0800, Asias He wrote: > > vs->vs_endpoint is protected by the vs->dev.mutex. Use > > tcm_vhost_check_endpoint() to do check. The helper does the needed > > locking for us. > > > > Signed-off-b

Re: [PATCH V2 0/6] tcm_vhost hotplug/hotunplug support and locking/flushing fix

2013-03-12 Thread Asias He
On Tue, Mar 12, 2013 at 11:55:14AM +0200, Michael S. Tsirkin wrote: > On Tue, Mar 12, 2013 at 10:31:09AM +0800, Asias He wrote: > > On Mon, Mar 11, 2013 at 02:03:27PM +0200, Michael S. Tsirkin wrote: > > > On Fri, Mar 08, 2013 at 10:21:41AM +0800, Asias He wrote: > > > > Changes in v2: > > > > - Re

[PATCH 1/6] KVM: MMU: move mmu related members into a separate struct

2013-03-12 Thread Xiao Guangrong
Move all mmu related members from kvm_arch to a separate struct named kvm_mmu_cache, so we can easily reset the mmu cache when we zap all shadow pages Signed-off-by: Xiao Guangrong --- arch/x86/include/asm/kvm_host.h |6 +- arch/x86/kvm/mmu.c | 36 -

[PATCH 2/6] KVM: MMU: introduce mmu_cache->pte_list_descs

2013-03-12 Thread Xiao Guangrong
This list is used to link all the pte_list_desc used by mmu cache, so we can easily free the memory used by gfn's rmap and parent spte list [ The new function name: kvm_mmu_init is vey similar with init_kvm_mmu which actually init vcpu mmu, will rename init_kvm_mmu to init_vcpu_mmu ] Signed-off

[PATCH 3/6] KVM: x86: introduce memslot_set_lpage_disallowed

2013-03-12 Thread Xiao Guangrong
It is used to set disallowed lage page on the specified level, can be used in later patch Signed-off-by: Xiao Guangrong --- arch/x86/kvm/x86.c | 53 ++- 1 files changed, 35 insertions(+), 18 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x8

[PATCH 4/6] KVM: x86: introduce kvm_clear_all_gfn_page_info

2013-03-12 Thread Xiao Guangrong
This function is used to reset the rmaps and page info of all guest page which will be used in later patch Signed-off-by: Xiao Guangrong --- arch/x86/kvm/x86.c | 31 +++ include/linux/kvm_host.h |1 + 2 files changed, 32 insertions(+), 0 deletions(-) diff

[PATCH 5/6] KVM: MMU: delete shadow page from hash list in kvm_mmu_prepare_zap_page

2013-03-12 Thread Xiao Guangrong
Move deletion shadow page from the hash list from kvm_mmu_commit_zap_page to kvm_mmu_prepare_zap_page, we that we can free the shadow page out of mmu-lock. Also, delete the invalid shadow page from the hash list since this page can not be reused anymore. This makes reset mmu-cache more easier - we

[PATCH 6/6] KVM: MMU: fast zap all shadow pages

2013-03-12 Thread Xiao Guangrong
The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to walk and zap all shadow pages one by one, also it need to zap all guest page's rmap and all shadow page's parent spte list. Particularly, things become worse if guest uses more memory or vcpus. It is not good for scalability. S

Re: [PATCH 1/2] KVM: MMU: Mark sp mmio cached when creating mmio spte

2013-03-12 Thread Xiao Guangrong
On 03/12/2013 04:44 PM, Takuya Yoshikawa wrote: > This will be used not to zap unrelated mmu pages when creating/moving > a memory slot later. How about save all mmio spte into a mmio-rmap? The good things are: - instead walking all shadow page, we can only walk the rmap - Comparing to zap a shad

Re: [PATCH 1/2] tcm_vhost: Wait for pending requests in vhost_scsi_flush()

2013-03-12 Thread Asias He
On Tue, Mar 12, 2013 at 09:21:51AM +0100, Paolo Bonzini wrote: > Il 12/03/2013 02:31, Asias He ha scritto: > > On Mon, Mar 11, 2013 at 12:36:37PM +0100, Paolo Bonzini wrote: > >> Il 11/03/2013 06:09, Asias He ha scritto: > >>> This patch makes vhost_scsi_flush() wait for all the pending requests >

Re: KVM: MMU: make kvm_mmu_available_pages robust against n_used_mmu_pages > n_max_mmu_pages

2013-03-12 Thread Xiao Guangrong
On 03/13/2013 09:36 AM, Marcelo Tosatti wrote: > > As noticed by Ulrich Obergfell , the mmu > counters are for beancounting purposes only - so n_used_mmu_pages and > n_max_mmu_pages could be relaxed (example: before f0f5933a1626c8df7b), > resulting in n_used_mmu_pages > n_max_mmu_pages. > Intere