[COMMIT master] device-assignment: Always use slow mapping for PCI option ROM

2010-08-17 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com KVM doesn't support read-only mappings for MMIO space. Performance isn't an issue for the option ROM mapping, so always use slow mapping. kvm.git cset b4f8c249 will make kvm hang with a Bad address fault without this. We can also then drop the

[COMMIT master] device-assignment: Fix slow option ROM mapping

2010-08-17 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com cpu_register_io_memory() supports individual function pointers being NULL, not the structure itself. Create and pass the right thing. Signed-off-by: Alex Williamson alex.william...@redhat.com Acked-by: Chris Wright chr...@redhat.com

[COMMIT master] device-assignment: Byte-wise ROM read

2010-08-17 Thread Avi Kivity
From: Alex Williamson alex.william...@redhat.com The host kernel filters the PCI option ROM, returning only bytes for the actual ROM size, not for the whole BAR. That means we typically do a short read of the PCI sysfs ROM file. Read it a byte at a time so we know how much to actually copy and

[COMMIT master] KVM: PPC: fix leakage of error page in kvmppc_patch_dcbz()

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Add kvm_release_page_clean() after is_error_page() to avoid leakage of error page. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index

[COMMIT master] KVM: destroy workqueue on kvm_create_pit() failures

2010-08-17 Thread Avi Kivity
From: Xiaotian Feng df...@redhat.com kernel needs to destroy workqueue if kvm_create_pit() fails, otherwise after pit is freed, the workqueue is leaked. Signed-off-by: Xiaotian Feng df...@redhat.com Cc: Avi Kivity a...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com Cc: Thomas Gleixner

[COMMIT master] KVM: PIT: free irq source id in handling error path

2010-08-17 Thread Avi Kivity
From: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Free irq source id if create pit workqueue fail Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index f539c3c..ddeb231 100644 ---

[COMMIT master] KVM: x86 emulator: remove useless label from x86_emulate_insn()

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index fccbed6..42725df 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2788,16

[COMMIT master] KVM: x86 emulator: add XADD instruction emulation

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Add XADD instruction emulation (opcode 0x0f 0xc0~0xc1) Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index d690daf..41ca98b 100644 ---

[COMMIT master] KVM: x86 emulator: add setcc instruction emulation

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Add setcc instruction emulation (opcode 0x0f 0x90~0x9f) Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 41ca98b..fccbed6 100644 ---

[COMMIT master] KVM: x86 emulator: change OUT instruction to use dst instead of src

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Change OUT instruction to use dst instead of src, so we can reuse those code for all out instructions. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c

[COMMIT master] KVM: x86 emulator: put register operand write back to a function

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Introduce function write_register_operand() to write back the register operand. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c476a67..d690daf

[COMMIT master] KVM: x86 emulator: remove dup code of in/out instruction

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index c208315..ac13831 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2924,28

[COMMIT master] KVM: x86: explain 'no-kvmclock' kernel parameter

2010-08-17 Thread Avi Kivity
From: Jiri Kosina jkos...@suse.cz no-kvmclock kernel parameter is missing its explanation in Documentation/kernel-parameters.txt. Add it. Signed-off-by: Jiri Kosina jkos...@suse.cz Signed-off-by: Avi Kivity a...@redhat.com diff --git a/Documentation/kernel-parameters.txt

[COMMIT master] KVM: x86 emulator: introduce DstImmUByte for dst operand decode

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Introduce DstImmUByte for dst operand decode, which will be used for out instruction. Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[COMMIT master] Add imul real mode test

2010-08-17 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/realmode.c b/x86/realmode.c index 3bbd630..14ea70f 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -733,6 +733,7 @@ void test_long_jmp()

[COMMIT master] Add real mode test for mul instruction

2010-08-17 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/realmode.c b/x86/realmode.c index 14ea70f..3d8aed4 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -1060,6 +1060,50 @@ void test_imul()

[COMMIT master] Add test for xadd instruction

2010-08-17 Thread Avi Kivity
From: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/emulator.c b/x86/emulator.c index 571f48d..a302ffd 100644 --- a/x86/emulator.c +++ b/x86/emulator.c @@ -360,6 +360,56 @@ void test_xchg(void *mem)

