Re: Question on skip_emulated_instructions()

2010-04-06 Thread Gleb Natapov
On Tue, Apr 06, 2010 at 01:11:23PM +0900, Yoshiaki Tamura wrote: Hi. When handle_io() is called, rip is currently proceeded *before* actually having I/O handled by qemu in userland. Upon implementing Kemari for KVM(http://www.mail-archive.com/kvm@vger.kernel.org/msg25141.html) mainly in

Re: Question on skip_emulated_instructions()

2010-04-07 Thread Gleb Natapov
On Wed, Apr 07, 2010 at 03:25:10PM +0900, Yoshiaki Tamura wrote: 2010/4/6 Gleb Natapov g...@redhat.com: On Tue, Apr 06, 2010 at 01:11:23PM +0900, Yoshiaki Tamura wrote: Hi. When handle_io() is called, rip is currently proceeded *before* actually having I/O handled by qemu in userland

Re: Question on skip_emulated_instructions()

2010-04-07 Thread Gleb Natapov
On Thu, Apr 08, 2010 at 02:27:53PM +0900, Yoshiaki Tamura wrote: Avi Kivity wrote: On 04/07/2010 08:21 PM, Yoshiaki Tamura wrote: The problem here is that, I needed to transfer the VM state which is just *before* the output to the devices. Otherwise, the VM state has already been proceeded,

Re: Question on skip_emulated_instructions()

2010-04-08 Thread Gleb Natapov
On Thu, Apr 08, 2010 at 02:27:53PM +0900, Yoshiaki Tamura wrote: Currently we complete instructions for output operations and leave them incomplete for input operations. Deferring completion for output operations should work, except it may break the vmware backdoor port (see hw/vmport.c),

Re: Question on skip_emulated_instructions()

2010-04-08 Thread Gleb Natapov
On Thu, Apr 08, 2010 at 10:17:01AM +0300, Avi Kivity wrote: On 04/08/2010 08:27 AM, Yoshiaki Tamura wrote: The requirement is that the guest must always be able to replay at least the instruction which triggered the synchronization on the primary. You have two choices: - complete

Re: [PATCH] KVM: move DR register access handling into generic code.

2010-04-12 Thread Gleb Natapov
On Mon, Apr 12, 2010 at 07:54:22PM +0300, Avi Kivity wrote: On 04/12/2010 07:52 PM, Gleb Natapov wrote: On Mon, Apr 12, 2010 at 06:09:50PM +0200, Jan Kiszka wrote: Avi Kivity wrote: On 04/12/2010 03:27 PM, Gleb Natapov wrote: Currently both SVM and VMX have their own DR handling code. Move

[PATCHv2] KVM: move DR register access handling into generic code

2010-04-13 Thread Gleb Natapov
Currently both SVM and VMX have their own DR handling code. Move it to x86.c. Changelog: v1-v2 - kvm_set_dr() always return 1 in a case of error Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 0c49c88..5d5e0a9

[PATCH] get rid of mmu_only parameter in emulator_write_emulated()

2010-04-13 Thread Gleb Natapov
May be I am missing something here, but it seams we can call kvm_mmu_pte_write() directly from emulator_cmpxchg_emulated() instead of passing mmu_only down to emulator_write_emulated_onepage() and call it there. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch

Re: [PATCH] get rid of mmu_only parameter in emulator_write_emulated()

2010-04-13 Thread Gleb Natapov
On Tue, Apr 13, 2010 at 10:35:53AM +0300, Avi Kivity wrote: On 04/13/2010 10:26 AM, Gleb Natapov wrote: On Tue, Apr 13, 2010 at 10:24:40AM +0300, Avi Kivity wrote: On 04/13/2010 10:21 AM, Gleb Natapov wrote: May be I am missing something here, but it seams we can call kvm_mmu_pte_write

Re: KVM: x86: Push potential exception error code on task switches

2010-04-14 Thread Gleb Natapov
On Wed, Apr 14, 2010 at 02:11:39PM +0200, Jan Kiszka wrote: static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops, - u16 tss_selector, int reason) +struct

Re: KVM: x86: Push potential exception error code on task switches

2010-04-14 Thread Gleb Natapov
On Wed, Apr 14, 2010 at 03:00:18PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Wed, Apr 14, 2010 at 02:11:39PM +0200, Jan Kiszka wrote: static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt, - struct x86_emulate_ops *ops

Re: [PATCH] kvm test: Add 32-bit task switch micro-test

