[PATCH] KVM: Fix IOMMU memslot reference warning

2010-07-01 Thread Sheng Yang
This patch fixes the following warning. === [ INFO: suspicious rcu_dereference_check() usage. ] --- include/linux/kvm_host.h:259 invoked rcu_dereference_check() without protection! other info that

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Avi Kivity
On 06/30/2010 04:18 PM, Alexander Graf wrote: Book3s suffered from my really bad shadow MMU implementation so far. So I finally got around to implement a combined hash and list mechanism that allows for much faster lookup of mapped pages. To show that it really is faster, I tried to run simple

[ kvm-Bugs-2091534 ] Guests see 2 CD drives if one is specified with -drive

2010-07-01 Thread SourceForge.net
Bugs item #2091534, was opened at 2008-09-03 19:27 Message generated for change (Comment added) made by jessorensen You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=2091534group_id=180599 Please note that this message will contain a full copy of the comment

[ kvm-Bugs-2084493 ] unhandled vm exit during init on Lenovo x60s

2010-07-01 Thread SourceForge.net
Bugs item #2084493, was opened at 2008-08-30 23:58 Message generated for change (Comment added) made by jessorensen You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=2084493group_id=180599 Please note that this message will contain a full copy of the comment

[ kvm-Bugs-2104495 ] kernel double fault (kvm induced?)

2010-07-01 Thread SourceForge.net
Bugs item #2104495, was opened at 2008-09-11 00:12 Message generated for change (Comment added) made by jessorensen You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=2104495group_id=180599 Please note that this message will contain a full copy of the comment

[ kvm-Bugs-2113643 ] guests AND host still getting stuck under CPU load

2010-07-01 Thread SourceForge.net
Bugs item #2113643, was opened at 2008-09-16 09:34 Message generated for change (Comment added) made by jessorensen You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=2113643group_id=180599 Please note that this message will contain a full copy of the comment

[ kvm-Bugs-2198658 ] USB Passthrough is broken in the latest code

2010-07-01 Thread SourceForge.net
Bugs item #2198658, was opened at 2008-10-26 21:06 Message generated for change (Settings changed) made by jessorensen You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=2198658group_id=180599 Please note that this message will contain a full copy of the

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Alexander Graf
On 01.07.2010, at 09:29, Avi Kivity wrote: On 06/30/2010 04:18 PM, Alexander Graf wrote: Book3s suffered from my really bad shadow MMU implementation so far. So I finally got around to implement a combined hash and list mechanism that allows for much faster lookup of mapped pages. To show

[ kvm-Bugs-2386363 ] virtio-net doesn't set vc-info_str

2010-07-01 Thread SourceForge.net
Bugs item #2386363, was opened at 2008-12-04 04:43 Message generated for change (Comment added) made by jessorensen You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=2386363group_id=180599 Please note that this message will contain a full copy of the comment

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Avi Kivity
On 07/01/2010 11:18 AM, Alexander Graf wrote: How does dirty bitmap flushing work on x86 atm? I loop through all mapped pages and flush the ones that match the range of the region I need to flush. But wouldn't it be a lot more efficient to have an hlist in the memslot and loop through that

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Alexander Graf
Avi Kivity wrote: On 07/01/2010 11:18 AM, Alexander Graf wrote: How does dirty bitmap flushing work on x86 atm? I loop through all mapped pages and flush the ones that match the range of the region I need to flush. But wouldn't it be a lot more efficient to have an hlist in the memslot and

[PATCH 06/27] KVM: PPC: Convert SPRG[0-4] to shared page

2010-07-01 Thread Alexander Graf
When in kernel mode there are 4 additional registers available that are simple data storage. Instead of exiting to the hypervisor to read and write those, we can just share them with the guest using the page. This patch converts all users of the current field to the shared page. Signed-off-by:

[PATCH 00/27] KVM PPC PV framework

2010-07-01 Thread Alexander Graf
On PPC we run PR=0 (kernel mode) code in PR=1 (user mode) and don't use the hypervisor extensions. While that is all great to show that virtualization is possible, there are quite some cases where the emulation overhead of privileged instructions is killing performance. This patchset tackles

[PATCH 12/27] KVM: PPC: First magic page steps

