Re: [Qemu-devel] [PATCH 1/3] start vm after reseting it

2012-06-12 Thread Wen Congyang
At 05/31/2012 03:17 AM, Luiz Capitulino Wrote: > On Mon, 21 May 2012 14:49:32 +0800 > Wen Congyang wrote: > >> The guest should run after reseting it, but it does not >> run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED. >> >> Signed-off-by: Wen Congyang >> --- >> vl.c |1

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-06-12 Thread Kevin Wolf
Am 12.06.2012 03:52, schrieb Marcelo Tosatti: > On Thu, Jun 07, 2012 at 01:13:50PM +0100, Stefan Hajnoczi wrote: >> The 1st bad commit in your attached list is abc551bd >> More detailed info: >> 171d2f2249a360d7d623130d3aa991418c53716d good >> fd453a24166e36a3d376c9bc221e520e3

Re: [PATCH] kvm: notify host when guest panicked

2012-06-12 Thread Christian Borntraeger
>> We have three solutions to implement this feature: >> 1. use vmcall >> 2. use I/O port >> 3. use virtio-serial. > >> We have decided to avoid touching hypervisor. The reason why I choose >> choose the I/O port is: >> 1. it is easier to implememt >> 2. it does not depend any virtual device >> 3.

Re: [PATCH] kvm: notify host when guest panicked

2012-06-12 Thread Wen Congyang
At 06/12/2012 03:49 PM, Christian Borntraeger Wrote: >>> We have three solutions to implement this feature: >>> 1. use vmcall >>> 2. use I/O port >>> 3. use virtio-serial. >> >>> We have decided to avoid touching hypervisor. The reason why I choose >>> choose the I/O port is: >>> 1. it is easier to

Re: [PATCH] kvm: notify host when guest panicked

2012-06-12 Thread Wen Congyang
At 06/12/2012 03:49 PM, Christian Borntraeger Wrote: >>> We have three solutions to implement this feature: >>> 1. use vmcall >>> 2. use I/O port >>> 3. use virtio-serial. >> >>> We have decided to avoid touching hypervisor. The reason why I choose >>> choose the I/O port is: >>> 1. it is easier to

Re: Bug? 100% load on core after physically removing USB storage from host

2012-06-12 Thread Stefan Hajnoczi
On Tue, Jun 12, 2012 at 6:02 AM, Emmanuel Noobadmin wrote: > After removing a USB flash drive using virtual machine manager, I > notice that the core assigned to the VM guest goes up to 100% load. > Within the guest itself, there is no significant activity. > > This also prompted me to look at the

Re: WARNING: at arch/x86/kernel/kvmclock.c:127

2012-06-12 Thread Sedat Dilek
On Tue, Jun 12, 2012 at 4:13 AM, Marcelo Tosatti wrote: > On Mon, Jun 11, 2012 at 06:10:34PM -0400, Eric B Munson wrote: >> On Mon, 11 Jun 2012 19:07:19 -0300, Marcelo Tosatti wrote: >> >On Mon, Jun 11, 2012 at 05:47:00PM -0400, Eric B Munson wrote: >> >>On Sun, 10 Jun 2012 17:47:24 +0200, Sedat D

Re: [PATCH] kvm: notify host when guest panicked

2012-06-12 Thread Gleb Natapov
On Tue, Jun 12, 2012 at 04:26:35PM +0800, Wen Congyang wrote: > At 06/12/2012 03:49 PM, Christian Borntraeger Wrote: > >>> We have three solutions to implement this feature: > >>> 1. use vmcall > >>> 2. use I/O port > >>> 3. use virtio-serial. > >> > >>> We have decided to avoid touching hypervisor

Re: [RFC 00/10] KVM: Add TMEM host/guest support

2012-06-12 Thread Avi Kivity
On 06/12/2012 04:18 AM, Dan Magenheimer wrote: >> From: Avi Kivity [mailto:a...@redhat.com] >> Subject: Re: [RFC 00/10] KVM: Add TMEM host/guest support >> >> On 06/11/2012 06:44 PM, Dan Magenheimer wrote: >> > > >> This is pretty steep. We have flash storage doing a million iops/sec, >> > > >> a

Re: KVM entry failed, hardware error

2012-06-12 Thread Johannes Bauer
On 10.06.2012 17:19, Avi Kivity wrote: > Looks like we weren't dealing with interrupts correctly. I pushed some > patches, please pull again and retry. Updated to cf3d9372065470403e0780599ca612553211a10b and it works perfectly for me! Thank you very much for the support! Very cool! Best regards

