Re: [PATCH] device-assignment: move irqs update to piix emulation

2011-03-28 Thread Konstantin Khlebnikov
Alex Williamson wrote: On Sun, 2011-03-27 at 23:22 +0400, Konstantin Khlebnikov wrote: Move assigned devices irq reroute hook from generic pci code to piix emulation. Actually without this patch this hook had never worked, because pci.c not include config.h and CONFIG_KVM_DEVICE_ASSIGNMENT ther

Re: 2.6.38.1 general protection fault

2011-03-28 Thread Avi Kivity
On 03/28/2011 08:24 AM, Tomasz Chmielewski wrote: On 27.03.2011 11:42, Avi Kivity wrote: (...) Okay, the fork came from the ,script=. The issue with %rsi looks like a use-after-free, however kvm_mmu_notifier_invalidate_range_start appears to be properly srcu protected. FYI, I saw this one a

Re: "KVM internal error. Suberror: 1" with ancient 2.4 kernel as guest

2011-03-28 Thread Avi Kivity
On 03/28/2011 02:53 AM, Wei Xu wrote: >> +++ linux/contents/include/linux/kvm.h 2011-03-21 09:16:39.0 -0700 >> @@ -152,7 +152,7 @@ >> /* KVM_EXIT_MMIO */ >> struct { >> __u64 phys_addr; >> - __u8 data[8]; >> + __u8 data[16]; >> __u32 len; >> __u8 is_write; >> } mmio; > >

Re: "KVM internal error. Suberror: 1" with ancient 2.4 kernel as guest

2011-03-28 Thread Avi Kivity
On 03/28/2011 02:54 AM, Wei Xu wrote: Avi, Are you sure there is a sse-mmio branch? I could not find it anywhere... http://git.kernel.org/?p=virt/kvm/kvm.git;a=shortlog;h=refs/heads/sse-mmio Badly out of date, and somewhat broken. Rebasing and fixing now. -- error compiling committee.c:

Re: [PATCH 01/13] KVM: x86 emulator: add framework for instruction