2010-07-01 Thread Alexander Graf
We will be introducing a method to project the shared page in guest context. As soon as we're talking about this coupling, the shared page is colled magic page. This patch introduces simple defines, so the follow-up patches are easier to read. Signed-off-by: Alexander Graf ag...@suse.de ---

[PATCH 11/27] KVM: PPC: Make RMO a define

2010-07-01 Thread Alexander Graf
On PowerPC it's very normal to not support all of the physical RAM in real mode. To check if we're matching on the shared page or not, we need to know the limits so we can restrain ourselves to that range. So let's make it a define instead of open-coding it. And while at it, let's also increase

[PATCH 15/27] KVM: PPC: Expose magic page support to guest

2010-07-01 Thread Alexander Graf
Now that we have the shared page in place and the MMU code knows about the magic page, we can expose that capability to the guest! Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_para.h |2 ++ arch/powerpc/kvm/powerpc.c | 11 +++ 2 files

[PATCH 16/27] KVM: Move kvm_guest_init out of generic code

2010-07-01 Thread Alexander Graf
Currently x86 is the only architecture that uses kvm_guest_init(). With PowerPC we're getting a second user, but the signature is different there and we don't need to export it, as it uses the normal kernel init framework. So let's move the x86 specific definition of that function over to the x86

[PATCH 24/27] KVM: PPC: PV mtmsrd L=1

2010-07-01 Thread Alexander Graf
The PowerPC ISA has a special instruction for mtmsr that only changes the EE and RI bits, namely the L=1 form. Since that one is reasonably often occuring and simple to implement, let's go with this first. Writing EE=0 is always just a store. Doing EE=1 also requires us to check for pending

[PATCH 27/27] KVM: PPC: Add Documentation about PV interface

2010-07-01 Thread Alexander Graf
We just introduced a new PV interface that screams for documentation. So here it is - a shiny new and awesome text file describing the internal works of the PPC KVM paravirtual interface. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - clarify guest implementation - clarify that

[PATCH 25/27] KVM: PPC: PV mtmsrd L=0 and mtmsr

2010-07-01 Thread Alexander Graf
There is also a form of mtmsr where all bits need to be addressed. While the PPC64 Linux kernel behaves resonably well here, on PPC32 we do not have an L=1 form. It does mtmsr even for simple things like only changing EE. So we need to hook into that one as well and check for a mask of bits that

[PATCH 22/27] KVM: PPC: Introduce branch patching helper

2010-07-01 Thread Alexander Graf
We will need to patch several instruction streams over to a different code path, so we need a way to patch a single instruction with a branch somewhere else. This patch adds a helper to facilitate this patching. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/kvm.c |5

[PATCH 21/27] KVM: PPC: Introduce kvm_tmp framework

2010-07-01 Thread Alexander Graf
We will soon require more sophisticated methods to replace single instructions with multiple instructions. We do that by branching to a memory region where we write replacement code for the instruction to. This region needs to be within 32 MB of the patched instruction though, because that's the

[PATCH 14/27] KVM: PPC: Magic Page BookE support

2010-07-01 Thread Alexander Graf
As we now have Book3s support for the magic page, we also need BookE to join in on the party. This patch implements generic magic page logic for BookE and specific TLB logic for e500. I didn't have any 440 around, so I didn't dare to blindly try and write up broken code. Signed-off-by: Alexander

[PATCH 20/27] KVM: PPC: PV tlbsync to nop

2010-07-01 Thread Alexander Graf
With our current MMU scheme we don't need to know about the tlbsync instruction. So we can just nop it out. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - use kvm_patch_ins --- arch/powerpc/kernel/kvm.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff

[PATCH 19/27] KVM: PPC: PV instructions to loads and stores

2010-07-01 Thread Alexander Graf
Some instructions can simply be replaced by load and store instructions to or from the magic page. This patch replaces often called instructions that fall into the above category. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - use kvm_patch_ins --- arch/powerpc/kernel/kvm.c |

[PATCH 23/27] KVM: PPC: PV assembler helpers

2010-07-01 Thread Alexander Graf
When we hook an instruction we need to make sure we don't clobber any of the registers at that point. So we write them out to scratch space in the magic page. To make sure we don't fall into a race with another piece of hooked code, we need to disable interrupts. To make the later patches and

