From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH] KVM: PPC: Book3s PR: Disable AIL mode with OPAL Date: Tue, 17 Jun 2014 11:18:26 +0200 Message-ID: <53A007E2.1020105@suse.de> References: <1402420980-2796-1-git-send-email-agraf@suse.de> <20140612035619.GB14343@drongo> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Paul Mackerras Return-path: In-Reply-To: <20140612035619.GB14343@drongo> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 12.06.14 05:56, Paul Mackerras wrote: > On Tue, Jun 10, 2014 at 07:23:00PM +0200, Alexander Graf wrote: >> When we're using PR KVM we must not allow the CPU to take interrupts >> in virtual mode, as the SLB does not contain host kernel mappings >> when running inside the guest context. >> >> To make sure we get good performance for non-KVM tasks but still >> properly functioning PR KVM, let's just disable AIL whenever a vcpu >> is scheduled in. >> >> This patch fixes running PR KVM on POWER8 bare metal for me. > We already handle this for the situation where we're running under a > hypervisor with the calls to pSeries_disable_reloc_on_exc() and > pSeries_enable_reloc_on_exc() in kvmppc_core_init_vm_pr() and > kvmppc_core_destroy_vm_pr() respectively. > > The obvious approach to fixing this problem would be to generalize > those calls, perhaps via a ppc_md callback, to work on the powernv > platform too. If you don't want to do that, for instance because > those calls are defined to operate across the whole machine rather > than a single CPU thread, and you prefer to affect just the one thread > we're running on, then I think you need to explain that in the commit > message. It's what I've done at first, yes. Unfortunately the pSeries call is system global, while we need to do the AIL switching per cpu on bare metal. Once you start considering CPU hotplug and how that affects the secondary bringup paths you start wondering whether it's worth the hassle :). This way you can have a single guest running which only slows down (disables AIL) on its own vcpu, while all the others still enjoy the benefits of AIL. Alex