[COMMIT master] Add real mode tests for div and idiv

2010-08-17 Thread Avi Kivity
From: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Mohammed Gamal m.gamal...@gmail.com Signed-off-by: Avi Kivity a...@redhat.com diff --git a/x86/realmode.c b/x86/realmode.c index 3d8aed4..35f6a16 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -1104,6 +1104,96 @@ void test_mul()

Re: Intel VT-d and KVM

2010-08-17 Thread Nirmal Guhan
On Sat, Aug 7, 2010 at 7:05 PM, Nirmal Guhan vavat...@gmail.com wrote: On Sat, Aug 7, 2010 at 8:29 AM, Alex Williamson alex.william...@redhat.com wrote: On Fri, 2010-08-06 at 17:29 -0700, Nirmal Guhan wrote: On Thu, Aug 5, 2010 at 10:44 PM, Alex Williamson alex.william...@redhat.com wrote:

Re: FW: intel_scu_ipc

2010-08-17 Thread Zhou Peng
Thanks :) 2010/8/17 Hong Liu hong@intel.com: On Tue, 2010-08-17 at 13:59 +0800, Zhou Peng wrote: After compile disabling intel_scu_ipc, the kernel is  vmlinuz-2.6.35+ In linux kernel 2.6.35 mrst.h is the same with kvm (http://lxr.free-electrons.com/source/arch/x86/include/asm/mrst.h)

vhost-net unreleased?

2010-08-17 Thread Christian Theune
Hi, I've been plugging through code and presentations trying to find out whether the KVM/qemu side of vhost-net has been released yet. The git archive seems to include the vhost-net code since about a year already, but I could not find any trace of it in 0.12.5. Can you confirm, that

[PATCH RESEND] KVM: PIT: free irq source id in handling error path

2010-08-17 Thread Xiao Guangrong
Free irq source id if create pit workqueue fail Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/i8254.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c index 0fd6378..211716f 100644 ---

Re: [PATCH] cgroups: fix API thinko

2010-08-17 Thread Li Zefan
(Just came back from vacation) Michael S. Tsirkin wrote: cgroup_attach_task_current_cg API that have upstream is backwards: we really need an API to attach to the cgroups from another process A to the current one. In our case (vhost), a priveledged user wants to attach it's task to cgroups

Re: vhost-net unreleased?

2010-08-17 Thread Avi Kivity
On 08/17/2010 09:58 AM, Christian Theune wrote: Hi, I've been plugging through code and presentations trying to find out whether the KVM/qemu side of vhost-net has been released yet. The git archive seems to include the vhost-net code since about a year already, but I could not find any

[PATCH 0/4] Emulator INTn and SCAS fixes

2010-08-17 Thread Avi Kivity
The following patchset makes INTn work and implements SCAS (used by vgabios). With the patchset, vgabios is able to display its splash screen but gets confused shortly afterwards. Based on the non-atomic-injection branch. Avi Kivity (4): KVM: Initialize operand and address sizes before

[PATCH 2/4] KVM: x86 emulator: fix INTn emulation not pushing EFLAGS and CS

2010-08-17 Thread Avi Kivity
emulate_push() only schedules a push; it doesn't actually push anything. Call writeback() to flush out the write. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c

[PATCH 4/4] KVM: x86 emulator: fix REPZ/REPNZ termination condition

2010-08-17 Thread Avi Kivity
EFLAGS.ZF needs to be checked after each iteration, not before. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 42 +++--- 1 files changed, 23 insertions(+), 19 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c

[PATCH 3/4] KVM: x86 emulator: implement SCAS (opcodes AE, AF)

2010-08-17 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 0e8f25e..0c0ada9 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -2308,7

[PATCH 1/4] KVM: Initialize operand and address sizes before emulating interrupts

2010-08-17 Thread Avi Kivity
The emulator needs the operand and address sizes to be valid. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/x86.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6a77fa1..f6a31a1 100644 --- a/arch/x86/kvm/x86.c

Re: vhost-net unreleased?

2010-08-17 Thread Christian Theune
On 08/17/2010 10:13 AM, Avi Kivity wrote: On 08/17/2010 09:58 AM, Christian Theune wrote: Hi, I've been plugging through code and presentations trying to find out whether the KVM/qemu side of vhost-net has been released yet. The git archive seems to include the vhost-net code since about a

Re: [PATCH RESEND] KVM: PIT: free irq source id in handling error path

2010-08-17 Thread Avi Kivity
On 08/17/2010 10:02 AM, Xiao Guangrong wrote: Free irq source id if create pit workqueue fail Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [PATCH RESEND] KVM: PPC: fix leakage of error page in kvmppc_patch_dcbz()

2010-08-17 Thread Avi Kivity
On 08/17/2010 05:08 AM, Wei Yongjun wrote: Add kvm_release_page_clean() after is_error_page() to avoid leakage of error page. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a

Re: [PATCH 1/2 v4] KVM: x86 emulator: put register operand write back to a function

2010-08-17 Thread Avi Kivity
On 08/17/2010 04:17 AM, Wei Yongjun wrote: Introduce function write_register_operand() to write back the register operand. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Christoph Hellwig
On Mon, Aug 16, 2010 at 03:34:12PM -0500, Anthony Liguori wrote: On 08/16/2010 01:42 PM, Christoph Hellwig wrote: On Mon, Aug 16, 2010 at 09:43:09AM -0500, Anthony Liguori wrote: Also, ext4 is _very_ slow on O_SYNC writes (which is used in kvm with default cache). Yeah, we probably need to

Re: [PATCH] KVM: x86: explain 'no-kvmclock' kernel parameter

2010-08-17 Thread Avi Kivity
On 08/16/2010 06:51 PM, Jiri Kosina wrote: no-kvmclock kernel parameter is missing its explanation in Documentation/kernel-parameters.txt. Add it. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm

Re: [PATCH 4/4] KVM: x86 emulator: fix REPZ/REPNZ termination condition

2010-08-17 Thread Gleb Natapov
On Tue, Aug 17, 2010 at 11:26:43AM +0300, Avi Kivity wrote: EFLAGS.ZF needs to be checked after each iteration, not before. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/emulate.c | 42 +++--- 1 files changed, 23 insertions(+), 19

Re: [PATCH 4/4] KVM: x86 emulator: fix REPZ/REPNZ termination condition

2010-08-17 Thread Avi Kivity
On 08/17/2010 12:13 PM, Gleb Natapov wrote: On Tue, Aug 17, 2010 at 11:26:43AM +0300, Avi Kivity wrote: EFLAGS.ZF needs to be checked after each iteration, not before. Signed-off-by: Avi Kivitya...@redhat.com --- arch/x86/kvm/emulate.c | 42 +++--- 1

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Avi Kivity
On 08/17/2010 12:07 PM, Christoph Hellwig wrote: In short it's completely worthless for any real filesystem. The documentation should be updated then. It suggests that it is usable for data integrity. (or maybe, it should be fixed?) -- error compiling committee.c: too many arguments to

Re: [PATCH 4/4] KVM: x86 emulator: fix REPZ/REPNZ termination condition

2010-08-17 Thread Gleb Natapov
On Tue, Aug 17, 2010 at 12:20:34PM +0300, Avi Kivity wrote: On 08/17/2010 12:13 PM, Gleb Natapov wrote: On Tue, Aug 17, 2010 at 11:26:43AM +0300, Avi Kivity wrote: EFLAGS.ZF needs to be checked after each iteration, not before. Signed-off-by: Avi Kivitya...@redhat.com ---

Re: [PATCH 0 of 3] Fix KVM on PowerPC 440GP

2010-08-17 Thread Avi Kivity
On 08/07/2010 08:33 PM, hollis_blanch...@mentor.com wrote: Hi Avi, these patches make KVM run on 440GP (the only 440-based SoC that wasn't passing the compatibility check) and fix or enhance a couple very minor issues in related code. Please apply. Patches don't apply (at least the first),

Re: [qemu-kvm] build fail on i386 RHEL5u4

2010-08-17 Thread Avi Kivity
On 08/16/2010 11:46 AM, Avi Kivity wrote: On 08/16/2010 04:27 AM, Hao, Xudong wrote: Appears to be a gcc bug. I opened https://bugzilla.redhat.com/show_bug.cgi?id=624279 to track this. Meanwhile, installing the gcc44 package and building with it (./configure --cc=gcc44) appears to work.

Re: [PATCH] test: Add test for xadd instruction

2010-08-17 Thread Avi Kivity
On 08/12/2010 04:44 PM, Wei Yongjun wrote: Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH 0 of 3] Fix KVM on PowerPC 440GP

2010-08-17 Thread Alexander Graf
On 17.08.2010, at 11:27, Avi Kivity wrote: On 08/07/2010 08:33 PM, hollis_blanch...@mentor.com wrote: Hi Avi, these patches make KVM run on 440GP (the only 440-based SoC that wasn't passing the compatibility check) and fix or enhance a couple very minor issues in related code. Please

Re: guest MAC-address isolation

2010-08-17 Thread Avi Kivity
On 08/06/2010 08:09 PM, Robert Rebstock wrote: Hello all, can anyone recommend a better way to achive (guest agnostic) MAC-address isolation in qemu/kvm then with user-mode networking? I have multiple guests requiring the same MAC-address, and user-mode/slirp networking is quite slow. You

Re: [PATCH] KVM: x86 emulator: add setcc instruction emulation

2010-08-17 Thread Avi Kivity
On 08/06/2010 12:10 PM, Wei Yongjun wrote: Add setcc instruction emulation (opcode 0x0f 0x90~0x9f) Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [PATCH] KVM: x86 emulator: remove useless label from x86_emulate_insn()

2010-08-17 Thread Avi Kivity
On 08/06/2010 10:36 AM, Wei Yongjun wrote: Signed-off-by: Wei Yongjun yj...@cn.fujitsu.com Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org

Re: Relationship between libkvm and qemu-kvm.c

2010-08-17 Thread Avi Kivity
On 08/16/2010 12:31 AM, SHEN Hao wrote: Hello, everyone, I am a little bit confusing with the qemu-kvm project in which I found some similar code in both libkvm and qemu-kvm.c. Is the libkvm really used by qemu? What's the relationship between them? libkvm is no longer used by qemu. --

Re: [PATCH 1/3] KVM: x86 emulator: introduce DstImmUByte for dst operand decode

2010-08-17 Thread Avi Kivity
On 08/06/2010 06:36 AM, Wei Yongjun wrote: Introduce DstImmUByte for dst operand decode, which will be used for out instruction. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a

Re: [PATCH 0/3] device-assignment: PCI option ROM fixes

2010-08-17 Thread Avi Kivity
On 07/30/2010 10:40 PM, Alex Williamson wrote: Changeset b4f8c249 in kvm.git makes the mprotects in device assignment produce a Bad address hang when a device with an option ROM is assigned. We can avoid this by just using the slow mapping path since ROM access doesn't need to be fast.

kvm or bios bug?

2010-08-17 Thread Zhou Peng
Hi all, I have enabled Virtualization in BIOS. However, when I modprobe kvm-intel, I get $ sudo modprobe kvm-intel FATAL: Error inserting kvm_intel (/lib/modules/2.6.35+/kernel/arch/x86/kvm/kvm-intel.ko): Operation not supported And $ dmesg | grep kvm [ 220.670287] kvm: disabled by bios egrep

Re: kvm or bios bug?

2010-08-17 Thread Avi Kivity
On 08/17/2010 01:58 PM, Zhou Peng wrote: Hi all, I have enabled Virtualization in BIOS. However, when I modprobe kvm-intel, I get $ sudo modprobe kvm-intel FATAL: Error inserting kvm_intel (/lib/modules/2.6.35+/kernel/arch/x86/kvm/kvm-intel.ko): Operation not supported And $ dmesg | grep kvm

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Christoph Hellwig
On Tue, Aug 17, 2010 at 12:23:01PM +0300, Avi Kivity wrote: On 08/17/2010 12:07 PM, Christoph Hellwig wrote: In short it's completely worthless for any real filesystem. The documentation should be updated then. It suggests that it is usable for data integrity. The manpage has a

Re: [PATCH v2 1/3] test: Add imul real mode test

2010-08-17 Thread Avi Kivity
On 08/08/2010 09:13 PM, Mohammed Gamal wrote: Signed-off-by: Mohammed Gamalm.gamal...@gmail.com Applied, thanks. Note it is better to use emulator.flat for instructions that access memory, since it is a lot easier to use that framework. Also, you don't IDIV #DE exceptions (and we

Re: [qemu-kvm PATCH 0/3] small qemu-kvm cleanups

2010-08-17 Thread Avi Kivity
On 08/12/2010 06:29 PM, Paolo Bonzini wrote: Nothing earth shattering. :) Paolo Bonzini (3): move kvm_set_irqfd to kvm-stub.c This touches kvm-all.c, so should be against uq/master. remove unused function make kvm_mutex_*lock static Those two applied. Thanks. -- error

Re: KVM call agenda for August 17

2010-08-17 Thread Anthony Liguori
On 08/16/2010 05:08 PM, Chris Wright wrote: Please send in any agenda items you are interested in covering. I would be able to attend this week. I imagine most people are sick of hearing from me anyway post KVM Forum ;-) Regards, Anthony Liguori thanks, -chris -- To unsubscribe from

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Anthony Liguori
On 08/17/2010 04:07 AM, Christoph Hellwig wrote: On Mon, Aug 16, 2010 at 03:34:12PM -0500, Anthony Liguori wrote: On 08/16/2010 01:42 PM, Christoph Hellwig wrote: On Mon, Aug 16, 2010 at 09:43:09AM -0500, Anthony Liguori wrote: Also, ext4 is _very_ slow on O_SYNC writes

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Christoph Hellwig
On Tue, Aug 17, 2010 at 07:56:04AM -0500, Anthony Liguori wrote: But assuming that you had a preallocated disk image, it would effectively flush the page cache so it sounds like the only real issue is sparse and growable files. For preallocated as in using fallocate() we still converting

