Re: [PATCH 1/6] KVM: Check for pending events before attempting injection

2010-07-28 Thread Gleb Natapov
On Tue, Jul 27, 2010 at 04:19:35PM +0300, Avi Kivity wrote: > Instead of blindly attempting to inject an event before each guest entry, > check for a possible event first in vcpu->requests. Sites that can trigger > event injection are modified to set KVM_REQ_EVENT: > > - interrupt, nmi window ope

Re: [PATCH 5/6] kvm, x86: use ro page and don't copy shared page

2010-07-28 Thread Gleb Natapov
On Thu, Jul 29, 2010 at 10:15:22AM +0800, Lai Jiangshan wrote: > On 07/16/2010 03:19 PM, Gleb Natapov wrote: > > >> +/* get a current mapped page fast, and test whether the page is writable. > >> */ > >> +static struct page *get_user_page_and_protection(unsigned long addr, > >> + int *writable)

[PATCH] KVM Test: time_drift_with_stop: Wait a few seconds after the continue

2010-07-28 Thread Amos Kong
Except for kvm-clock, we need to wait a few seconds to let the interrupt lost during the stop to be reinjected. So sleep for 30 seconds ( could be configurated throug configuration file). Signed-off-by: Jason Wang Signed-off-by: Amos Kong --- 0 files changed, 0 insertions(+), 0 deletions(-) di

Re: [PATCH] test: Add emulator test for iret instruction

2010-07-28 Thread Marcelo Tosatti
On Thu, Jul 29, 2010 at 02:18:20AM +0300, Mohammed Gamal wrote: > >  Fourth test: > >   qemu-system-x86-12850 [001]  5167.510302: kvm_emulate_insn: 0:4200: 9c > > (real) > >   qemu-system-x86-12850 [001]  5167.510304: kvm_emulate_insn: 0:4201: 58 > > (real) > >   qemu-system-x86-12850 [001]  5167

Re: [PATCH 5/6] kvm, x86: use ro page and don't copy shared page

2010-07-28 Thread Lai Jiangshan
On 07/17/2010 07:26 AM, Marcelo Tosatti wrote: > On Fri, Jul 16, 2010 at 10:19:36AM +0300, Gleb Natapov wrote: >> On Fri, Jul 16, 2010 at 10:13:07AM +0800, Lai Jiangshan wrote: >>> When page fault, we always call get_user_pages(write=1). >>> >>> Actually, we don't need to do this when it is not wri

Re: [PATCH 5/6] kvm, x86: use ro page and don't copy shared page

