Re: [RFC] virtio: Support releasing lock during kick

2010-06-25 Thread Stefan Hajnoczi
On Fri, Jun 25, 2010 at 4:09 AM, Rusty Russell ru...@rustcorp.com.au wrote: On Thu, 24 Jun 2010 03:00:30 pm Stefan Hajnoczi wrote: On Wed, Jun 23, 2010 at 11:12 PM, Anthony Liguori anth...@codemonkey.ws wrote: Shouldn't it be possible to just drop the lock before invoking virtqueue_kick()

RE: qemu fail to parse command line with -pcidevice 00:19.0

2010-06-25 Thread Hao, Xudong
Thanks, Mark. -Original Message- From: Markus Armbruster [mailto:arm...@redhat.com] Sent: 2010年6月25日 12:58 To: Hao, Xudong Cc: qemu-de...@nongnu.org; aligu...@us.ibm.com; kvm@vger.kernel.org Subject: Re: qemu fail to parse command line with -pcidevice 00:19.0 Hao, Xudong

Re: qemu fail to parse command line with -pcidevice 00:19.0

2010-06-25 Thread Hidetoshi Seto
(2010/06/24 15:08), Markus Armbruster wrote: Note to qemu-devel: this issue is qemu-kvm only. Hao, Xudong xudong@intel.com writes: When assign one PCI device, qemu fail to parse the command line: qemu-system_x86 -smp 2 -m 1024 -hda /path/to/img -pcidevice host=00:19.0 Error:

Re: Graphical virtualisation management system

2010-06-25 Thread Christoph Hellwig
On Thu, Jun 24, 2010 at 02:01:52PM -0500, Javier Guerra Giraldez wrote: On Thu, Jun 24, 2010 at 1:32 PM, Freddie Cash fjwc...@gmail.com wrote: ??* virt-manager which requires X and seems to be more desktop-oriented; don't know about the others, but virt-manager runs only on the admin

[PATCH] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-25 Thread Sheng Yang
Some guest device driver may leverage the Non-Snoop I/O, and explicitly WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or CLFLUSH, we need to maintain data consistency either by: 1: flushing cache (wbinvd) when the guest is scheduled out if there is no wbinvd exit, or 2:

Re: qemu fail to parse command line with -pcidevice 00:19.0

2010-06-25 Thread Markus Armbruster
Hidetoshi Seto seto.hideto...@jp.fujitsu.com writes: (2010/06/24 15:08), Markus Armbruster wrote: Note to qemu-devel: this issue is qemu-kvm only. Hao, Xudong xudong@intel.com writes: When assign one PCI device, qemu fail to parse the command line: qemu-system_x86 -smp 2 -m 1024 -hda

Re: [PATCH] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-25 Thread Jan Kiszka
Sheng Yang wrote: Some guest device driver may leverage the Non-Snoop I/O, and explicitly WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or CLFLUSH, we need to maintain data consistency either by: 1: flushing cache (wbinvd) when the guest is scheduled out if there is

Re: Graphical virtualisation management system

2010-06-25 Thread Gerd Hoffmann
On 06/25/10 09:05, Christoph Hellwig wrote: On Thu, Jun 24, 2010 at 02:01:52PM -0500, Javier Guerra Giraldez wrote: On Thu, Jun 24, 2010 at 1:32 PM, Freddie Cashfjwc...@gmail.com wrote: ??* virt-manager which requires X and seems to be more desktop-oriented; don't know about the others, but

Re: Graphical virtualisation management system

2010-06-25 Thread Daniel P. Berrange
On Fri, Jun 25, 2010 at 11:07:26AM +0200, Gerd Hoffmann wrote: On 06/25/10 09:05, Christoph Hellwig wrote: Second I still haven't figure out how to install and manage a system using the serial console with KVM, which certainly contributes to the complete lack of usability above. Serial

Re: Graphical virtualisation management system

2010-06-25 Thread Gerd Hoffmann
Hi, We want to move to a multi-tiered, SAN-based virtualisation setup, but can't find a VM management tool that handles both KVM and Xen (we have some old Opteron hardware that doesn't support SVM), and does not require Linux from end-to-end. For example, we want to run FreeBSD + ZFS on our

Re: Graphical virtualisation management system

