[PATCH 02/23] Add PPC64 definitions

2009-07-07 Thread Alexander Graf
We need quite a bunch of new constants for PPC64, so let's define them now. These constants will be used in later patches. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_asm.h | 39 1 files changed, 39 insertions(+), 0

[PATCH 04/23] Add asm/970_kvm.h

2009-07-07 Thread Alexander Graf
This adds the 970 specific header file that contains structs that are only valid on 970 specific code. Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_970.h | 131 1 files changed, 131 insertions(+), 0 deletions(-) create mode

[PATCH 22/23] Hack in dirty logging for VGA

2009-07-07 Thread Alexander Graf
I haven't implemented dirty logging yet, but without things are just way too slow. So for the time being I hacked in a dummy function that always tells userspace we're dirty in VGA regions. Please don't apply this. This patch is for reference only. Signed-off-by: Alexander Graf ag...@suse.de ---

Re: [PATCH 01/23] Pass PVR in sregs

2009-07-07 Thread Avi Kivity
On 07/07/2009 05:17 PM, Alexander Graf wrote: Right now sregs is unused on PPC, so we can use it for initialization of the CPU. KVM on BookE always virtualizes the host CPU. On PPC64 we go a step further and take the PVR from userspace that tells us what kind of CPU we are supposed to

Re: [PATCH 03/23] Add PPC64 fields to vcpu structs

2009-07-07 Thread Avi Kivity
On 07/07/2009 05:17 PM, Alexander Graf wrote: We need to store more information than we currently have for vcpus when running on PPC64. So let's extend the internal struct definitions. Signed-off-by: Alexander Grafag...@suse.de --- arch/powerpc/include/asm/kvm_host.h | 80

Re: [PATCH 00/23] Add KVM support for PPC64 (970) hosts

2009-07-07 Thread Avi Kivity
On 07/07/2009 05:17 PM, Alexander Graf wrote: KVM for PowerPC only supports embedded cores at the moment. While it makes sense to virtualize on small machines, it's even more fun to do so on big boxes. So I figured we need KVM for PowerPC64 as well. This patchset implements KVM support for

Re: [PATCH 22/23] Hack in dirty logging for VGA

2009-07-07 Thread Alexander Graf
On 07.07.2009, at 17:48, Avi Kivity wrote: On 07/07/2009 05:17 PM, Alexander Graf wrote: I haven't implemented dirty logging yet, but without things are just way too slow. So for the time being I hacked in a dummy function that always tells userspace we're dirty in VGA regions. Please

Re: [PATCH 00/23] Add KVM support for PPC64 (970) hosts

2009-07-07 Thread Avi Kivity
On 07/07/2009 06:56 PM, Alexander Graf wrote: From a quick review (not that I'm qualified to review ppc code) this looks very good. Wow - thanks :-). Well, I only reviewed the code that I understood, which was the whitespace. Apparently that part is a well-formed program (see

Re: [PATCH 01/23] Pass PVR in sregs

2009-07-07 Thread Hollis Blanchard
On Tue, 2009-07-07 at 18:40 +0300, Avi Kivity wrote: On 07/07/2009 05:17 PM, Alexander Graf wrote: Right now sregs is unused on PPC, so we can use it for initialization of the CPU. KVM on BookE always virtualizes the host CPU. On PPC64 we go a step further and take the PVR from

Re: [PATCH 01/23] Pass PVR in sregs

2009-07-07 Thread Alexander Graf
On 08.07.2009, at 00:50, Hollis Blanchard wrote: On Tue, 2009-07-07 at 18:40 +0300, Avi Kivity wrote: On 07/07/2009 05:17 PM, Alexander Graf wrote: Right now sregs is unused on PPC, so we can use it for initialization of the CPU. KVM on BookE always virtualizes the host CPU. On PPC64 we

Re: [PATCH 05/23] Add common PPC64 KVM asm helpers

2009-07-07 Thread Benjamin Herrenschmidt
On Tue, 2009-07-07 at 16:17 +0200, Alexander Graf wrote: +.macro to_phys dest_reg, source_reg +#if PAGE_OFFSET == 0xc000 + clrldi \dest_reg, \source_reg, 2 +#else + #error Unknown PAGE_OFFSET +#endif We already have tophys() for that in ppc_asm.h BTW. We prefer using

Re: [PATCH 06/23] Add 970 highmem asm code

2009-07-07 Thread Benjamin Herrenschmidt
On Tue, 2009-07-07 at 16:17 +0200, Alexander Graf wrote: This is the of entry / exit code. In order to switch between host and guest context, we need to switch register state and call the exit code handler on exit. This assembly file does exactly that. To finally enter the guest it calls

Re: [PATCH 07/23] Add SLB switching code for entry/exit

2009-07-07 Thread Benjamin Herrenschmidt
On Tue, 2009-07-07 at 16:17 +0200, Alexander Graf wrote: This is the really low level of guest entry/exit code. Usually the Linux kernel resides in virtual memory 0xc000 to 0x. These addresses are mapped into every userspace application. When going into a 32

Re: [PATCH 08/23] Add interrupt handling code

2009-07-07 Thread Benjamin Herrenschmidt
On Tue, 2009-07-07 at 16:17 +0200, Alexander Graf wrote: Getting from host state to the guest is only half the story. We also need to return to our host context and handle whatever happened to get us out of the guest. On PowerPC every guest exit is an interrupt. So all we need to do is trap