2010-07-28 Thread Lai Jiangshan
On 07/16/2010 03:19 PM, Gleb Natapov wrote: >> +/* get a current mapped page fast, and test whether the page is writable. */ >> +static struct page *get_user_page_and_protection(unsigned long addr, >> +int *writable) >> +{ >> +struct page *page[1]; >> + >> +if (__get_user_pages_fast(ad

Re: [PATCH] test: Add emulator test for iret instruction

2010-07-28 Thread Mohammed Gamal
On Thu, Jul 29, 2010 at 2:16 AM, Mohammed Gamal wrote: > On Thu, Jul 29, 2010 at 2:13 AM, Mohammed Gamal wrote: >> On Wed, Jul 28, 2010 at 11:56 PM, Marcelo Tosatti >> wrote: >>> On Wed, Jul 28, 2010 at 11:36:16PM +0300, Mohammed Gamal wrote: On Wed, Jul 28, 2010 at 11:32 PM, Marcelo Tosat

Re: [PATCH] test: Add emulator test for iret instruction

2010-07-28 Thread Mohammed Gamal
On Thu, Jul 29, 2010 at 2:13 AM, Mohammed Gamal wrote: > On Wed, Jul 28, 2010 at 11:56 PM, Marcelo Tosatti wrote: >> On Wed, Jul 28, 2010 at 11:36:16PM +0300, Mohammed Gamal wrote: >>> On Wed, Jul 28, 2010 at 11:32 PM, Marcelo Tosatti >>> wrote: >>> > On Wed, Jul 28, 2010 at 11:28:05PM +0300, M

Re: [PATCH RFC 0/4] Paravirt-spinlock implementation for KVM guests (Version 0)

2010-07-28 Thread Konrad Rzeszutek Wilk
On Wed, Jul 28, 2010 at 06:10:59PM -0400, Konrad Rzeszutek Wilk wrote: > On Mon, Jul 26, 2010 at 11:41:50AM +0530, Srivatsa Vaddagiri wrote: > > This patch-series implements paravirt-spinlock implementation for KVM > > guests, > > based heavily on Xen's implementation. I tried to refactor Xen's sp

Re: [Qemu-devel] [RFC PATCH 11/14] KVM-test: Add a subtest of changing mac address

2010-07-28 Thread Lucas Meneghel Rodrigues
On Tue, 2010-07-20 at 09:36 +0800, Amos Kong wrote: > Mainly test steps: > 1. get a new mac from pool, and the old mac addr of guest. > 2. execute the mac_change.sh in guest. > 3. relogin to guest and query the interfaces info by `ifconfig` > > Signed-off-by: Cao, Chen > Signed-off-by: Amos Kong

Re: [PATCH V3] VFIO driver: Non-privileged user level PCI drivers

2010-07-28 Thread Alex Williamson
On Thu, 2010-07-29 at 00:57 +0300, Michael S. Tsirkin wrote: > On Wed, Jul 28, 2010 at 03:57:02PM -0600, Alex Williamson wrote: > > > > Something like GET_MSIX_VECTORS seems like a user library routine to me. > > The PCI config space is well specified and if we try to do more than > > shortcut tri

Re: [PATCH RFC 0/4] Paravirt-spinlock implementation for KVM guests (Version 0)

2010-07-28 Thread Konrad Rzeszutek Wilk
On Mon, Jul 26, 2010 at 11:41:50AM +0530, Srivatsa Vaddagiri wrote: > This patch-series implements paravirt-spinlock implementation for KVM guests, > based heavily on Xen's implementation. I tried to refactor Xen's spinlock > implementation to make it common for both Xen and KVM - but found that >

Re: [Qemu-devel] [RFC PATCH 10/14] KVM-test: Add a subtest of pxe

2010-07-28 Thread Lucas Meneghel Rodrigues
On Tue, 2010-07-20 at 09:36 +0800, Amos Kong wrote: > This case just snoop tftp packet through tcpdump, it depends on public dhcp > server, better to test it through dnsmasq. It would be a good idea to have an alternate implementation using dnsmasq, but not urgent. > Signed-off-by: Jason Wang >

Re: [PATCH V3] VFIO driver: Non-privileged user level PCI drivers

2010-07-28 Thread Michael S. Tsirkin
On Wed, Jul 28, 2010 at 03:57:02PM -0600, Alex Williamson wrote: > > Something like GET_MSIX_VECTORS seems like a user library routine to me. > The PCI config space is well specified and if we try to do more than > shortcut trivial operations (like getting the BAR length), we risk > losing functio

Re: [PATCH V3] VFIO driver: Non-privileged user level PCI drivers

2010-07-28 Thread Alex Williamson
On Wed, 2010-07-28 at 14:14 -0700, Tom Lyon wrote: > On Tuesday, July 27, 2010 04:53:22 pm Michael S. Tsirkin wrote: > > On Tue, Jul 27, 2010 at 03:13:14PM -0700, Tom Lyon wrote: > > > [ Sorry for the long hiatus, I've been wrapped up in other issues.] > > > > > > I think the fundamental issue to

Re: [Qemu-devel] [RFC PATCH 09/14] KVM-test: Add a subtest of multicast

2010-07-28 Thread Lucas Meneghel Rodrigues
On Tue, 2010-07-20 at 09:36 +0800, Amos Kong wrote: > Use 'ping' to test send/recive multicat packets. Flood ping test is also > added. > Limit guest network as 'bridge' mode, because multicast packets could not be > transmitted to guest when using 'user' network. > Add join_mcast.py for joining m

Re: [PATCH V3] VFIO driver: Non-privileged user level PCI drivers

2010-07-28 Thread Michael S. Tsirkin
On Wed, Jul 28, 2010 at 02:14:21PM -0700, Tom Lyon wrote: > On Tuesday, July 27, 2010 04:53:22 pm Michael S. Tsirkin wrote: > > On Tue, Jul 27, 2010 at 03:13:14PM -0700, Tom Lyon wrote: > > > [ Sorry for the long hiatus, I've been wrapped up in other issues.] > > > > > > I think the fundamental is

Re: [RFC PATCH 08/14] KVM-test: Add a subtest of nic promisc

2010-07-28 Thread Lucas Meneghel Rodrigues
On Tue, 2010-07-20 at 09:35 +0800, Amos Kong wrote: > This test mainly covers TCP sent from host to guest and from guest to host > with repeatedly turn on/off NIC promiscuous mode. > > Signed-off-by: Amos Kong > --- > 0 files changed, 0 insertions(+), 0 deletions(-) > > diff --git a/client/test

Re: [PATCH V3] VFIO driver: Non-privileged user level PCI drivers

2010-07-28 Thread Tom Lyon
On Tuesday, July 27, 2010 04:53:22 pm Michael S. Tsirkin wrote: > On Tue, Jul 27, 2010 at 03:13:14PM -0700, Tom Lyon wrote: > > [ Sorry for the long hiatus, I've been wrapped up in other issues.] > > > > I think the fundamental issue to resolve is to decide on the model which > > the VFIO driver p

Re: [PATCH] test: Add emulator test for iret instruction

2010-07-28 Thread Mohammed Gamal
On Wed, Jul 28, 2010 at 11:32 PM, Marcelo Tosatti wrote: > On Wed, Jul 28, 2010 at 11:28:05PM +0300, Mohammed Gamal wrote: >> On Wed, Jul 28, 2010 at 10:55 PM, Marcelo Tosatti >> wrote: >> > On Wed, Jul 28, 2010 at 12:39:01PM +0300, Mohammed Gamal wrote: >> >> This adds a unit test for real mode

Re: [PATCH] test: Add emulator test for iret instruction

2010-07-28 Thread Marcelo Tosatti
On Wed, Jul 28, 2010 at 11:28:05PM +0300, Mohammed Gamal wrote: > On Wed, Jul 28, 2010 at 10:55 PM, Marcelo Tosatti wrote: > > On Wed, Jul 28, 2010 at 12:39:01PM +0300, Mohammed Gamal wrote: > >> This adds a unit test for real mode emulation of the iret instruction > >> > >> Signed-off-by: Mohamme

Re: [PATCH] test: Add emulator test for iret instruction

2010-07-28 Thread Mohammed Gamal
On Wed, Jul 28, 2010 at 10:55 PM, Marcelo Tosatti wrote: > On Wed, Jul 28, 2010 at 12:39:01PM +0300, Mohammed Gamal wrote: >> This adds a unit test for real mode emulation of the iret instruction >> >> Signed-off-by: Mohammed Gamal >> >> --- >> Changes from v1: >> - Added test for 16-bit iret >>

Re: [PATCH] test: Add emulator test for iret instruction

2010-07-28 Thread Marcelo Tosatti
On Wed, Jul 28, 2010 at 12:39:01PM +0300, Mohammed Gamal wrote: > This adds a unit test for real mode emulation of the iret instruction > > Signed-off-by: Mohammed Gamal > > --- > Changes from v1: > - Added test for 16-bit iret > - Added tests for returned eflags > --- > kvm/test/x86/realmode.c

Re: [PATCH 1/6] KVM: Check for pending events before attempting injection

2010-07-28 Thread Marcelo Tosatti
On Wed, Jul 28, 2010 at 07:53:32PM +0300, Avi Kivity wrote: > On 07/28/2010 07:37 PM, Marcelo Tosatti wrote: > >On Wed, Jul 28, 2010 at 07:31:03PM +0300, Avi Kivity wrote: > >> On 07/28/2010 07:21 PM, Marcelo Tosatti wrote: > >>>On Tue, Jul 27, 2010 at 04:19:35PM +0300, Avi Kivity wrote: > In

Re: [Qemu-devel] [RFC PATCH 07/14] KVM-test: Add a subtest of load/unload nic driver

2010-07-28 Thread Lucas Meneghel Rodrigues
On Tue, 2010-07-20 at 09:35 +0800, Amos Kong wrote: > Repeatedly load/unload nic driver, try to transfer file between guest and host > by threads at the same time, and check the md5sum. > > Signed-off-by: Amos Kong > --- > 0 files changed, 0 insertions(+), 0 deletions(-) > > diff --git a/client

Re: [PATCH 6/6] test: verify that the emulator honours svm intercepts

2010-07-28 Thread Avi Kivity
On 07/28/2010 07:25 PM, Avi Kivity wrote: +static void corrupt_cr3_intercept_bypass(void *_test) +{ +struct test *test = _test; +extern volatile u32 mmio_insn; + +while (!__sync_bool_compare_and_swap(&test->scratch, 1, 2)) +pause(); +pause(); +pause(); +pause();

Re: [PATCH 0/2] Nested SVM fix and next_rip emulation

2010-07-28 Thread Marcelo Tosatti
On Tue, Jul 27, 2010 at 06:14:19PM +0200, Joerg Roedel wrote: > Hi Avi, Marcelo, > > here are two small patches for kvm-amd. The first patch fixes a small bug in > nested svm efer handling. The second patch implements emulation for the > next_rip feature. Applied, thanks. -- To unsubscribe from

Re: [PATCH] x86 emulator: Add IRET instruction

2010-07-28 Thread Marcelo Tosatti
On Wed, Jul 28, 2010 at 12:38:40PM +0300, Mohammed Gamal wrote: > Ths patch adds IRET instruction (opcode 0xcf). > Currently, only IRET in real mode is emulated. Protected mode support is to > be added later if needed. > > Signed-off-by: Mohammed Gamal > > > Changes from v2: > - Delay comm

Re: [PATCH 1/6] KVM: Check for pending events before attempting injection

2010-07-28 Thread Avi Kivity
On 07/28/2010 07:37 PM, Marcelo Tosatti wrote: On Wed, Jul 28, 2010 at 07:31:03PM +0300, Avi Kivity wrote: On 07/28/2010 07:21 PM, Marcelo Tosatti wrote: On Tue, Jul 27, 2010 at 04:19:35PM +0300, Avi Kivity wrote: Instead of blindly attempting to inject an event before each guest entry, che

Re: [PATCH 1/6] KVM: Check for pending events before attempting injection

2010-07-28 Thread Marcelo Tosatti
On Wed, Jul 28, 2010 at 07:31:03PM +0300, Avi Kivity wrote: > On 07/28/2010 07:21 PM, Marcelo Tosatti wrote: > >On Tue, Jul 27, 2010 at 04:19:35PM +0300, Avi Kivity wrote: > >>Instead of blindly attempting to inject an event before each guest entry, > >>check for a possible event first in vcpu->re

Re: [PATCH 1/6] KVM: Check for pending events before attempting injection

2010-07-28 Thread Avi Kivity
On 07/28/2010 07:21 PM, Marcelo Tosatti wrote: On Tue, Jul 27, 2010 at 04:19:35PM +0300, Avi Kivity wrote: Instead of blindly attempting to inject an event before each guest entry, check for a possible event first in vcpu->requests. Sites that can trigger event injection are modified to set KV

[PATCH 6/6] test: verify that the emulator honours svm intercepts

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/x86/svm.c | 37 + 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index 3c30118..cb26af6 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -3,6 +3,7 @@ #

[PATCH 2/6] test: add intercepted and unintercepted cr3 read tests for svm

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/x86/svm.c | 26 +- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index 5bb64ff..222356d 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -146,12 +146,36 @@ static

[PATCH 0/6] svm intercept tests

2010-07-28 Thread Avi Kivity
This patchset adds three more svm tests: cr3 read intercept, cr3 read intercept (disabled), and cr3 read intercept through the instruction emulator. As usual, 66.7% of the tests pass. Avi Kivity (6): test: add scratch word for use by svm tests test: add intercepted and unintercepted cr3 read

[PATCH 4/6] test: add cli() and sti() instruction accessors

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/lib/x86/processor.h | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/kvm/test/lib/x86/processor.h b/kvm/test/lib/x86/processor.h index 0376d04..67d7ca5 100644 --- a/kvm/test/lib/x86/processor.h +++ b/kvm/test/lib/x86/process

[PATCH 5/6] test: ensure svm tests are executed with interrupts disabled by default

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/x86/svm.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index 222356d..3c30118 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -110,6 +110,7 @@ static bool test_run(struct test *t

[PATCH 3/6] test: add pause() instruction accessor

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/lib/x86/processor.h |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/kvm/test/lib/x86/processor.h b/kvm/test/lib/x86/processor.h index ea44a9d..0376d04 100644 --- a/kvm/test/lib/x86/processor.h +++ b/kvm/test/lib/x86/processor.h @

[PATCH 1/6] test: add scratch word for use by svm tests

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/x86/svm.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/kvm/test/x86/svm.c b/kvm/test/x86/svm.c index af0e60c..5bb64ff 100644 --- a/kvm/test/x86/svm.c +++ b/kvm/test/x86/svm.c @@ -63,6 +63,7 @@ struct test { bool (*succeeded)(

Re: [PATCH 1/6] KVM: Check for pending events before attempting injection

2010-07-28 Thread Marcelo Tosatti
On Tue, Jul 27, 2010 at 04:19:35PM +0300, Avi Kivity wrote: > Instead of blindly attempting to inject an event before each guest entry, > check for a possible event first in vcpu->requests. Sites that can trigger > event injection are modified to set KVM_REQ_EVENT: > > - interrupt, nmi window ope

Re: Freezing Windows 2008 x64bit guest

2010-07-28 Thread Gleb Natapov
On Wed, Jul 28, 2010 at 12:53:02AM +0300, Harri Olin wrote: > Gleb Natapov wrote: > >On Wed, Jul 21, 2010 at 09:25:31AM +0300, Harri Olin wrote: > >>Gleb Natapov kirjoitti: > >>>On Mon, Jul 19, 2010 at 10:17:02AM +0300, Harri Olin wrote: > Gleb Natapov kirjoitti: > >On Thu, Jul 15, 2010 at

[PATCH 1/2] Fix segfault in mmio subpage handling code.

2010-07-28 Thread Gleb Natapov
It is possible that subpage mmio is registered over existing memory page. When this happens "memory" will have real memory address and not index into io_mem array so next access to the page will generate segfault. It is uncommon to have some part of a page to be accessed as memory and some as mmio,

[PATCH 0/2] cpu_register_physical_memory() is completely broken.

2010-07-28 Thread Gleb Natapov
Or just a little bit? Nothing prevents guest from configuring pci mmio bar to overlap system memory region and the physical memory address will became mmio, but when guest will change pci bar mapping the physical address location will not become memory again, but instead it becomes unassigned. Yes

[PATCH 2/2] Remove guest triggerable abort()

2010-07-28 Thread Gleb Natapov
This abort() condition is easily triggerable by a guest if it configures pci bar with unaligned address that overlaps main memory. Signed-off-by: Gleb Natapov --- kvm-all.c | 16 1 files changed, 4 insertions(+), 12 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index fec6d0

Re: [PATCH 00/13] Emulator group simplification

2010-07-28 Thread Marcelo Tosatti
On Mon, Jul 26, 2010 at 02:37:38PM +0300, Avi Kivity wrote: > This patchset simplifies the x86 emulator group decoding, cleans up the > decoder > tables (and adds a missing Lock marker as well). > > Avi Kivity (13): > KVM: x86 emulator: add macros for repetitive instructions > KVM: x86 emulat

Re: [PATCH] KVM: fix compile warning

2010-07-28 Thread Marcelo Tosatti
On Mon, Jul 26, 2010 at 01:47:23PM +0800, Xiao Guangrong wrote: > > Stephen Rothwell wrote: > > Hi all, > > > > After merging the kvm tree, today's linux-next build (x86_64 > > allmodconfig) produced this warning: > > > > arch/x86/kvm/mmu.c: In function 'kvm_mmu_pte_write': > > arch/x86/kvm/mmu.

Re: [PATCH] KVM: MMU: remove valueless output message

2010-07-28 Thread Marcelo Tosatti
On Tue, Jul 27, 2010 at 11:21:18AM +0800, Xiao Guangrong wrote: > After commit 53383eaad08d, the '*spte' has updated before call > rmap_remove()(in most case it's 'shadow_trap_nonpresent_pte'), so > remove this information from error message > > Signed-off-by: Xiao Guangrong > --- > arch/x86/kvm

Re: [PATCH] KVM: x86 emulator: fix handling for unemulated instructions

2010-07-28 Thread Marcelo Tosatti
On Sun, Jul 25, 2010 at 02:51:16PM +0300, Avi Kivity wrote: > If an instruction is present in the decode tables but not in the execution > switch, it will be emulated as a NOP. An example is IRET (0xcf). > > Fix by adding default: labels to the execution switches. > > Signed-off-by: Avi Kivity

Re: [PATCH 0/2] Fix GDT limit corruption on Intel

2010-07-28 Thread Marcelo Tosatti
On Mon, Jul 26, 2010 at 06:32:37PM +0300, Avi Kivity wrote: > Intel vmx does not restore GDT.LIMIT; this allows host userspace to look at > some host kernel bits by loading a segment register and looking whether a > trap happened or not. > > Fix that by reloading GDT on heavyweight exits. > > Avi

Re: [PATCH] test: emulator: test LOCK NEG and LOCK NOT

2010-07-28 Thread Marcelo Tosatti
On Mon, Jul 26, 2010 at 03:21:54PM +0300, Avi Kivity wrote: > Signed-off-by: Avi Kivity > --- > kvm/test/x86/emulator.c | 21 ++--- > 1 files changed, 18 insertions(+), 3 deletions(-) Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the bod

Re: [PATCH RFC 2/4] Add yield hypercall for KVM guests

2010-07-28 Thread Srivatsa Vaddagiri
On Mon, Jul 26, 2010 at 10:19:41AM -0700, Jeremy Fitzhardinge wrote: > On 07/25/2010 11:14 PM, Srivatsa Vaddagiri wrote: > >Add KVM hypercall for yielding vcpu timeslice. > > Can you do a directed yield? We don't have that support yet in Linux scheduler. Also I feel it would be more useful when

Re: [PATCH RFC 0/4] Paravirt-spinlock implementation for KVM guests (Version 0)

2010-07-28 Thread Srivatsa Vaddagiri
On Mon, Jul 26, 2010 at 10:18:58AM -0700, Jeremy Fitzhardinge wrote: > >I tried to refactor Xen's spinlock > >implementation to make it common for both Xen and KVM - but found that > >few differences between Xen and KVM (Xen has the ability to block on a > >particular event/irq for example) _and_ t

Re: [Qemu-devel] [RFC PATCH 03/14] KVM Test: Add a common ping module for network related tests

2010-07-28 Thread Michael Goldish
On 07/28/2010 02:50 PM, Michael Goldish wrote: > On 07/27/2010 04:01 PM, Lucas Meneghel Rodrigues wrote: >> On Tue, 2010-07-20 at 09:35 +0800, Amos Kong wrote: >>> The kvm_net_utils.py is a just a place that wraps common network >>> related commands which is used to do the network-related tests. >>

Re: [PATCH] x86 emulator: Add IRET instruction

2010-07-28 Thread Paolo Bonzini
On 07/28/2010 03:30 PM, Paolo Bonzini wrote: On 07/28/2010 11:38 AM, Mohammed Gamal wrote: + unsigned long mask = EFLG_CF | EFLG_PF | EFLG_AF | EFLG_ZF | EFLG_SF | EFLG_TF | + EFLG_IF | EFLG_DF | EFLG_OF | EFLG_IOPL | EFLG_NT | EFLG_RF | + EFLG_AC | EFLG_ID | (1 << 1); /* Last one is the reserve

Re: [Qemu-devel] [PATCH v2 0/2] Use kvm64/kvm32 when running under KVM

2010-07-28 Thread Markus Armbruster
jes.soren...@redhat.com writes: > From: Jes Sorensen > > This set of patches adds default CPU types to the PC compat > definitions, and patch #2 sets the CPU type to kvm64/kvm32 when > running under KVM. > > Long term we might want to qdev'ify the CPUs but I think it is better > to keep it simple

[GIT PULL net-next-2.6] vhost-net patchset for 2.6.36

2010-07-28 Thread Michael S. Tsirkin
David, The following tree includes the current vhost-net patchset. Please merge it for 2.6.36. Thanks! The following changes since commit 4cfa580e7eebb8694b875d2caff3b989ada2efac: r6040: Fix args to phy_mii_ioctl(). (2010-07-21 21:10:49 -0700) are available in the git repository at: git://gi

Re: [PATCH] x86 emulator: Add IRET instruction

2010-07-28 Thread Paolo Bonzini
On 07/28/2010 11:38 AM, Mohammed Gamal wrote: + unsigned long mask = EFLG_CF | EFLG_PF | EFLG_AF | EFLG_ZF | EFLG_SF | EFLG_TF | +EFLG_IF | EFLG_DF | EFLG_OF | EFLG_IOPL | EFLG_NT | EFLG_RF | +EFLG_AC | EFLG_ID | (1 << 1); /* Last on

Re: [Qemu-devel] Re: KVM call agenda for July 27

2010-07-28 Thread Markus Armbruster
Kevin Wolf writes: > Am 28.07.2010 13:22, schrieb Markus Armbruster: >> Anthony Liguori writes: >> >>> On 07/27/2010 10:22 AM, Markus Armbruster wrote: [...] Raw can't be probed safely, by its very nature. For historical reasons, we try anyway. I think we should stop doing that, eve

Re: [PATCH 0/8] Nested SVM unit tests

2010-07-28 Thread Avi Kivity
On 07/28/2010 03:39 PM, Roedel, Joerg wrote: On Wed, Jul 28, 2010 at 07:53:59AM -0400, Avi Kivity wrote: The test framework supports smp, so you can have the second vcpu do nasty stuff. The difficult part is when the failure depends on host state that is not visible to the guest. Perhaps we c

[PATCH 2/2] Use kvm32/kvm64 as default CPUs when running under KVM.

2010-07-28 Thread Jes . Sorensen
From: Jes Sorensen KVM has a minimum CPU requirement in order to run, so there is no reason to default to the very basic family 6, model 2 (or model 3 for qemu32) CPU since the additional features are going to be available on the host CPU. Signed-off-by: Jes Sorensen --- hw/pc.c | 13 +++

[PATCH 1/2] Set a default CPU type for compat PC machine defs.

2010-07-28 Thread Jes . Sorensen
From: Jes Sorensen This allows for changing the default CPU type on the current PC definition without breaking legacy mode. Signed-off-by: Jes Sorensen --- hw/boards.h |1 + hw/pc_piix.c | 15 +++ vl.c |2 ++ 3 files changed, 18 insertions(+), 0 deletions(-) dif

[PATCH v2 0/2] Use kvm64/kvm32 when running under KVM

2010-07-28 Thread Jes . Sorensen
From: Jes Sorensen This set of patches adds default CPU types to the PC compat definitions, and patch #2 sets the CPU type to kvm64/kvm32 when running under KVM. Long term we might want to qdev'ify the CPUs but I think it is better to keep it simple for 0.13. Jes Sorensen (2): Set a default C

Re: [PATCH 0/8] Nested SVM unit tests

2010-07-28 Thread Roedel, Joerg
On Wed, Jul 28, 2010 at 07:53:59AM -0400, Avi Kivity wrote: > The test framework supports smp, so you can have the second vcpu do > nasty stuff. The difficult part is when the failure depends on host > state that is not visible to the guest. Perhaps we can add test-only > hypercalls that allow

Re: 2.6.35-rc1 regression with pvclock and smp guests

2010-07-28 Thread Andre Przywara
Andre Przywara wrote: Andre Przywara wrote: Avi Kivity wrote: On 07/27/2010 04:48 PM, Andre Przywara wrote: Wierd. Maybe the clock goes crazy. Let's see if it jumps forward alot: } while (unlikely(last != ret)); + + { +static u64 last_report; +if (re

Re: [PATCH 2/2] KVM: SVM: Emulate next_rip svm feature

2010-07-28 Thread Avi Kivity
On 07/28/2010 03:18 PM, Roedel, Joerg wrote: The guest (L2 in this case) is doomed since it execution cannot continue. But L1 and L0 are fine. The problem with L2 avoiding intercepts is that L2 can change control registers and take over L1. Right too. We can not ignore it. The right fix is

Re: [PATCH 2/2] KVM: SVM: Emulate next_rip svm feature

2010-07-28 Thread Roedel, Joerg
On Wed, Jul 28, 2010 at 07:57:36AM -0400, Avi Kivity wrote: > If the instruction opcode is on mmio, the processor never sees the > opcode and thus can not intercept. Or the processor may see one > instruction, which is not intercepted, but by the time the emulator > kicks in a different instru

Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-07-28 Thread Tejun Heo
Hello, On 07/28/2010 12:48 PM, Michael S. Tsirkin wrote: > I'm unsure how flush_work operates under these conditions. E.g. in > workqueue.c, this seems to work by keeping a pointer to current > workqueue in the work. But what prevents us from destroying the > workqueue when work might not be run

Re: [PATCH 2/2] KVM: SVM: Emulate next_rip svm feature

2010-07-28 Thread Avi Kivity
On 07/28/2010 02:51 PM, Roedel, Joerg wrote: On Wed, Jul 28, 2010 at 07:34:11AM -0400, Avi Kivity wrote: On 07/28/2010 02:25 PM, Roedel, Joerg wrote: On Wed, Jul 28, 2010 at 06:28:06AM -0400, Avi Kivity wrote: We have a slightly different problem, if the nested guest manages to get an inst

Re: [PATCH 0/8] Nested SVM unit tests

2010-07-28 Thread Avi Kivity
On 07/28/2010 02:40 PM, Roedel, Joerg wrote: On Wed, Jul 28, 2010 at 06:18:19AM -0400, Avi Kivity wrote: The following patchset adds a framework for nested SVM unit testing. As you may guess, future fixes and enhancements to nested SVM will require matching tests. Cool stuff. I guess the thir

Re: [PATCH 2/2] KVM: SVM: Emulate next_rip svm feature

2010-07-28 Thread Roedel, Joerg
On Wed, Jul 28, 2010 at 07:34:11AM -0400, Avi Kivity wrote: > On 07/28/2010 02:25 PM, Roedel, Joerg wrote: > > On Wed, Jul 28, 2010 at 06:28:06AM -0400, Avi Kivity wrote: > >> We have a slightly different problem, if the nested guest manages to get > >> an instruction to be emulated by the host (

Re: [Qemu-devel] [RFC PATCH 03/14] KVM Test: Add a common ping module for network related tests

2010-07-28 Thread Michael Goldish
On 07/27/2010 04:01 PM, Lucas Meneghel Rodrigues wrote: > On Tue, 2010-07-20 at 09:35 +0800, Amos Kong wrote: >> The kvm_net_utils.py is a just a place that wraps common network >> related commands which is used to do the network-related tests. >> Use -1 as the packet ratio for loss analysis. >> Us

Re: [PATCH 0/8] Nested SVM unit tests

2010-07-28 Thread Roedel, Joerg
On Wed, Jul 28, 2010 at 06:18:19AM -0400, Avi Kivity wrote: > The following patchset adds a framework for nested SVM unit testing. As > you may guess, future fixes and enhancements to nested SVM will require > matching tests. Cool stuff. I guess the third test failed (vmrun intercept check), shou

Re: [PATCH 2/2] KVM: SVM: Emulate next_rip svm feature

2010-07-28 Thread Avi Kivity
On 07/28/2010 02:25 PM, Roedel, Joerg wrote: On Wed, Jul 28, 2010 at 06:28:06AM -0400, Avi Kivity wrote: We have a slightly different problem, if the nested guest manages to get an instruction to be emulated by the host (if the guest assigned it the cirrus framebuffer, for example, so from L1's

Re: [Qemu-devel] Re: KVM call agenda for July 27

2010-07-28 Thread Kevin Wolf
Am 28.07.2010 13:22, schrieb Markus Armbruster: > Anthony Liguori writes: > >> On 07/27/2010 10:22 AM, Markus Armbruster wrote: >>> Kevin Wolf writes: >>> >>> Am 27.07.2010 15:00, schrieb Anthony Liguori: > On 07/27/2010 02:19 AM, Markus Armbruster wrote: > >>

Re: [PATCH 2/2] KVM: SVM: Emulate next_rip svm feature

2010-07-28 Thread Roedel, Joerg
On Wed, Jul 28, 2010 at 06:28:06AM -0400, Avi Kivity wrote: > We have a slightly different problem, if the nested guest manages to get > an instruction to be emulated by the host (if the guest assigned it the > cirrus framebuffer, for example, so from L1's point of view it is RAM, > but from L0'

Re: [Qemu-devel] Re: KVM call agenda for July 27

2010-07-28 Thread Markus Armbruster
Anthony Liguori writes: > On 07/27/2010 10:22 AM, Markus Armbruster wrote: >> Kevin Wolf writes: >> >> >>> Am 27.07.2010 15:00, schrieb Anthony Liguori: >>> On 07/27/2010 02:19 AM, Markus Armbruster wrote: > Anthony Liguori writes: > > > >>

Re: [Qemu-devel] [PATCH] Use kvm32/kvm64 as default CPUs when running under KVM.

2010-07-28 Thread Jes Sorensen
On 07/28/10 12:51, Avi Kivity wrote: > On 07/28/2010 01:05 PM, jes.soren...@redhat.com wrote: >> From: Jes Sorensen >> >> KVM has a minimum CPU requirement in order to run, so there is no >> reason to default to the very basic family 6, model 2 (or model 3 for >> qemu32) CPU since the additional f

Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-07-28 Thread Michael S. Tsirkin
On Wed, Jul 28, 2010 at 09:48:31AM +0200, Tejun Heo wrote: > On 07/27/2010 09:19 PM, Michael S. Tsirkin wrote: > >> Thinking a bit more about it, it kind of sucks that queueing to > >> another worker from worker->func() breaks flush. Maybe the right > >> thing to do there is using atomic_t for don

Re: [Qemu-devel] [PATCH] Use kvm32/kvm64 as default CPUs when running under KVM.

2010-07-28 Thread Avi Kivity
On 07/28/2010 01:05 PM, jes.soren...@redhat.com wrote: From: Jes Sorensen KVM has a minimum CPU requirement in order to run, so there is no reason to default to the very basic family 6, model 2 (or model 3 for qemu32) CPU since the additional features are going to be available on the host CPU.

Re: 2.6.35-rc1 regression with pvclock and smp guests

2010-07-28 Thread Avi Kivity
On 07/28/2010 12:00 AM, Arjan Koers wrote: On 2010-07-26 20:59, Arjan Koers wrote: I ran into the same problem. 2.6.34.1 and 2.6.35-rc6 SMP guest kernels hang during boot. It appears that last is way ahead of ret twice. The kernel boots with this debug patch that makes the clock go backwards

Re: [PATCH] x86 emulator: Add IRET instruction

2010-07-28 Thread Avi Kivity
On 07/28/2010 12:38 PM, Mohammed Gamal wrote: Ths patch adds IRET instruction (opcode 0xcf). Currently, only IRET in real mode is emulated. Protected mode support is to be added later if needed. Looks good. -- I have a truly marvellous patch that fixes the bug which this signature is too nar

Re: [Qemu-devel] [RFC PATCH 02/14] KVM Test: Add a function get_interface_name() to kvm_net_utils.py

2010-07-28 Thread Michael Goldish
On 07/27/2010 05:08 AM, Lucas Meneghel Rodrigues wrote: > On Tue, 2010-07-20 at 09:35 +0800, Amos Kong wrote: >> The function get_interface_name is used to get the interface name of linux >> guest through the macaddress of specified macaddress. > > I wonder if it wouldn't be overkill to have separ

Re: [PATCH 0/2] Nested SVM fix and next_rip emulation

2010-07-28 Thread Avi Kivity
On 07/27/2010 07:14 PM, Joerg Roedel wrote: Hi Avi, Marcelo, here are two small patches for kvm-amd. The first patch fixes a small bug in nested svm efer handling. The second patch implements emulation for the next_rip feature. Please post test cases for both patches. -- I have a truly marve

Re: [PATCH 2/2] KVM: SVM: Emulate next_rip svm feature

2010-07-28 Thread Avi Kivity
On 07/28/2010 12:37 PM, Roedel, Joerg wrote: Can it be really this simple? Suppose we emulate a nested guest instruction just before vmexit, doesn't that invalidate vmcb->control.next_rip? Can that happen? Good point. I looked again into it. The documentation states: The next seque

[PATCH 4/8] test: add processor register access functions

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/lib/x86/processor.h | 246 ++ 1 files changed, 246 insertions(+), 0 deletions(-) create mode 100644 kvm/test/lib/x86/processor.h diff --git a/kvm/test/lib/x86/processor.h b/kvm/test/lib/x86/processor.h new file mode

[PATCH 1/8] test: move ARRAY_SIZE() to libcflat.h

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/lib/libcflat.h |2 ++ kvm/test/x86/vmexit.c |2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kvm/test/lib/libcflat.h b/kvm/test/lib/libcflat.h index 1da4013..7274fed 100644 --- a/kvm/test/lib/libcflat.h +++ b/kvm/test/lib/libcf

[PATCH 8/8] test: add svm tests

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/config-x86-common.mak |2 + kvm/test/config-x86_64.mak |1 + kvm/test/x86/svm.c | 180 3 files changed, 183 insertions(+), 0 deletions(-) create mode 100644 kvm/test/x86/svm.c diff --git a/k

[PATCH 7/8] test: add msr definitions header

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/lib/x86/msr.h | 406 1 files changed, 406 insertions(+), 0 deletions(-) create mode 100644 kvm/test/lib/x86/msr.h diff --git a/kvm/test/lib/x86/msr.h b/kvm/test/lib/x86/msr.h new file mode 100644 index

[PATCH 6/8] test: add svm definitions header

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/x86/svm.h | 328 1 files changed, 328 insertions(+), 0 deletions(-) create mode 100644 kvm/test/x86/svm.h diff --git a/kvm/test/x86/svm.h b/kvm/test/x86/svm.h new file mode 100644 index 000..3fdc0d3

[PATCH 5/8] test: make use of new processor.h header

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/x86/apic.c |8 kvm/test/x86/emulator.c | 10 +- kvm/test/x86/vm.c | 20 +++- kvm/test/x86/vm.h | 43 ++- 4 files changed, 14 insertions(+), 67 deletions(-) di

[PATCH 3/8] test: add type bool

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/lib/libcflat.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/kvm/test/lib/libcflat.h b/kvm/test/lib/libcflat.h index 2e2a8bf..d0d3df2 100644 --- a/kvm/test/lib/libcflat.h +++ b/kvm/test/lib/libcflat.h @@ -28,6 +28,10 @@ typedef

[PATCH 2/8] test: move memset() to libcflat

2010-07-28 Thread Avi Kivity
Signed-off-by: Avi Kivity --- kvm/test/lib/libcflat.h |3 +++ kvm/test/lib/string.c | 11 +++ kvm/test/x86/access.c |8 kvm/test/x86/idt.c |8 kvm/test/x86/vm.c | 10 -- 5 files changed, 14 insertions(+), 26 deletions(-) diff --git

[PATCH 0/8] Nested SVM unit tests

2010-07-28 Thread Avi Kivity
The following patchset adds a framework for nested SVM unit testing. As you may guess, future fixes and enhancements to nested SVM will require matching tests. Currently, our nested SVM implementation has a 66.67% success rate using these tests. Avi Kivity (8): test: move ARRAY_SIZE() to libcf

[PATCH] Use kvm32/kvm64 as default CPUs when running under KVM.

2010-07-28 Thread Jes . Sorensen
From: Jes Sorensen KVM has a minimum CPU requirement in order to run, so there is no reason to default to the very basic family 6, model 2 (or model 3 for qemu32) CPU since the additional features are going to be available on the host CPU. Signed-off-by: Jes Sorensen --- hw/pc.c | 13 +++

[PATCH] test: Add emulator test for iret instruction

2010-07-28 Thread Mohammed Gamal
This adds a unit test for real mode emulation of the iret instruction Signed-off-by: Mohammed Gamal --- Changes from v1: - Added test for 16-bit iret - Added tests for returned eflags --- kvm/test/x86/realmode.c | 79 +++ 1 files changed, 79 inserti

[PATCH] x86 emulator: Add IRET instruction

2010-07-28 Thread Mohammed Gamal
Ths patch adds IRET instruction (opcode 0xcf). Currently, only IRET in real mode is emulated. Protected mode support is to be added later if needed. Signed-off-by: Mohammed Gamal Changes from v2: - Delay committing cs until all pop operation are ensured to be successful - Corrected handlin

Re: [PATCH 2/2] KVM: SVM: Emulate next_rip svm feature

2010-07-28 Thread Roedel, Joerg
On Tue, Jul 27, 2010 at 02:32:35PM -0400, Avi Kivity wrote: > On 07/27/2010 07:14 PM, Joerg Roedel wrote: > > This patch implements the emulations of the svm next_rip > > feature in the nested svm implementation in kvm. > > > > Signed-off-by: Joerg Roedel > > --- > > arch/x86/kvm/svm.c |8 +

How to use live migration with non-shared storage about kvm

2010-07-28 Thread 姚远
>From qemu-kvm-0.12.1, kvm has the function about live migration with non-shared storage. But I don't know how to use it. In the qemu monitor, "migrate -d tcp:10.1.10.42:444" which is based on shared storage is going well. I don't know how to use the command of "-b or -i" or maybe I don't know the

Re: 2.6.35-rc1 regression with pvclock and smp guests

2010-07-28 Thread Andre Przywara
Zachary Amsden wrote: On 07/27/2010 11:51 AM, Andre Przywara wrote: Andre Przywara wrote: Avi Kivity wrote: On 07/27/2010 04:48 PM, Andre Przywara wrote: Wierd. Maybe the clock goes crazy. Let's see if it jumps forward alot: } while (unlikely(last != ret)); + + { +

Re: [PATCH 1/2] KVM: SVM: Sync efer back into nested vmcb

2010-07-28 Thread Roedel, Joerg
On Tue, Jul 27, 2010 at 03:07:32PM -0400, Avi Kivity wrote: > On 07/27/2010 07:14 PM, Joerg Roedel wrote: > > This patch fixes a bug in a nested hypervisor that heavily > > switches between real-mode and long-mode. The problem is > > fixed by syncing back efer into the guest vmcb on emulated > >

Re: [PATCH UPDATED 1/3] vhost: replace vhost_workqueue with per-vhost kthread

2010-07-28 Thread Tejun Heo
On 07/27/2010 09:19 PM, Michael S. Tsirkin wrote: >> Thinking a bit more about it, it kind of sucks that queueing to >> another worker from worker->func() breaks flush. Maybe the right >> thing to do there is using atomic_t for done_seq? > > I don't believe it will help: we might have: > > worke

  1   2   >