2010-04-14 Thread Gleb Natapov
On Wed, Apr 14, 2010 at 04:12:46PM +0200, Jan Kiszka wrote: This implements a basic task switch test for 32-bit targets. It specifically stresses the case that a fault with attached error code triggers the switch via a task gate. How do you compile this? I was sure kvm test suit is broken for

Re: [PATCH] kvm test: Add 32-bit task switch micro-test

2010-04-14 Thread Gleb Natapov
On Wed, Apr 14, 2010 at 04:41:15PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Wed, Apr 14, 2010 at 04:12:46PM +0200, Jan Kiszka wrote: This implements a basic task switch test for 32-bit targets. It specifically stresses the case that a fault with attached error code triggers

Re: [PATCH] kvm test: Add 32-bit task switch micro-test

2010-04-14 Thread Gleb Natapov
On Wed, Apr 14, 2010 at 04:12:46PM +0200, Jan Kiszka wrote: Gleb, you might want to have a look at this test. When using it with my 2.6.34 queue (or below or with QEMU), I get the following, expected output: fault at 8:4002ef, prev task 18, error code 1234 post fault When using it with

[PATCH] KVM: prevent spurious exit to userspace during task switch emulation.

2010-04-15 Thread Gleb Natapov
kvm_task_switch() never requires userspace exit, so no matter what the function returns we should not exit to userspace. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index c773a46..1bd434b 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm

[PATCHv2] KVM: prevent spurious exit to userspace during task switch emulation.

2010-04-15 Thread Gleb Natapov
If kvm_task_switch() fails code exits to userspace without specifying exit reason, so the previous exit reason is reused by userspace. Fix this by specifying exit reason correctly. --- Changelog: v1-v2: - report emulation error to userspace instead of ignoring it silently. Should be

Re: [PATCHv2 REBASE] KVM: prevent spurious exit to userspace during task switch emulation.

2010-04-15 Thread Gleb Natapov
If kvm_task_switch() fails code exits to userspace without specifying exit reason, so the previous exit reason is reused by userspace. Fix this by specifying exit reason correctly. --- Changelog: v1-v2: - report emulation error to userspace instead of ignoring it silently. Signed-off-by: Gleb

Re: Timedrift in KVM guests after livemigration.

2010-04-18 Thread Gleb Natapov
On Sun, Apr 18, 2010 at 12:22:54PM +0300, Dor Laor wrote: On 04/18/2010 02:21 AM, Espen Berg wrote: Den 17.04.2010 22:17, skrev Michael Tokarev: We have three KVM hosts that supports live-migration between them, but one of our problems is time drifting. The three frontends has different CPU

Re: Timedrift in KVM guests after livemigration.

2010-04-19 Thread Gleb Natapov
On Mon, Apr 19, 2010 at 11:21:47AM +0200, Espen Berg wrote: Den 18.04.2010 11:56, skrev Gleb Natapov: That's two different things here: The issue that Espen is reporting is that the hosts have different frequency and guests that relay on the tsc as a source clock will notice that post

Re: [PATCH] KVM: VMX: Translate interrupt shadow when waiting on NMI window

2010-04-21 Thread Gleb Natapov
On Wed, Apr 21, 2010 at 04:17:03PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:37:15AM +0100, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:27:07AM +0100, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:14:45AM +0100, Jan

Re: [PATCH] KVM: VMX: Translate interrupt shadow when waiting on NMI window

2010-04-21 Thread Gleb Natapov
On Wed, Apr 21, 2010 at 04:41:38PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Wed, Apr 21, 2010 at 04:17:03PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:37:15AM +0100, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:27:07AM +0100, Jan

Re: [PATCH] KVM: VMX: Translate interrupt shadow when waiting on NMI window

2010-04-21 Thread Gleb Natapov
On Wed, Apr 21, 2010 at 05:14:04PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Wed, Apr 21, 2010 at 04:41:38PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Wed, Apr 21, 2010 at 04:17:03PM +0200, Jan Kiszka wrote: Gleb Natapov wrote: On Tue, Feb 16, 2010 at 11:37:15AM +0100, Jan

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-21 Thread Gleb Natapov
On Wed, Apr 21, 2010 at 12:58:41PM -0300, Marcelo Tosatti wrote: Or could we make kvm_set_irq() atomic? Though the code path is a little long for spinlock. Yes, given the sleep-inside-RCU-protected section bug from kvm_notify_acked_irq, either that or convert IRQ locking to SRCU.

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-21 Thread Gleb Natapov
On Wed, Apr 21, 2010 at 02:37:34PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 08:12:27PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 12:58:41PM -0300, Marcelo Tosatti wrote: Or could we make kvm_set_irq() atomic? Though the code path is a little long for spinlock

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-21 Thread Gleb Natapov
On Wed, Apr 21, 2010 at 03:29:11PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 08:58:48PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 02:37:34PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 08:12:27PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 12:58:41PM

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-22 Thread Gleb Natapov
On Thu, Apr 22, 2010 at 04:40:30PM -0300, Marcelo Tosatti wrote: On Thu, Apr 22, 2010 at 09:11:30PM +0300, Gleb Natapov wrote: On Thu, Apr 22, 2010 at 01:40:38PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 09:38:39PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 03:29:11PM

