Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-31 Thread Paul Mackerras
On Wed, Jun 01, 2011 at 12:34:43AM +0200, Segher Boessenkool wrote: > There's a loop of 128 iterations of 3 insns. > > I'm not saying it is actually bad, just that that 50 is slightly off ;-) That would be the TLB invalidation. On POWER7 we only need to do that if the virtual cpu last ran on a

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-31 Thread Segher Boessenkool
Sure, but that shouldn't happen with HDEC during the odd 50 instructions that it takes to enter the guest :) It's more like 500 insns, including some ptesync, so lots of cycles too. I don't think its actually that bad. There's a loop of 128 iterations of 3 insns. I'm not saying it is actua

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-31 Thread Jimi Xenidis
On May 27, 2011, at 9:07 PM, Segher Boessenkool wrote: If HDEC expires when interrupts are off, the HDEC interrupt stays pending until interrupts get re-enabled. I'm not sure exactly what the conditions are that cause an HDEC interrupt to get lost, but they seem to involve at

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-27 Thread Segher Boessenkool
If HDEC expires when interrupts are off, the HDEC interrupt stays pending until interrupts get re-enabled. I'm not sure exactly what the conditions are that cause an HDEC interrupt to get lost, but they seem to involve at least a partition switch. On some CPUs, if the top bit of the decrementer

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-27 Thread Alexander Graf
On 27.05.2011, at 22:59, Segher Boessenkool wrote: I do the check there because I was having problems where, if the HDEC goes negative before we do the partition switch, we would occasionally not get the HDEC interrupt at all until the next time HDEC went negative, ~ 8.4 secon

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-27 Thread Segher Boessenkool
I do the check there because I was having problems where, if the HDEC goes negative before we do the partition switch, we would occasionally not get the HDEC interrupt at all until the next time HDEC went negative, ~ 8.4 seconds later. Yikes - so HDEC is edge and doesn't even keep the interrup

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-27 Thread Alexander Graf
On 27.05.2011, at 12:33, Paul Mackerras wrote: > On Tue, May 17, 2011 at 12:17:50PM +0200, Alexander Graf wrote: >> >> On 16.05.2011, at 07:58, Paul Mackerras wrote: >> >>> I do the check there because I was having problems where, if the HDEC >>> goes negative before we do the partition switch,

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-27 Thread Paul Mackerras
On Tue, May 17, 2011 at 12:17:50PM +0200, Alexander Graf wrote: > > On 16.05.2011, at 07:58, Paul Mackerras wrote: > > > I do the check there because I was having problems where, if the HDEC > > goes negative before we do the partition switch, we would occasionally > > not get the HDEC interrupt

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-17 Thread Alexander Graf
On 16.05.2011, at 07:58, Paul Mackerras wrote: > On Sun, May 15, 2011 at 11:58:12PM +0200, Alexander Graf wrote: >> >> On 11.05.2011, at 12:44, Paul Mackerras wrote: > >>> +#ifdef CONFIG_KVM_BOOK3S_NONHV >> >> I really liked how you called the .c file _pr - why call it NONHV now? > > I agree,

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-15 Thread Paul Mackerras
On Sun, May 15, 2011 at 11:58:12PM +0200, Alexander Graf wrote: > > On 11.05.2011, at 12:44, Paul Mackerras wrote: > > +#ifdef CONFIG_KVM_BOOK3S_NONHV > > I really liked how you called the .c file _pr - why call it NONHV now? I agree, CONFIG_KVM_BOOK3S_PR would be better, I'll change it. > > d

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-15 Thread Paul Mackerras
On Thu, May 12, 2011 at 12:07:17PM +0300, Avi Kivity wrote: > On 05/11/2011 01:44 PM, Paul Mackerras wrote: > >--- a/include/linux/kvm.h > >+++ b/include/linux/kvm.h > >@@ -161,6 +161,7 @@ struct kvm_pit_config { > > #define KVM_EXIT_NMI 16 > > #define KVM_EXIT_INTERNAL_ERROR 17 >

Re: [PATCH 10/13] kvm/powerpc: Add support for Book3S processors in hypervisor mode

2011-05-12 Thread Avi Kivity
On 05/11/2011 01:44 PM, Paul Mackerras wrote: This adds support for KVM running on 64-bit Book 3S processors, specifically POWER7, in hypervisor mode. Using hypervisor mode means that the guest can use the processor's supervisor mode. That means that the guest can execute privileged instruction