2010-06-25 Thread Daniel P. Berrange
On Fri, Jun 25, 2010 at 03:05:42AM -0400, Christoph Hellwig wrote: On Thu, Jun 24, 2010 at 02:01:52PM -0500, Javier Guerra Giraldez wrote: On Thu, Jun 24, 2010 at 1:32 PM, Freddie Cash fjwc...@gmail.com wrote: ??* virt-manager which requires X and seems to be more desktop-oriented;

Re: [PATCH 5/5] KVM test: Make it possible to run VMs without NICs

2010-06-25 Thread Michael Goldish
On 06/25/2010 02:33 AM, Lucas Meneghel Rodrigues wrote: For unittesting, for example, is interesting that we run the VM with the bare mininum number of parameters. This fix allows that. Signed-off-by: Lucas Meneghel Rodrigues l...@redhat.com --- client/tests/kvm/kvm_vm.py |5 +++-- 1

[PATCH] sched: export sched_set/getaffinity (was Re: [PATCH 3/3] vhost: apply cpumask and cgroup to vhost pollers)

2010-06-25 Thread Michael S. Tsirkin
On Thu, Jun 24, 2010 at 03:45:51PM -0700, Sridhar Samudrala wrote: On Thu, 2010-06-24 at 11:11 +0300, Michael S. Tsirkin wrote: On Sun, May 30, 2010 at 10:25:01PM +0200, Tejun Heo wrote: Apply the cpumask and cgroup of the initializing task to the created vhost poller. Based on

Re: [PATCH] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-25 Thread Sheng Yang
On Friday 25 June 2010 16:54:19 Jan Kiszka wrote: Sheng Yang wrote: Some guest device driver may leverage the Non-Snoop I/O, and explicitly WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or CLFLUSH, we need to maintain data consistency either by: 1: flushing

Re: UIO interrupts being lost

2010-06-25 Thread Michael S. Tsirkin
On Thu, Jun 24, 2010 at 05:43:15PM -0600, Cam Macdonell wrote: Hi Michael, I'm trying to write a uio driver for my shared memory device for KVM and I'm running into a situation where several interrupts in quick succession are not all triggering the callback function in my kernel UIO driver,

Re: [RFC] virtio: Support releasing lock during kick

2010-06-25 Thread Michael S. Tsirkin
On Fri, Jun 25, 2010 at 12:39:21PM +0930, Rusty Russell wrote: On Thu, 24 Jun 2010 03:00:30 pm Stefan Hajnoczi wrote: On Wed, Jun 23, 2010 at 11:12 PM, Anthony Liguori anth...@codemonkey.ws wrote: Shouldn't it be possible to just drop the lock before invoking virtqueue_kick() and

Re: [PATCH 0/3][RFC] NUMA: add host side pinning

2010-06-25 Thread Andre Przywara
Jes Sorensen wrote: On 06/24/10 13:34, Andre Przywara wrote: Avi Kivity wrote: On 06/24/2010 01:58 PM, Andre Przywara wrote: Non-anonymous memory doesn't work well with ksm and transparent hugepages. Is it possible to use anonymous memory rather than file backed? I'd prefer non-file backed,

Re: [RFC PATCH v7 01/19] Add a new structure for skb buffer from external.

2010-06-25 Thread Michael S. Tsirkin
On Fri, Jun 25, 2010 at 09:03:46AM +0800, Dong, Eddie wrote: Herbert Xu wrote: On Wed, Jun 23, 2010 at 06:05:41PM +0800, Dong, Eddie wrote: I mean once the frontend side driver post the buffers to the backend driver, the backend driver will immediately use that buffers to compose skb

[PATCH v2 1/10] KVM: MMU: fix writable sync sp mapping

2010-06-25 Thread Xiao Guangrong
While we sync the unsync sp, we may mapping the spte writable, it's dangerous, if one unsync sp's mapping gfn is another unsync page's gfn. For example: have two unsync pages SP1, SP2 and: SP1.pte[0] = P SP2.gfn's pfn = P [SP1.pte[0] = SP2.gfn's pfn] First, we unsync SP2, it will write protect

[PATCH v2 2/10] KVM: MMU: fix conflict access permissions in direct sp

2010-06-25 Thread Xiao Guangrong
In no-direct mapping, we mark sp is 'direct' when we mapping the guest's larger page, but its access is encoded form upper page-struct entire not include the last mapping, it will cause access conflict. For example, have this mapping: [W] / PDE1 - |---| P[W] | | LPA

[PATCH v2 4/10] KVM: MMU: fix forgot to flush all vcpu's tlb

2010-06-25 Thread Xiao Guangrong
After remove a rmap, we should flush all vcpu's tlb Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 0412ba4..f151540 100644 ---

[PATCH v2 6/10] KVM: MMU: introduce gfn_to_hva_many() function

2010-06-25 Thread Xiao Guangrong
This function not only return the gfn's hva but also the page number after @gfn in the slot It's used in the later patch Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c | 13 - 2 files changed, 13

[PATCH v2 3/10] KVM: MMU: fix direct sp's access corruptted

2010-06-25 Thread Xiao Guangrong
Consider using small page to fit guest's large page mapping: If the mapping is writable but the dirty flag is not set, we will find the read-only direct sp and setup the mapping, then if the write #PF occur, we will mark this mapping writable in the read-only direct sp, now, other real read-only

[PATCH v2 5/10] KVM: MMU: introduce gfn_to_pfn_atomic() function

2010-06-25 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 v2 7/10] KVM: MMU: introduce mmu_topup_memory_cache_atomic()

2010-06-25 Thread Xiao Guangrong
Introduce mmu_topup_memory_cache_atomic(), it support topup memory cache in atomic context Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 29 + 1 files changed, 25 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/mmu.c

[PATCH v2 8/10] KVM: MMU: prefetch ptes when intercepted guest #PF

2010-06-25 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 v2 10/10] KVM: MMU: trace pte prefetch

2010-06-25 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 | 42 +- arch/x86/kvm/mmutrace.h| 33 +

[ANNOUNCE] kvm-kmod-2.6.35-rc3

2010-06-25 Thread Jan Kiszka
No pending KVM patches for upcoming 2.6.35, so let's give it a try in form of a release candidate. Major KVM changes since kvm-kmod-2.6.34: - lots of x86 emulator fixes and improvements - timekeeping (kvm-clock) improvements - SVM: nesting correctness and performance improvements - tons of

[PATCH v2] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-25 Thread Sheng Yang
Some guest device driver may leverage the Non-Snoop I/O, and explicitly WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or CLFLUSH, we need to maintain data consistency either by: 1: flushing cache (wbinvd) when the guest is scheduled out if there is no wbinvd exit, or 2:

[ kvm-Bugs-2001121 ] Windows 2003 x64 - SESSION5_INITIALIZATION_FAILED

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

Re: [PATCH v2] KVM: VMX: Execute WBINVD to keep data consistency with assigned devices

2010-06-25 Thread Jan Kiszka
Sheng Yang wrote: Some guest device driver may leverage the Non-Snoop I/O, and explicitly WBINVD or CLFLUSH to a RAM space. Since migration may occur before WBINVD or CLFLUSH, we need to maintain data consistency either by: 1: flushing cache (wbinvd) when the guest is scheduled out if there is

[ kvm-Bugs-1949429 ] Windows XP 2003 - 64-bit Editions may FAIL during setup

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

[ kvm-Bugs-2034672 ] guest: BUG: soft lockup - CPU#0 stuck for 41s!

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

[ kvm-Bugs-1817779 ] KVM crash with Windows XP guest because of ACPI

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

Re: [RFC] virtio: Support releasing lock during kick

2010-06-25 Thread Stefan Hajnoczi
On Fri, Jun 25, 2010 at 01:43:17PM +0300, Michael S. Tsirkin wrote: On Fri, Jun 25, 2010 at 12:39:21PM +0930, Rusty Russell wrote: On Thu, 24 Jun 2010 03:00:30 pm Stefan Hajnoczi wrote: On Wed, Jun 23, 2010 at 11:12 PM, Anthony Liguori anth...@codemonkey.ws wrote: Shouldn't it be

Re: [RFC] virtio: Support releasing lock during kick