Re: using ftrace with kvm

2010-04-22 Thread Gleb Natapov
On Thu, Apr 22, 2010 at 02:53:45PM -0600, David S. Ahern wrote: I have a VM that is spinning (both vcpus at 100%). As I recall kvm_stat has been deprecated in favor or ftrace. Is there a wiki page or document that gives suggestions on this? kvmtrace was depricated in favor of ftrace. kvm_stat

Re: 2.6.32.12: Build warning due to 78ce64a384 / missing in 2.6.33?

2010-04-27 Thread Gleb Natapov
On Mon, Apr 26, 2010 at 07:54:22PM +0200, Jan Kiszka wrote: Gleb, I'm getting a build warning with latest 2.6.32.12 due to Fix segment descriptor loading. load_segment_descriptor_to_kvm_desct is unused after that patch. I assume it's just forgotten code and did not accidentally become

Re: 2.6.32.12: Build warning due to 78ce64a384 / missing in 2.6.33?

2010-04-27 Thread Gleb Natapov
On Tue, Apr 27, 2010 at 10:41:21AM +0300, Avi Kivity wrote: On 04/27/2010 09:17 AM, Gleb Natapov wrote: The fact that 2.6.33.3 does not generate this makes me wonder why it obviously lacks the above patch. Not required or not yet queued? Doesn't make much sense to include it in stable-32

Re: KVM call agenda for Apr 27

2010-04-27 Thread Gleb Natapov
On Mon, Apr 26, 2010 at 05:36:52PM -0500, Anthony Liguori wrote: On 04/26/2010 05:12 PM, Chris Wright wrote: * Anthony Liguori (anth...@codemonkey.ws) wrote: On 04/26/2010 12:26 PM, Chris Wright wrote: Please send in any agenda items you are interested in covering. While I don't expect it

[PATCH 03/23] KVM: x86 emulator: cleanup xchg emulation.

2010-04-27 Thread Gleb Natapov
Dst operand is already initialized during decoding stage. No need to reinitialize. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index efb7853

[PATCH 02/23] KVM: x86 emulator: fix Move r/m16 to segment register decoding.

2010-04-27 Thread Gleb Natapov
This instruction does not need generic decoding for its dst operand. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 6f40337..efb7853 100644

[PATCH 11/23] KVM: x86 emulator: fix X86EMUL_RETRY_INSTR and X86EMUL_CMPXCHG_FAILED values

2010-04-27 Thread Gleb Natapov
Currently X86EMUL_PROPAGATE_FAULT, X86EMUL_RETRY_INSTR and X86EMUL_CMPXCHG_FAILED have the same value so caller cannot distinguish why function such as emulator_cmpxchg_emulated() (which can return both X86EMUL_PROPAGATE_FAULT and X86EMUL_CMPXCHG_FAILED) failed. Signed-off-by: Gleb Natapov g

[PATCH 07/23] KVM: x86 emulator: add (set|get)_msr callbacks to x86_emulate_ops

2010-04-27 Thread Gleb Natapov
Add (set|get)_msr callbacks to x86_emulate_ops instead of calling them directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/kvm/emulate.c | 36 ++-- arch/x86/kvm/x86.c |2

[PATCH 04/23] KVM: x86 emulator: cleanup nop emulation

2010-04-27 Thread Gleb Natapov
Make it more explicit what we are checking for. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index ea5c6fd..fbc555b 100644 --- a/arch/x86/kvm

[PATCH 12/23] KVM: fill in run-mmio details in (read|write)_emulated function.

2010-04-27 Thread Gleb Natapov
Fill in run-mmio details in (read|write)_emulated function just like pio does. There is no point in filling only vcpu fields there just to copy them into vcpu-run a little bit later. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/x86.c | 25 + 1 files

[PATCH 14/23] KVM: remove export of emulator_write_emulated().