Re: kvm or bios bug?

2010-08-17 Thread Zhou Peng
Hi Avi, Power cycle really resolves the problem. Amazing! Thanks, 2010/8/17 Avi Kivity a...@redhat.com:  On 08/17/2010 01:58 PM, Zhou Peng wrote: Hi all, I have enabled Virtualization in BIOS. However, when I  modprobe kvm-intel, I get $ sudo modprobe kvm-intel FATAL: Error inserting

KVM call cancelled [was: KVM call agenda for August 17]

2010-08-17 Thread Chris Wright
* Chris Wright (chr...@redhat.com) wrote: Please send in any agenda items you are interested in covering. Today's call is cancelled. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH 12/26] KVM: PPC: Remove unused define

2010-08-17 Thread Alexander Graf
The define VSID_ALL is unused. Let's remove it. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_64_mmu_host.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c index

[PATCH 07/26] KVM: PPC: Preload magic page when in kernel mode

2010-08-17 Thread Alexander Graf
When the guest jumps into kernel mode and has the magic page mapped, theres a very high chance that it will also use it. So let's detect that scenario and map the segment accordingly. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s.c | 10 ++ 1 files changed, 10

[PATCH 00/26] KVM: PPC: Mid-August patch queue

2010-08-17 Thread Alexander Graf
Howdy, This is my local patch queue with stuff that has accumulated over the last weeks on KVM for PPC with some last minute fixes, speedups and debugging help that I needed for the KVM Forum ;-). The highlights of this set are: - Converted most important debug points to tracepoints - Flush