2010-06-25 Thread Michael S. Tsirkin
On Fri, Jun 25, 2010 at 04:31:44PM +0100, Stefan Hajnoczi wrote: On Fri, Jun 25, 2010 at 01:43:17PM +0300, Michael S. Tsirkin wrote: On Fri, Jun 25, 2010 at 12:39:21PM +0930, Rusty Russell wrote: On Thu, 24 Jun 2010 03:00:30 pm Stefan Hajnoczi wrote: On Wed, Jun 23, 2010 at 11:12 PM,

Re: [RFC] virtio: Support releasing lock during kick

2010-06-25 Thread Stefan Hajnoczi
On Fri, Jun 25, 2010 at 06:32:20PM +0300, Michael S. Tsirkin wrote: On Fri, Jun 25, 2010 at 04:31:44PM +0100, Stefan Hajnoczi wrote: On Fri, Jun 25, 2010 at 01:43:17PM +0300, Michael S. Tsirkin wrote: On Fri, Jun 25, 2010 at 12:39:21PM +0930, Rusty Russell wrote: On Thu, 24 Jun 2010

[ kvm-Bugs-2063072 ] compiling problem with tcg_ctx

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

[ kvm-Bugs-1949429 ] Windows XP 2003 - 64-bit Editions may FAIL during setup

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

KVM in remote server with bridge in a single ethernet interface

2010-06-25 Thread Armando Montiel
Hi, I have only one ethernet port in a remote server. (eth0) I have a public address with x.x.x.164 netmask 255.255.255.240 gw x.x.x.161 and want to use in my guest OS the next available ip address (x.x.x.165 netmask 255.255.255.240 gw x.x.x.161) Is this posible with brctl to achieve this? I

[ kvm-Bugs-1900228 ] Time on guest slows down sometimes...

2010-06-25 Thread SourceForge.net
Bugs item #1900228, was opened at 2008-02-23 10:26 Message generated for change (Comment added) made by glommer You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=893831aid=1900228group_id=180599 Please note that this message will contain a full copy of the comment

Re: [PATCH v2 3/4] KVM: cleanup: remove kvm_get_dirty_log()

2010-06-25 Thread Alexander Graf
On 23.06.2010, at 08:01, Takuya Yoshikawa wrote: kvm_get_dirty_log() is a helper function for kvm_vm_ioctl_get_dirty_log() which is currently used by ia64 and ppc and the following is what it is doing: - sanity checks - bitmap scan to check if the slot is dirty - copy_to_user()

KVM in remote server with bridge in a single ethernet interface

2010-06-25 Thread Armando Montiel
Hi, I have only one ethernet port in a remote server. (eth0) I have a public address with x.x.x.164 netmask 255.255.255.240 gw x.x.x.161 and want to use in my guest OS the next available ip address (x.x.x.165 netmask 255.255.255.240 gw x.x.x.161) Is this posible with brctl to achieve this? I

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

2010-06-25 Thread Alexander Graf
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 --- arch/powerpc/kvm/book3s_32_mmu.c |4 ++--

[PATCH] Faster MMU lookups for Book3s

2010-06-25 Thread Alexander Graf
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 process spawning code inside the guest with and

[PATCH] KVM: PPC: Make use of hash based Shadow MMU

2010-06-25 Thread Alexander Graf
We just introduced generic functions to handle shadow pages on PPC. This patch makes the respective backends make use of them, getting rid of a lot of duplicate code along the way. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_book3s.h |7 ++

[PATCH] KVM: PPC: Add generic hpte management functions

2010-06-25 Thread Alexander Graf
Currently the shadow paging code keeps an array of entries it knows about. Whenever the guest invalidates an entry, we loop through that entry, trying to invalidate matching parts. While this is a really simple implementation, it is probably the most ineffective one possible. So instead, let's

Re: [PATCH] KVM: PPC: Add generic hpte management functions

2010-06-25 Thread Alexander Graf
On 26.06.2010, at 01:16, Alexander Graf wrote: Currently the shadow paging code keeps an array of entries it knows about. Whenever the guest invalidates an entry, we loop through that entry, trying to invalidate matching parts. While this is a really simple implementation, it is probably

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

2010-06-25 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 09/26] KVM: PPC: Add PV guest scratch registers

2010-06-25 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 10/26] KVM: PPC: Tell guest about pending interrupts

2010-06-25 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 08/26] KVM: PPC: Add PV guest critical sections