Re: Bug? 100% load on core after physically removing USB storage from host

2012-06-12 Thread Emmanuel Noobadmin
On 6/12/12, Stefan Hajnoczi wrote: >> After some testing, the only steps needed are >> 1. VMM add physical host usb device -> select storage to guest >> 2. VMM remove hardware >> 3. Physically remove the USB storage from the host, thread/core >> assigned to guest goes 100% > > Two clarifications:

Re: KVM entry failed, hardware error

2012-06-12 Thread Avi Kivity
On 06/12/2012 01:23 PM, Johannes Bauer wrote: > On 10.06.2012 17:19, Avi Kivity wrote: > >> Looks like we weren't dealing with interrupts correctly. I pushed some >> patches, please pull again and retry. > > Updated to cf3d9372065470403e0780599ca612553211a10b and it works > perfectly for me! Go

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-06-12 Thread Marcelo Tosatti
On Tue, Jun 12, 2012 at 09:45:16AM +0200, Kevin Wolf wrote: > Am 12.06.2012 03:52, schrieb Marcelo Tosatti: > > On Thu, Jun 07, 2012 at 01:13:50PM +0100, Stefan Hajnoczi wrote: > >> The 1st bad commit in your attached list is abc551bd > >> More detailed info: > >> 171d2f2249a360d7d62313

Re: [RFC 00/10] KVM: Add TMEM host/guest support

2012-06-12 Thread Avi Kivity
On 06/11/2012 10:25 PM, Sasha Levin wrote: > On Mon, 2012-06-11 at 20:06 +0300, Avi Kivity wrote: >> Sorry, no, first demonstrate no performance regressions, then we can >> talk about performance improvements. > > No performance regressions? For caching? How would that work? A small degradation

Re: [RFC 00/10] KVM: Add TMEM host/guest support

2012-06-12 Thread Avi Kivity
On 06/11/2012 10:56 PM, Sasha Levin wrote: > > btw, so far we've been poking on half of the code here. > > What about frontswap over kvm-tmem? are there any specific tests you'd > like to see there? hmm. On one hand, no one swaps these days so there aren't any good benchmarks for it. On the ot

Re: [RFC 00/10] KVM: Add TMEM host/guest support

2012-06-12 Thread Gleb Natapov
On Tue, Jun 12, 2012 at 02:46:38PM +0300, Avi Kivity wrote: > On 06/11/2012 10:56 PM, Sasha Levin wrote: > > > > btw, so far we've been poking on half of the code here. > > > > What about frontswap over kvm-tmem? are there any specific tests you'd > > like to see there? > > hmm. On one hand, no

[PATCHv2 2/5] KVM: emulator: make x86 emulation modes enum instead of defines

2012-06-12 Thread Gleb Natapov
Signed-off-by: Gleb Natapov --- arch/x86/include/asm/kvm_emulate.h | 22 ++ arch/x86/kvm/emulate.c |4 +++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index 1ac46c

[PATCHv2 3/5] KVM: emulator: move some address manipulation function out of emulator code.

2012-06-12 Thread Gleb Natapov
The functions will be used outside of the emulator. Signed-off-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h | 25 + arch/x86/kvm/emulate.c | 15 ++- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/kvm_

[PATCHv2 1/5] Provide userspace IO exit completion callback.

2012-06-12 Thread Gleb Natapov
Current code assumes that IO exit was due to instruction emulation and handles execution back to emulator directly. This patch adds new userspace IO exit completion callback that can be set by any other code that caused IO exit to userspace. Signed-off-by: Gleb Natapov --- arch/x86/include/asm/k

[PATCHv2 0/5] improve speed of "rep ins" emulation

2012-06-12 Thread Gleb Natapov
With this patches loading 100M initrd takes ~10s instead of ~40s without. Changelog: v1->v2 - add segment check and mask rcx/rdi correctly drying increment. Gleb Natapov (5): Provide userspace IO exit completion callback. KVM: emulator: make x86 emulation modes enum instead of defines K

[PATCHv2 4/5] KVM: emulator: move linearize() out of emulator code.