[PATCH 14/26] KVM: PPC: Move BAT handling code into spr handler

2010-08-17 Thread Alexander Graf
The current approach duplicates the spr-bat finding logic and makes it harder to reuse the actually used variables. So let's move everything down to the spr handler. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_emulate.c | 48 1

[PATCH 20/26] KVM: PPC: Make PV mtmsrd L=1 work with r30 and r31

2010-08-17 Thread Alexander Graf
We had an arbitrary limitation in mtmsrd L=1 that kept us from using r30 and r31 as input registers. Let's get rid of that and get more potential speedups! Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/kvm.c | 21 + arch/powerpc/kernel/kvm_emul.S

[PATCH 22/26] KVM: PPC: Implement correct SID mapping on Book3s_32

2010-08-17 Thread Alexander Graf
Up until now we were doing segment mappings wrong on Book3s_32. For Book3s_64 we were using a trick where we know that a single mmu_context gives us 16 bits of context ids. The mm system on Book3s_32 instead uses a clever algorithm to distribute VSIDs across the available range, so a context id

[PATCH 25/26] KVM: PPC: fix compilation of dump tlbs debug function

2010-08-17 Thread Alexander Graf
From: Hollis Blanchard hollis_blanch...@mentor.com Missing local variable. Signed-off-by: Hollis Blanchard hollis_blanch...@mentor.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/44x_tlb.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git