2010-04-27 Thread Gleb Natapov
It is not called directly outside of the file it's defined in anymore. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_host.h |5 - arch/x86/kvm/x86.c |1 - 2 files changed, 0 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm

[PATCH 09/23] KVM: x86 emulator: make set_cr() callback return error if it fails

2010-04-27 Thread Gleb Natapov
Make set_cr() callback return error if it fails instead of injecting #GP behind emulator's back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 +- arch/x86/kvm/emulate.c | 10 ++- arch/x86/kvm/x86.c | 148

[PATCH 23/23] KVM: x86 emulator: do not inject exception directly into vcpu

2010-04-27 Thread Gleb Natapov
Return exception as a result of instruction emulation and handle injection in KVM code. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |6 ++ arch/x86/kvm/emulate.c | 124 ++-- arch/x86/kvm/x86.c

[PATCH 01/23] KVM: x86 emulator: introduce read cache.

2010-04-27 Thread Gleb Natapov
Introduce read cache which is needed for instruction that require more then one exit to userspace. After returning from userspace the instruction will be re-executed with cached read value. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm

[PATCH 21/23] KVM: x86 emulator: move interruptibility state tracking out of emulator

2010-04-27 Thread Gleb Natapov
Emulator shouldn't access vcpu directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 19 ++- arch/x86/kvm/x86.c | 20 +--- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm

[PATCH 20/23] KVM: x86 exmulator: handle shadowed registers outside emulator.

2010-04-27 Thread Gleb Natapov
Emulator shouldn't access vcpu directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 15 --- arch/x86/kvm/x86.c | 16 +--- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c

[PATCH 15/23] KVM: do not inject #PF in (read|write)_emulated() callbacks

2010-04-27 Thread Gleb Natapov
Return error to x86 emulator instead of injection exception behind its back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |3 +++ arch/x86/kvm/emulate.c | 12 +++- arch/x86/kvm/x86.c | 28

[PATCH 17/23] KVM: x86 emulator: advance RIP outside x86 emulator code

2010-04-27 Thread Gleb Natapov
Return new RIP as part of instruction emulation result instead of updating KVM's RIP from x86 emulator code. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |7 --- arch/x86/kvm/x86.c |4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git

[PATCH 19/23] KVM: x86 emulator: use shadowed register in emulate_sysexit()

2010-04-27 Thread Gleb Natapov
emulate_sysexit() should use shadowed registers copy instead of looking into vcpu state directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c

[PATCH 22/23] KVM: remove unneeded initialization.

2010-04-27 Thread Gleb Natapov
This initialization is no longer needed. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/x86.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index ed15b20..29e2d3b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm

[PATCH 18/23] KVM: x86 emulator: set RFLAGS outside x86 emulator code.

2010-04-27 Thread Gleb Natapov
Removes the need for set_flags() callback. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 - arch/x86/kvm/emulate.c |1 - arch/x86/kvm/x86.c |7 +-- 3 files changed, 1 insertions(+), 8 deletions(-) diff --git

[PATCH 16/23] KVM: handle emulation failure case first.

2010-04-27 Thread Gleb Natapov
If emulation failed return immediately. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/x86.c | 31 +++ 1 files changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 4f0a0a1..f1ebeed 100644 --- a/arch/x86

[PATCH 06/23] KVM: x86 emulator: add (set|get)_dr callbacks to x86_emulate_ops

2010-04-27 Thread Gleb Natapov
Add (set|get)_dr callbacks to x86_emulate_ops instead of calling them directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/include/asm/kvm_host.h|4 arch/x86/kvm/emulate.c |7 +-- arch/x86/kvm/x86.c

[PATCH 10/23] KVM: x86 emulator: make (get|set)_dr() callback return error if it fails

2010-04-27 Thread Gleb Natapov
Make (get|set)_dr() callback return error if it fails instead of injecting exception behind emulator's back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 11 ++-- arch/x86/kvm/x86.c | 63 --- 2 files changed, 45

[PATCH 13/23] KVM: x86 emulator: x86_emulate_insn() return -1 only in case of emulation failure

2010-04-27 Thread Gleb Natapov
X86EMUL_IO_NEEDED is introduced. It is used to distinguish between error condition (which returns X86EMUL_UNHANDLEABLE) and condition that requires IO exit to userspace to continue emulation. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm/x86.c

[PATCH 05/23] KVM: x86 emulator: handle far address source operand.

