From mboxrd@z Thu Jan 1 00:00:00 1970 From: Antonios Motakis Subject: Re: [Android-virt] [PATCH RFC v2 3/3] ARM: KVM: Add support for MMU notifiers Date: Sat, 11 Feb 2012 16:00:56 +0100 Message-ID: <4F3682A8.2060006@virtualopensystems.com> References: <1328912534-28888-1-git-send-email-marc.zyngier@arm.com> <1328912534-28888-3-git-send-email-marc.zyngier@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: c.dall@virtualopensystems.com, android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org To: Marc Zyngier Return-path: Received: from mail-ww0-f44.google.com ([74.125.82.44]:36942 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754641Ab2BKPBB (ORCPT ); Sat, 11 Feb 2012 10:01:01 -0500 Received: by wgbdt10 with SMTP id dt10so3625371wgb.1 for ; Sat, 11 Feb 2012 07:00:59 -0800 (PST) In-Reply-To: <1328912534-28888-3-git-send-email-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 02/10/2012 11:22 PM, Marc Zyngier wrote: > +ENTRY(__kvm_tlb_flush_vmid) > + hvc #0 @ Switch to Hyp mode > + push {r2, r3} > > + ldrd r2, r3, [r0, #KVM_VTTBR] > + mcrr p15, 6, r2, r3, c2 @ Write VTTBR > + isb > + mcr p15, 0, r0, c8, c7, 0 @ TBLIALL > + dsb > + isb > + mov r2, #0 > + mov r3, #0 > + mcrr p15, 6, r2, r3, c2 @ Back to VMID #0 > + isb > + > + pop {r2, r3} > + hvc #0 @ Back to SVC > + mov pc, lr > +ENDPROC(__kvm_tlb_flush_vmid) With the last VMID implementation, you could get the equivalent effect of a per-VMID flush, by just getting a new VMID for the current VM. So you could do a (kvm->arch.vmid = 0) to force a new VMID when the guest reruns, and save the overhead of that flush (you will do a complete flush every 255 times instead of a small one every single time). Best regards, Antonios