[PATCH v12 rebased 4/8] add a new runstate: RUN_STATE_GUEST_PANICKED

2013-01-22 Thread Hu Tao
The guest will be in this state when it is panicked. If guest is panicked during live migration, the runstate RUN_STATE_GUEST_PANICKED will be transferred to dest machine. Signed-off-by: Wen Congyang Signed-off-by: Hu Tao --- migration.c | 1 + qapi-schema.json | 6 +- qmp.c

[PATCH v12 rebased 3/8] update kernel headers

2013-01-22 Thread Hu Tao
update kernel headers to add pv event macros. Signed-off-by: Wen Congyang Signed-off-by: Hu Tao --- linux-headers/asm-x86/kvm_para.h | 1 + linux-headers/linux/kvm_para.h | 6 ++ 2 files changed, 7 insertions(+) diff --git a/linux-headers/asm-x86/kvm_para.h b/linux-headers/asm-x86/kvm_pa

[PATCH v12 rebased 0/8] pv event to notify host when the guest is panicked

2013-01-22 Thread Hu Tao
This series implements a new interface, kvm pv event, to notify host when some events happen in guest. Right now there is one supported event: guest panic. Also, the cpu runstate is preserved during save/load vm and migration. Thus, if vm is panicked during migration, we can still know it by qurin

[PATCH v12 rebased] kvm: notify host when the guest is panicked

2013-01-22 Thread Hu Tao
We can know the guest is panicked when the guest runs on xen. But we do not have such feature on kvm. Another purpose of this feature is: management app(for example: libvirt) can do auto dump when the guest is panicked. If management app does not do auto dump, the guest's user can do dump by hand

[PATCH v12 rebased 5/8] add a new qevent: QEVENT_GUEST_PANICKED

2013-01-22 Thread Hu Tao
This event will be emited when the guest is panicked. Signed-off-by: Wen Congyang --- include/monitor/monitor.h | 1 + monitor.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 87fb49c..4006905 100644 --- a/include

[PATCH v12 rebased 2/8] start vm after resetting it

2013-01-22 Thread Hu Tao
From: Wen Congyang The guest should run after resetting it, but it does not run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED. We don't set runstate to RUN_STATE_PAUSED when resetting the guest, so the runstate will be changed from RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED

[PATCH v12 rebased 7/8] allower the user to disable pv event support

2013-01-22 Thread Hu Tao
Signed-off-by: Wen Congyang Signed-off-by: Hu Tao --- hw/pc_piix.c| 9 - qemu-options.hx | 3 ++- vl.c| 4 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hw/pc_piix.c b/hw/pc_piix.c index fed6ccf..507c98b 100644 --- a/hw/pc_piix.c +++ b/hw/pc_piix.c

[PATCH v12 rebased 1/8] preserve cpu runstate

2013-01-22 Thread Hu Tao
This patch enables preservation of cpu runstate during save/load vm. So when a vm is restored from snapshot, the cpu runstate is restored, too. See following example: # save two vms: one is running, the other is paused (qemu) info status VM status: running (qemu) savevm running (qemu) stop (qemu)

[PATCH v12 rebased 6/8] introduce a new qom device to deal with panicked event

2013-01-22 Thread Hu Tao
If the target is x86/x86_64, the guest's kernel will write 0x01 to the port KVM_PV_EVENT_PORT when it is panciked. This patch introduces a new qom device kvm_pv_ioport to listen this I/O port, and deal with panicked event according to panicked_action's value. The possible actions are: 1. emit QEVEN

[PATCH v12 rebased 8/8] pv event: add document to describe the usage

2013-01-22 Thread Hu Tao
Signed-off-by: Hu Tao --- docs/pv-event.txt | 17 + 1 file changed, 17 insertions(+) create mode 100644 docs/pv-event.txt diff --git a/docs/pv-event.txt b/docs/pv-event.txt new file mode 100644 index 000..ac9e7fa --- /dev/null +++ b/docs/pv-event.txt @@ -0,0 +1,17 @@ +KVM PV

RE: [PATCH 2/2] x86, apicv: Add Posted Interrupt supporting

2013-01-22 Thread Zhang, Yang Z
Marcelo Tosatti wrote on 2013-01-23: > On Thu, Dec 13, 2012 at 03:29:40PM +0800, Yang Zhang wrote: >> From: Yang Zhang >> >> Posted Interrupt allows APIC interrupts to inject into guest directly >> without any vmexit. >> >> - When delivering a interrupt to guest, if target vcpu is running, >>

RE: [PATCH v11 3/3] x86, apicv: add virtual interrupt delivery support

2013-01-22 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-01-21: > On Mon, Jan 21, 2013 at 12:49:01AM +, Zhang, Yang Z wrote: >> Gleb Natapov wrote on 2013-01-20: >>> On Thu, Jan 17, 2013 at 01:26:03AM +, Zhang, Yang Z wrote: Previous patch is stale. Resend the new patch. The only change is clear EOI and SELF-I

RE: [PATCH v11 2/3] x86, apicv: add virtual x2apic support

2013-01-22 Thread Zhang, Yang Z
Marcelo Tosatti wrote on 2013-01-23: > On Tue, Jan 22, 2013 at 05:55:53PM +0200, Gleb Natapov wrote: >> On Tue, Jan 22, 2013 at 12:21:47PM +, Zhang, Yang Z wrote: > +static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu) > +{ > + unsigned long *msr_bitmap; > + > + if (apic_x2

Re: [PATCH v2 8/8] KVM: x86 emulator: convert a few freestanding emulations to fastop

2013-01-22 Thread Marcelo Tosatti
Missing signed off by. On Sat, Jan 19, 2013 at 07:51:57PM +0200, Avi Kivity wrote: > --- > arch/x86/kvm/emulate.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org

[PATCH][v2] KVM: PPC: add paravirt idle loop for 64-bit book E

2013-01-22 Thread Stuart Yoder
From: Stuart Yoder Signed-off-by: Stuart Yoder --- -v2 -macro'ized loop in idle_book3e.S to avoid code duplication, paravirt loop is now in idle_book3e.S arch/powerpc/kernel/epapr_hcalls.S |2 ++ arch/powerpc/kernel/idle_book3e.S | 30 -- 2 files cha

Re: [PATCH v11 2/3] x86, apicv: add virtual x2apic support

2013-01-22 Thread Marcelo Tosatti
On Tue, Jan 22, 2013 at 05:55:53PM +0200, Gleb Natapov wrote: > On Tue, Jan 22, 2013 at 12:21:47PM +, Zhang, Yang Z wrote: > > >> +static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu) > > >> +{ > > >> +unsigned long *msr_bitmap; > > >> + > > >> +if (apic_x2apic_mode(vcpu->arch.

Re: [PATCH 2/2] x86, apicv: Add Posted Interrupt supporting

2013-01-22 Thread Marcelo Tosatti
On Thu, Dec 13, 2012 at 03:29:40PM +0800, Yang Zhang wrote: > From: Yang Zhang > > Posted Interrupt allows APIC interrupts to inject into guest directly > without any vmexit. > > - When delivering a interrupt to guest, if target vcpu is running, > update Posted-interrupt requests bitmap and se

Re: [Qemu-devel] [PATCH for-1.4 01/12] kvm: Add fake KVM_FEATURE_CLOCKSOURCE_STABLE_BIT for builds withou KVM

2013-01-22 Thread Marcelo Tosatti
On Tue, Jan 22, 2013 at 05:59:14AM +0100, Andreas Färber wrote: > Am 22.01.2013 02:43, schrieb Marcelo Tosatti: > > On Thu, Jan 17, 2013 at 06:59:27PM -0200, Eduardo Habkost wrote: > >> Signed-off-by: Eduardo Habkost > >> --- > >> Cc: kvm@vger.kernel.org > >> Cc: Michael S. Tsirkin > >> Cc: Gleb

[PATCH for-1.4 qom-cpu 1/9] kvm: Create kvm_arch_vcpu_id() function

2013-01-22 Thread Eduardo Habkost
This will allow each architecture to define how the VCPU ID is set on the KVM_CREATE_VCPU ioctl call. Signed-off-by: Eduardo Habkost --- Cc: kvm@vger.kernel.org Cc: Michael S. Tsirkin Cc: Gleb Natapov Cc: Marcelo Tosatti Changes v2: - Get CPUState as argument instead of CPUArchState Changes

[PATCH for-1.4 qom-cpu 2/9] target-i386: kvm: Set vcpu_id to APIC ID instead of CPU index

2013-01-22 Thread Eduardo Habkost
The CPU ID in KVM is supposed to be the APIC ID, so change the KVM_CREATE_VCPU call to match it. The current behavior didn't break anything yet because today the APIC ID is assumed to be equal to the CPU index, but this won't be true in the future. Signed-off-by: Eduardo Habkost Reviewed-by: Marc

Re: [PATCH v2] kvm tools: remove redundant "if" condition

2013-01-22 Thread Pekka Enberg
On Sat, Jan 19, 2013 at 12:27 PM, Cong Ding wrote: > On Sat, Jan 19, 2013 at 10:58:33AM +0200, Pekka Enberg wrote: >> On Wed, Jan 16, 2013 at 6:52 PM, Cong Ding wrote: >> > After we check (state.kcount != 0), state.kcount has to be 0 in all the >> > "else" >> > branchs. >> > >> > Signed-off-by:

[RFC] KVM/arm64, take #3

2013-01-22 Thread Marc Zyngier
Guys, I've once more updated the branches for KVM/arm64 - kvm-arm/pre-arm64: kvm-arm-master as of today + the "cleanup" branch + some basic perf support - arm64/soc-armv8-model: Catalin Marinas' arm64 branch - arm64/psci: Implementation of PSCI for the above - arm64/perf: host/guest discrimina

windows 2008 guest causing rcu_shed to emit NMI

2013-01-22 Thread Andrey Korolyov
Hi, problem described in the title happens on heavy I/O pressure on the host, without idle=poll trace almost always is the same, involving mwait, with poll and nohz=off RIP varies from time to time, at the previous hang it was tg_throttle_down, rather than test_ti_thread_flag in attached one. Both

[QEMU PATCH v5 0/3] virtio-net: fix of ctrl commands

2013-01-22 Thread Amos Kong
Currently virtio-net code relys on the layout of descriptor, this patchset removed the assumptions and introduced a control command to set mac address. Last patch is a trivial renaming. V2: check guest's iov_len V3: fix of migration compatibility make mac field in config space read-only when n

Re: [PATCH v11 2/3] x86, apicv: add virtual x2apic support

2013-01-22 Thread Gleb Natapov
On Tue, Jan 22, 2013 at 12:21:47PM +, Zhang, Yang Z wrote: > >> +static void vmx_set_msr_bitmap(struct kvm_vcpu *vcpu) > >> +{ > >> + unsigned long *msr_bitmap; > >> + > >> + if (apic_x2apic_mode(vcpu->arch.apic)) > > > > vcpu->arch.apic can be NULL. > Actually, call apic_x2apic_mode to chec

Re: [Qemu-devel] [PATCH for-1.4 04/12] kvm: Create kvm_arch_vcpu_id() function

2013-01-22 Thread Eduardo Habkost
On Mon, Jan 21, 2013 at 07:35:22AM -0700, Eric Blake wrote: > On 01/21/2013 06:14 AM, Andreas Färber wrote: > >> glibc is already responsible from converting the 'unsigned long > >> int' of the user declaration back into the 'unsigned int' that the > >> kernel expects for the second argument. The

[QEMU PATCH v5 1/3] virtio-net: remove layout assumptions for ctrl vq

2013-01-22 Thread Amos Kong
From: Michael S. Tsirkin Virtio-net code makes assumption about virtqueue descriptor layout (e.g. sg[0] is the header, sg[1] is the data buffer). This patch makes code not rely on the layout of descriptors. Signed-off-by: Michael S. Tsirkin Signed-off-by: Amos Kong --- hw/virtio-net.c | 129

[QEMU PATCH v5 3/3] virtio-net: rename ctrl rx commands

2013-01-22 Thread Amos Kong
This patch makes rx commands consistent with specification. Signed-off-by: Amos Kong --- hw/virtio-net.c | 14 +++--- hw/virtio-net.h | 14 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index acef5a5..ac4434e 100644

Re: KVM call agenda for 2013-01-22

2013-01-22 Thread Juan Quintela
Juan Quintela wrote: > Hi > > Please send in any agenda topics you are interested in. As there are no topics, no call Today. See you next week. Later, Juan. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo inf

Re: [QEMU PATCH v4 1/3] virtio-net: remove layout assumptions for ctrl vq

2013-01-22 Thread Stefan Hajnoczi
On Tue, Jan 22, 2013 at 10:38:14PM +0800, Amos Kong wrote: > On Mon, Jan 21, 2013 at 05:03:30PM +0100, Stefan Hajnoczi wrote: > > On Sat, Jan 19, 2013 at 09:54:26AM +0800, ak...@redhat.com wrote: > > > From: "Michael S. Tsirkin" > > > > > > Virtio-net code makes assumption about virtqueue descrip

Re: [QEMU PATCH v4 1/3] virtio-net: remove layout assumptions for ctrl vq

2013-01-22 Thread Amos Kong
On Mon, Jan 21, 2013 at 05:03:30PM +0100, Stefan Hajnoczi wrote: > On Sat, Jan 19, 2013 at 09:54:26AM +0800, ak...@redhat.com wrote: > > From: "Michael S. Tsirkin" > > > > Virtio-net code makes assumption about virtqueue descriptor layout > > (e.g. sg[0] is the header, sg[1] is the data buffer).

Re: [Qemu-devel] [PATCH for-1.4 01/12] kvm: Add fake KVM_FEATURE_CLOCKSOURCE_STABLE_BIT for builds withou KVM

2013-01-22 Thread Eduardo Habkost
On Tue, Jan 22, 2013 at 05:59:14AM +0100, Andreas Färber wrote: > Am 22.01.2013 02:43, schrieb Marcelo Tosatti: > > On Thu, Jan 17, 2013 at 06:59:27PM -0200, Eduardo Habkost wrote: > >> Signed-off-by: Eduardo Habkost > >> --- > >> Cc: kvm@vger.kernel.org > >> Cc: Michael S. Tsirkin > >> Cc: Gleb

RE: [PATCH v11 2/3] x86, apicv: add virtual x2apic support

2013-01-22 Thread Zhang, Yang Z
Marcelo Tosatti wrote on 2013-01-22: > On Wed, Jan 16, 2013 at 06:21:11PM +0800, Yang Zhang wrote: >> From: Yang Zhang >> >> basically to benefit from apicv, we need to enable virtualized x2apic mode. >> Currently, we only enable it when guest is really using x2apic. >> >> Also, clear MSR bitmap

Re: [QEMU PATCH v4 2/3] virtio-net: introduce a new macaddr control

2013-01-22 Thread Amos Kong
On Mon, Jan 21, 2013 at 05:08:26PM +0100, Stefan Hajnoczi wrote: > On Sat, Jan 19, 2013 at 09:54:27AM +0800, ak...@redhat.com wrote: > > @@ -350,6 +351,18 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t > > cmd, > > struct virtio_net_ctrl_mac mac_data; > > size_t s; > > > > +

Re: [PATCH v11 2/3] x86, apicv: add virtual x2apic support

2013-01-22 Thread Gleb Natapov
On Mon, Jan 21, 2013 at 10:33:46PM -0200, Marcelo Tosatti wrote: > > The question is, why is intercept for EOI MSR address (0x80B) not being > > disabled here, while TPR is? I don't see intercept disabled by other > > patches either. > > Point still valid: why intercept for EOI MSR address not bei

Re: [PATCH v11 2/3] x86, apicv: add virtual x2apic support

2013-01-22 Thread Gleb Natapov
On Mon, Jan 21, 2013 at 08:16:18PM -0200, Marcelo Tosatti wrote: > On Mon, Jan 21, 2013 at 11:34:20PM +0200, Gleb Natapov wrote: > > On Mon, Jan 21, 2013 at 07:21:13PM -0200, Marcelo Tosatti wrote: > > > On Mon, Jan 21, 2013 at 10:21:14PM +0200, Gleb Natapov wrote: > > > > > > } > > > > > > + >