2010-04-27 Thread Gleb Natapov
ljmp/lcall instruction operand contains address and segment. It can be 10 bytes long. Currently we decode it as two different operands. Fix it by introducing new kind of operand that can hold entire far address. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h

[PATCH 1/2] Test cmps between two IO locations.

2010-04-27 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com --- kvm/user/test/x86/emulator.c | 22 ++ roms/seabios |2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/kvm/user/test/x86/emulator.c b/kvm/user/test/x86/emulator.c index c6adbb5..db84c13

[PATCH 2/2] Add test for ljmp.

2010-04-27 Thread Gleb Natapov
Test that ljmp with operand in IO memory works. Signed-off-by: Gleb Natapov g...@redhat.com --- kvm/user/test/x86/emulator.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/emulator.c b/kvm/user/test/x86/emulator.c index db84c13..4967d1f

Re: [qemu-kvm tests PATCH v2 2/3] qemu-kvm tests cleanup: adapt stringio test to kernel-mode run

2010-04-27 Thread Gleb Natapov
On Tue, Apr 27, 2010 at 03:57:44PM +0300, Naphtali Sprei wrote: Also use testdev for output, call exit to quit. Currently, test reboots endlessly because of a triple-fault. Need to run test with -no-reboot till issue fixed (in kvm ??) Rewriting this in C would be nice. May be adding this as

Re: KVM call agenda for Apr 27

2010-04-27 Thread Gleb Natapov
On Tue, Apr 27, 2010 at 02:11:46PM +0100, Daniel P. Berrange wrote: On Tue, Apr 27, 2010 at 08:03:42AM -0500, Anthony Liguori wrote: On 04/27/2010 03:14 AM, Avi Kivity wrote: On 04/27/2010 01:36 AM, Anthony Liguori wrote: A few comments: 1) The problem was not block watermark itself

Re: KVM call agenda for Apr 27

2010-04-27 Thread Gleb Natapov
On Tue, Apr 27, 2010 at 08:19:06AM -0500, Anthony Liguori wrote: On 04/27/2010 08:05 AM, Gleb Natapov wrote: On Tue, Apr 27, 2010 at 08:00:02AM -0500, Anthony Liguori wrote: On 04/27/2010 06:11 AM, Gleb Natapov wrote: Network cards have low number of rx/tx buffers interrupt. This is also

Re: KVM call agenda for Apr 27

2010-04-27 Thread Gleb Natapov
On Tue, Apr 27, 2010 at 02:38:17PM +0100, Daniel P. Berrange wrote: On Tue, Apr 27, 2010 at 04:15:54PM +0300, Gleb Natapov wrote: On Tue, Apr 27, 2010 at 02:11:46PM +0100, Daniel P. Berrange wrote: On Tue, Apr 27, 2010 at 08:03:42AM -0500, Anthony Liguori wrote: On 04/27/2010 03:14 AM

Re: [PATCH 2.6.32.12] KVM: remove unused load_segment_descriptor_to_kvm_desct

2010-04-27 Thread Gleb Natapov
On Tue, Apr 27, 2010 at 07:43:55AM -0700, Greg KH wrote: On Tue, Apr 27, 2010 at 11:14:14AM -0300, Marcelo Tosatti wrote: Function is now unused. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Was this patch also upstream? Why does stable need it? It is upstream, but as part

Re: [PATCH 15/23] KVM: do not inject #PF in (read|write)_emulated() callbacks

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 12:11:41PM +0300, Avi Kivity wrote: On 04/27/2010 03:15 PM, Gleb Natapov wrote: Return error to x86 emulator instead of injection exception behind its back. Signed-off-by: Gleb Natapovg...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |3 +++ arch/x86/kvm

Re: [PATCH 08/23] KVM: x86 emulator: cleanup some direct calls into kvm to use existing callbacks

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 11:59:54AM +0300, Avi Kivity wrote: On 04/27/2010 03:15 PM, Gleb Natapov wrote: Use callbacks from x86_emulate_ops to access segments instead of calling into kvm directly. -static unsigned long seg_base(struct x86_emulate_ctxt *ctxt, int seg) +static unsigned

Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 11:31:00AM +0200, Jes Sorensen wrote: On 04/22/10 03:12, Kevin O'Connor wrote: As I understand it, the hotplug support was only in the kvm copy of bochs bios. It also limited the number of cpus one could use (I think 16). The current smp support in SeaBIOS

Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 12:41:51PM +0200, Jes Sorensen wrote: On 04/28/10 12:30, Gleb Natapov wrote: On Wed, Apr 28, 2010 at 11:31:00AM +0200, Jes Sorensen wrote: On 04/22/10 03:12, Kevin O'Connor wrote: Generating the more complex tables dynamically would be preferred, but it requires