[PATCH 17/27] KVM: PPC: Generic KVM PV guest support

2010-07-01 Thread Alexander Graf
We have all the hypervisor pieces in place now, but the guest parts are still missing. This patch implements basic awareness of KVM when running Linux as guest. It doesn't do anything with it yet though. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/Makefile |2 ++

[PATCH 02/27] KVM: PPC: Convert MSR to shared page

2010-07-01 Thread Alexander Graf
One of the most obvious registers to share with the guest directly is the MSR. The MSR contains the interrupts enabled flag which the guest has to toggle in critical sections. So in order to bring the overhead of interrupt en- and disabling down, let's put msr into the shared page. Keep in mind

[PATCH 09/27] KVM: PPC: Add PV guest scratch registers

2010-07-01 Thread Alexander Graf
While running in hooked code we need to store register contents out because we must not clobber any registers. So let's add some fields to the shared page we can just happily write to. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_para.h |3 +++ 1 files

[PATCH 18/27] KVM: PPC: KVM PV guest stubs

2010-07-01 Thread Alexander Graf
We will soon start and replace instructions from the text section with other, paravirtualized versions. To ease the readability of those patches I split out the generic looping and magic page mapping code out. This patch still only contains stubs. But at least it loops through the text section

[PATCH 04/27] KVM: PPC: Convert DAR to shared page.

2010-07-01 Thread Alexander Graf
The DAR register contains the address a data page fault occured at. This register behaves pretty much like a simple data storage register that gets written to on data faults. There is no hypervisor interaction required on read or write. This patch converts all users of the current field to the

[PATCH 13/27] KVM: PPC: Magic Page Book3s support

2010-07-01 Thread Alexander Graf
We need to override EA as well as PA lookups for the magic page. When the guest tells us to project it, the magic page overrides any guest mappings. In order to reflect that, we need to hook into all the MMU layers of KVM to force map the magic page if necessary. Signed-off-by: Alexander Graf

[PATCH 07/27] KVM: PPC: Implement hypervisor interface

2010-07-01 Thread Alexander Graf
To communicate with KVM directly we need to plumb some sort of interface between the guest and KVM. Usually those interfaces use hypercalls. This hypercall implementation is described in the last patch of the series in a special documentation file. Please read that for further information. This

[PATCH 01/27] KVM: PPC: Introduce shared page

2010-07-01 Thread Alexander Graf
For transparent variable sharing between the hypervisor and guest, I introduce a shared page. This shared page will contain all the registers the guest can read and write safely without exiting guest context. This patch only implements the stubs required for the basic structure of the shared

[PATCH 10/27] KVM: PPC: Tell guest about pending interrupts

2010-07-01 Thread Alexander Graf
When the guest turns on interrupts again, it needs to know if we have an interrupt pending for it. Because if so, it should rather get out of guest context and get the interrupt. So we introduce a new field in the shared page that we use to tell the guest that there's a pending interrupt lying

[PATCH 03/27] KVM: PPC: Convert DSISR to shared page

2010-07-01 Thread Alexander Graf
The DSISR register contains information about a data page fault. It is fully read/write from inside the guest context and we don't need to worry about interacting based on writes of this register. This patch converts all users of the current field to the shared page. Signed-off-by: Alexander

[ kvm-Bugs-3022896 ] bad network performance with 10Gbit

2010-07-01 Thread SourceForge.net
Bugs item #3022896, was opened at 2010-06-29 18:39 Message generated for change (Comment added) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=3022896group_id=180599 Please note that this message will contain a full copy of the comment thread,

[PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Michael S. Tsirkin
Author: Sridhar Samudrala s...@us.ibm.com sched: export sched_set/getaffinity to modules vhost-net driver wants to copy the affinity from the owner thread to thread it creates. Export sched_set/get affinity to modules to make this possible when vhost is built as a module. Signed-off-by: Sridhar

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Avi Kivity
On 07/01/2010 01:00 PM, Alexander Graf wrote: But doesn't that mean that you still need to loop through all the hvas that you want to invalidate? It does. Wouldn't it speed up dirty bitmap flushing a lot if we'd just have a simple linked list of all sPTEs belonging to that memslot?

Re: [PATCH 14/27] KVM: PPC: Magic Page BookE support

2010-07-01 Thread Josh Boyer
On Thu, Jul 01, 2010 at 12:42:49PM +0200, Alexander Graf wrote: As we now have Book3s support for the magic page, we also need BookE to join in on the party. This patch implements generic magic page logic for BookE and specific TLB logic for e500. I didn't have any 440 around, so I didn't dare to

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 14:07 +0300, Michael S. Tsirkin wrote: Author: Sridhar Samudrala s...@us.ibm.com sched: export sched_set/getaffinity to modules vhost-net driver wants to copy the affinity from the owner thread to thread it creates. Export sched_set/get affinity to modules to make

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 13:19 +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 14:07 +0300, Michael S. Tsirkin wrote: Author: Sridhar Samudrala s...@us.ibm.com sched: export sched_set/getaffinity to modules vhost-net driver wants to copy the affinity from the owner thread to thread

Re: random crash in post_kvm_run()

2010-07-01 Thread Avi Kivity
On 06/30/2010 09:25 PM, BuraphaLinux Server wrote: Can you downgrade the kernel to a known good one to see which component causes the failure? Thank you for your suggestion. Changing only the kernel back to 2.6.32.14 and changing nothing else, the qemu/kvm works well. However, I want

Re: [PATCH v3 3/11] KVM: MMU: fix direct sp's access corruptted

2010-07-01 Thread Marcelo Tosatti
On Thu, Jul 01, 2010 at 08:50:58AM +0800, Xiao Guangrong wrote: Marcelo Tosatti wrote: - if (is_shadow_present_pte(*sptep) !is_large_pte(*sptep)) - continue; + if (is_shadow_present_pte(*sptep) !is_large_pte(*sptep)) { + struct

Re: [PATCH v3 5/11] KVM: MMU: cleanup FNAME(fetch)() functions

2010-07-01 Thread Marcelo Tosatti
On Wed, Jun 30, 2010 at 04:05:00PM +0800, Xiao Guangrong wrote: Cleanup this function that we are already get the direct sp's access Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/paging_tmpl.h | 19 --- 1 files changed, 8 insertions(+), 11

Re: [PATCH v3 9/11] KVM: MMU: prefetch ptes when intercepted guest #PF

2010-07-01 Thread Avi Kivity
On 07/01/2010 04:11 AM, Xiao Guangrong wrote: Marcelo Tosatti wrote: + + addr = gfn_to_hva_many(vcpu-kvm, gfn,entry); + if (kvm_is_error_hva(addr)) + return -1; + + entry = min(entry, (int)(end - start)); + ret

Re: [PATCH v3 9/11] KVM: MMU: prefetch ptes when intercepted guest #PF

2010-07-01 Thread Xiao Guangrong
Avi Kivity wrote: On 07/01/2010 04:11 AM, Xiao Guangrong wrote: Marcelo Tosatti wrote: + +addr = gfn_to_hva_many(vcpu-kvm, gfn,entry); +if (kvm_is_error_hva(addr)) +return -1; + +entry = min(entry, (int)(end - start)); +ret =

Re: [PATCH 14/27] KVM: PPC: Magic Page BookE support

2010-07-01 Thread Alexander Graf
Josh Boyer wrote: On Thu, Jul 01, 2010 at 12:42:49PM +0200, Alexander Graf wrote: As we now have Book3s support for the magic page, we also need BookE to join in on the party. This patch implements generic magic page logic for BookE and specific TLB logic for e500. I didn't have any 440

Re: [PATCH v3 9/11] KVM: MMU: prefetch ptes when intercepted guest #PF

2010-07-01 Thread Marcelo Tosatti
On Thu, Jul 01, 2010 at 08:13:40PM +0800, Xiao Guangrong wrote: Avi Kivity wrote: On 07/01/2010 04:11 AM, Xiao Guangrong wrote: Marcelo Tosatti wrote: + +addr = gfn_to_hva_many(vcpu-kvm, gfn,entry); +if (kvm_is_error_hva(addr)) +return -1; +

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Alexander Graf
Avi Kivity wrote: On 07/01/2010 01:00 PM, Alexander Graf wrote: But doesn't that mean that you still need to loop through all the hvas that you want to invalidate? It does. Wouldn't it speed up dirty bitmap flushing a lot if we'd just have a simple linked list of all sPTEs belonging to

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 02:55:07PM +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 01:43:23PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 13:19 +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 14:07 +0300, Michael S. Tsirkin wrote: Author: Sridhar Samudrala

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 14:55 +0300, Michael S. Tsirkin wrote: - why can't it set the kernel thread's affinity too? It can. However: the threads are started internally by the driver when qemu does an ioctl. What we want to do is give it a sensible default affinity. management tool can

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 15:23 +0300, Michael S. Tsirkin wrote: The patch using this is here: http://www.mail-archive.com/kvm@vger.kernel.org/msg35411.html It simply copies the affinity from the parent when thread is created. Sounds like policy, not something the kernel should do.. -- To

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Avi Kivity
On 07/01/2010 03:28 PM, Alexander Graf wrote: Wouldn't it speed up dirty bitmap flushing a lot if we'd just have a simple linked list of all sPTEs belonging to that memslot? The complexity is O(pages_in_slot) + O(sptes_for_slot). Usually, every page is mapped at least once, so

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 14:34 +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 15:23 +0300, Michael S. Tsirkin wrote: The patch using this is here: http://www.mail-archive.com/kvm@vger.kernel.org/msg35411.html It simply copies the affinity from the parent when thread is created.

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Alexander Graf
Avi Kivity wrote: On 07/01/2010 03:28 PM, Alexander Graf wrote: Wouldn't it speed up dirty bitmap flushing a lot if we'd just have a simple linked list of all sPTEs belonging to that memslot? The complexity is O(pages_in_slot) + O(sptes_for_slot). Usually, every page is

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 02:32:43PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 14:55 +0300, Michael S. Tsirkin wrote: - why can't it set the kernel thread's affinity too? It can. However: the threads are started internally by the driver when qemu does an ioctl. What we want

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 15:50 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 02:32:43PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 14:55 +0300, Michael S. Tsirkin wrote: - why can't it set the kernel thread's affinity too? It can. However: the threads are started

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 02:46:35PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 14:34 +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 15:23 +0300, Michael S. Tsirkin wrote: The patch using this is here: http://www.mail-archive.com/kvm@vger.kernel.org/msg35411.html It

Re: [PATCH] virt-what.in: Added VMware virt detection using cpuid in wrapper script

2010-07-01 Thread Richard W.M. Jones
On Tue, Jun 29, 2010 at 07:29:01PM -0400, Chetan Loke wrote: Brief discussion thread - http://lkml.org/lkml/2010/6/29/355 Added VMware detection via cpuid.Mimic'd VMware's balloon driver's init-time check(cpuid followed by dmi-checks). Moved the existing logic into a simple function to

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 03:07:26PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 15:50 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 02:32:43PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 14:55 +0300, Michael S. Tsirkin wrote: - why can't it set the kernel

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 16:08 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 02:46:35PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 14:34 +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 15:23 +0300, Michael S. Tsirkin wrote: The patch using this is here:

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Avi Kivity
On 07/01/2010 03:52 PM, Alexander Graf wrote: Don't you use lazy spte updates? We do, but given enough time, the guest will touch its entire memory. Oh, so that's the major difference. On PPC we have the HTAB with a fraction of all the mapped pages in it. We don't have a

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 03:30:24PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 16:08 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 02:46:35PM +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 14:34 +0200, Peter Zijlstra wrote: On Thu, 2010-07-01 at 15:23 +0300, Michael

[PATCH v4 1/6] KVM: MMU: introduce gfn_to_pfn_atomic() function

2010-07-01 Thread Xiao Guangrong
Introduce gfn_to_pfn_atomic(), it's the fast path and can used in atomic context, the later patch will use it Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/mm/gup.c|2 ++ include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c | 32

[PATCH v4 2/6] KVM: MMU: introduce gfn_to_page_many_atomic() function

2010-07-01 Thread Xiao Guangrong
This function not only return the gfn's page but also the page number after @gfn in the slot Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- include/linux/kvm_host.h |2 ++ virt/kvm/kvm_main.c | 29 - 2 files changed, 30 insertions(+), 1

[PATCH v4 3/6] KVM: MMU: introduce pte_prefetch_topup_memory_cache()

2010-07-01 Thread Xiao Guangrong
Introduce this function to topup prefetch cache Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 25 + 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index a0c5c31..6673484

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 16:39 +0300, Michael S. Tsirkin wrote: The proposed patch kills the thread when the fd is closed, so I think this already works without making it part of the process. OK, fd bound resources are fine. -- To unsubscribe from this list: send the line unsubscribe kvm in the

[PATCH v4 4/6] KVM: MMU: prefetch ptes when intercepted guest #PF

2010-07-01 Thread Xiao Guangrong
Support prefetch ptes when intercept guest #PF, avoid to #PF by later access If we meet any failure in the prefetch path, we will exit it and not try other ptes to avoid become heavy path Note: this speculative will mark page become dirty but it not really accessed, the same issue is in other

[PATCH v4 5/6] KVM: MMU: combine guest pte read between walk and pte prefetch

2010-07-01 Thread Xiao Guangrong
Combine guest pte read between guest pte walk and pte prefetch Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/paging_tmpl.h | 48 ++- 1 files changed, 33 insertions(+), 15 deletions(-) diff --git a/arch/x86/kvm/paging_tmpl.h

[PATCH 0/2] Use u64 for gfn_t in KVM

2010-07-01 Thread Joerg Roedel
Hi, Avi, Marcelo, these two patches currently lie on the bottom of my npt-npt patch set. They came out of a discussion on the mailing list about the last version of the npt-npt patchset. These patches are independent of the rest of the patchset, so I post and discuss them seperatly. The changes

[PATCH 1/2] KVM: Remove unnecessary divide operations

2010-07-01 Thread Joerg Roedel
This patch converts unnecessary divide and modulo operations in the KVM large page related code into logical operations. This allows to convert gfn_t to u64 while not breaking 32 bit builds. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- arch/ia64/include/asm/kvm_host.h|1 +

[PATCH 2/2] KVM: Use u64 for frame data types

2010-07-01 Thread Joerg Roedel
For 32bit machines where the physical address width is larger than the virtual address width the frame number types in KVM may overflow. Fix this by changing them to u64. Signed-off-by: Joerg Roedel joerg.roe...@amd.com --- include/linux/kvm_types.h |4 ++-- virt/kvm/iommu.c |2

[PATCH v4 6/6] KVM: MMU: trace pte prefetch

2010-07-01 Thread Xiao Guangrong
Trace pte prefetch, it can help us to improve the prefetch's performance Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 41 +++-- arch/x86/kvm/mmutrace.h| 33 +

[PATCH] qemu-kvm unittests: Small makefile fix

2010-07-01 Thread Lucas Meneghel Rodrigues
Turns out $(tests-common) does not encompass all flat files built for the unittests. So let's fix the makefile install rule to include all flat files generated by the make procedure. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- kvm/test/config-x86-common.mak |2 +- 1 files

Re: [PATCH 1/2] KVM: Remove unnecessary divide operations

2010-07-01 Thread Avi Kivity
On 07/01/2010 05:00 PM, Joerg Roedel wrote: This patch converts unnecessary divide and modulo operations in the KVM large page related code into logical operations. This allows to convert gfn_t to u64 while not breaking 32 bit builds. #define KVM_NR_PAGE_SIZES 2 -#define KVM_HPAGE_SHIFT(x)

Re: [PATCH 0/2] Use u64 for gfn_t in KVM

2010-07-01 Thread Avi Kivity
On 07/01/2010 05:00 PM, Joerg Roedel wrote: Hi, Avi, Marcelo, these two patches currently lie on the bottom of my npt-npt patch set. They came out of a discussion on the mailing list about the last version of the npt-npt patchset. These patches are independent of the rest of the patchset, so I

Re: [PATCH] virt-what.in: Added VMware virt detection using cpuid in wrapper script

2010-07-01 Thread Chetan Loke
On Thu, Jul 1, 2010 at 9:15 AM, Richard W.M. Jones rjo...@redhat.com wrote: On Tue, Jun 29, 2010 at 07:29:01PM -0400, Chetan Loke wrote: Brief discussion thread - http://lkml.org/lkml/2010/6/29/355 Added VMware detection via cpuid.Mimic'd VMware's balloon driver's init-time check(cpuid

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Tejun Heo
Hello, On 07/01/2010 03:39 PM, Michael S. Tsirkin wrote: I think that's called kernel_thread() see kernel/kthread.c:create_kthread(). Doing the whole kthreadd dance and then copying bits and pieces back sounds very fragile, so yeah, something like that should work. Thanks! Sridhar,

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Oleg Nesterov
On 07/01, Peter Zijlstra wrote: On Thu, 2010-07-01 at 16:08 +0300, Michael S. Tsirkin wrote: Maybe it makes sense to add kthread_clone (in addition to kthread_create) that would do what you suggest? If yes, any hints on an implementation? I think that's called kernel_thread() see

Re: [PATCH] Remove MSR_P6_{EVNTSEL0,PERFCTR0} from printk warning list.

2010-07-01 Thread Avi Kivity
On 06/30/2010 05:27 PM, jes.soren...@redhat.com wrote: From: Jes Sorensenjes.soren...@redhat.com MSR_P6_EVNTSEL0 and MSR_P6_PERFCTR0 are used to probe for the P6 PMU for older family 6 CPUs, which is also the default in QEMU. Ie. per default we get the noise of these warnings in dmesg,

Re: [PATCH] Remove MSR_P6_{EVNTSEL0,PERFCTR0} from printk warning list.

2010-07-01 Thread Jes Sorensen
On 07/01/10 16:38, Avi Kivity wrote: On 06/30/2010 05:27 PM, jes.soren...@redhat.com wrote: From: Jes Sorensenjes.soren...@redhat.com MSR_P6_EVNTSEL0 and MSR_P6_PERFCTR0 are used to probe for the P6 PMU for older family 6 CPUs, which is also the default in QEMU. Ie. per default we get the

Re: [PATCH] KVM test: Disable HPET on windows timedrift tests

2010-07-01 Thread Avi Kivity
On 06/30/2010 06:39 PM, Lucas Meneghel Rodrigues wrote: By default, HPET is enabled on qemu and no time drift mitigation is being made for it. So, add -no-hpet if qemu supports it, during windows timedrift tests. Hm, you're compensating for a qemu bug by not testing it. Can we have an

Re: [PATCH] Remove MSR_P6_{EVNTSEL0,PERFCTR0} from printk warning list.

2010-07-01 Thread Avi Kivity
On 07/01/2010 05:41 PM, Jes Sorensen wrote: On 07/01/10 16:38, Avi Kivity wrote: On 06/30/2010 05:27 PM, jes.soren...@redhat.com wrote: From: Jes Sorensenjes.soren...@redhat.com MSR_P6_EVNTSEL0 and MSR_P6_PERFCTR0 are used to probe for the P6 PMU for older family 6 CPUs, which is

Re: [PATCH] Remove MSR_P6_{EVNTSEL0,PERFCTR0} from printk warning list.

2010-07-01 Thread Jes Sorensen
On 07/01/10 16:44, Avi Kivity wrote: On 07/01/2010 05:41 PM, Jes Sorensen wrote: Saw it, which is why I only suggest we remove EVNTSEL0 and PERFCTR0 but not the others. If the guest is expecting normal operation it is likely to use more than just the first. Why is that? Depends on

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Oleg Nesterov
On 07/01, Tejun Heo wrote: All that's necessary is shortcutting indirection through kthreadd. ie. An exported function which looks like the following, struct kthread_clone_or_whatever(int (*threadfn).) { struct kthread_create_info create; int pid; INIT create;

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Tejun Heo
Hello, On 07/01/2010 04:46 PM, Oleg Nesterov wrote: It might be a good idea to make the function take extra clone flags but anyways once created cloned task can be treated the same way as other kthreads, so nothing else needs to be changed. This makes kthread_stop() work. Otherwise the new

Re: [PATCH repost] sched: export sched_set/getaffinity to modules

2010-07-01 Thread Peter Zijlstra
On Thu, 2010-07-01 at 16:53 +0200, Tejun Heo wrote: Hello, On 07/01/2010 04:46 PM, Oleg Nesterov wrote: It might be a good idea to make the function take extra clone flags but anyways once created cloned task can be treated the same way as other kthreads, so nothing else needs to be

Re: [PATCH] Remove MSR_P6_{EVNTSEL0,PERFCTR0} from printk warning list.

2010-07-01 Thread Avi Kivity
On 07/01/2010 05:47 PM, Jes Sorensen wrote: On 07/01/10 16:44, Avi Kivity wrote: On 07/01/2010 05:41 PM, Jes Sorensen wrote: Saw it, which is why I only suggest we remove EVNTSEL0 and PERFCTR0 but not the others. If the guest is expecting normal operation it is likely to use more

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

2010-07-01 Thread Alex Williamson
On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the maximum permissible DMA address +(device dependent). It takes a single unsigned 64 bit integer as an argument. +This call also has the side effect of enabling PCI bus mastership. Hi Tom, This

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

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 09:29:04AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the maximum permissible DMA address +(device dependent). It takes a single unsigned 64 bit integer as an argument. +This call also

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

2010-07-01 Thread Alex Williamson
On Thu, 2010-07-01 at 18:31 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 09:29:04AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the maximum permissible DMA address +(device dependent). It takes a

Re: [PATCH] KVM test: Disable HPET on windows timedrift tests

2010-07-01 Thread Lucas Meneghel Rodrigues
On Thu, 2010-07-01 at 17:42 +0300, Avi Kivity wrote: On 06/30/2010 06:39 PM, Lucas Meneghel Rodrigues wrote: By default, HPET is enabled on qemu and no time drift mitigation is being made for it. So, add -no-hpet if qemu supports it, during windows timedrift tests. Hm, you're

[PATCH v2] KVM: Fix IOMMU RCU related warning

2010-07-01 Thread Sheng Yang
This patch fixes the following warning. === [ INFO: suspicious rcu_dereference_check() usage. ] --- include/linux/kvm_host.h:259 invoked rcu_dereference_check() without protection! other info that

Re: [PATCH v2] KVM: Fix IOMMU RCU related warning

2010-07-01 Thread Marcelo Tosatti
On Fri, Jul 02, 2010 at 12:11:53AM +0800, Sheng Yang wrote: This patch fixes the following warning. === [ INFO: suspicious rcu_dereference_check() usage. ] --- include/linux/kvm_host.h:259

Re: [PATCH] KVM: Fix IOMMU memslot reference warning

2010-07-01 Thread Marcelo Tosatti
On Thu, Jul 01, 2010 at 03:00:50PM +0800, Sheng Yang wrote: This patch fixes the following warning. === [ INFO: suspicious rcu_dereference_check() usage. ] --- include/linux/kvm_host.h:259

Re: [PATCH 0/2] Faster MMU lookups for Book3s v3

2010-07-01 Thread Marcelo Tosatti
On Wed, Jun 30, 2010 at 03:18:44PM +0200, Alexander Graf wrote: Book3s suffered from my really bad shadow MMU implementation so far. So I finally got around to implement a combined hash and list mechanism that allows for much faster lookup of mapped pages. To show that it really is faster, I

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

2010-07-01 Thread Michael S. Tsirkin
On Thu, Jul 01, 2010 at 09:48:41AM -0600, Alex Williamson wrote: On Thu, 2010-07-01 at 18:31 +0300, Michael S. Tsirkin wrote: On Thu, Jul 01, 2010 at 09:29:04AM -0600, Alex Williamson wrote: On Tue, 2010-06-08 at 14:21 -0700, Tom Lyon wrote: +The VFIO_DMA_MASK ioctl is used to set the

Re: [PATCH] KVM: PPC: Book3S_32 MMU debug compile fixes

2010-07-01 Thread Alexander Graf
Alexander Graf wrote: Due to previous changes, the Book3S_32 guest MMU code didn't compile properly when enabling debugging. This patch repairs the broken code paths, making it possible to define DEBUG_MMU and friends again. Signed-off-by: Alexander Graf ag...@suse.de Please also

[GIT PULL net-2.6] vhost-net: more error handling fixes

2010-07-01 Thread Michael S. Tsirkin
David, The following tree includes more fixes dealing with error handling in vhost-net. It is on top of net-2.6. Please merge it for 2.6.35. Thanks! The following changes since commit 38000a94a902e94ca8b5498f7871c6316de8957a: sky2: enable rx/tx in sky2_phy_reinit() (2010-06-23 14:37:04 -0700)

  1   2   >