[PATCH 24/26] KVM: PPC: initialize IVORs in addition to IVPR

2010-08-17 Thread Alexander Graf
From: Hollis Blanchard hollis_blanch...@mentor.com Developers can now tell at a glace the exact type of the premature interrupt, instead of just knowing that there was some premature interrupt. Signed-off-by: Hollis Blanchard hollis_blanch...@mentor.com Signed-off-by: Alexander Graf

[PATCH 26/26] KVM: PPC: allow ppc440gp to pass the compatibility check

2010-08-17 Thread Alexander Graf
From: Hollis Blanchard hollis_blanch...@mentor.com Match only the first part of cur_cpu_spec-platform. 440GP (the first 440 processor) is identified by the string ppc440gp, while all later 440 processors use simply ppc440. Signed-off-by: Hollis Blanchard hollis_blanch...@mentor.com

[PATCH 21/26] KVM: PPC: Force enable nap on KVM

2010-08-17 Thread Alexander Graf
There are some heuristics in the PPC power management code that try to find out if the particular hardware we're running on supports proper power management or just hangs the machine when going into nap mode. Since we know that KVM is safe with nap, let's force enable it in the PV code once we're

[PATCH 05/26] KVM: PPC: Fix sid map search after flush

2010-08-17 Thread Alexander Graf
After a flush the sid map contained lots of entries with 0 for their gvsid and hvsid value. Unfortunately, 0 can be a real value the guest searches for when looking up a vsid so it would incorrectly find the host's 0 hvsid mapping which doesn't belong to our sid space. So let's also check for the