[PATCHv2 01/23] KVM: x86 emulator: introduce read cache.

2010-04-28 Thread Gleb Natapov
Introduce read cache which is needed for instruction that require more then one exit to userspace. After returning from userspace the instruction will be re-executed with cached read value. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm

[PATCHv2 03/23] KVM: x86 emulator: cleanup xchg emulation.

2010-04-28 Thread Gleb Natapov
Dst operand is already initialized during decoding stage. No need to reinitialize. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index efb7853

[PATCHv2 02/23] KVM: x86 emulator: fix Move r/m16 to segment register decoding.

2010-04-28 Thread Gleb Natapov
This instruction does not need generic decoding for its dst operand. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 6f40337..efb7853 100644

[PATCHv2 04/23] KVM: x86 emulator: cleanup nop emulation

2010-04-28 Thread Gleb Natapov
Make it more explicit what we are checking for. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index ea5c6fd..fbc555b 100644 --- a/arch/x86/kvm

[PATCHv2 00/23] next round of emulator cleanups

2010-04-28 Thread Gleb Natapov
segment base - use double underscore on helper functions - fold remove unneeded initialization patch Gleb Natapov (23): KVM: x86 emulator: introduce read cache. KVM: x86 emulator: fix Move r/m16 to segment register decoding. KVM: x86 emulator: cleanup xchg emulation. KVM: x86 emulator

[PATCHv2 20/23] KVM: x86 emulator: use shadowed register in emulate_sysexit()

2010-04-28 Thread Gleb Natapov
emulate_sysexit() should use shadowed registers copy instead of looking into vcpu state directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c

[PATCHv2 23/23] KVM: x86 emulator: do not inject exception directly into vcpu

2010-04-28 Thread Gleb Natapov
Return exception as a result of instruction emulation and handle injection in KVM code. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |6 ++ arch/x86/kvm/emulate.c | 124 ++-- arch/x86/kvm/x86.c

[PATCHv2 16/23] KVM: do not inject #PF in (read|write)_emulated() callbacks

2010-04-28 Thread Gleb Natapov
Return error to x86 emulator instead of injection exception behind its back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |3 +++ arch/x86/kvm/emulate.c | 12 +++- arch/x86/kvm/x86.c | 28

[PATCHv2 22/23] KVM: x86 emulator: move interruptibility state tracking out of emulator

2010-04-28 Thread Gleb Natapov
Emulator shouldn't access vcpu directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 19 ++- arch/x86/kvm/x86.c | 20 +--- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm

[PATCHv2 15/23] KVM: remove export of emulator_write_emulated().

2010-04-28 Thread Gleb Natapov
It is not called directly outside of the file it's defined in anymore. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_host.h |5 - arch/x86/kvm/x86.c |1 - 2 files changed, 0 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm

[PATCHv2 17/23] KVM: handle emulation failure case first.

2010-04-28 Thread Gleb Natapov
If emulation failed return immediately. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/x86.c | 31 +++ 1 files changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 696b34b..445769b 100644 --- a/arch/x86

[PATCHv2 18/23] KVM: x86 emulator: advance RIP outside x86 emulator code

2010-04-28 Thread Gleb Natapov
Return new RIP as part of instruction emulation result instead of updating KVM's RIP from x86 emulator code. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |7 --- arch/x86/kvm/x86.c |4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git

[PATCHv2 09/23] KVM: x86 emulator: cleanup some direct calls into kvm to use existing callbacks

2010-04-28 Thread Gleb Natapov
Use callbacks from x86_emulate_ops to access segments instead of calling into kvm directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 200 +--- 1 files changed, 105 insertions(+), 95 deletions(-) diff --git a/arch/x86

[PATCHv2 11/23] KVM: x86 emulator: make (get|set)_dr() callback return error if it fails

2010-04-28 Thread Gleb Natapov
Make (get|set)_dr() callback return error if it fails instead of injecting exception behind emulator's back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 11 ++-- arch/x86/kvm/x86.c | 63 --- 2 files changed, 45

[PATCHv2 08/23] KVM: x86 emulator: add get_cached_segment_base() callback to x86_emulate_ops.

2010-04-28 Thread Gleb Natapov
On VMX it is expensive to call get_cached_descriptor() just to get segment base since multiple vmcs_reads are done instead of only one. Introduce new call back get_cached_segment_base() for efficiency. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1