2011-03-28 Thread Joerg Roedel
On Sun, Mar 27, 2011 at 02:56:56PM +0200, Gleb Natapov wrote: > On Fri, Mar 25, 2011 at 10:29:04AM +0100, Joerg Roedel wrote: > > @@ -259,6 +267,18 @@ struct x86_emulate_ctxt { > > #define X86EMUL_MODE_PROT32 4/* 32-bit protected mode. */ > > #define X86EMUL_MODE_PROT64 8/* 64-bit (lo

[PATCH 02/13] KVM: x86 emulator: add SVM intercepts

2011-03-28 Thread Joerg Roedel
From: Avi Kivity Add intercept codes for instructions defined by SVM as interceptable. Signed-off-by: Avi Kivity Signed-off-by: Joerg Roedel --- arch/x86/include/asm/kvm_emulate.h | 35 +++ arch/x86/kvm/emulate.c | 24 +--- 2

[PATCH 03/13] KVM: X86: Don't write-back cpu-state on X86EMUL_INTERCEPTED

2011-03-28 Thread Joerg Roedel
This patch prevents the changed CPU state to be written back when the emulator detected that the instruction was intercepted by the guest. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm/emulate.c |3 +++ arch/x86/kvm/x86.c

[PATCH 04/13] KVM: X86: Add x86 callback for intercept check

2011-03-28 Thread Joerg Roedel
This patch adds a callback into kvm_x86_ops so that svm and vmx code can do intercept checks on emulated instructions. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/kvm_emulate.h | 22 -- arch/x86/include/asm/kvm_host.h|7 +++ arch/x86/kvm/emulate.c

[PATCH 13/13] KVM: SVM: Remove nested sel_cr0_write handling code

2011-03-28 Thread Joerg Roedel
This patch removes all the old code which handled the nested selective cr0 write intercepts. This code was only in place as a work-around until the instruction emulator is capable of doing the same. This is the case with this patch-set and so the code can be removed. Signed-off-by: Joerg Roedel -

[PATCH 06/13] KVM: SVM: Add intercept check for accessing dr registers

2011-03-28 Thread Joerg Roedel
This patch adds the intercept checks for instruction accessing the debug registers. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/kvm/emulate.c |4 ++-- arch/x86/kvm/svm.c |6 ++ 3 files changed, 10 insertions(+), 2

[PATCH 05/13] KVM: SVM: Add intercept check for emulated cr accesses

2011-03-28 Thread Joerg Roedel
This patch adds all necessary intercept checks for instructions that access the crX registers. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/kvm_emulate.h |3 + arch/x86/kvm/emulate.c |8 ++- arch/x86/kvm/svm.c | 81 +++

[PATCH 08/13] KVM: SVM: Add intercept checks for SVM instructions

2011-03-28 Thread Joerg Roedel
This patch adds the necessary code changes in the instruction emulator and the extensions to svm.c to implement intercept checks for the svm instructions. Signed-off-by: Joerg Roedel --- arch/x86/kvm/emulate.c | 23 ++- arch/x86/kvm/svm.c |8 2 files change

[PATCH 01/13] KVM: x86 emulator: add framework for instruction intercepts

2011-03-28 Thread Joerg Roedel
From: Avi Kivity When running in guest mode, certain instructions can be intercepted by hardware. This also holds for nested guests running on emulated virtualization hardware, in particular instructions emulated by kvm itself. This patch adds a framework for intercepting instructions. If an i

[PATCH 07/13] KVM: SVM: Add intercept checks for descriptor table accesses

2011-03-28 Thread Joerg Roedel
This patch add intercept checks into the KVM instruction emulator to check for the 8 instructions that access the descriptor table addresses. Signed-off-by: Joerg Roedel --- arch/x86/kvm/emulate.c | 13 +++-- arch/x86/kvm/svm.c | 13 + 2 files changed, 24 insertions(+

[PATCH 0/13] KVM: Make the instruction emulator aware of Nested Virtualization v3

2011-03-28 Thread Joerg Roedel
Hi, this is version 3 of the instruction intercept check framework and svm code. This version addresses the review comments of Avi and Gleb. There were no other changes beside that since v2. Regards, Joerg Diffstat: arch/x86/include/asm/kvm_emulate.h | 85 arch/x86/inc

[PATCH 12/13] KVM: SVM: Add checks for IO instructions

2011-03-28 Thread Joerg Roedel
This patch adds code to check for IOIO intercepts on instructions decoded by the KVM instruction emulator. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/kvm_emulate.h |4 arch/x86/kvm/emulate.c | 10 ++ arch/x86/kvm/svm.c | 36 +

[PATCH 11/13] KVM: SVM: Add intercept checks for one-byte instructions

2011-03-28 Thread Joerg Roedel
This patch add intercept checks for emulated one-byte instructions to the KVM instruction emulation path. Signed-off-by: Joerg Roedel --- arch/x86/kvm/emulate.c |4 ++-- arch/x86/kvm/svm.c | 14 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm

[PATCH 10/13] KVM: SVM: Add intercept checks for remaining twobyte instructions

2011-03-28 Thread Joerg Roedel
This patch adds intercepts checks for the remaining twobyte instructions to the KVM instruction emulator. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/kvm/emulate.c |8 arch/x86/kvm/svm.c | 19 ++

[PATCH 09/13] KVM: SVM: Add intercept checks for remaining group7 instructions

2011-03-28 Thread Joerg Roedel
This patch implements the emulator intercept checks for the RDTSCP, MONITOR, and MWAIT instructions. Signed-off-by: Joerg Roedel --- arch/x86/kvm/emulate.c | 15 +-- arch/x86/kvm/svm.c |3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emul

Re: [PATCH 08/13] KVM: SVM: Add intercept checks for SVM instructions

2011-03-28 Thread Avi Kivity
On 03/28/2011 12:46 PM, Joerg Roedel wrote: This patch adds the necessary code changes in the instruction emulator and the extensions to svm.c to implement intercept checks for the svm instructions. diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 485a09f..9b22f5f 100644 --- a/arch/x86

Re: [PATCH 09/13] KVM: SVM: Add intercept checks for remaining group7 instructions

2011-03-28 Thread Avi Kivity
On 03/28/2011 12:46 PM, Joerg Roedel wrote: This patch implements the emulator intercept checks for the RDTSCP, MONITOR, and MWAIT instructions. Signed-off-by: Joerg Roedel --- arch/x86/kvm/emulate.c | 15 +-- arch/x86/kvm/svm.c |3 +++ 2 files changed, 16 insertions(+)

Re: [PATCH 08/13] KVM: SVM: Add intercept checks for SVM instructions

2011-03-28 Thread Roedel, Joerg
On Mon, Mar 28, 2011 at 08:08:21AM -0400, Avi Kivity wrote: > On 03/28/2011 12:46 PM, Joerg Roedel wrote: > > This patch adds the necessary code changes in the > > instruction emulator and the extensions to svm.c to > > implement intercept checks for the svm instructions. > > > > diff --git a/arch/

Re: [PATCH 12/13] KVM: SVM: Add checks for IO instructions

2011-03-28 Thread Avi Kivity
On 03/28/2011 12:46 PM, Joerg Roedel wrote: This patch adds code to check for IOIO intercepts on instructions decoded by the KVM instruction emulator. @@ -3926,6 +3926,10 @@ static struct __x86_intercept { [x86_intercept_iret]= PRE_EX(SVM_EXIT_IRET), [x86_intercept_i

Re: [PATCH 10/13] KVM: SVM: Add intercept checks for remaining twobyte instructions

2011-03-28 Thread Avi Kivity
On 03/28/2011 12:46 PM, Joerg Roedel wrote: This patch adds intercepts checks for the remaining twobyte instructions to the KVM instruction emulator. diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index e0eed4c..4a5881d 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulat

Re: [PATCH 07/13] KVM: SVM: Add intercept checks for descriptor table accesses

2011-03-28 Thread Avi Kivity
On 03/28/2011 12:46 PM, Joerg Roedel wrote: This patch add intercept checks into the KVM instruction emulator to check for the 8 instructions that access the descriptor table addresses. +static struct opcode group6[] = { + DI(ModRM,sldt), + DI(ModRM,str), + DI(M

Re: KVM, iSCSI and High Availability

2011-03-28 Thread Avi Kivity
On 03/25/2011 10:26 PM, Marcin M. Jessa wrote: Hi. Over the last several days I've been reading, asking questions, searching the Internet to find a viable HA stack for Ubuntu with KVM virtualization and shared iSCSI storage. And I'm nearly as confused as when I started. Basically I'm trying

Re: [PATCH 07/13] KVM: SVM: Add intercept checks for descriptor table accesses

2011-03-28 Thread Roedel, Joerg
On Mon, Mar 28, 2011 at 08:35:54AM -0400, Avi Kivity wrote: > On 03/28/2011 12:46 PM, Joerg Roedel wrote: > > This patch add intercept checks into the KVM instruction > > emulator to check for the 8 instructions that access the > > descriptor table addresses. > > > > +static struct opcode group6[]

Re: [PATCH 07/13] KVM: SVM: Add intercept checks for descriptor table accesses

2011-03-28 Thread Avi Kivity
On 03/28/2011 03:56 PM, Roedel, Joerg wrote: On Mon, Mar 28, 2011 at 08:35:54AM -0400, Avi Kivity wrote: > On 03/28/2011 12:46 PM, Joerg Roedel wrote: > > This patch add intercept checks into the KVM instruction > > emulator to check for the 8 instructions that access the > > descriptor ta

[PATCH] emulator: do not open code return values from the emulator

2011-03-28 Thread Gleb Natapov
Signed-off-by: Gleb Natapov diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 14c5ad5..96c02a6 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2168,7 +2168,7 @@ int emulator_task_switch(struct x86_emulate_ctxt *ctxt, ctxt->eip = c->eip

Re: KVM, iSCSI and High Availability

2011-03-28 Thread David Martin
- Original Message - > - Original Message - > > On 03/25/2011 10:26 PM, Marcin M. Jessa wrote: > > > Hi. > > > > > > Over the last several days I've been reading, asking questions, > > > searching the Internet to find a viable HA stack for Ubuntu with > > > KVM > > > virtualization

Re: "KVM internal error. Suberror: 1" with ancient 2.4 kernel as guest

2011-03-28 Thread Wei Xu
Avi, That's why I also attached the mmx-qemu.patch for user space... Wei On 3/28/11 2:23 AM, "Avi Kivity" wrote: > On 03/28/2011 02:53 AM, Wei Xu wrote: +++ linux/contents/include/linux/kvm.h 2011-03-21 09:16:39.0 -0700 @@ -152,7 +152,7 @@ /* KVM_EXIT_MMIO */

[PATCH 1/2] KVM: x86 emulator: Disable writeback for CMP emulation

2011-03-28 Thread Takuya Yoshikawa
From: Takuya Yoshikawa This stops "CMP r/m, reg" to write back the data into memory. Pointed out by Avi. Signed-off-by: Takuya Yoshikawa --- arch/x86/kvm/emulate.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 14

Re: "KVM internal error. Suberror: 1" with ancient 2.4 kernel as guest

2011-03-28 Thread Avi Kivity
On 03/28/2011 06:31 PM, Wei Xu wrote: Avi, That's why I also attached the mmx-qemu.patch for user space... We can't ask users to rebuild their qemus when they upgrade a kernel. I pushed a new version as tag sse-mmio-v2; unfortunately there's quite a bit of work remaining. -- error compili

[RFC PATCH 2/2] KVM: x86 emulator: Cleanup emulate_push() writebacks

2011-03-28 Thread Takuya Yoshikawa
From: Takuya Yoshikawa Recently, emulate_push family functions started to call writeback() during their emulation. This clearly shows that the usual writeback() which is done at the end of x86_emulate_insn() cannot cover all cases. Furthermore, suppressing writeback by changing dst operand's typ

Re: "KVM internal error. Suberror: 1" with ancient 2.4 kernel as guest

2011-03-28 Thread Wei Xu
Avi, Thanks for quick response! Let me know when it's done. Wei On 3/28/11 9:33 AM, "Avi Kivity" wrote: > On 03/28/2011 06:31 PM, Wei Xu wrote: >> Avi, >> >> That's why I also attached the mmx-qemu.patch for user space... >> > > We can't ask users to rebuild their qemus when they upgrade

Re: 2.6.38.1 general protection fault

2011-03-28 Thread Andrea Arcangeli
Hello everyone, On Mon, Mar 28, 2011 at 11:19:51AM +0200, Avi Kivity wrote: > On 03/28/2011 08:24 AM, Tomasz Chmielewski wrote: > > On 27.03.2011 11:42, Avi Kivity wrote: > > > > (...) > > > >> Okay, the fork came from the ,script=. > >> > >> The issue with %rsi looks like a use-after-free, howeve

Re: 2.6.38.1 general protection fault

2011-03-28 Thread Avi Kivity
On 03/28/2011 07:54 PM, Andrea Arcangeli wrote: BTW, is it genuine that a protection fault is generated instead of a page fault while dereferencing address 0x8805d6b087f8? I would normally except a page fault from a memory dereference that doesn't alter processor state/segments. Yes. Bits

Re: 2.6.38.1 general protection fault

2011-03-28 Thread Andrea Arcangeli
On Mon, Mar 28, 2011 at 08:02:47PM +0200, Avi Kivity wrote: > On 03/28/2011 07:54 PM, Andrea Arcangeli wrote: > > BTW, is it genuine that a protection fault is generated instead of a page > > fault while dereferencing address 0x8805d6b087f8? I would normally > > except a page fault from a memor

Re: 2.6.38.1 general protection fault

2011-03-28 Thread Tomasz Chmielewski
On 28.03.2011 22:04, Andrea Arcangeli wrote: Tomasz, how easily can you reproduce? Well, this server runs 10 VMs or so, and it happens after 1-2 days of uptime. I reverted now to a 2.6.35.x, as it had enough downtime with 2.6.38 already ;) so I'd rather not experiment anymore for some time

Re: KVM, iSCSI and High Availability

2011-03-28 Thread Marcin M. Jessa
On 3/28/11 2:46 PM, Avi Kivity wrote: On 03/25/2011 10:26 PM, Marcin M. Jessa wrote: [...] One LUN per image allows you to implement failover, LVM doesn't (but cluster-LVM does). I recommend using one LUN per image; it's much simpler. Some people say "Use one LUN, it's easier and use CLVM".

Re: KVM, iSCSI and High Availability

2011-03-28 Thread Marcin M. Jessa
On 3/28/11 6:21 PM, David Martin wrote: [...] CLVM was more complicated initially but is pretty once we got through that. Having to hack around in the SAN manager and then going to the hosts to mess with the multipath configs etc gets old fast. However if your setup is pretty static then I gues

Re: KVM, iSCSI and High Availability

2011-03-28 Thread David Martin
- Original Message - > On 3/28/11 2:46 PM, Avi Kivity wrote: > > On 03/25/2011 10:26 PM, Marcin M. Jessa wrote: > > [...] > > > > One LUN per image allows you to implement failover, LVM doesn't (but > > cluster-LVM does). I recommend using one LUN per image; it's much > > simpler. > > Som

Re: [PATCH 1/2] rbd: use the higher level librbd instead of just librados

2011-03-28 Thread Stefan Hajnoczi
On Thu, Mar 24, 2011 at 03:51:36PM -0700, Josh Durgin wrote: You have sent a malformed patch. Please send patches that follow the guidelines at http://wiki.qemu.org/Contribute/SubmitAPatch and test that your mail client is not line wrapping or mangling whitespace. Stefan -- To unsubscribe from th

[PATCH v2 1/2] rbd: use the higher level librbd instead of just librados

2011-03-28 Thread Josh Durgin
librbd stacks on top of librados to provide access to rbd images. Using librbd simplifies the qemu code, and allows qemu to use new versions of the rbd format with few (if any) changes. Signed-off-by: Josh Durgin Signed-off-by: Yehuda Sadeh --- block/rbd.c | 785 +++-

[PATCH v2 2/2] rbd: allow configuration of rados from the rbd filename

2011-03-28 Thread Josh Durgin
The new format is rbd:pool/image[@snapshot][:option1=value1[:option2=value2...]] Each option is used to configure rados, and may be any Ceph option, or "conf". The "conf" option specifies a Ceph configuration file to read. This allows rbd volumes from more than one Ceph cluster to be used by speci

Re: [Qemu-devel] Re: [PATCH 1/2] rbd: use the higher level librbd instead of just librados

2011-03-28 Thread Josh Durgin
On 03/28/2011 02:08 PM, Stefan Hajnoczi wrote: > You have sent a malformed patch. Please send patches that follow the > guidelines at http://wiki.qemu.org/Contribute/SubmitAPatch and test that > your mail client is not line wrapping or mangling whitespace. Sorry about that. I've fixed the style i

[PATCH] numa: Don't limit node count by smp count

2011-03-28 Thread Sasha Levin
It is possible to create CPU-less NUMA nodes, node amount shouldn't be limited by amount of CPUs. Signed-off-by: Sasha Levin --- vl.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 8bcf2ae..8cc1aa8 100644 --- a/vl.c +++ b/vl.c @@ -3002,8 +3002,8 @@

[PATCH] KVM test: Virtio console - Adding migration test

2011-03-28 Thread Lucas Meneghel Rodrigues
From: Jiri Zupka This patch adds migration test (tmigrate). It also daemonize the virtio_console_guest.py script, which is necessary for the migration test. [virtio_console_guest.py] It is splited to 2 parts, first one is client and second one is daemon. * Daemon part is forked and works as the

Re: [Autotest] [PATCH] KVM test: Virtio console - Adding migration test

2011-03-28 Thread Lucas Meneghel Rodrigues
On Mon, 2011-03-28 at 22:20 -0300, Lucas Meneghel Rodrigues wrote: > From: Jiri Zupka > > This patch adds migration test (tmigrate). It also daemonize the > virtio_console_guest.py script, which is necessary for the migration test. > > [virtio_console_guest.py] > It is splited to 2 parts, first

Re: KVM, iSCSI and High Availability

2011-03-28 Thread Javier Guerra Giraldez
On Mon, Mar 28, 2011 at 3:31 PM, Marcin M. Jessa wrote: > How is OCFS2 compared to CLVM? different layers, can't compare. CLVM (aka cLVM) is the cluster version of LVM, the volume manager. the addition of a userspace lock manager lets you do all volume management (create/delete volumes, resize t