[PATCH 16/26] KVM: PPC: Put segment registers in shared page

2010-08-17 Thread Alexander Graf
Now that the actual mtsr doesn't do anything anymore, we can move the sr contents over to the shared page, so a guest can directly read and write its sr contents from guest context. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_book3s.h |1 -

[PATCH 15/26] KVM: PPC: Interpret SR registers on demand

2010-08-17 Thread Alexander Graf
Right now we're examining the contents of Book3s_32's segment registers when the register is written and put the interpreted contents into a struct. There are two reasons this is bad. For starters, the struct has worse real-time performance, as it occupies more ram. But the more important part is

[PATCH 11/26] KVM: PPC: Revert KVM: PPC: Use kernel hash function

2010-08-17 Thread Alexander Graf
It turns out the in-kernel hash function is sub-optimal for our subtle hash inputs where every bit is significant. So let's revert to the original hash functions. This reverts commit 05340ab4f9a6626f7a2e8f9fe5397c61d494f445. Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 23/26] KVM: PPC: Don't put MSR_POW in MSR

2010-08-17 Thread Alexander Graf
On Book3S a mtmsr with the MSR_POW bit set indicates that the OS is in idle and only needs to be waked up on the next interrupt. Now, unfortunately we let that bit slip into the stored MSR value which is not what the real CPU does, so that we ended up executing code like this: r =

[PATCH 09/26] KVM: PPC: Make invalidation code more reliable

2010-08-17 Thread Alexander Graf
There is a race condition in the pte invalidation code path where we can't be sure if a pte was invalidated already. So let's move the spin lock around to get rid of the race. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_mmu_hpte.c | 14 -- 1 files

[PATCH 10/26] KVM: PPC: Move slb debugging to tracepoints