[PATCHv2 10/23] KVM: x86 emulator: make set_cr() callback return error if it fails

2010-04-28 Thread Gleb Natapov
Make set_cr() callback return error if it fails instead of injecting #GP behind emulator's back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 +- arch/x86/kvm/emulate.c | 10 ++- arch/x86/kvm/x86.c | 148

[PATCHv2 06/23] KVM: x86 emulator: add (set|get)_dr callbacks to x86_emulate_ops

2010-04-28 Thread Gleb Natapov
Add (set|get)_dr callbacks to x86_emulate_ops instead of calling them directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/include/asm/kvm_host.h|4 arch/x86/kvm/emulate.c |7 +-- arch/x86/kvm/x86.c

[PATCHv2 14/23] KVM: x86 emulator: x86_emulate_insn() return -1 only in case of emulation failure

2010-04-28 Thread Gleb Natapov
X86EMUL_IO_NEEDED is introduced. It is used to distinguish between error condition (which returns X86EMUL_UNHANDLEABLE) and condition that requires IO exit to userspace to continue emulation. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm/x86.c

[PATCHv2 05/23] KVM: x86 emulator: handle far address source operand.

2010-04-28 Thread Gleb Natapov
ljmp/lcall instruction operand contains address and segment. It can be 10 bytes long. Currently we decode it as two different operands. Fix it by introducing new kind of operand that can hold entire far address. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h

[PATCHv2 07/23] KVM: x86 emulator: add (set|get)_msr callbacks to x86_emulate_ops

2010-04-28 Thread Gleb Natapov
Add (set|get)_msr callbacks to x86_emulate_ops instead of calling them directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/kvm/emulate.c | 36 ++-- arch/x86/kvm/x86.c |2

Re: qemu-kvm.0.12.2 aborts on linux

2010-04-30 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 10:19:37AM -0700, K D wrote: Am using yahoo mail and my mails to this mailer gets rejected every time saying message has HTML content etc. Should I use some other mail tool? Below is my issue. I am trying to get KVM/qemu running on linux. I compiled 2.6.27.10 by

Re: qemu-kvm.0.12.2 aborts on linux

2010-05-01 Thread Gleb Natapov
distribution. I went through qemu code and there is no place to raise rlimits. didn't want to touch it. thanks for looking. From: Gleb Natapov g...@redhat.com To: K D kdca...@yahoo.com Cc: a...@redhat.com; mtosa...@redhat.com; kvm@vger.kernel.org Sent: Thu

Re: What changed since kvm-72 resulting in winNT to fail to boot (STOP 0x0000001E) ?

2010-05-01 Thread Gleb Natapov
On Sat, May 01, 2010 at 09:30:03PM +0400, Michael Tokarev wrote: file=winnt.raw,if=ide,boot=on ? Um, that's equivalent, no? boot=on is not needed and does more harm than good with ide interface. -- Gleb. -- To unsubscribe from this list: send the line unsubscribe kvm

Re: [PATCH] KVM: VMX: Translate interrupt shadow when waiting on NMI window

2010-05-03 Thread Gleb Natapov
On Wed, Apr 21, 2010 at 05:14:04PM +0200, Jan Kiszka wrote: No you don't. I was told that software should be prepared to handle NMI after MOV SS. What part of SDM does this contradict? I found nothing in latest SDM. [ updated to March 2010 version ] To sum up the scenario again, I

Re: qemu-kvm.0.12.2 aborts on linux

2010-05-03 Thread Gleb Natapov
it is doing. any clues? Haven't used '-curses' option for a long time. Have you provided bootable disk? Does your guest boots into graphical mode or text mode? thanks for help. From: Gleb Natapov g...@redhat.com To: K D kdca...@yahoo.com Cc

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Gleb Natapov
On Thu, May 06, 2010 at 12:15:58PM +0300, Avi Kivity wrote: On 04/29/2010 02:58 PM, Gleb Natapov wrote: Do not kill VM If instruction emulation fails while vcpu is in userspace. Inject #UD instead in a hope that guest OS will kill offending process. Emulation failure is still traced by ftrace

Re: [PATCH RFC] KVM: inject #UD if instruction emulation fails while vcpu is in cpl==3

2010-05-06 Thread Gleb Natapov
On Thu, May 06, 2010 at 01:13:30PM +0300, Avi Kivity wrote: On 05/06/2010 01:06 PM, Gleb Natapov wrote: On Thu, May 06, 2010 at 12:15:58PM +0300, Avi Kivity wrote: On 04/29/2010 02:58 PM, Gleb Natapov wrote: Do not kill VM If instruction emulation fails while vcpu is in userspace. Inject #UD

