From: Marc Zyngier <marc.zyngier@arm.com>
To: Mario Smarduch <m.smarduch@samsung.com>
Cc: "kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
"christoffer.dall@linaro.org" <christoffer.dall@linaro.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
이정석 <jays.lee@samsung.com>, 정성진 <sungjinn.chung@samsung.com>
Subject: Re: [PATCH 1/5] add ARMv7 HYP API to flush VM TLBs without address param
Date: Thu, 17 Apr 2014 08:28:24 +0100 [thread overview]
Message-ID: <87eh0wxvmv.fsf@approximate.cambridge.arm.com> (raw)
In-Reply-To: <534F2F5D.2090806@samsung.com> (Mario Smarduch's message of "Thu, 17 Apr 2014 02:33:17 +0100")
On Thu, Apr 17 2014 at 2:33:17 am BST, Mario Smarduch <m.smarduch@samsung.com> wrote:
> Add HYP API to invalidate all VM TLBs without passing address parameter,
> that kvm_tlb_flush_vmid_ipa() uses. Hopefully this is a valid way
> to do it. Tests show nothing is broken.
>
> The address parameter is confusing since whole VM is being invalidated.
>
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
> arch/arm/include/asm/kvm_asm.h | 1 +
> arch/arm/include/asm/kvm_host.h | 2 ++
> arch/arm/kvm/interrupts.S | 5 +++++
> arch/arm/kvm/mmu.c | 9 +++++++++
> 4 files changed, 17 insertions(+)
>
> diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
> index 661da11..090398d 100644
> --- a/arch/arm/include/asm/kvm_asm.h
> +++ b/arch/arm/include/asm/kvm_asm.h
> @@ -76,6 +76,7 @@ extern char __kvm_hyp_code_end[];
>
> extern void __kvm_flush_vm_context(void);
> extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa);
> +extern void __kvm_tlb_flush_vm(struct kvm *kvm);
I'd prefer you retain the "vmid" acronym, instead of "vm". It helps
showing that we're using an invalidation by VMID instead of another
mechanism.
>
> extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
> #endif
> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> index 098f7dd..315e3f3 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -228,4 +228,6 @@ int kvm_perf_teardown(void);
> u64 kvm_arm_timer_get_reg(struct kvm_vcpu *, u64 regid);
> int kvm_arm_timer_set_reg(struct kvm_vcpu *, u64 regid, u64 value);
>
> +void kvm_tlb_flush_vm(struct kvm *kvm);
> +
> #endif /* __ARM_KVM_HOST_H__ */
> diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
> index 0d68d40..f81c228 100644
> --- a/arch/arm/kvm/interrupts.S
> +++ b/arch/arm/kvm/interrupts.S
> @@ -45,8 +45,13 @@ __kvm_hyp_code_start:
> *
> * As v7 does not support flushing per IPA, just nuke the whole TLB
> * instead, ignoring the ipa value.
> + *
> + * void __kvm_tlb_flush_vm(struct kvm *kvm) - alias on ARMv7 to flush all VM
> + * TLBs, with no need to pass IPA. Eliminate confusing code which flushes
> + * whole VM but still requires an IPA which is unused.
Loose the comment about confusion. I don't think we're that confused ;-).
> */
> ENTRY(__kvm_tlb_flush_vmid_ipa)
> +ENTRY(__kvm_tlb_flush_vm)
> push {r2, r3}
>
> dsb ishst
Missing ENDPROC(). This may cause issues on a Thumb2 kernel, and confuse
the unwinder.
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index e8580e2..d7a1846 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -56,6 +56,15 @@ static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
> kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa);
> }
>
> +/* Flushes entire VMs TLBs, for ARMv7 reuses __kvm_tlb_flush_vmid_ipa
> + * interface without the misleading address argument
> + */
Superfluous (and wrong) comment. The address argument is not misleading,
but a concious design decision.
> +void kvm_tlb_flush_vm(struct kvm *kvm)
> +{
> + if (kvm)
> + kvm_call_hyp(__kvm_tlb_flush_vm, kvm);
> +}
> +
> static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache,
> int min, int max)
> {
--
Jazz is not dead. It just smells funny.
prev parent reply other threads:[~2014-04-17 7:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-17 1:33 [PATCH 1/5] add ARMv7 HYP API to flush VM TLBs without address param Mario Smarduch
2014-04-17 7:28 ` Marc Zyngier [this message]
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=87eh0wxvmv.fsf@approximate.cambridge.arm.com \
--to=marc.zyngier@arm.com \
--cc=christoffer.dall@linaro.org \
--cc=jays.lee@samsung.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=m.smarduch@samsung.com \
--cc=sungjinn.chung@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox