Re: [F.A.Q.] the advantages of a shared tool/kernel Git repository, tools/perf/ and tools/kvm/

2011-11-10 Thread Ingo Molnar
* Anca Emanuel anca.eman...@gmail.com wrote: I'd even argue that that C library is obviously something the kernelshould offer as well - so klibc is the way to go and would help usfurther streamline this and keep Linux quality high. I think there is code to share. Why not ? The biggest

Re: [F.A.Q.] the advantages of a shared tool/kernel Git repository, tools/perf/ and tools/kvm/

2011-11-10 Thread Anca Emanuel
[offtopic] Any news from Mathieu Desnoyers Generic Ring Buffer Library http://www.efficios.com/ringbuffer ? -- 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 http://vger.kernel.org/majordomo-info.html

Re: [F.A.Q.] the advantages of a shared tool/kernel Git repository, tools/perf/ and tools/kvm/

2011-11-10 Thread Ingo Molnar
* Alexander Graf ag...@suse.de wrote: [...] Outside of the kernel tree, you can do your own decisions. If someone thinks it's a great idea to write device emulation in python (I would love that!), he could go in and implement it without having to worry about Linus possibly rejecting it

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Pekka Enberg
On Thu, Nov 10, 2011 at 9:57 AM, Markus Armbruster arm...@redhat.com wrote: 3) The block probing code replicates a well known CVE from three years ago[1]. Using kvm-tool, a malicious guest could write the qcow2 signature to the zero sector and use that to attack the host. We don't support

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Sasha Levin
On Thu, Nov 10, 2011 at 9:57 AM, Markus Armbruster arm...@redhat.com wrote: Pekka Enberg penb...@kernel.org writes: Hi Anthony, On 11/04/2011 03:38 AM, Pekka Enberg wrote: Hi Linus, Please consider pulling the latest KVM tool tree from:

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Pekka Enberg
On Thu, Nov 10, 2011 at 10:23 AM, Sasha Levin levinsasha...@gmail.com wrote: I'm actually not sure why KVM tool got QCOW support in the first place. You can have anything QCOW provides if you use btrfs (among several other FSs). To make it easy for people to use their existing images. I would

Re: [F.A.Q.] the advantages of a shared tool/kernel Git repository, tools/perf/ and tools/kvm/

2011-11-10 Thread Gerd Hoffmann
Hi, As far I know it is pretty much impossible to figure the foreground/background colors of the terminal you are running on. You Glad to hear that, I thought I hadn't researched that much (I did). Hope somebody appears and tell us how it is done :-) In xterm, '\e]10;?\e\\' and

Re: OpenBSD 5.0 kernel panic in AMD K10 cpu power state

2011-11-10 Thread Avi Kivity
(re-adding cc) On 11/09/2011 09:35 PM, Walter Haidinger wrote: Am 09.11.2011 14:40, schrieb Avi Kivity: Actually, it looks like an OpenBSD bug. According to the AMD documentation: Well, the OpenBSD developers are very confident that is a bug in the KVM cpu emulation and _not_ in

Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout

2011-11-10 Thread Michael S. Tsirkin
On Wed, Nov 09, 2011 at 11:13:56PM +0200, Sasha Levin wrote: On Wed, 2011-11-09 at 23:14 +0200, Michael S. Tsirkin wrote: On Wed, Nov 09, 2011 at 10:57:28PM +0200, Sasha Levin wrote: On Wed, 2011-11-09 at 22:52 +0200, Michael S. Tsirkin wrote: On Wed, Nov 09, 2011 at 10:24:47PM +0200,

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Avi Kivity
On 11/09/2011 07:35 PM, Anthony Liguori wrote: On 11/09/2011 11:02 AM, Avi Kivity wrote: On 11/09/2011 06:39 PM, Anthony Liguori wrote: Migration with qcow2 is not a supported feature for 1.0. Migration is only supported with raw images using coherent shared storage[1]. [1] NFS is only

Re: [PATCH 6/9] perf: expose perf capability to other modules.