2010-06-25 Thread Alexander Graf
When running in hooked code we need a way to disable interrupts without clobbering any interrupts or exiting out to the hypervisor. To achieve this, we have an additional critical field in the shared page. If that field is equal to the r1 register of the guest, it tells the hypervisor that we're

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

2010-06-25 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 26/26] KVM: PPC: Add Documentation about PV interface

2010-06-25 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 --- Documentation/kvm/ppc-pv.txt | 164

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

2010-06-25 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 15/26] KVM: PPC: Expose magic page support to guest

2010-06-25 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 14/26] KVM: PPC: Magic Page BookE support

2010-06-25 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 25/26] KVM: PPC: PV wrteei

2010-06-25 Thread Alexander Graf
On BookE the preferred way to write the EE bit is the wrteei instruction. It already encodes the EE bit in the instruction. So in order to get BookE some speedups as well, let's also PV'nize thati instruction. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/kvm.c | 50

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

2010-06-25 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 20/26] KVM: PPC: PV tlbsync to nop

2010-06-25 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 --- arch/powerpc/kernel/kvm.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/kvm.c

[PATCH 24/26] KVM: PPC: PV mtmsrd L=0 and mtmsr

2010-06-25 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, the PPC32 one never uses the L=1 form but 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

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

2010-06-25 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 12/26] KVM: PPC: First magic page steps

2010-06-25 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 23/26] KVM: PPC: PV mtmsrd L=1

2010-06-25 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 17/26] KVM: PPC: Generic KVM PV guest support

2010-06-25 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 19/26] KVM: PPC: PV instructions to loads and stores

2010-06-25 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 --- arch/powerpc/kernel/kvm.c | 111

[PATCH 22/26] KVM: PPC: PV assembler helpers

2010-06-25 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 13/26] KVM: PPC: Magic Page Book3s support

2010-06-25 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/26] KVM: PPC: Implement hypervisor interface

2010-06-25 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 03/26] KVM: PPC: Convert DSISR to shared page

2010-06-25 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

[PATCH 00/26] KVM PPC PV framework

2010-06-25 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 05/26] KVM: PPC: Convert SRR0 and SRR1 to shared page

2010-06-25 Thread Alexander Graf
The SRR0 and SRR1 registers contain cached values of the PC and MSR respectively. They get written to by the hypervisor when an interrupt occurs or directly by the kernel. They are also used to tell the rfi(d) instruction where to jump to. Because it only gets touched on defined events that, it's

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

2010-06-25 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 04/26] KVM: PPC: Convert DAR to shared page.

2010-06-25 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

Re: [PATCH v2 3/4] KVM: cleanup: remove kvm_get_dirty_log()

2010-06-25 Thread Takuya Yoshikawa
On Fri, 25 Jun 2010 21:25:57 +0200 Alexander Graf ag...@suse.de wrote: This patch plus 4/4 broke dirty bitmap updating on PPC. I didn't get around to track down why, but I figured you should now. Is there any way to get you a PPC development box? A simple G4 or G5 should be 200$ on ebay by

Re: [PATCH v2 3/4] KVM: cleanup: remove kvm_get_dirty_log()

2010-06-25 Thread Takuya Yoshikawa
This patch plus 4/4 broke dirty bitmap updating on PPC. I didn't get around to track down why, but I figured you should now. Is there any way to get you a PPC development box? A simple G4 or G5 should be 200$ on ebay by now :). A simple G4 or G5, thanks for the info, I'll buy one. I hope

Where is the entry point of hypercalls in kvm

2010-06-25 Thread Balachandar
Hello,  I am trying to understand the virtio mechanism in linux. I read that the kick function will notify the host side about the newly published buffers. I am looking especially at virtio_net.Once a packet is ready for transmission the kick function is called. From here i where does it go? Which

Re: [PATCH] kvm/ppc: fix build warning

2010-06-25 Thread Denis Kirjanov
On 06/25/2010 12:42 AM, Alexander Graf wrote: On 24.06.2010, at 21:44, Denis Kirjanov wrote: Fix build warning: arch/powerpc/kvm/book3s_64_mmu.c: In function 'kvmppc_mmu_book3s_64_esid_to_vsid': arch/powerpc/kvm/book3s_64_mmu.c:446: warning: 'slb' may be used uninitialized in this function