2010-08-17 Thread Alexander Graf
This patch moves debugging printks for shadow SLB debugging over to tracepoints. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_64_mmu_host.c | 22 ++ arch/powerpc/kvm/trace.h | 73 + 2 files changed, 78

[PATCH 13/26] KVM: PPC: Add feature bitmap for magic page

2010-08-17 Thread Alexander Graf
We will soon add SR PV support to the shared page, so we need some infrastructure that allows the guest to query for features KVM exports. This patch adds a second return value to the magic mapping that indicated to the guest which features are available. Signed-off-by: Alexander Graf

[PATCH 19/26] KVM: PPC: Update int_pending also on dequeue

2010-08-17 Thread Alexander Graf
When having a decrementor interrupt pending, the dequeuing happens manually through an mtdec instruction. This instruction simply calls dequeue on that interrupt, so the int_pending hint doesn't get updated. This patch enables updating the int_pending hint also on dequeue, thus correctly enabling

[PATCH 17/26] KVM: PPC: Add mtsrin PV code

2010-08-17 Thread Alexander Graf
This is the guest side of the mtsr acceleration. Using this a guest can now call mtsrin with almost no overhead as long as it ensures that it only uses it with (MSR_IR|MSR_DR) == 0. Linux does that, so we're good. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/asm-offsets.c

[PATCH 18/26] KVM: PPC: Make PV mtmsr work with r30 and r31

2010-08-17 Thread Alexander Graf
So far we've been restricting ourselves to r0-r29 as registers an mtmsr instruction could use. This was bad, as there are some code paths in Linux actually using r30. So let's instead handle all registers gracefully and get rid of that stupid limitation Signed-off-by: Alexander Graf

[PATCH 02/26] KVM: PPC: Move book3s_64 mmu map debug print to trace point

2010-08-17 Thread Alexander Graf
This patch moves Book3s MMU debugging over to tracepoints. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_64_mmu_host.c | 13 +-- arch/powerpc/kvm/trace.h | 34 + 2 files changed, 36 insertions(+), 11 deletions(-)

[PATCH 04/26] KVM: PPC: Move pte invalidate debug code to tracepoint

2010-08-17 Thread Alexander Graf
This patch moves the SPTE flush debug printk over to tracepoints. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_mmu_hpte.c |3 +-- arch/powerpc/kvm/trace.h | 29 + 2 files changed, 30 insertions(+), 2 deletions(-) diff --git

[PATCH 08/26] KVM: PPC: Don't flush PTEs on NX/RO hit

2010-08-17 Thread Alexander Graf
When hitting a no-execute or read-only data/inst storage interrupt we were flushing the respective PTE so we're sure it gets properly overwritten next. According to the spec, this is unnecessary though. The guest issues a tlbie anyways, so we're safe to just keep the PTE around and have it

[PATCH 03/26] KVM: PPC: Add tracepoint for generic mmu map

2010-08-17 Thread Alexander Graf
This patch moves the generic mmu map debugging over to tracepoints. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_mmu_hpte.c |3 +++ arch/powerpc/kvm/trace.h | 29 + 2 files changed, 32 insertions(+), 0 deletions(-) diff

[PATCH 06/26] KVM: PPC: Add tracepoints for generic spte flushes

2010-08-17 Thread Alexander Graf
The different ways of flusing shadow ptes have their own debug prints which use stupid old printk. Let's move them to tracepoints, making them easier available, faster and possible to activate on demand Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_mmu_hpte.c | 18

[PATCH 01/26] KVM: PPC: Move EXIT_DEBUG partially to tracepoints