2011-11-10 Thread Frederic Weisbecker
On Mon, Nov 07, 2011 at 02:45:17PM +, Will Deacon wrote: Hi Frederic, On Wed, Nov 02, 2011 at 07:42:04AM +, Frederic Weisbecker wrote: On Tue, Nov 01, 2011 at 10:20:04AM -0600, David Ahern wrote: Right. Originally it could be enabled/disabled. Right now it cannot be, but I

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Sasha Levin
On Thu, Nov 10, 2011 at 10:57 AM, Markus Armbruster arm...@redhat.com wrote: Sasha Levin levinsasha...@gmail.com writes: On Thu, Nov 10, 2011 at 9:57 AM, Markus Armbruster arm...@redhat.com wrote: [...] Start with a clean read/write raw image.  Probing declares it raw. Guest writes QCOW

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:04 AM, Sasha Levin wrote: On Thu, Nov 10, 2011 at 10:57 AM, Markus Armbruster arm...@redhat.com wrote: Sasha Levin levinsasha...@gmail.com writes: On Thu, Nov 10, 2011 at 9:57 AM, Markus Armbruster arm...@redhat.com wrote: [...] Start with a clean read/write raw

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Sasha Levin
On Thu, Nov 10, 2011 at 11:09 AM, Avi Kivity a...@redhat.com wrote: On 11/10/2011 11:04 AM, Sasha Levin wrote: On Thu, Nov 10, 2011 at 10:57 AM, Markus Armbruster arm...@redhat.com wrote: Sasha Levin levinsasha...@gmail.com writes: On Thu, Nov 10, 2011 at 9:57 AM, Markus Armbruster

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:14 AM, Sasha Levin wrote: Trying and failing. sVirt will deny access to all files except those explicitly allowed by libvirt. It still allows the guest to read more than enough files which it shouldn't be reading. Unless you configure sVirt on a per-guest basis... sVirt

