Re: 2.6.38.1 general protection fault

2011-03-28 Thread Tomasz Chmielewski
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 as well: http://www.virtall.com/files/temp/kvm.txt

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

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

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; This breaks the

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 (long)

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

2011-03-28 Thread Joerg Roedel
From: Avi Kivity a...@redhat.com Add intercept codes for instructions defined by SVM as interceptable. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/x86/include/asm/kvm_emulate.h | 35 +++

[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 joerg.roe...@amd.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm/emulate.c |3 +++

[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 joerg.roe...@amd.com --- arch/x86/include/asm/kvm_emulate.h | 22 -- arch/x86/include/asm/kvm_host.h|7 +++

[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 joerg.roe...@amd.com --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/kvm/emulate.c |4 ++-- arch/x86/kvm/svm.c |6 ++ 3 files

[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 joerg.roe...@amd.com --- 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 joerg.roe...@amd.com --- arch/x86/kvm/emulate.c | 23 ++- arch/x86/kvm/svm.c |8

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

2011-03-28 Thread Joerg Roedel
From: Avi Kivity a...@redhat.com 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

[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 joerg.roe...@amd.com --- arch/x86/kvm/emulate.c | 13 +++-- arch/x86/kvm/svm.c | 13 + 2 files

[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

[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 joerg.roe...@amd.com --- arch/x86/include/asm/kvm_emulate.h |4 arch/x86/kvm/emulate.c | 10 ++ arch/x86/kvm/svm.c

[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 joerg.roe...@amd.com --- arch/x86/kvm/emulate.c |4 ++-- arch/x86/kvm/svm.c | 14 ++ 2 files changed, 16 insertions(+), 2 deletions(-) diff

[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 joerg.roe...@amd.com --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/kvm/emulate.c |8 arch/x86/kvm/svm.c |

[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 joerg.roe...@amd.com --- arch/x86/kvm/emulate.c | 15 +-- arch/x86/kvm/svm.c |3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff

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 ---

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 Roedeljoerg.roe...@amd.com --- arch/x86/kvm/emulate.c | 15 +-- arch/x86/kvm/svm.c |3 +++ 2 files

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

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),

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 +++

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), +

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

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 table

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

2011-03-28 Thread Gleb Natapov
Signed-off-by: Gleb Natapov g...@redhat.com 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,

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 and shared iSCSI

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 a...@redhat.com 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 yoshikawa.tak...@oss.ntt.co.jp This stops CMP r/m, reg to write back the data into memory. Pointed out by Avi. Signed-off-by: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp --- arch/x86/kvm/emulate.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git

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

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

2011-03-28 Thread Takuya Yoshikawa
From: Takuya Yoshikawa yoshikawa.tak...@oss.ntt.co.jp 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

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 a...@redhat.com 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

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, however

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 memory

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

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

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. Some people say

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

[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 josh.dur...@dreamhost.com Signed-off-by: Yehuda Sadeh yeh...@hq.newdream.net ---

[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

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

[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 levinsasha...@gmail.com --- 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 +++

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

2011-03-28 Thread Lucas Meneghel Rodrigues
From: Jiri Zupka jzu...@redhat.com 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

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 jzu...@redhat.com 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

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 li...@yazzy.org 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

[PATCH] KVM: PPC: emulate SVR

2011-03-28 Thread Scott Wood
Return the actual host SVR. On e500, qemu currently pretends in the device tree to be an mpc8544 regardless of what the host is, but that's something that ought to be changed. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/emulate.c |2 ++ 1 files changed, 2

[PATCH v2 1/4] powerpc/e500v2: Save SPEFCSR in flush_spe_to_thread()

2011-03-28 Thread Scott Wood
From: yu liu yu@freescale.com giveup_spe() saves the SPE state which is protected by MSR[SPE]. However, modifying SPEFSCR does not trap when MSR[SPE]=0. And since SPEFSCR is already saved/restored in _switch(), not all the callers want to save SPEFSCR again. Thus, saving SPEFSCR should not

[PATCH v2 4/4] KVM: PPC: e500: SPE switch between guest and host

2011-03-28 Thread Scott Wood
From: yu liu yu@freescale.com This patch provide a lazy way to do SPE switch. The SPE save/restore will be done only if it's needed. Linux already switches SPEFSCR on context switch (non-lazily), so the only remaining bit is to save it between qemu and the guest. Signed-off-by: Liu Yu

[PATCH 1/2] KVM: PPC: fix exit accounting for SPRs, tlbwe, tlbsx

2011-03-28 Thread Scott Wood
The exit type setting for mfspr/mtspr is moved from 44x to toplevel SPR emulation. This enables it on e500, and makes sure that all SPRs are covered. Exit accounting for tlbwe and tlbsx is added to e500. Signed-off-by: Stuart Yoder stuart.yo...@freescale.com Signed-off-by: Scott Wood

[PATCH 2/2] KVM: PPC: use ticks, not usecs, for exit timing

2011-03-28 Thread Scott Wood
From: Stuart Yoder stuart.yo...@freescale.com Convert to microseconds when displaying (with fix from Bharat Bhushan bharat.bhus...@freescale.com). This reduces rounding error with large quantities of short exits. Signed-off-by: Stuart Yoder stuart.yo...@freescale.com Signed-off-by: Scott Wood

[PATCH v2 2/4] KVM: PPC: booke: Wrap __kvmppc_vcpu_run()

2011-03-28 Thread Scott Wood
From: yu liu yu@freescale.com We need to save/restore SPE environment on e500 core. Wrap __kvmppc_vcpu_run() so that we can put the SPE code in e500.c. Signed-off-by: Liu Yu yu@freescale.com Signed-off-by: Scott Wood scottw...@freescale.com --- v2: added kvm-ppc (sorry for the resend)