Re: [PATCH 08/26] KVM: PPC: Add PV guest critical sections

2010-06-27 Thread Alexander Graf
Am 27.06.2010 um 13:53 schrieb Avi Kivity a...@redhat.com: On 06/27/2010 02:49 PM, Alexander Graf wrote: Am 27.06.2010 um 12:59 schrieb Avi Kivity a...@redhat.com: On 06/27/2010 01:33 PM, Alexander Graf wrote: Or inc/dec... Uh - huh? How would that help? inc shared-critical

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

2010-06-28 Thread Alexander Graf
On 28.06.2010, at 09:18, Milton Miller wrote: On Sun Jun 27 around 19:33:52 EST 2010 Alexander Graf wrote: Am 27.06.2010 um 10:14 schrieb Avi Kivity avi at redhat.com: On 06/26/2010 02:25 AM, Alexander Graf wrote: + +PPC hypercalls +== + +The only viable ways to reliably

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

2010-06-28 Thread Alexander Graf
On 28.06.2010, at 10:13, Avi Kivity wrote: On 06/28/2010 10:49 AM, Alexander Graf wrote: I don't believe we support the kernel actually doing a syscall to itself anymore, at least on powerpc. The callers call the underlying system call function, or kernel_thread. That said, I would

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

2010-06-28 Thread Alexander Graf
On 28.06.2010, at 10:28, Avi Kivity wrote: On 06/26/2010 02:16 AM, 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

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

2010-06-28 Thread Alexander Graf
Avi Kivity wrote: On 06/28/2010 12:27 PM, Alexander Graf wrote: Am I looking at old code? Apparently. Check book3s_mmu_*.c I don't have that pattern. It's in this patch. +static void invalidate_pte(struct kvm_vcpu *vcpu, struct hpte_cache *pte) +{ + dprintk_mmu(KVM: Flushing SPT

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

2010-06-28 Thread Alexander Graf
Avi Kivity wrote: On 06/28/2010 12:55 PM, Alexander Graf wrote: Avi Kivity wrote: On 06/28/2010 12:27 PM, Alexander Graf wrote: Am I looking at old code? Apparently. Check book3s_mmu_*.c I don't have that pattern. It's in this patch. Yes. Silly

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

2010-06-29 Thread Alexander Graf
On 29.06.2010, at 09:32, Segher Boessenkool wrote: On PowerPC it's very normal to not support all of the physical RAM in real mode. Oh? Are you referring to real mode limit, or 32-bit implementations with more than 32 address lines, or something else? The former. Okay. In that

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

2010-06-29 Thread Alexander Graf
On 29.06.2010, at 09:52, Segher Boessenkool wrote: Also, it seems you construct the physical address by masking out bits from the effective address. Most implementations will trap or machine check if you address outside of physical address space, instead. Well the only case where I

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

2010-06-29 Thread Alexander Graf
Avi Kivity wrote: On 06/26/2010 02:24 AM, Alexander Graf wrote: 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

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

2010-06-29 Thread Alexander Graf
Avi Kivity wrote: On 06/28/2010 11:55 AM, Alexander Graf wrote: + +static inline u64 kvmppc_mmu_hash_pte(u64 eaddr) { +return hash_64(eaddr PTE_SIZE, HPTEG_HASH_BITS_PTE); +} + +static inline u64 kvmppc_mmu_hash_vpte(u64 vpage) { +return hash_64(vpage 0xfULL

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

2010-06-29 Thread Alexander Graf
Avi Kivity wrote: On 06/29/2010 03:56 PM, Alexander Graf wrote: Avi Kivity wrote: On 06/28/2010 11:55 AM, Alexander Graf wrote: + +static inline u64 kvmppc_mmu_hash_pte(u64 eaddr) { +return hash_64(eaddrPTE_SIZE, HPTEG_HASH_BITS_PTE); +} + +static inline u64

[PATCH 00/27] KVM PPC PV framework

2010-07-01 Thread Alexander Graf
kvm_patch_ins - only flush icache when patching - introduce kvm_patch_ins_b - update documentation Alexander Graf (27): KVM: PPC: Introduce shared page KVM: PPC: Convert MSR to shared page KVM: PPC: Convert DSISR to shared page KVM: PPC: Convert DAR to shared page. KVM: PPC: Convert SRR0

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

2010-07-01 Thread Alexander Graf
it. Signed-off-by: Alexander Graf ag...@suse.de v1 - v2: - RMO - PAM --- arch/powerpc/include/asm/kvm_host.h |3 +++ arch/powerpc/kvm/book3s.c |4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include

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

2010-07-01 Thread Alexander Graf
specfic header file. Signed-off-by: Alexander Graf ag...@suse.de --- arch/x86/include/asm/kvm_para.h |6 ++ include/linux/kvm_para.h|5 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index

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

2010-07-01 Thread Alexander Graf
interrupts and if necessary exit back to the hypervisor. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - use kvm_patch_ins_b --- arch/powerpc/kernel/kvm.c | 45 arch/powerpc/kernel/kvm_emul.S | 56 2

[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 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 23/27] KVM: PPC: PV assembler helpers

2010-07-01 Thread Alexander Graf
and code in general easier readable, let's introduce a set of defines that save and restore r30, r31 and cr. Let's also define some helpers to read the lower 32 bits of a 64 bit field on 32 bit systems. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/kvm_emul.S | 29

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

2010-07-01 Thread Alexander Graf
that even though you can fully read its contents, writing to it doesn't always update all state. There are a few safe fields that don't require hypervisor interaction. See the documentation for a list of MSR bits that are safe to be set from inside the guest. Signed-off-by: Alexander Graf ag

[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
:). Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - kvm guest patch framework: introduce patch_ins --- arch/powerpc/kernel/kvm.c | 63 + 1 files changed, 63 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/kvm.c b/arch

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

2010-07-01 Thread Alexander Graf
to the shared page. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_host.h |1 - arch/powerpc/include/asm/kvm_para.h |1 + arch/powerpc/kvm/book3s.c| 14 +++--- arch/powerpc/kvm/book3s_emulate.c|6 +++--- arch/powerpc/kvm

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

2010-07-01 Thread Alexander Graf
very simple to share with the guest. Hypervisor and guest both have full r/w access. This patch converts all users of the current field to the shared page. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_host.h |2 -- arch/powerpc/include/asm/kvm_para.h |2

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

2010-07-01 Thread Alexander Graf
around. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_para.h |1 + arch/powerpc/kvm/book3s.c |7 +++ arch/powerpc/kvm/booke.c|7 +++ 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm

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

2010-07-01 Thread Alexander Graf
. This patch implements stubs to handle KVM PPC hypercalls on the host and guest side alike. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - change hypervisor calls to use new register values --- arch/powerpc/include/asm/kvm_para.h | 100 ++- arch/powerpc

[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

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

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

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

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

2010-07-02 Thread Alexander Graf
On 02.07.2010, at 09:41, Geert Uytterhoeven wrote: On Thu, 1 Jul 2010, Alexander Graf wrote: 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

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

2010-07-02 Thread Alexander Graf
Alexander Graf wrote: 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

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

2010-07-02 Thread Alexander Graf
On 02.07.2010, at 18:27, Segher Boessenkool wrote: +To find out if we're running on KVM or not, we overlay the PVR register. Usually +the PVR register contains an id that identifies your CPU type. If, however, you +pass KVM_PVR_PARA in the register that you want the PVR result in, the

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

2010-07-02 Thread Alexander Graf
On 02.07.2010, at 19:59, Hollis Blanchard wrote: [Resending...] Please reconcile this with http://www.linux-kvm.org/page/PowerPC_Hypercall_ABI, which has been discussed in the (admittedly closed) Power.org embedded hypervisor working group. Bear in mind that other hypervisors are already

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

2010-07-04 Thread Alexander Graf
On 02.07.2010, at 21:10, Scott Wood wrote: On Fri, 2 Jul 2010 20:47:44 +0200 Alexander Graf ag...@suse.de wrote: On 02.07.2010, at 19:59, Hollis Blanchard wrote: [Resending...] Please reconcile this with http://www.linux-kvm.org/page/PowerPC_Hypercall_ABI, which has been discussed

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

2010-07-04 Thread Alexander Graf
On 04.07.2010, at 00:41, Benjamin Herrenschmidt wrote: On Fri, 2010-07-02 at 18:27 +0200, Segher Boessenkool wrote: +To find out if we're running on KVM or not, we overlay the PVR register. Usually +the PVR register contains an id that identifies your CPU type. If, however, you +pass

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

2010-07-04 Thread Alexander Graf
On 04.07.2010, at 11:17, Alexander Graf wrote: On 04.07.2010, at 11:10, Avi Kivity wrote: On 07/04/2010 12:04 PM, Alexander Graf wrote: My biggest concern about putting things in the device-tree is that I was trying to keep things as separate as possible. Why does the firmware have

Re: [PATCH 00/27] KVM PPC PV framework

2010-07-09 Thread Alexander Graf
On 09.07.2010, at 06:57, MJ embd wrote: On Thu, Jul 1, 2010 at 4:12 PM, Alexander Graf ag...@suse.de wrote: 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

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

2010-07-09 Thread Alexander Graf
On 09.07.2010, at 11:11, MJ embd wrote: On Thu, Jul 1, 2010 at 4:13 PM, Alexander Graf ag...@suse.de wrote: 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

Re: KVM on ps3-linux working?

2010-07-12 Thread Alexander Graf
On 12.07.2010, at 05:04, Takuya Yoshikawa wrote: Hi Alex, I've been testing dirty logging on ps3 linux for a few weeks. - I luckily got one by chance. That is great news! Although I could find what was the main cause of breaking dirty logging, I'm struggling with stabilizing KVM on

Re: KVM on ps3-linux working?

2010-07-12 Thread Alexander Graf
On 12.07.2010, at 09:59, Takuya Yoshikawa wrote: Are there any restrictions in KVM on ps3 linux? Not really. The biggest thing to keep in mind is that ram is really limited. So make sure you have a lot of swap. In fact, I used to use a PS3 for development and testing quite a lot myself,

[PATCH] KVM: PPC: Make long relocations be ulong

2010-07-19 Thread Alexander Graf
...@linux.vnet.ibm.com Signed-off-by: Alexander Graf ag...@suse.de --- I'm not sure which tree this should go through. Avi and Ben, please coordinate this. --- arch/powerpc/include/asm/kvm_book3s.h |4 ++-- arch/powerpc/kvm/book3s_rmhandlers.S |4 ++-- 2 files changed, 4 insertions(+), 4

Re: [PATCH] KVM: PPC: Make long relocations be ulong

2010-07-19 Thread Alexander Graf
Avi Kivity wrote: On 07/19/2010 05:54 PM, Alexander Graf wrote: I'm not sure which tree this should go through. Avi and Ben, please coordinate this. --- arch/powerpc/include/asm/kvm_book3s.h |4 ++-- arch/powerpc/kvm/book3s_rmhandlers.S |4 ++-- 2 files changed, 4 insertions

Re: [PPC64/Power7 - 2.6.35-rc5] Bad relocation warnings whileBuilding a CONFIG_RELOCATABLE kernel with CONFIG_ISERIES enabled

2010-07-20 Thread Alexander Graf
On 20.07.2010, at 09:27, Milton Miller wrote: On Mon, 19 Jul 2010 about 14:00:56 +0200, Alexander Graf wrote: Milton Miller wrote: I wrote: Oh yea, and for book-3s, the code copies from 0x100 to __end_interrupts in arch/powerpc/kernel/exceptions-64s.h down to the real 0, but the rest

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

2010-07-29 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 17/27] KVM: PPC: KVM PV guest stubs

2010-07-29 Thread Alexander Graf
:). Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - kvm guest patch framework: introduce patch_ins v2 - v3: - add self-test in guest code - remove superfluous new lines in generic guest code --- arch/powerpc/kernel/kvm.c | 95 + 1

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

2010-07-29 Thread Alexander Graf
the furthest we can jump with immediate branches. So we keep 1MB of free space around in bss. After we're done initing we can just tell the mm system that the unused pages are free, but until then we have enough space to fit all our code in. Signed-off-by: Alexander Graf ag...@suse.de --- arch

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

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

2010-07-29 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

[PATCH 27/27] KVM: PPC: Add get_pvinfo interface to query hypercall instructions

2010-07-29 Thread Alexander Graf
conditions. If we're running in hardware accelerated hypervisor mode, a hypercall looks different from when we're running without hardware acceleration. Signed-off-by: Alexander Graf ag...@suse.de --- Documentation/kvm/api.txt | 23 +++ arch/powerpc/kvm/powerpc.c | 38

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

2010-07-29 Thread Alexander Graf
around. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_para.h |1 + arch/powerpc/kvm/book3s.c |7 +++ arch/powerpc/kvm/booke.c|7 +++ 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/include/asm

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

2010-07-29 Thread Alexander Graf
interrupts and if necessary exit back to the hypervisor. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - use kvm_patch_ins_b --- arch/powerpc/kernel/kvm.c | 45 arch/powerpc/kernel/kvm_emul.S | 56 2

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

2010-07-29 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 04/27] KVM: PPC: Convert DAR to shared page.

2010-07-29 Thread Alexander Graf
to the shared page. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_host.h |1 - arch/powerpc/include/asm/kvm_para.h |1 + arch/powerpc/kvm/book3s.c| 14 +++--- arch/powerpc/kvm/book3s_emulate.c|6 +++--- arch/powerpc/kvm

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

2010-07-29 Thread Alexander Graf
. This patch implements stubs to handle KVM PPC hypercalls on the host and guest side alike. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - change hypervisor calls to use new register values v2 - v3: - move PV interface to ePAPR - only check R0 on hypercall - remove PVR hack

[PATCH 25/27] KVM: PPC: PV wrteei

2010-07-29 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 --- v1 - v2: - use kvm_patch_ins_b

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

2010-07-29 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 16/27] KVM: PPC: Generic KVM PV guest support

2010-07-29 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 --- v2 - v3: - Add hypercall stub --- arch

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

2010-07-29 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 ag

[PATCH 08/27] KVM: PPC: Add PV guest critical sections

2010-07-29 Thread Alexander Graf
in such a critical section and thus may not receive any interrupts. Signed-off-by: Alexander Graf ag...@suse.de --- v1 - v2: - make crit detection only trigger in supervisor mode --- arch/powerpc/include/asm/kvm_para.h |1 + arch/powerpc/kvm/book3s.c | 18

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

2010-07-29 Thread Alexander Graf
it. Signed-off-by: Alexander Graf ag...@suse.de v2 - v3: - RMO - PAM (non-magic page) --- arch/powerpc/include/asm/kvm_host.h |3 +++ arch/powerpc/kvm/book3s.c |4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch

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

2010-07-29 Thread Alexander Graf
very simple to share with the guest. Hypervisor and guest both have full r/w access. This patch converts all users of the current field to the shared page. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_host.h |2 -- arch/powerpc/include/asm/kvm_para.h |2

[PATCH 00/27] KVM PPC PV framework v3

2010-07-29 Thread Alexander Graf
for relocatable kernels Alexander Graf (27): KVM: PPC: Introduce shared page KVM: PPC: Convert MSR to shared page KVM: PPC: Convert DSISR to shared page KVM: PPC: Convert DAR to shared page. KVM: PPC: Convert SRR0 and SRR1 to shared page KVM: PPC: Convert SPRG[0-4] to shared page KVM: PPC

[PATCH 7/7] KVM: PPC: Move KVM trampolines before __end_interrupts

2010-07-29 Thread Alexander Graf
-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/exceptions-64s.S |6 ++ arch/powerpc/kernel/head_64.S|6 -- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 3e423fb..a0f25fb

[PATCH 5/7] KVM: PPC: Use MSR_DR for external load_up

2010-07-29 Thread Alexander Graf
Book3S_32 requires MSR_DR to be disabled during load_up_xxx while on Book3S_64 it's supposed to be enabled. I misread the code and disabled it in both cases, potentially breaking the PS3 which has a really small RMA. This patch makes KVM work on the PS3 again. Signed-off-by: Alexander Graf ag

[PATCH 3/7] KVM: PPC: correctly check gfn_to_pfn() return value

2010-07-29 Thread Alexander Graf
From: Gleb Natapov g...@redhat.com On failure gfn_to_pfn returns bad_page so use correct function to check for that. Signed-off-by: Gleb Natapov g...@redhat.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_32_mmu_host.c |2 +- arch/powerpc/kvm/book3s_64_mmu_host.c

[PATCH 4/7] KVM: PPC: Add book3s_32 tlbie flush acceleration

2010-07-29 Thread Alexander Graf
On Book3s_32 the tlbie instruction flushed effective addresses by the mask 0x0000. This is pretty hard to reflect with a hash that hashes ~0xfff, so to speed up that target we should also keep a special hash around for it. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include

Re: [PATCH 4/7] KVM: PPC: Add book3s_32 tlbie flush acceleration

2010-08-01 Thread Alexander Graf
On 01.08.2010, at 16:08, Avi Kivity wrote: On 07/29/2010 04:04 PM, Alexander Graf wrote: On Book3s_32 the tlbie instruction flushed effective addresses by the mask 0x0000. This is pretty hard to reflect with a hash that hashes ~0xfff, so to speed up that target we should also keep

Re: [PATCH 00/27] KVM PPC PV framework v3

2010-08-01 Thread Alexander Graf
On 01.08.2010, at 16:02, Avi Kivity wrote: On 07/29/2010 03:47 PM, Alexander Graf wrote: 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

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

2010-08-02 Thread Alexander Graf
On 30.07.2010, at 03:00, Hollis Blanchard wrote: This is the only kernel patch needed for KVM on 440GP. However, there are a couple blockers in qemu at the moment, for which patches exist but are not yet upstream. Signed-off-by: Hollis Blanchard hol...@penguinppc.org Please give this a

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

2010-08-02 Thread Alexander Graf
On 02.08.2010, at 10:32, Alexander Graf wrote: On 30.07.2010, at 03:00, Hollis Blanchard wrote: This is the only kernel patch needed for KVM on 440GP. However, there are a couple blockers in qemu at the moment, for which patches exist but are not yet upstream. Signed-off-by: Hollis

Re: [PATCH] KVM: PPC: fix compilation of dump tlbs debug function

2010-08-02 Thread Alexander Graf
On 30.07.2010, at 02:57, Hollis Blanchard wrote: Signed-off-by: Hollis Blanchard hol...@penguinppc.org Missing patch description. Otherwise the same comments apply as to the previous patches. Alex -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message

Re: [PATCH] PPC4xx: don't unregister RAM at reset

2010-08-02 Thread Alexander Graf
On 30.07.2010, at 03:48, Hollis Blanchard wrote: The PowerPC 4xx SDRAM controller emulation unregisters RAM in its reset callback. However, qemu_system_reset() is now called at initialization time, so RAM is unregistered before starting the guest. So the registration should be moved to reset

Re: [PATCH 00/27] KVM PPC PV framework v3

2010-08-05 Thread Alexander Graf
On 05.08.2010, at 09:57, Avi Kivity wrote: On 08/03/2010 07:16 PM, Scott Wood wrote: On Sun, 1 Aug 2010 22:21:37 +0200 Alexander Grafag...@suse.de wrote: On 01.08.2010, at 16:02, Avi Kivity wrote: Looks reasonable. Since it's fair to say I understand nothing about powerpc, I'd like

Re: [PATCH 00/27] KVM PPC PV framework v3

2010-08-16 Thread Alexander Graf
On 06.08.2010, at 18:28, Kumar Gala wrote: On Jul 29, 2010, at 7:47 AM, Alexander Graf wrote: [without] debian-powerpc:~# time for i in {1..1000}; do /bin/echo hello /dev/null; done real0m14.659s user0m8.967s sys 0m5.688s [with] debian-powerpc:~# time for i

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

2010-08-16 Thread Alexander Graf
On 07.08.2010, at 19:33, hollis_blanch...@mentor.com wrote: Hi Avi, these patches make KVM run on 440GP (the only 440-based SoC that wasn't passing the compatibility check) and fix or enhance a couple very minor issues in related code. Please apply. Alex, please ack. Acked-by: Alexander

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

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

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

2010-08-17 Thread Alexander Graf
.git kvm-ppc-next Have fun with more accurate, faster and less buggy KVM on PowerPC! Alexander Graf (23): KVM: PPC: Move EXIT_DEBUG partially to tracepoints KVM: PPC: Move book3s_64 mmu map debug print to trace point KVM: PPC: Add tracepoint for generic mmu map KVM: PPC: Move pte

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

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

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

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

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

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

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

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

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

2010-08-17 Thread Alexander Graf
-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/44x.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c index e7b1f3f..74d0e74 100644 --- a/arch/powerpc/kvm/44x.c +++ b/arch/powerpc/kvm/44x.c @@ -43,7 +43,7 @@ int

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

2010-08-17 Thread Alexander Graf
certain that we are on a KVM VM. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/kvm.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c index 517da39..95aed6b 100644 --- a/arch/powerpc/kernel/kvm.c

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

2010-08-17 Thread Alexander Graf
for the valid bit that indicated that the sid we're looking at actually contains useful data. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_64_mmu_host.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch

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

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

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

2010-08-17 Thread Alexander Graf
(); /* r containts MSR_POW */ mtmsr(r | MSR_EE); This obviously breaks, as we're going into idle mode in code sections that don't expect to be idling. This patch masks MSR_POW out of the stored MSR value on wakeup, making guests happy again. Signed-off-by: Alexander Graf ag

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2010-08-17 Thread Alexander Graf
it manually removed from the guest, saving us a flush. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index b3c1dde..3e017da 100644 --- a/arch/powerpc

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

2010-08-17 Thread Alexander Graf
On 17.08.2010, at 20:28, Scott Wood wrote: On Tue, 17 Aug 2010 15:57:56 +0200 Alexander Graf ag...@suse.de wrote: There are some heuristics in the PPC power management code that try to find out if the particular hardware we're running on supports proper power management or just hangs

Re: [PATCH] powerpc/kvm/e500_tlb: Fix a minor copy-paste tracing bug

2010-08-27 Thread Alexander Graf
On 27.08.2010, at 21:06, Kyle Moffett wrote: The kvmppc_e500_stlbe_invalidate() function was trying to pass too many parameters to trace_kvm_stlb_inval(). This appears to be a bad copy-paste from a call to trace_kvm_stlb_write(). Which kernel is this against? That trace point is already

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

2010-08-30 Thread Alexander Graf
On 22.08.2010, at 18:42, Avi Kivity wrote: On 08/17/2010 04:57 PM, Alexander Graf wrote: We will soon add SR PV support to the shared page, so we need some infrastructure that allows the guest to query for features KVM exports. This patch adds a second return value to the magic mapping

<    1   2   3   4   5   6   7   8   9   10   >