[PATCH] Support for booting from virtio disks

2010-05-09 Thread Gleb Natapov
This patch adds native support for booting from virtio disks to Seabios. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/Makefile b/Makefile index 327a1bf..d0b8881 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,8 @@ OUT=out/ SRCBOTH=misc.c pmm.c stacks.c output.c util.c block.c

Re: [SeaBIOS] [PATCH] Support for booting from virtio disks

2010-05-09 Thread Gleb Natapov
On Sun, May 09, 2010 at 05:31:16PM +0100, Stefan Hajnoczi wrote: On Sun, May 9, 2010 at 4:23 PM, Gleb Natapov g...@redhat.com wrote: Neat! I believe SeaBIOS will see virtio-blk devices as harddisks and not attempt to boot ISOs? Many existing OS installers probably cannot boot from virtio-blk

[PATCHv2] Support for booting from virtio disks

2010-05-10 Thread Gleb Natapov
This patch adds native support for booting from virtio disks to Seabios. Signed-off-by: Gleb Natapov g...@redhat.com --- Changelog: v1-v2: - free memory in case of vq initialization error. - change license of virtio ring/pci to LGPLv3 with permission of Laurent Vivier (aka the author

[PATCHv2] KVM: inject #UD if instruction emulation fails and exit to userspace

2010-05-10 Thread Gleb Natapov
Do not kill VM when instruction emulation fails. Inject #UD and report failure to userspace instead. Userspace may choose to reenter guest if vcpu is in userspace (cpl == 3) in which case guest OS will kill offending process and continue running. Signed-off-by: Gleb Natapov g...@redhat.com

[PATCH] Do not stop VM if emulation failed in userspace.

2010-05-10 Thread Gleb Natapov
Continue vcpu execution in case emulation failure happened while vcpu was in userspace. In this case #UD will be injected into the guest allowing guest OS to kill offending process and continue. Signed-off-by: Gleb Natapov g...@redhat.com diff --git a/kvm-all.c b/kvm-all.c index 9ac35aa..db28d94

Re: [PATCHv2] Support for booting from virtio disks

2010-05-10 Thread Gleb Natapov
On Mon, May 10, 2010 at 09:25:20AM +0100, Stefan Hajnoczi wrote: diff --git a/src/virtio-blk.c b/src/virtio-blk.c new file mode 100644 index 000..a41c336 --- /dev/null +++ b/src/virtio-blk.c @@ -0,0 +1,155 @@ +// Virtio blovl boot support. Just noticed the blovl typo. +    

[PATCHv3] Support for booting from virtio disks

2010-05-10 Thread Gleb Natapov
This patch adds native support for booting from virtio disks to Seabios. Signed-off-by: Gleb Natapov g...@redhat.com --- Changelog: v1-v2: - free memory in case of vq initialization error. - change license of virtio ring/pci to LGPLv3 with permission of Laurent Vivier (aka the author

Re: [PATCHv2] KVM: inject #UD if instruction emulation fails and exit to userspace

2010-05-10 Thread Gleb Natapov
On Mon, May 10, 2010 at 11:16:56AM +0300, Gleb Natapov wrote: Do not kill VM when instruction emulation fails. Inject #UD and report failure to userspace instead. Userspace may choose to reenter guest if vcpu is in userspace (cpl == 3) in which case guest OS will kill offending process

Re: [PATCHv2] Support for booting from virtio disks

2010-05-10 Thread Gleb Natapov
On Mon, May 10, 2010 at 10:48:42AM -0500, Anthony Liguori wrote: On 05/10/2010 03:11 AM, Gleb Natapov wrote: This patch adds native support for booting from virtio disks to Seabios. Signed-off-by: Gleb Natapovg...@redhat.com A related problem that I think we need to think about how we

Re: [PATCHv2] Support for booting from virtio disks

2010-05-10 Thread Gleb Natapov
On Mon, May 10, 2010 at 10:58:45AM -0500, Anthony Liguori wrote: On 05/10/2010 10:54 AM, Gleb Natapov wrote: On Mon, May 10, 2010 at 10:48:42AM -0500, Anthony Liguori wrote: On 05/10/2010 03:11 AM, Gleb Natapov wrote: This patch adds native support for booting from virtio disks to Seabios

  1   2   3   4   5   6   7   8   9   10   >