Re: [PATCH] kvm/ppc: fix build warning

2010-06-25 Thread Alexander Graf
On 25.06.2010, at 11:02, Denis Kirjanov wrote: On 06/25/2010 12:42 AM, Alexander Graf wrote: On 24.06.2010, at 21:44, Denis Kirjanov wrote: Fix build warning: arch/powerpc/kvm/book3s_64_mmu.c: In function 'kvmppc_mmu_book3s_64_esid_to_vsid': arch/powerpc/kvm/book3s_64_mmu.c:446:

Re: [PATCH] kvm/ppc: fix build warning

2010-06-25 Thread Denis Kirjanov
On 06/25/2010 01:02 PM, Denis Kirjanov wrote: On 06/25/2010 12:42 AM, Alexander Graf wrote: On 24.06.2010, at 21:44, Denis Kirjanov wrote: Fix build warning: arch/powerpc/kvm/book3s_64_mmu.c: In function 'kvmppc_mmu_book3s_64_esid_to_vsid': arch/powerpc/kvm/book3s_64_mmu.c:446: warning:

Re: [PATCH v2 3/4] KVM: cleanup: remove kvm_get_dirty_log()

2010-06-25 Thread Alexander Graf
On 23.06.2010, at 08:01, Takuya Yoshikawa wrote: kvm_get_dirty_log() is a helper function for kvm_vm_ioctl_get_dirty_log() which is currently used by ia64 and ppc and the following is what it is doing: - sanity checks - bitmap scan to check if the slot is dirty - copy_to_user()

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

2010-06-25 Thread Alexander Graf
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 --- arch/powerpc/kvm/book3s_32_mmu.c |4 ++--

[PATCH] KVM: PPC: Make use of hash based Shadow MMU

2010-06-25 Thread Alexander Graf
We just introduced generic functions to handle shadow pages on PPC. This patch makes the respective backends make use of them, getting rid of a lot of duplicate code along the way. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_book3s.h |7 ++

Re: [PATCH] KVM: PPC: Add generic hpte management functions

2010-06-25 Thread Alexander Graf
On 26.06.2010, at 01:16, Alexander Graf wrote: Currently the shadow paging code keeps an array of entries it knows about. Whenever the guest invalidates an entry, we loop through that entry, trying to invalidate matching parts. While this is a really simple implementation, it is probably

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

2010-06-25 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 06/26] KVM: PPC: Convert SPRG[0-4] to shared page

2010-06-25 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 01/26] KVM: PPC: Introduce shared page

2010-06-25 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 09/26] KVM: PPC: Add PV guest scratch registers

2010-06-25 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 26/26] KVM: PPC: Add Documentation about PV interface

2010-06-25 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 --- Documentation/kvm/ppc-pv.txt | 164

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

2010-06-25 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 23/26] KVM: PPC: PV mtmsrd L=1

2010-06-25 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 19/26] KVM: PPC: PV instructions to loads and stores

2010-06-25 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 --- arch/powerpc/kernel/kvm.c | 111

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

2010-06-25 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 13/26] KVM: PPC: Magic Page Book3s support

2010-06-25 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 15/26] KVM: PPC: Expose magic page support to guest

2010-06-25 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 07/26] KVM: PPC: Implement hypervisor interface

2010-06-25 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 25/26] KVM: PPC: PV wrteei

2010-06-25 Thread Alexander Graf
On BookE the preferred way to write the EE bit is the wrteei instruction. It already encodes the EE bit in the instruction. So in order to get BookE some speedups as well, let's also PV'nize thati instruction. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/kvm.c | 50

[PATCH 05/26] KVM: PPC: Convert SRR0 and SRR1 to shared page

2010-06-25 Thread Alexander Graf
The SRR0 and SRR1 registers contain cached values of the PC and MSR respectively. They get written to by the hypervisor when an interrupt occurs or directly by the kernel. They are also used to tell the rfi(d) instruction where to jump to. Because it only gets touched on defined events that, it's

[PATCH 00/26] KVM PPC PV framework

2010-06-25 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/26] KVM: PPC: First magic page steps

2010-06-25 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 ---

  1   2   >