[PATCH v4-rebased 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread Ohad Ben-Cohen
When mapping a memory region, split it to page sizes as supported by the iommu hardware. Always prefer bigger pages, when possible, in order to reduce the TLB pressure. The logic to do that is now added to the IOMMU core, so neither the iommu drivers themselves nor users of the IOMMU API have to

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Sasha Levin
On Thu, Nov 10, 2011 at 11:23 AM, Avi Kivity a...@redhat.com wrote: On 11/10/2011 11:14 AM, Sasha Levin wrote: Trying and failing.  sVirt will deny access to all files except those explicitly allowed by libvirt. It still allows the guest to read more than enough files which it shouldn't be

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:34 AM, Sasha Levin wrote: On Thu, Nov 10, 2011 at 11:23 AM, Avi Kivity a...@redhat.com wrote: On 11/10/2011 11:14 AM, Sasha Levin wrote: Trying and failing. sVirt will deny access to all files except those explicitly allowed by libvirt. It still allows the guest to

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Markus Armbruster
Sasha Levin levinsasha...@gmail.com writes: On Thu, Nov 10, 2011 at 10:57 AM, Markus Armbruster arm...@redhat.com wrote: Sasha Levin levinsasha...@gmail.com writes: [...] I'm actually not sure why KVM tool got QCOW support in the first place. You can have anything QCOW provides if you use

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Sasha Levin
On Thu, Nov 10, 2011 at 11:43 AM, Avi Kivity a...@redhat.com wrote: On 11/10/2011 11:34 AM, Sasha Levin wrote: On Thu, Nov 10, 2011 at 11:23 AM, Avi Kivity a...@redhat.com wrote: On 11/10/2011 11:14 AM, Sasha Levin wrote: Trying and failing.  sVirt will deny access to all files except those

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:49 AM, Sasha Levin wrote: It does, but the hypervisor can only access the guest's images, and a few internal files (like the qemu-kvm executable and its libraries). What about devices? You let the guest read and write to devices as well (/dev/kvm for example, or network

[PATCH 0/10] nEPT: Nested EPT support for Nested VMX

2011-11-10 Thread Nadav Har'El
The following patches add nested EPT support to Nested VMX. Nested EPT means emulating EPT for an L1 guest, allowing it use EPT when running a nested guest L2. When L1 uses EPT, it allows the L2 guest to set its own cr3 and take its own page faults without either of L0 or L1 getting involved. In

[PATCH 01/10] nEPT: Module option

2011-11-10 Thread Nadav Har'El
Add a module option nested_ept determining whether to enable Nested EPT. Nested EPT means emulating EPT for an L1 guest so that L1 can use EPT when running a nested guest L2. When L1 uses EPT, it allows the L2 guest to set its own cr3 and take its own page faults without either of L0 or L1

[PATCH 02/10] nEPT: MMU context for nested EPT

2011-11-10 Thread Nadav Har'El
KVM's existing shadow MMU code already supports nested TDP. To use it, we need to set up a new MMU context for nested EPT, and create a few callbacks for it (nested_ept_*()). We then need to switch back and forth between this nested context and the regular MMU context when switching between L1 and

[PATCH 03/10] nEPT: Fix cr3 handling in nested exit and entry

2011-11-10 Thread Nadav Har'El
The existing code for handling cr3 and related VMCS fields during nested exit and entry wasn't correct in all cases: If L2 is allowed to control cr3 (and this is indeed the case in nested EPT), during nested exit we must copy the modified cr3 from vmcs02 to vmcs12, and we forgot to do so. This

[PATCH 04/10] nEPT: Fix page table format in nested EPT

2011-11-10 Thread Nadav Har'El
When the existing KVM MMU code creates a shadow page table, it assumes it has the normal x86 page table format. This is obviously correct for normal shadow page tables, and also correct for AMD's NPT. Unfortunately, Intel's EPT page tables differ in subtle ways from ordinary page tables, so when

[PATCH 05/10] nEPT: Fix wrong test in kvm_set_cr3

2011-11-10 Thread Nadav Har'El
kvm_set_cr3() attempts to check if the new cr3 is a valid guest physical address. The problem is that with nested EPT, cr3 is an *L2* physical address, not an L1 physical address as this test expects. As the comment above this test explains, it isn't necessary, and doesn't correspond to anything

[PATCH 06/10] nEPT: Some additional comments

2011-11-10 Thread Nadav Har'El
Some additional comments to preexisting code: Explain who (L0 or L1) handles EPT violation and misconfiguration exits. Don't mention shadow on either EPT or shadow as the only two options. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c | 21 +++-- 1 file

[PATCH 08/10] nEPT: Nested INVEPT

2011-11-10 Thread Nadav Har'El
If we let L1 use EPT, we should probably also support the INVEPT instruction. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/include/asm/vmx.h |2 arch/x86/kvm/vmx.c | 112 +++ 2 files changed, 114 insertions(+) ---

[PATCH 07/10] nEPT: Advertise EPT to L1

2011-11-10 Thread Nadav Har'El
Advertise the support of EPT to the L1 guest, through the appropriate MSR. This is the last patch of the basic Nested EPT feature, so as to allow bisection through this patch series: The guest will not see EPT support until this last patch, and will not attempt to use the half-applied feature.

[PATCH 10/10] nEPT: Miscelleneous cleanups

2011-11-10 Thread Nadav Har'El
Some trivial code cleanups not really related to nested EPT. Signed-off-by: Nadav Har'El n...@il.ibm.com --- arch/x86/kvm/vmx.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) --- .before/arch/x86/kvm/vmx.c 2011-11-10 11:33:59.0 +0200 +++ .after/arch/x86/kvm/vmx.c

[PATCH 09/10] nEPT: Documentation

2011-11-10 Thread Nadav Har'El
Update the documentation to no longer say that nested EPT is not supported. Signed-off-by: Nadav Har'El n...@il.ibm.com --- Documentation/virtual/kvm/nested-vmx.txt |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- .before/Documentation/virtual/kvm/nested-vmx.txt2011-11-10

Re: [PATCH 02/10] nEPT: MMU context for nested EPT

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:58 AM, Nadav Har'El wrote: KVM's existing shadow MMU code already supports nested TDP. To use it, we need to set up a new MMU context for nested EPT, and create a few callbacks for it (nested_ept_*()). We then need to switch back and forth between this nested context and the

Re: [PATCH 04/10] nEPT: Fix page table format in nested EPT

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:59 AM, Nadav Har'El wrote: When the existing KVM MMU code creates a shadow page table, it assumes it has the normal x86 page table format. This is obviously correct for normal shadow page tables, and also correct for AMD's NPT. Unfortunately, Intel's EPT page tables differ in

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Kevin Wolf
Am 09.11.2011 22:01, schrieb Anthony Liguori: On 11/09/2011 03:00 PM, Michael S. Tsirkin wrote: On Wed, Nov 09, 2011 at 02:22:02PM -0600, Anthony Liguori wrote: On 11/09/2011 02:18 PM, Michael S. Tsirkin wrote: On Wed, Nov 09, 2011 at 11:35:54AM -0600, Anthony Liguori wrote: On 11/09/2011

Re: [PATCH 04/10] nEPT: Fix page table format in nested EPT

2011-11-10 Thread Nadav Har'El
On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 04/10] nEPT: Fix page table format in nested EPT: @@ -287,6 +287,7 @@ struct kvm_mmu { bool nx; u64 pdptrs[4]; /* pae */ + u64 link_shadow_page_set_bits; ... +static void link_shadow_page(u64 *sptep, struct

Re: [PATCHv2 6/9] perf: expose perf capability to other modules.

2011-11-10 Thread Gleb Natapov
On Tue, Nov 08, 2011 at 03:12:27PM +0100, Peter Zijlstra wrote: I do not want to introduce incidental regressions. For instance the patch below will introduce regression on my Nehalem cpu. It reports value 0x44 in cpuid10.ebx which means that unhalted_reference_cycles is not available (bit

Re: [PATCH 6/9] perf: expose perf capability to other modules.

2011-11-10 Thread Jason Wessel
On 11/10/2011 02:58 AM, Frederic Weisbecker wrote: On Mon, Nov 07, 2011 at 02:45:17PM +, Will Deacon wrote: Hi Frederic, On Wed, Nov 02, 2011 at 07:42:04AM +, Frederic Weisbecker wrote: On Tue, Nov 01, 2011 at 10:20:04AM -0600, David Ahern wrote: Right. Originally it could be

Re: [PATCH v4 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread cody
On 11/10/2011 03:31 PM, Ohad Ben-Cohen wrote: On Thu, Nov 10, 2011 at 8:17 AM, Kai Huangmail.kai.hu...@gmail.com wrote: Seems the unmap function don't take phys as parameter, does this mean domain-ops-unmap will walk through the page table to find out the actual page size? The short

Re: [PATCH 08/10] nEPT: Nested INVEPT

2011-11-10 Thread Avi Kivity
On 11/10/2011 12:01 PM, Nadav Har'El wrote: If we let L1 use EPT, we should probably also support the INVEPT instruction. + case VMX_EPT_EXTENT_CONTEXT: + if (!(nested_vmx_ept_caps VMX_EPT_EXTENT_CONTEXT_BIT)) + nested_vmx_failValid(vcpu, +

Re: [PATCH 04/10] nEPT: Fix page table format in nested EPT

2011-11-10 Thread Avi Kivity
On 11/10/2011 01:03 PM, Nadav Har'El wrote: On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 04/10] nEPT: Fix page table format in nested EPT: @@ -287,6 +287,7 @@ struct kvm_mmu { bool nx; u64 pdptrs[4]; /* pae */ + u64 link_shadow_page_set_bits; ... +static void

Re: [PATCH 01/10] nEPT: Module option

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:58 AM, Nadav Har'El wrote: Add a module option nested_ept determining whether to enable Nested EPT. Nested EPT means emulating EPT for an L1 guest so that L1 can use EPT when running a nested guest L2. When L1 uses EPT, it allows the L2 guest to set its own cr3 and take its

Re: [PATCH 0/10] nEPT: Nested EPT support for Nested VMX

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:57 AM, Nadav Har'El wrote: The following patches add nested EPT support to Nested VMX. Nested EPT means emulating EPT for an L1 guest, allowing it use EPT when running a nested guest L2. When L1 uses EPT, it allows the L2 guest to set its own cr3 and take its own page faults

Re: [PATCH 02/10] nEPT: MMU context for nested EPT

2011-11-10 Thread Avi Kivity
On 11/10/2011 11:58 AM, Nadav Har'El wrote: KVM's existing shadow MMU code already supports nested TDP. To use it, we need to set up a new MMU context for nested EPT, and create a few callbacks for it (nested_ept_*()). We then need to switch back and forth between this nested context and the

[PATCHv3 06/10] x86, perf: disable non available architectural events.

2011-11-10 Thread Gleb Natapov
Intel CPUs report non-available architectural events in cpuid leaf 0AH.EBX. Use it to disable events that are not available according to CPU. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/perf_event.h | 14 ++ arch/x86/kernel/cpu/perf_event.h |

[PATCHv3 05/10] KVM: VMX: Intercept RDPMC

2011-11-10 Thread Gleb Natapov
From: Avi Kivity a...@redhat.com Intercept RDPMC and forward it to the PMU emulation code. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/vmx.c | 15 ++- 1 files changed, 14 insertions(+), 1 deletions(-) diff --git

[PATCHv3 01/10] KVM: Expose kvm_lapic_local_deliver()

2011-11-10 Thread Gleb Natapov
From: Avi Kivity a...@redhat.com Needed to deliver performance monitoring interrupts. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/lapic.c |2 +- arch/x86/kvm/lapic.h |1 + 2 files changed, 2 insertions(+), 1 deletions(-) diff

[PATCHv3 03/10] KVM: Add generic RDPMC support

2011-11-10 Thread Gleb Natapov
From: Avi Kivity a...@redhat.com Add a helper function that emulates the RDPMC instruction operation. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/x86.c | 15 +++ 2

[PATCHv3 07/10] perf, x86: expose perf capability to other modules.

2011-11-10 Thread Gleb Natapov
KVM needs to know perf capability to decide which PMU it can expose to a guest. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/perf_event.h | 15 +++ arch/x86/kernel/cpu/perf_event.c | 11 +++ 2 files changed, 26 insertions(+), 0 deletions(-) diff

[PATCHv3 10/10] KVM: x86 emulator: implement RDPMC (0F 33)

2011-11-10 Thread Gleb Natapov
From: Avi Kivity a...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 + arch/x86/kvm/emulate.c | 13 - arch/x86/kvm/x86.c |7 +++ 3 files changed, 20

[PATCHv3 08/10] KVM: Expose the architectural performance monitoring CPUID leaf

2011-11-10 Thread Gleb Natapov
Provide a CPUID leaf that describes the emulated PMU. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/x86.c | 30 +- 1 files changed, 29 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index b88426c..2c44b05 100644

[PATCHv3 04/10] KVM: SVM: Intercept RDPMC

2011-11-10 Thread Gleb Natapov
From: Avi Kivity a...@redhat.com Intercept RDPMC and forward it to the PMU emulation code. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/svm.c | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git

[PATCHv3 02/10] KVM: Expose a version 2 architectural PMU to a guests

2011-11-10 Thread Gleb Natapov
Use perf_events to emulate an architectural PMU, version 2. Based on PMU version 1 emulation by Avi Kivity. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_host.h | 48 arch/x86/kvm/Kconfig|1 + arch/x86/kvm/Makefile |2 +-

[PATCHv3 09/10] KVM: x86 emulator: fix RDPMC privilege check

2011-11-10 Thread Gleb Natapov
From: Avi Kivity a...@redhat.com RDPMC is only privileged if CR4.PCE=0. check_rdpmc() already implements this, so all we need to do is drop the Priv flag. Signed-off-by: Avi Kivity a...@redhat.com Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |2 +- 1 files

[PATCHv3 00/10] KVM in-guest performance monitoring

2011-11-10 Thread Gleb Natapov
This patchset exposes an emulated version 2 architectural performance monitoring unit to KVM guests. The PMU is emulated using perf_events, so the host kernel can multiplex host-wide, host-user, and the guest on available resources. The patches are against next branch on kvm.git. If you want to

Re: [PATCH 04/10] nEPT: Fix page table format in nested EPT

2011-11-10 Thread Avi Kivity
On 11/10/2011 02:21 PM, Avi Kivity wrote: On 11/10/2011 01:03 PM, Nadav Har'El wrote: On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 04/10] nEPT: Fix page table format in nested EPT: @@ -287,6 +287,7 @@ struct kvm_mmu { bool nx; u64 pdptrs[4]; /*

Re: [PATCH 04/10] nEPT: Fix page table format in nested EPT

2011-11-10 Thread Orit Wasserman
On 11/10/2011 11:59 AM, Nadav Har'El wrote: When the existing KVM MMU code creates a shadow page table, it assumes it has the normal x86 page table format. This is obviously correct for normal shadow page tables, and also correct for AMD's NPT. Unfortunately, Intel's EPT page tables differ in

Re: [PATCH v4 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread Joerg Roedel
On Thu, Nov 10, 2011 at 08:16:16PM +0800, cody wrote: On 11/10/2011 03:31 PM, Ohad Ben-Cohen wrote: On Thu, Nov 10, 2011 at 8:17 AM, Kai Huangmail.kai.hu...@gmail.com wrote: Seems the unmap function don't take phys as parameter, does this mean domain-ops-unmap will walk through the page table

Re: [Qemu-devel] [PATCH] i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

2011-11-10 Thread Avi Kivity
On 11/09/2011 08:21 PM, Sasha Levin wrote: On Wed, 2011-11-09 at 20:00 +0200, Avi Kivity wrote: On 11/09/2011 07:56 PM, Anthony Liguori wrote: On 11/09/2011 07:44 AM, Avi Kivity wrote: The fact that a host cpu supports a feature doesn't mean that QEMU and KVM will also support it,

Re: [PATCH v4 00/11] KVM: x86: optimize for writing guest page

2011-11-10 Thread Xiao Guangrong
On 11/06/2011 11:35 PM, Avi Kivity wrote: On 11/04/2011 11:16 AM, Xiao Guangrong wrote: I have done kernbench tests several times on my desktop, but it shows very well: before patchset: real 212.27 real 213.47 real 204.99 real 200.58 real 199.99 real 199.94 real 201.51 real 199.83 real 198.19

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Anthony Liguori
On 11/10/2011 12:46 AM, Pekka Enberg wrote: Hi Anthony, 1) The RTC emulation is limited to emulating CMOS and only the few fields used to store the date and time. If code is added to arch/x86 that tries to make use of a CMOS field for something useful, kvm-tool is going to fall over. None of

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Pekka Enberg
Hi Anthony, On Thu, Nov 10, 2011 at 3:43 PM, Anthony Liguori anth...@codemonkey.ws wrote: It's not just the qcow2 implementation or even the block layer.  This pull requests adds a userspace TCP/IP stack to the kernel and yet netdev isn't on the CC and there are no Ack's from anyone from the

Re: [PATCH v4 00/11] KVM: x86: optimize for writing guest page

2011-11-10 Thread Avi Kivity
On 11/10/2011 03:28 PM, Xiao Guangrong wrote: I have tested RHEL.6.1 setup/boot/reboot/shutdown and the complete output of scan_results.py is attached. The result shows the performance is improved: before:After: 570529 555538 552531 546

Re: [PATCH 04/14] KVM: PPC: e500: MMU API

2011-11-10 Thread Alexander Graf
On 11/01/2011 05:16 PM, Scott Wood wrote: On 11/01/2011 03:58 AM, Avi Kivity wrote: On 10/31/2011 10:12 PM, Scott Wood wrote: +4.59 KVM_DIRTY_TLB + +Capability: KVM_CAP_SW_TLB +Architectures: ppc +Type: vcpu ioctl +Parameters: struct kvm_dirty_tlb (in) +Returns: 0 on success, -1 on error +

Re: [PATCH 09/14] KVM: PPC: Add generic single register ioctls

2011-11-10 Thread Alexander Graf
On 10/31/2011 02:36 PM, Avi Kivity wrote: On 10/31/2011 09:53 AM, Alexander Graf wrote: Right now we transfer a static struct every time we want to get or set registers. Unfortunately, over time we realize that there are more of these than we thought of before and the extensibility and

Re: [PATCH 13/14] KVM: PPC: E500: Support hugetlbfs

2011-11-10 Thread Alexander Graf
On 10/31/2011 02:38 PM, Avi Kivity wrote: On 10/31/2011 09:53 AM, Alexander Graf wrote: With hugetlbfs support emerging on e500, we should also support KVM backing its guest memory by it. This patch adds support for hugetlbfs into the e500 shadow mmu code. @@ -673,12 +674,31 @@ static inline

Re: [PATCH 04/14] KVM: PPC: e500: MMU API

2011-11-10 Thread Avi Kivity
On 11/10/2011 04:20 PM, Alexander Graf wrote: looks like this is different in the 32x86 ABI. We can pad explicitly if you prefer. The size is 16 on 32-bit ppc -- the alignment of __u64 forces this. It I would prefer if we keep this stable :). There's no good reason to pad it - ppc64

Re: [PATCH 01/10] nEPT: Module option

2011-11-10 Thread Nadav Har'El
On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 01/10] nEPT: Module option: On 11/10/2011 11:58 AM, Nadav Har'El wrote: Add a module option nested_ept determining whether to enable Nested EPT. ... In the future, we can support emulation of EPT for L1 *always*, even when L0 itself

Re: [PATCH v4 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread cody
On 11/10/2011 09:08 PM, Joerg Roedel wrote: On Thu, Nov 10, 2011 at 08:16:16PM +0800, cody wrote: On 11/10/2011 03:31 PM, Ohad Ben-Cohen wrote: On Thu, Nov 10, 2011 at 8:17 AM, Kai Huangmail.kai.hu...@gmail.com wrote: Seems the unmap function don't take phys as parameter,

Re: [PATCH 01/10] nEPT: Module option

2011-11-10 Thread Avi Kivity
On 11/10/2011 04:21 PM, Nadav Har'El wrote: On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 01/10] nEPT: Module option: On 11/10/2011 11:58 AM, Nadav Har'El wrote: Add a module option nested_ept determining whether to enable Nested EPT. ... In the future, we can support

Re: [PATCH 02/10] nEPT: MMU context for nested EPT

2011-11-10 Thread Nadav Har'El
On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 02/10] nEPT: MMU context for nested EPT: +static int nested_ept_init_mmu_context(struct kvm_vcpu *vcpu) +{ + int r = kvm_init_shadow_mmu(vcpu, vcpu-arch.mmu); ... + vcpu-arch.walk_mmu = vcpu-arch.nested_mmu; ...

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Markus Armbruster
Pekka Enberg penb...@kernel.org writes: Hi Anthony, On Thu, Nov 10, 2011 at 3:43 PM, Anthony Liguori anth...@codemonkey.ws wrote: It's not just the qcow2 implementation or even the block layer.  This pull requests adds a userspace TCP/IP stack to the kernel and yet netdev isn't on the CC

Re: [PATCH v4 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread Joerg Roedel
On Thu, Nov 10, 2011 at 10:35:34PM +0800, cody wrote: Yes I totally agree page-size is not required for unmap operations and should not be added as parameter to map/unmap operations. I am not saying the unmap operation, but the IOTLB flush operation. My point is we also may also need to add

Re: [PATCH 01/10] nEPT: Module option

2011-11-10 Thread Nadav Har'El
On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 01/10] nEPT: Module option: By this, do you mean without the nested_ept option, or without the hypothetical EPT on shadow page tables feature? Er, both. The feature should be controlled on a per-guest basis, not per host. .. It's

Re: [PATCH 01/10] nEPT: Module option

2011-11-10 Thread Avi Kivity
On 11/10/2011 05:14 PM, Nadav Har'El wrote: On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 01/10] nEPT: Module option: By this, do you mean without the nested_ept option, or without the hypothetical EPT on shadow page tables feature? Er, both. The feature should be

Re: [PATCH 02/10] nEPT: MMU context for nested EPT

2011-11-10 Thread Avi Kivity
On 11/10/2011 04:40 PM, Nadav Har'El wrote: On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 02/10] nEPT: MMU context for nested EPT: +static int nested_ept_init_mmu_context(struct kvm_vcpu *vcpu) +{ + int r = kvm_init_shadow_mmu(vcpu, vcpu-arch.mmu); ... +

Re: [PATCH v4 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread David Woodhouse
On Thu, 2011-11-10 at 14:17 +0800, Kai Huang wrote: And another question: have we considered the IOTLB flush operation? I think we need to implement similar logic when flush the DVMA range. Intel VT-d's manual says software needs to specify the appropriate mask value to flush large pages, but

Re: [RFC/GIT PULL] Linux KVM tool for v3.2

2011-11-10 Thread Stefan Hajnoczi
On Thu, Nov 10, 2011 at 2:47 PM, Markus Armbruster arm...@redhat.com wrote: Pekka Enberg penb...@kernel.org writes: Hi Anthony, On Thu, Nov 10, 2011 at 3:43 PM, Anthony Liguori anth...@codemonkey.ws wrote: It's not just the qcow2 implementation or even the block layer.  This pull requests

Re: [PATCH 09/14] KVM: PPC: Add generic single register ioctls

2011-11-10 Thread Marcelo Tosatti
On Mon, Oct 31, 2011 at 08:53:11AM +0100, Alexander Graf wrote: Right now we transfer a static struct every time we want to get or set registers. Unfortunately, over time we realize that there are more of these than we thought of before and the extensibility and flexibility of transferring a

Re: [PATCH] kvm: x86: Drop redundant apic base and tpr update from kvm_get_sregs

2011-11-10 Thread Marcelo Tosatti
On Wed, Oct 26, 2011 at 01:09:45PM +0200, Jan Kiszka wrote: The latter was already commented out, the former is redundant as well. We always get the latest changes after return from the guest via kvm_arch_post_run. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Applied, thanks. -- To

Re: [PATCH RFC v2 0/2] Initial support for Microsoft Hyper-V.

2011-11-10 Thread Marcelo Tosatti
On Sun, Oct 23, 2011 at 05:39:47PM +0200, Vadim Rozenfeld wrote: With the following series of patches we are starting to implement some basic Microsoft Hyper-V Enlightenment functionality. This series is mostly about adding support for relaxed timing, spinlock, and virtual apic. For more

Re: [PATCH] Set numa topology for max_cpus

2011-11-10 Thread Marcelo Tosatti
On Wed, Oct 26, 2011 at 02:19:00PM +0200, Vasilis Liaskovitis wrote: qemu-kvm passes numa/SRAT topology information for smp_cpus to SeaBIOS. However SeaBIOS always expects to setup max_cpus number of SRAT cpu entries (MaxCountCPUs variable in build_srat function of Seabios). When qemu-kvm

Memory sync algorithm during migration

2011-11-10 Thread Oliver Hookins
Hi, I am performing some benchmarks on KVM migration on two different types of VM. One has 4GB RAM and the other 32GB. More or less idle, the 4GB VM takes about 20 seconds to migrate on our hardware while the 32GB VM takes about a minute. With a reasonable amount of memory activity going on (in

Re: [PATCH 09/14] KVM: PPC: Add generic single register ioctls

2011-11-10 Thread Alexander Graf
On 11/10/2011 05:05 PM, Marcelo Tosatti wrote: On Mon, Oct 31, 2011 at 08:53:11AM +0100, Alexander Graf wrote: Right now we transfer a static struct every time we want to get or set registers. Unfortunately, over time we realize that there are more of these than we thought of before and the

Re: qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Juan Quintela
Kevin Wolf kw...@redhat.com wrote: What I took from the feedback was that Kevin wanted to defer open until the device model started. That eliminates the need to reopen or have a invalidation callback. I think it would be good for Kevin to comment here though because I might have

Re: [PATCH 09/14] KVM: PPC: Add generic single register ioctls

2011-11-10 Thread Marcelo Tosatti
On Thu, Nov 10, 2011 at 05:49:42PM +0100, Alexander Graf wrote: Documentation/virtual/kvm/api.txt | 47 ++ arch/powerpc/kvm/powerpc.c| 51 + include/linux/kvm.h | 32 +++

Re: [PATCH v4 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread Joerg Roedel
On Thu, Nov 10, 2011 at 03:28:50PM +, David Woodhouse wrote: Which brings me to another question I have been pondering... do we even have a consensus on exactly *when* the IOTLB should be flushed? Well, sort of, there is still the outstanding idea of the iommu_commit() interface for the

Re: qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Juan Quintela
Avi Kivity a...@redhat.com wrote: On 11/09/2011 07:35 PM, Anthony Liguori wrote: On 11/09/2011 11:02 AM, Avi Kivity wrote: On 11/09/2011 06:39 PM, Anthony Liguori wrote: Migration with qcow2 is not a supported feature for 1.0. Migration is only supported with raw images using coherent

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Anthony Liguori
On 11/10/2011 10:50 AM, Juan Quintela wrote: Kevin Wolfkw...@redhat.com wrote: What I took from the feedback was that Kevin wanted to defer open until the device model started. That eliminates the need to reopen or have a invalidation callback. I think it would be good for Kevin to comment

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Anthony Liguori
On 11/10/2011 02:55 AM, Avi Kivity wrote: On 11/09/2011 07:35 PM, Anthony Liguori wrote: On 11/09/2011 11:02 AM, Avi Kivity wrote: On 11/09/2011 06:39 PM, Anthony Liguori wrote: Migration with qcow2 is not a supported feature for 1.0. Migration is only supported with raw images using

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Anthony Liguori
On 11/10/2011 04:41 AM, Kevin Wolf wrote: Am 09.11.2011 22:01, schrieb Anthony Liguori: On 11/09/2011 03:00 PM, Michael S. Tsirkin wrote: On Wed, Nov 09, 2011 at 02:22:02PM -0600, Anthony Liguori wrote: On 11/09/2011 02:18 PM, Michael S. Tsirkin wrote: On Wed, Nov 09, 2011 at 11:35:54AM

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Anthony Liguori
On 11/10/2011 02:55 AM, Avi Kivity wrote: On 11/09/2011 07:35 PM, Anthony Liguori wrote: On 11/09/2011 11:02 AM, Avi Kivity wrote: On 11/09/2011 06:39 PM, Anthony Liguori wrote: Migration with qcow2 is not a supported feature for 1.0. Migration is only supported with raw images using

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Daniel P. Berrange
On Thu, Nov 10, 2011 at 12:27:30PM -0600, Anthony Liguori wrote: What does libvirt actually do in the monitor prior to migration completing on the destination? The least invasive way of doing delayed open of block devices is probably to make -incoming create a monitor and run a main loop

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Anthony Liguori
On 11/10/2011 12:42 PM, Daniel P. Berrange wrote: On Thu, Nov 10, 2011 at 12:27:30PM -0600, Anthony Liguori wrote: What does libvirt actually do in the monitor prior to migration completing on the destination? The least invasive way of doing delayed open of block devices is probably to make

Re: [PATCH v4 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread David Woodhouse
On Thu, 2011-11-10 at 18:09 +0100, Joerg Roedel wrote: The requirement for the DMA-API is, that the IOTLB must be consistent with existing mappings, and only with the parts that are really mapped. The unmapped parts are not important. This allows nice optimizations like your 'batched unmap'

Re: [PATCH] kvm tools: Allow retrieval about PTY redirection in 'kvm stat'

2011-11-10 Thread Pekka Enberg
On Tue, 2011-11-01 at 18:34 +0200, Sasha Levin wrote: This patch adds an option to provide information about redirection of terminal redirection to a PTY device within 'kvm stat'. Usage: 'kvm stat -p [term] -n [instance_name]' Will print information about redirection of terminal

Re: [PATCH 02/10] nEPT: MMU context for nested EPT

2011-11-10 Thread Nadav Har'El
On Thu, Nov 10, 2011, Avi Kivity wrote about Re: [PATCH 02/10] nEPT: MMU context for nested EPT: This is all correct, but the code in question parses the EPT12 table using the ia32 page table format. They're sufficiently similar so that it works, but it isn't correct. Bit 0: EPT readable,

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Daniel P. Berrange
On Thu, Nov 10, 2011 at 01:11:42PM -0600, Anthony Liguori wrote: On 11/10/2011 12:42 PM, Daniel P. Berrange wrote: On Thu, Nov 10, 2011 at 12:27:30PM -0600, Anthony Liguori wrote: What does libvirt actually do in the monitor prior to migration completing on the destination? The least invasive

Re: [Qemu-devel] qemu and qemu.git - Migration + disk stress introduces qcow2 corruptions

2011-11-10 Thread Anthony Liguori
On 11/10/2011 02:06 PM, Daniel P. Berrange wrote: On Thu, Nov 10, 2011 at 01:11:42PM -0600, Anthony Liguori wrote: On 11/10/2011 12:42 PM, Daniel P. Berrange wrote: On Thu, Nov 10, 2011 at 12:27:30PM -0600, Anthony Liguori wrote: What does libvirt actually do in the monitor prior to migration

Re: [PATCH v4 2/7] iommu/core: split mapping to page sizes as supported by the hardware

2011-11-10 Thread Stepan Moskovchenko
On 11/10/2011 9:09 AM, Joerg Roedel wrote: The plan is to have a single DMA-API implementation for all IOMMU drivers (X86 and ARM) which just uses the IOMMU-API. But to make this performing reasonalbly well a few changes to the IOMMU-API are required. I already have some ideas which we can

  1   2   >