2010-08-17 Thread Alexander Graf
We have a debug printk on every exit that is usually #ifdef'ed out. Using tracepoints makes a lot more sense here though, as they can be dynamically enabled. This patch converts the most commonly used debug printks of EXIT_DEBUG to tracepoints. Signed-off-by: Alexander Graf ag...@suse.de ---

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Anthony Liguori
On 08/17/2010 08:07 AM, Christoph Hellwig wrote: The point is that we don't want to flush the disk write cache. The intention of writethrough is not to make the disk cache writethrough but to treat the host's cache as writethrough. We need to make sure data is not in the disk write

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Christoph Hellwig
On Tue, Aug 17, 2010 at 09:20:37AM -0500, Anthony Liguori wrote: On 08/17/2010 08:07 AM, Christoph Hellwig wrote: The point is that we don't want to flush the disk write cache. The intention of writethrough is not to make the disk cache writethrough but to treat the host's cache as

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Anthony Liguori
On 08/17/2010 09:28 AM, Christoph Hellwig wrote: On Tue, Aug 17, 2010 at 09:20:37AM -0500, Anthony Liguori wrote: On 08/17/2010 08:07 AM, Christoph Hellwig wrote: The point is that we don't want to flush the disk write cache. The intention of writethrough is not to make the disk

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Michael Tokarev
17.08.2010 18:28, Christoph Hellwig wrote: On Tue, Aug 17, 2010 at 09:20:37AM -0500, Anthony Liguori wrote: [] For normal writes from a guest, we don't need to follow the write with an fsync(). We should only need to issue an fsync() given an explicit flush from the guest. Define normal

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Anthony Liguori
On 08/17/2010 09:40 AM, Michael Tokarev wrote: fsync() being slow is orthogonal to my point. I don't see why we need to do an fsync() on *every* write. It should only be necessary when a guest injects an actual barrier. We don't do sync on every write, but O_SYNC implies that. And

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Christoph Hellwig
On Tue, Aug 17, 2010 at 09:39:15AM -0500, Anthony Liguori wrote: The type of cache we present to the guest only should relate to how the hypervisor caches the storage. It should be independent of how data is cached by the disk. It is. There can be many levels of caching in a storage

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Christoph Hellwig
On Tue, Aug 17, 2010 at 09:44:49AM -0500, Anthony Liguori wrote: I think the real issue is we're mixing host configuration with guest visible state. The last time I proposed to decouple the two you and Avi were heavily opposed to it.. With O_SYNC, we're causing cache=writethrough to do

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Avi Kivity
On 08/17/2010 05:45 PM, Christoph Hellwig wrote: The users doesn't know or have to care about the caching. The users uses O_SYNC/fsync to tell it wants data on disk, and it's the operating systems job to make that happen. The situation with qemu is the same - if we tell the guest that we do

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Anthony Liguori
On 08/17/2010 09:45 AM, Christoph Hellwig wrote: On Tue, Aug 17, 2010 at 09:39:15AM -0500, Anthony Liguori wrote: The type of cache we present to the guest only should relate to how the hypervisor caches the storage. It should be independent of how data is cached by the disk. It is.

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Anthony Liguori
On 08/17/2010 09:46 AM, Christoph Hellwig wrote: On Tue, Aug 17, 2010 at 09:44:49AM -0500, Anthony Liguori wrote: I think the real issue is we're mixing host configuration with guest visible state. The last time I proposed to decouple the two you and Avi were heavily opposed to it..

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Avi Kivity
On 08/17/2010 05:46 PM, Christoph Hellwig wrote: On Tue, Aug 17, 2010 at 09:44:49AM -0500, Anthony Liguori wrote: I think the real issue is we're mixing host configuration with guest visible state. The last time I proposed to decouple the two you and Avi were heavily opposed to it.. I

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Avi Kivity
On 08/17/2010 05:54 PM, Anthony Liguori wrote: This is simply unrealistic. O_SYNC might force data to be on a platter when using a directly attached disk but many NAS's actually do writeback caching and relying on having an UPS to preserve data integrity. There's really no way in the

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Christoph Hellwig
On Tue, Aug 17, 2010 at 09:54:07AM -0500, Anthony Liguori wrote: This is simply unrealistic. O_SYNC might force data to be on a platter when using a directly attached disk but many NAS's actually do writeback caching and relying on having an UPS to preserve data integrity. There's really no

Re: JFYI: ext4 bug triggerable by kvm

2010-08-17 Thread Christoph Hellwig
On Tue, Aug 17, 2010 at 05:59:07PM +0300, Avi Kivity wrote: I agree, but there's another case: tell the guest that we have a write cache, use O_DSYNC, but only flush the disk cache on guest flushes. O_DSYNC flushes the disk write cache and any filesystem that supports non-volatile cache. The

  1   2   >