2012-06-12 Thread Gleb Natapov
The function will be used outside of the emulator. Signed-off-by: Gleb Natapov --- arch/x86/include/asm/kvm_emulate.h | 14 -- arch/x86/kvm/emulate.c | 84 ++-- arch/x86/kvm/x86.c | 92 ++-- 3 files

[PATCHv2 5/5] KVM: Provide fast path for "rep ins" emulation if possible.

2012-06-12 Thread Gleb Natapov
"rep ins" emulation is going through emulator now. This is slow because emulator knows how to write back only one datum at a time. This patch provides fast path for the instruction in certain conditions. The conditions are: DF flag is not set, destination memory is RAM and single datum does not cro

Re: [RFC 00/10] KVM: Add TMEM host/guest support

2012-06-12 Thread Avi Kivity
On 06/12/2012 02:58 PM, Gleb Natapov wrote: > On Tue, Jun 12, 2012 at 02:46:38PM +0300, Avi Kivity wrote: >> On 06/11/2012 10:56 PM, Sasha Levin wrote: >> > >> > btw, so far we've been poking on half of the code here. >> > >> > What about frontswap over kvm-tmem? are there any specific tests you'

Re: [Qemu-devel] [PATCH 3/3] deal with guest panicked event

2012-06-12 Thread Luiz Capitulino
On Tue, 12 Jun 2012 14:55:37 +0800 Wen Congyang wrote: > >> +static void panicked_perform_action(void) > >> +{ > >> +switch(panicked_action) { > >> +case PANICKED_REPORT: > >> +panicked_mon_event("report"); > >> +break; > >> + > >> +case PANICKED_PAUSE: > >> +p

Re: [Qemu-devel] [PATCH 3/3] deal with guest panicked event

2012-06-12 Thread Daniel P. Berrange
On Tue, Jun 12, 2012 at 09:35:04AM -0300, Luiz Capitulino wrote: > On Tue, 12 Jun 2012 14:55:37 +0800 > Wen Congyang wrote: > > > >> +static void panicked_perform_action(void) > > >> +{ > > >> +switch(panicked_action) { > > >> +case PANICKED_REPORT: > > >> +panicked_mon_event("rep

Re: [PATCH 1/4] drivers/net/ethernet/sfc: Add efx_ prefix to set_bit_le()

2012-06-12 Thread Takuya Yoshikawa
On Mon, 11 Jun 2012 14:09:15 + Arnd Bergmann wrote: > On Monday 11 June 2012, Takuya Yoshikawa wrote: > > > > /* Set bit in a little-endian bitfield */ > > -static inline void set_bit_le(unsigned nr, unsigned char *addr) > > +static inline void efx_set_bit_le(unsigned nr, unsigned char *add

Re: [PATCH 3/4] bitops: Introduce generic set_bit_le()

2012-06-12 Thread Takuya Yoshikawa
On Mon, 11 Jun 2012 14:10:26 + Arnd Bergmann wrote: > On Monday 11 June 2012, Takuya Yoshikawa wrote: > > From: Takuya Yoshikawa > > > > Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is > > being used for this missing function. > > > > Signed-off-by: Takuya Yoshikawa

Re: [PATCH 1/4] drivers/net/ethernet/sfc: Add efx_ prefix to set_bit_le()

2012-06-12 Thread Arnd Bergmann
On Tuesday 12 June 2012, Takuya Yoshikawa wrote: > > > > Hmm, any reason why we're not just using the existing non-atomic > > __set_bit_le() here? I think the helpers in sfc and tulip can > > just get removed if you use those. > > __set_bit_le() assumes long word alignment and does endian convers

Re: [Qemu-devel] [PATCH 3/3] deal with guest panicked event

2012-06-12 Thread Luiz Capitulino
On Tue, 12 Jun 2012 13:40:45 +0100 "Daniel P. Berrange" wrote: > On Tue, Jun 12, 2012 at 09:35:04AM -0300, Luiz Capitulino wrote: > > On Tue, 12 Jun 2012 14:55:37 +0800 > > Wen Congyang wrote: > > > > > >> +static void panicked_perform_action(void) > > > >> +{ > > > >> +switch(panicked_acti

Re: [PATCH 3/3] deal with guest panicked event

2012-06-12 Thread Paolo Bonzini
Il 21/05/2012 08:50, Wen Congyang ha scritto: > +DEF("onpanic", HAS_ARG, QEMU_OPTION_onpanic, \ > +"-onpanic report|pause|quit\n" \ > +"action when the guest is panicked [default=report]", > +QEMU_ARCH_ALL) > +STEXI > +@item -onpanic @var{action} > + > +The @var{action}

RE: [PATCH] KVM: change PT_FIRST_AVAIL_BITS_SHIFT to avoid conflict with EPT Dirty bit

2012-06-12 Thread Hao, Xudong
Hi, Avi What's your opinion of this patch? Thanks, -Xudong > -Original Message- > From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On > Behalf Of Hao, Xudong > Sent: Monday, June 11, 2012 9:10 AM > To: a...@redhat.com > Cc: kvm@vger.kernel.org; Zhang, Xiantao > Subject:

Re: KVM call agenda for Thrusday, June 12th

2012-06-12 Thread Juan Quintela
Juan Quintela wrote: > Hi > > Please, send in any agenda items you are interested in covering. As there are no topics, call gets cancelled until next week that our fearless leader would be back. Have a nice day, Juan. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body

Re: KVM call agenda for Thrusday, June 12th

2012-06-12 Thread Anthony Liguori
On 06/11/2012 05:16 AM, Juan Quintela wrote: Hi Please, send in any agenda items you are interested in covering. For next week, I'd like to queue up the following topic: - multithreading vhost (and general vhost improvements) Regards, Anthony Liguori Later, Juan. -- To unsubscribe from

Re: KVM call agenda for Thrusday, June 12th

2012-06-12 Thread Michael S. Tsirkin
On Tue, Jun 12, 2012 at 09:15:17AM -0500, Anthony Liguori wrote: > On 06/11/2012 05:16 AM, Juan Quintela wrote: > > > >Hi > > > >Please, send in any agenda items you are interested in covering. > > For next week, I'd like to queue up the following topic: > > - multithreading vhost (and general v

Re: Large sized guest taking for ever to boot...

2012-06-12 Thread Chegu Vinod
On 6/8/2012 11:37 AM, Jan Kiszka wrote: On 2012-06-08 20:20, Chegu Vinod wrote: On 6/8/2012 11:08 AM, Jan Kiszka wrote: [CC'ing qemu as this discusses its code base] On 2012-06-08 19:57, Chegu Vinod wrote: On 6/8/2012 10:42 AM, Alex Williamson wrote: On Fri, 2012-06-08 at 10:10 -0700, Chegu

Re: Large sized guest taking for ever to boot...

2012-06-12 Thread Gleb Natapov
On Tue, Jun 12, 2012 at 08:33:59AM -0700, Chegu Vinod wrote: > I rebuilt the 3.4.1 kernel in the guest from scratch and retried my > experiments and measured > the boot times... > > a) Host : RHEL6.3 RC1 + qemu-kvm (that came with it) & Guest : > RHEL6.3 RC1: ~1 min > > b) Host :3.4.1 + qemu-k

RE: [RFC 00/10] KVM: Add TMEM host/guest support

2012-06-12 Thread Dan Magenheimer
> From: Avi Kivity [mailto:a...@redhat.com] > Subject: Re: [RFC 00/10] KVM: Add TMEM host/guest support I started off with a point-by-point comment on most of your responses about the tradeoffs of how tmem works, but decided it best to simply say we disagree and kvm-tmem will need to prove who is

Re: [PATCH 4/4] PCI: save/restore max Latency Value for device LTR

2012-06-12 Thread Bjorn Helgaas
On Fri, Jun 8, 2012 at 2:01 AM, Xudong Hao wrote: > LTR: Save Max snoop/no-snoop Latency Value in pci_save_pcie_state, and restore > them in pci_restore_pcie_state. > > Signed-off-by: Xudong Hao > --- >  drivers/pci/pci.c   |   71 > --- >  drivers/

[PATCH 00/21] Big big real mode improvements

2012-06-12 Thread Avi Kivity
This patchset fixes several bugs in the emulator and in vmx invalid guest state emulation. They are sufficient to boot several Linux and Windows guests, so the last patch turns vmx invalid guest state emulation on by default. The first patch is a little hacky; we should try to emulate svm here by

[PATCH 01/21] KVM: VMX: Return correct CPL during transition to protected mode

2012-06-12 Thread Avi Kivity
In protected mode, the CPL is defined as the lower two bits of CS, as set by the last far jump. But during the transition to protected mode, there is no last far jump, so we need to return zero (the inherited real mode CPL). Fix by reading CPL from the cache during the transition. This isn't 100

[PATCH 05/21] KVM: x86 emulator: allow loading null SS in long mode

2012-06-12 Thread Avi Kivity
Null SS is valid in long mode; allow loading it. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index db95a55..9a95132 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x8

[PATCH 07/21] KVM: VMX: Relax check on unusable segment

2012-06-12 Thread Avi Kivity
Some userspace (e.g. QEMU 1.1) munge the d and g bits of segment descriptors, causing us not to recognize them as unusable segments with emulate_invalid_guest_state=1. Relax the check by testing for segment not present (a non-present segment cannot be usable). Signed-off-by: Avi Kivity --- arch

[PATCH 09/21] KVM: x86 emulator: emulate LEAVE

2012-06-12 Thread Avi Kivity
Opcode c9; used by some variants of Windows during boot, in big real mode. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c24da8d..5b6f99d 1

[PATCH 12/21] KVM: x86 emulator: emulate SGDT/SIDT

2012-06-12 Thread Avi Kivity
Opcodes 0F 01 /0 and 0F 01 /1 Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c | 33 +++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 0088e2d..46bbc9d 100644 --- a/arch/x86/kvm/emulate.c +

[PATCH 14/21] KVM: VMX: Continue emulating after batch exhausted

2012-06-12 Thread Avi Kivity
If we return early from an invalid guest state emulation loop, make sure we return to it later if the guest state is still invalid. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c inde

[PATCH 15/21] KVM: x86 emulator: emulate LAHF

2012-06-12 Thread Avi Kivity
Opcode 9F. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c |9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 46bbc9d..f23f504 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3218,6 +3218,

[PATCH 17/21] KVM: x86 emulator: split push logic from push opcode emulation

2012-06-12 Thread Avi Kivity
This allows us to reuse the code without populating ctxt->src and overriding ctxt->op_bytes. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 25eab1b..8d316

[PATCH 21/21] KVM: VMX: Emulate invalid guest state by default

2012-06-12 Thread Avi Kivity
Our emulation should be complete enough that we can emulate guests while they are in big real mode, or in a mode transition that is not virtualizable without unrestricted guest support. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) dif

[PATCH 20/21] KVM: VMX: Improve error reporting during invalid guest state emulation

2012-06-12 Thread Avi Kivity
If instruction emulation fails, report it properly to userspace. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 661df185..591dcea 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch

[PATCH 19/21] KVM: VMX: Stop invalid guest state emulation on pending event

2012-06-12 Thread Avi Kivity
Process the event, possibly injecting an interrupt, before continuing. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 26e6bdf..661df185 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx

[PATCH 02/21] KVM: Split cpuid register access from computation

2012-06-12 Thread Avi Kivity
Introduce kvm_cpuid() to perform the leaf limit check and calculate register values, and let kvm_emulate_cpuid() just handle reading and writing the registers from/to the vcpu. This allows us to reuse kvm_cpuid() in a context where directly reading and writing registers is not desired. Signed-off

[PATCH 06/21] KVM: x86 emulator: fix LIDT/LGDT in long mode

2012-06-12 Thread Avi Kivity
The operand size for these instructions is 8 bytes in long mode, even without a REX prefix. Set it explicitly. Triggered while booting Linux with emulate_invalid_guest_state=1. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c |4 1 file changed, 4 insertions(+) diff --git a/arch/

[PATCH 10/21] KVM: x86 emulator: initialize memop

2012-06-12 Thread Avi Kivity
memop is not initialized; this can lead to a two-byte operation following a 4-byte operation to see garbage values. Usually truncation fixes things fot us later on, but at least in one case (call abs) it doesn't. Fix by moving memop to the auto-initialized field area. Signed-off-by: Avi Kivity

[PATCH 18/21] KVM: x86 emulator: implement ENTER

2012-06-12 Thread Avi Kivity
Opcode C8. Only ENTER with lexical nesting depth 0 is implemented, since others are very rare. We'll fail emulation if nonzero lexical depth is used so data is not corrupted. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c | 28 +++- 1 file changed, 27 insertions

[PATCH 16/21] KVM: x86 emulator: fix byte-sized MOVZX/MOVSX

2012-06-12 Thread Avi Kivity
Commit 2adb5ad9fe1 removed ByteOp from MOVZX/MOVSX, replacing them by SrcMem8, but neglected to fix the dependency in the emulation code on ByteOp. This caused the instruction not to have any effect in some circumstances. Fix by replacing the check for ByteOp with the equivalent src.op_bytes == 1

[PATCH 13/21] KVM: VMX: Fix interrupt exit condition during emulation

2012-06-12 Thread Avi Kivity
Checking EFLAGS.IF is incorrect as we might be in interrupt shadow. If that is the case, the main loop will notice that and not inject the interrupt, causing an endless loop. Fix by using vmx_interrupt_allowed() to check if we can inject an interrupt instead. Signed-off-by: Avi Kivity --- arch

[PATCH 11/21] KVM: Fix SS default ESP/EBP based addressing

2012-06-12 Thread Avi Kivity
We correctly default to SS when BP is used as a base in 16-bit address mode, but we don't do that for 32-bit mode. Fix by adjusting the default to SS when either ESP or EBP is used as the base register. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c |6 +- 1 file changed, 5 insert

[PATCH 08/21] KVM: VMX: Limit iterations with emulator_invalid_guest_state

2012-06-12 Thread Avi Kivity
Otherwise, if the guest ends up looping, we never exit the srcu critical section, which causes synchronize_srcu() to hang. Signed-off-by: Avi Kivity --- arch/x86/kvm/vmx.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index a9c0e

[PATCH 04/21] KVM: x86 emulator: emulate cpuid

2012-06-12 Thread Avi Kivity
Opcode 0F A2. Used by Linux during the mode change trampoline while in a state that is not virtualizable on vmx without unrestricted_guest, so we need to emulate it is emulate_invalid_guest_state=1. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c | 16 +++- 1 file changed, 15

[PATCH 03/21] KVM: x86 emulator: change ->get_cpuid() accessor to use the x86 semantics

2012-06-12 Thread Avi Kivity
Instead of getting an exact leaf, follow the spec and fall back to the last main leaf instead. This lets us easily emulate the cpuid instruction in the emulator. Signed-off-by: Avi Kivity --- arch/x86/include/asm/kvm_emulate.h |4 +-- arch/x86/kvm/emulate.c | 53 ++

Re: [RFC 00/10] KVM: Add TMEM host/guest support

2012-06-12 Thread Avi Kivity
On 06/12/2012 07:40 PM, Dan Magenheimer wrote: > > From: Avi Kivity [mailto:a...@redhat.com] > > Subject: Re: [RFC 00/10] KVM: Add TMEM host/guest support > > I started off with a point-by-point comment on most of your > responses about the tradeoffs of how tmem works, but decided > it best to simp

Re: Large sized guest taking for ever to boot...

2012-06-12 Thread Chegu Vinod
On 6/12/2012 8:39 AM, Gleb Natapov wrote: On Tue, Jun 12, 2012 at 08:33:59AM -0700, Chegu Vinod wrote: I rebuilt the 3.4.1 kernel in the guest from scratch and retried my experiments and measured the boot times... a) Host : RHEL6.3 RC1 + qemu-kvm (that came with it)& Guest : RHEL6.3 RC1: ~1

[PATCH] sfc: Use standard __{clear,set}_bit_le() functions

2012-06-12 Thread Ben Hutchings
There are now standard functions for dealing with little-endian bit arrays, so use them instead of our own implementations. Signed-off-by: Ben Hutchings --- Please use this version instead. Ben. drivers/net/ethernet/sfc/efx.c|4 ++-- drivers/net/ethernet/sfc/net_driver.h | 12 ---

FreeBSD guest ICMP packet loss

2012-06-12 Thread Andy Smith
Hi, We have been running KVM for a few months with both Linux and FreeBSD guests. We've noticed that on the FreeBSD guests we see packet loss when pinging to or from any IP outside of the KVM host (we have no issues with Linux guests). The KVM server is Ubuntu 12.04 (I just updated it as we

Re: [PATCHv6 2/8] kvm: optimize ISR lookups

2012-06-12 Thread Marcelo Tosatti
On Sun, Jun 03, 2012 at 10:27:59AM +0300, Michael S. Tsirkin wrote: > We perform ISR lookups twice: during interrupt > injection and on EOI. Typical workloads only have > a single bit set there. So we can avoid ISR scans by > 1. counting bits as we set/clear them in ISR > 2. on set, caching the inj

Re: [PATCHv6 6/8] kvm: only sync when attention bits set

2012-06-12 Thread Marcelo Tosatti
On Sun, Jun 03, 2012 at 10:28:29AM +0300, Michael S. Tsirkin wrote: > Commit eb0dc6d0368072236dcd086d7fdc17fd3c4574d4 introduced apic > attention bitmask but kvm still syncs lapic unconditionally. > As that commit suggested and in anticipation of adding more attention > bits, only sync lapic if(api

Re: [PATCHv6 5/8] kvm: eoi msi documentation

2012-06-12 Thread Marcelo Tosatti
On Sun, Jun 03, 2012 at 10:28:21AM +0300, Michael S. Tsirkin wrote: > Document the new EOI MSR. Couldn't decide whether this change belongs > conceptually on guest or host side, so a separate patch. > > Signed-off-by: Michael S. Tsirkin > --- > Documentation/virtual/kvm/msr.txt | 32 ++

Re: [PATCH v2 3/7] KVM: Add paravirt kvm_flush_tlb_others

2012-06-12 Thread Marcelo Tosatti
On Mon, Jun 04, 2012 at 10:37:24AM +0530, Nikunj A. Dadhania wrote: > flush_tlb_others_ipi depends on lot of statics in tlb.c. Replicated > the flush_tlb_others_ipi as kvm_flush_tlb_others to further adapt to > paravirtualization. > > Use the vcpu state information inside the kvm_flush_tlb_others

Re: [PATCH v2 1/7] KVM Guest: Add VCPU running/pre-empted state for guest

2012-06-12 Thread Marcelo Tosatti
On Mon, Jun 04, 2012 at 10:36:05AM +0530, Nikunj A. Dadhania wrote: > The patch adds guest code for msr between guest and hypervisor. The > msr will export the vcpu running/pre-empted information to the guest > from host. This will enable guest to intelligently send ipi to running > vcpus and set f

Re: [PATCHv3 RFC 0/2] kvm: direct msix injection

2012-06-12 Thread Marcelo Tosatti
On Mon, Jun 11, 2012 at 02:19:17PM +0300, Michael S. Tsirkin wrote: > We can deliver certain interrupts, notably MSIX, > from atomic context. > Here's an untested patch to do this (compiled only). > > Changes from v2: > Don't inject broadcast interrupts directly > Changes from v1: > Tried to addre

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-06-12 Thread Marcelo Tosatti
On Tue, Jun 12, 2012 at 09:45:16AM +0200, Kevin Wolf wrote: > Am 12.06.2012 03:52, schrieb Marcelo Tosatti: > > On Thu, Jun 07, 2012 at 01:13:50PM +0100, Stefan Hajnoczi wrote: > >> The 1st bad commit in your attached list is abc551bd > >> More detailed info: > >> 171d2f2249a360d7d62313

Re: [PATCH v6 5/9] KVM: MMU: introduce SPTE_MMU_WRITEABLE bit

2012-06-12 Thread Marcelo Tosatti
On Tue, Jun 12, 2012 at 10:23:47AM +0800, Xiao Guangrong wrote: > On 06/12/2012 07:32 AM, Marcelo Tosatti wrote: > > > On Tue, May 29, 2012 at 02:49:14PM +0800, Xiao Guangrong wrote: > >> This bit indicates whether the spte can be writable on MMU, that means > >> the corresponding gpte is writable

Re: [PATCH] qemu msi/msix: added functions to API to set up message address and data

2012-06-12 Thread Alexey Kardashevskiy
Ping? On 12/05/12 16:48, Alexey Kardashevskiy wrote: > Added msi_set_address_data and msix_set_address_data in order to support > sPAPR-specific implementation of MSI/MSIX configuration mechanism. > POWER guest does not initialize these fields, it expects a supervisor to > get them initialized. >

Re: [PATCH v6 5/9] KVM: MMU: introduce SPTE_MMU_WRITEABLE bit

2012-06-12 Thread Xiao Guangrong
On 06/13/2012 10:01 AM, Marcelo Tosatti wrote: > On Tue, Jun 12, 2012 at 10:23:47AM +0800, Xiao Guangrong wrote: >> On 06/12/2012 07:32 AM, Marcelo Tosatti wrote: >> >>> On Tue, May 29, 2012 at 02:49:14PM +0800, Xiao Guangrong wrote: This bit indicates whether the spte can be writable on MMU,

Re: [PATCH] qemu msi/msix: added functions to API to set up message address and data

2012-06-12 Thread Benjamin Herrenschmidt
On Wed, 2012-06-13 at 12:44 +1000, Alexey Kardashevskiy wrote: > Ping? FYI. The way it normally works on pseries is that RTAS, which is the part of the firmware that lives inside the partition alongside the OS, performs the accesses to configure the MSI/MSI-X. With qemu "pseries" machine we don't

Re: [PATCH] qemu msi/msix: added functions to API to set up message address and data

2012-06-12 Thread Alexey Kardashevskiy
On 13/06/12 13:22, Benjamin Herrenschmidt wrote: > On Wed, 2012-06-13 at 12:44 +1000, Alexey Kardashevskiy wrote: >> Ping? > > FYI. The way it normally works on pseries is that RTAS, which is the > part of the firmware that lives inside the partition alongside the OS, > performs the accesses to co

Re: [PATCH] qemu msi/msix: added functions to API to set up message address and data

2012-06-12 Thread Benjamin Herrenschmidt
On Wed, 2012-06-13 at 13:39 +1000, Alexey Kardashevskiy wrote: > On 13/06/12 13:22, Benjamin Herrenschmidt wrote: > > On Wed, 2012-06-13 at 12:44 +1000, Alexey Kardashevskiy wrote: > >> Ping? > > > > FYI. The way it normally works on pseries is that RTAS, which is the > > part of the firmware that

[PATCH 0/5] Introduce generic set_bit_le() -v2

2012-06-12 Thread Takuya Yoshikawa
[ Andrew, can you take this or should I send to other person? Note: the whole series is against linux-next. ] KVM is using test_and_set_bit_le() for this missing function; this patch series corrects this usage. As some drivers have their own definitions of set_bit_le(), a bit of preparation

[PATCH 1/5] sfc: Use standard __{clear,set}_bit_le() functions

2012-06-12 Thread Takuya Yoshikawa
From: Ben Hutchings There are now standard functions for dealing with little-endian bit arrays, so use them instead of our own implementations. Signed-off-by: Ben Hutchings Signed-off-by: Takuya Yoshikawa --- drivers/net/ethernet/sfc/efx.c|4 ++-- drivers/net/ethernet/sfc/net_driv

[PATCH 2/5] drivers/net/ethernet/dec/tulip: Use standard __set_bit_le() function

2012-06-12 Thread Takuya Yoshikawa
From: Takuya Yoshikawa To introduce generic set_bit_le() later, we remove our own definition and use a proper non-atomic bitops function: __set_bit_le(). Signed-off-by: Takuya Yoshikawa Acked-by: Grant Grundler --- drivers/net/ethernet/dec/tulip/de2104x.c|7 ++- drivers/net/ethern

[PATCH 3/5] bitops: Introduce generic {clear,set}_bit_le()

2012-06-12 Thread Takuya Yoshikawa
From: Takuya Yoshikawa Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is being used for this missing function. Signed-off-by: Takuya Yoshikawa Acked-by: Arnd Bergmann --- include/asm-generic/bitops/le.h | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-)

[PATCH 4/5] powerpc: bitops: Introduce {clear,set}_bit_le()

2012-06-12 Thread Takuya Yoshikawa
From: Takuya Yoshikawa Needed to replace test_and_set_bit_le() in virt/kvm/kvm_main.c which is being used for this missing function. Signed-off-by: Takuya Yoshikawa Cc: Benjamin Herrenschmidt --- arch/powerpc/include/asm/bitops.h | 10 ++ 1 files changed, 10 insertions(+), 0 deletio

[PATCH 5/5] KVM: Replace test_and_set_bit_le() in mark_page_dirty_in_slot() with set_bit_le()

2012-06-12 Thread Takuya Yoshikawa
From: Takuya Yoshikawa Now that we have defined generic set_bit_le() we do not need to use test_and_set_bit_le() for atomically setting a bit. Signed-off-by: Takuya Yoshikawa Cc: Avi Kivity Cc: Marcelo Tosatti --- virt/kvm/kvm_main.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(

Re: [Qemu-devel] [PATCH 1/3] start vm after reseting it

2012-06-12 Thread Wen Congyang
At 05/31/2012 03:17 AM, Luiz Capitulino Wrote: > On Mon, 21 May 2012 14:49:32 +0800 > Wen Congyang wrote: > >> The guest should run after reseting it, but it does not >> run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED. >> >> Signed-off-by: Wen Congyang >> --- >> vl.c |1