All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonios Motakis <a.motakis@virtualopensystems.com>
To: Christoffer Dall <c.dall@virtualopensystems.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	android-virt@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [Android-virt] [PATCH RFC v2 3/3] ARM: KVM: Add support for MMU notifiers
Date: Sat, 11 Feb 2012 19:33:14 +0100	[thread overview]
Message-ID: <4F36B46A.1030805@virtualopensystems.com> (raw)
In-Reply-To: <CANM98qKqC6kByFabQqorDzLoNv=Kzx8oZ5OoeFUkELO4yLZqRg@mail.gmail.com>

On 02/11/2012 06:35 PM, Christoffer Dall wrote:
> On Sat, Feb 11, 2012 at 7:00 AM, Antonios Motakis
> <a.motakis@virtualopensystems.com>  wrote:
>> 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).
>>
> to do this you would need to send an IPI if the guest is currently
> executing on another CPU and make it exit the guest, so that the VMID
> assignment will run before the guest potentially accesses that TLB
> entry that points to the page that was just reclaimed - which I am not
> sure will be better than this solution.
Don't you have to do this anyway? You'd want the flush to be effective 
on all CPUs before proceeding.

  reply	other threads:[~2012-02-11 18:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 22:22 [PATCH RFC v2 1/3] KVM: Guard mmu_notifier specific code with CONFIG_MMU_NOTIFIER Marc Zyngier
2012-02-10 22:22 ` [PATCH RFC v2 2/3] ARM: KVM: mark the end of the HYP mode code with __kvm_hyp_code_end Marc Zyngier
2012-02-10 22:32   ` Christoffer Dall
2012-02-10 22:22 ` [PATCH RFC v2 3/3] ARM: KVM: Add support for MMU notifiers Marc Zyngier
2012-02-10 22:49   ` Christoffer Dall
2012-02-11 15:00   ` [Android-virt] " Antonios Motakis
2012-02-11 17:35     ` Christoffer Dall
2012-02-11 18:33       ` Antonios Motakis [this message]
2012-02-12  1:12         ` Christoffer Dall
2012-02-12  8:20           ` Alexander Graf
2012-02-13 13:13           ` Marc Zyngier
2012-02-13 14:50             ` Christoffer Dall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F36B46A.1030805@virtualopensystems.com \
    --to=a.motakis@virtualopensystems.com \
    --cc=android-virt@lists.cs.columbia.edu \
    --cc=c.dall@virtualopensystems.com \
    --cc=kvm@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.