* [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs
@ 2014-11-07 0:40 Mario Smarduch
2014-11-07 9:44 ` Marc Zyngier
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Mario Smarduch @ 2014-11-07 0:40 UTC (permalink / raw)
To: kvm-ia64
This patch adds ARMv7 architecture TLB Flush function.
Acked-by: Christoffer Dall <christoffer.dall at linaro.org>
Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
---
arch/arm/include/asm/kvm_asm.h | 1 +
arch/arm/include/asm/kvm_host.h | 12 ++++++++++++
arch/arm/kvm/Kconfig | 1 +
arch/arm/kvm/interrupts.S | 11 +++++++++++
4 files changed, 25 insertions(+)
diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
index 3a67bec..25410b2 100644
--- a/arch/arm/include/asm/kvm_asm.h
+++ b/arch/arm/include/asm/kvm_asm.h
@@ -96,6 +96,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_vmid(struct kvm *kvm);
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 6dfb404..fad598c 100644
--- a/arch/arm/include/asm/kvm_host.h
+++ b/arch/arm/include/asm/kvm_host.h
@@ -220,6 +220,18 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
}
+/**
+ * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
+ * @kvm: pointer to kvm structure.
+ *
+ * Interface to HYP function to flush all VM TLB entries without address
+ * parameter.
+ */
+static inline void kvm_flush_remote_tlbs(struct kvm *kvm)
+{
+ kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
+}
+
static inline int kvm_arch_dev_ioctl_check_extension(long ext)
{
return 0;
diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig
index 466bd29..a099df4 100644
--- a/arch/arm/kvm/Kconfig
+++ b/arch/arm/kvm/Kconfig
@@ -23,6 +23,7 @@ config KVM
select HAVE_KVM_CPU_RELAX_INTERCEPT
select KVM_MMIO
select KVM_ARM_HOST
+ select HAVE_KVM_ARCH_TLB_FLUSH_ALL
depends on ARM_VIRT_EXT && ARM_LPAE
---help---
Support hosting virtualized guest machines. You will also
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
index 01dcb0e..79caf79 100644
--- a/arch/arm/kvm/interrupts.S
+++ b/arch/arm/kvm/interrupts.S
@@ -66,6 +66,17 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
bx lr
ENDPROC(__kvm_tlb_flush_vmid_ipa)
+/**
+ * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
+ *
+ * Reuses __kvm_tlb_flush_vmid_ipa() for ARMv7, without passing address
+ * parameter
+ */
+
+ENTRY(__kvm_tlb_flush_vmid)
+ b __kvm_tlb_flush_vmid_ipa
+ENDPROC(__kvm_tlb_flush_vmid)
+
/********************************************************************
* Flush TLBs and instruction caches of all CPUs inside the inner-shareable
* domain, for all VMIDs
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs
2014-11-07 0:40 [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs Mario Smarduch
@ 2014-11-07 9:44 ` Marc Zyngier
2014-11-07 18:58 ` Mario Smarduch
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Marc Zyngier @ 2014-11-07 9:44 UTC (permalink / raw)
To: kvm-ia64
On 07/11/14 00:40, Mario Smarduch wrote:
> This patch adds ARMv7 architecture TLB Flush function.
>
> Acked-by: Christoffer Dall <christoffer.dall at linaro.org>
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
> arch/arm/include/asm/kvm_asm.h | 1 +
> arch/arm/include/asm/kvm_host.h | 12 ++++++++++++
> arch/arm/kvm/Kconfig | 1 +
> arch/arm/kvm/interrupts.S | 11 +++++++++++
> 4 files changed, 25 insertions(+)
>
> diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
> index 3a67bec..25410b2 100644
> --- a/arch/arm/include/asm/kvm_asm.h
> +++ b/arch/arm/include/asm/kvm_asm.h
> @@ -96,6 +96,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_vmid(struct kvm *kvm);
>
> 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 6dfb404..fad598c 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -220,6 +220,18 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
> }
>
> +/**
> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
> + * @kvm: pointer to kvm structure.
> + *
> + * Interface to HYP function to flush all VM TLB entries without address
> + * parameter.
> + */
> +static inline void kvm_flush_remote_tlbs(struct kvm *kvm)
> +{
> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
> +}
> +
> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
> {
> return 0;
> diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig
> index 466bd29..a099df4 100644
> --- a/arch/arm/kvm/Kconfig
> +++ b/arch/arm/kvm/Kconfig
> @@ -23,6 +23,7 @@ config KVM
> select HAVE_KVM_CPU_RELAX_INTERCEPT
> select KVM_MMIO
> select KVM_ARM_HOST
> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
[utter nit] Move this up by two lines so that the "HAVE_KVM_*" options
are together. The ARM tree has a tendency to sort the config options by
alphabetical order (though that's clearly not enforced in this file...).
> depends on ARM_VIRT_EXT && ARM_LPAE
> ---help---
> Support hosting virtualized guest machines. You will also
> diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
> index 01dcb0e..79caf79 100644
> --- a/arch/arm/kvm/interrupts.S
> +++ b/arch/arm/kvm/interrupts.S
> @@ -66,6 +66,17 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
> bx lr
> ENDPROC(__kvm_tlb_flush_vmid_ipa)
>
> +/**
> + * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
> + *
> + * Reuses __kvm_tlb_flush_vmid_ipa() for ARMv7, without passing address
> + * parameter
> + */
> +
> +ENTRY(__kvm_tlb_flush_vmid)
> + b __kvm_tlb_flush_vmid_ipa
> +ENDPROC(__kvm_tlb_flush_vmid)
> +
> /********************************************************************
> * Flush TLBs and instruction caches of all CPUs inside the inner-shareable
> * domain, for all VMIDs
>
Other than that:
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs
2014-11-07 0:40 [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs Mario Smarduch
2014-11-07 9:44 ` Marc Zyngier
@ 2014-11-07 18:58 ` Mario Smarduch
2014-11-07 20:18 ` Christoffer Dall
2014-11-07 20:46 ` Mario Smarduch
3 siblings, 0 replies; 5+ messages in thread
From: Mario Smarduch @ 2014-11-07 18:58 UTC (permalink / raw)
To: kvm-ia64
On 11/07/2014 01:44 AM, Marc Zyngier wrote:
> On 07/11/14 00:40, Mario Smarduch wrote:
>> This patch adds ARMv7 architecture TLB Flush function.
>>
>> Acked-by: Christoffer Dall <christoffer.dall at linaro.org>
>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>> ---
>> arch/arm/include/asm/kvm_asm.h | 1 +
>> arch/arm/include/asm/kvm_host.h | 12 ++++++++++++
>> arch/arm/kvm/Kconfig | 1 +
>> arch/arm/kvm/interrupts.S | 11 +++++++++++
>> 4 files changed, 25 insertions(+)
>>
>> diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
>> index 3a67bec..25410b2 100644
>> --- a/arch/arm/include/asm/kvm_asm.h
>> +++ b/arch/arm/include/asm/kvm_asm.h
>> @@ -96,6 +96,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_vmid(struct kvm *kvm);
>>
>> 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 6dfb404..fad598c 100644
>> --- a/arch/arm/include/asm/kvm_host.h
>> +++ b/arch/arm/include/asm/kvm_host.h
>> @@ -220,6 +220,18 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
>> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
>> }
>>
>> +/**
>> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
>> + * @kvm: pointer to kvm structure.
>> + *
>> + * Interface to HYP function to flush all VM TLB entries without address
>> + * parameter.
>> + */
>> +static inline void kvm_flush_remote_tlbs(struct kvm *kvm)
>> +{
>> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>> +}
>> +
>> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
>> {
>> return 0;
>> diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig
>> index 466bd29..a099df4 100644
>> --- a/arch/arm/kvm/Kconfig
>> +++ b/arch/arm/kvm/Kconfig
>> @@ -23,6 +23,7 @@ config KVM
>> select HAVE_KVM_CPU_RELAX_INTERCEPT
>> select KVM_MMIO
>> select KVM_ARM_HOST
>> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
>
> [utter nit] Move this up by two lines so that the "HAVE_KVM_*" options
> are together. The ARM tree has a tendency to sort the config options by
> alphabetical order (though that's clearly not enforced in this file...).
Ah, ok will update.
>
>> depends on ARM_VIRT_EXT && ARM_LPAE
>> ---help---
>> Support hosting virtualized guest machines. You will also
>> diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
>> index 01dcb0e..79caf79 100644
>> --- a/arch/arm/kvm/interrupts.S
>> +++ b/arch/arm/kvm/interrupts.S
>> @@ -66,6 +66,17 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
>> bx lr
>> ENDPROC(__kvm_tlb_flush_vmid_ipa)
>>
>> +/**
>> + * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
>> + *
>> + * Reuses __kvm_tlb_flush_vmid_ipa() for ARMv7, without passing address
>> + * parameter
>> + */
>> +
>> +ENTRY(__kvm_tlb_flush_vmid)
>> + b __kvm_tlb_flush_vmid_ipa
>> +ENDPROC(__kvm_tlb_flush_vmid)
>> +
>> /********************************************************************
>> * Flush TLBs and instruction caches of all CPUs inside the inner-shareable
>> * domain, for all VMIDs
>>
>
> Other than that:
>
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
>
> M.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs
2014-11-07 0:40 [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs Mario Smarduch
2014-11-07 9:44 ` Marc Zyngier
2014-11-07 18:58 ` Mario Smarduch
@ 2014-11-07 20:18 ` Christoffer Dall
2014-11-07 20:46 ` Mario Smarduch
3 siblings, 0 replies; 5+ messages in thread
From: Christoffer Dall @ 2014-11-07 20:18 UTC (permalink / raw)
To: kvm-ia64
On Thu, Nov 06, 2014 at 04:40:45PM -0800, Mario Smarduch wrote:
> This patch adds ARMv7 architecture TLB Flush function.
>
> Acked-by: Christoffer Dall <christoffer.dall at linaro.org>
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
> arch/arm/include/asm/kvm_asm.h | 1 +
> arch/arm/include/asm/kvm_host.h | 12 ++++++++++++
> arch/arm/kvm/Kconfig | 1 +
> arch/arm/kvm/interrupts.S | 11 +++++++++++
> 4 files changed, 25 insertions(+)
>
> diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
> index 3a67bec..25410b2 100644
> --- a/arch/arm/include/asm/kvm_asm.h
> +++ b/arch/arm/include/asm/kvm_asm.h
> @@ -96,6 +96,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_vmid(struct kvm *kvm);
>
> 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 6dfb404..fad598c 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -220,6 +220,18 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
> }
>
> +/**
> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
this name is not matching the function
> + * @kvm: pointer to kvm structure.
> + *
> + * Interface to HYP function to flush all VM TLB entries without address
> + * parameter.
> + */
> +static inline void kvm_flush_remote_tlbs(struct kvm *kvm)
> +{
> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
> +}
> +
> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
> {
> return 0;
> diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig
> index 466bd29..a099df4 100644
> --- a/arch/arm/kvm/Kconfig
> +++ b/arch/arm/kvm/Kconfig
> @@ -23,6 +23,7 @@ config KVM
> select HAVE_KVM_CPU_RELAX_INTERCEPT
> select KVM_MMIO
> select KVM_ARM_HOST
> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
> depends on ARM_VIRT_EXT && ARM_LPAE
> ---help---
> Support hosting virtualized guest machines. You will also
> diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
> index 01dcb0e..79caf79 100644
> --- a/arch/arm/kvm/interrupts.S
> +++ b/arch/arm/kvm/interrupts.S
> @@ -66,6 +66,17 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
> bx lr
> ENDPROC(__kvm_tlb_flush_vmid_ipa)
>
> +/**
> + * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
> + *
> + * Reuses __kvm_tlb_flush_vmid_ipa() for ARMv7, without passing address
> + * parameter
> + */
> +
> +ENTRY(__kvm_tlb_flush_vmid)
> + b __kvm_tlb_flush_vmid_ipa
> +ENDPROC(__kvm_tlb_flush_vmid)
> +
> /********************************************************************
> * Flush TLBs and instruction caches of all CPUs inside the inner-shareable
> * domain, for all VMIDs
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs
2014-11-07 0:40 [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs Mario Smarduch
` (2 preceding siblings ...)
2014-11-07 20:18 ` Christoffer Dall
@ 2014-11-07 20:46 ` Mario Smarduch
3 siblings, 0 replies; 5+ messages in thread
From: Mario Smarduch @ 2014-11-07 20:46 UTC (permalink / raw)
To: kvm-ia64
On 11/07/2014 12:18 PM, Christoffer Dall wrote:
> On Thu, Nov 06, 2014 at 04:40:45PM -0800, Mario Smarduch wrote:
>> This patch adds ARMv7 architecture TLB Flush function.
>>
>> Acked-by: Christoffer Dall <christoffer.dall at linaro.org>
>> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
>> ---
>> arch/arm/include/asm/kvm_asm.h | 1 +
>> arch/arm/include/asm/kvm_host.h | 12 ++++++++++++
>> arch/arm/kvm/Kconfig | 1 +
>> arch/arm/kvm/interrupts.S | 11 +++++++++++
>> 4 files changed, 25 insertions(+)
>>
>> diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
>> index 3a67bec..25410b2 100644
>> --- a/arch/arm/include/asm/kvm_asm.h
>> +++ b/arch/arm/include/asm/kvm_asm.h
>> @@ -96,6 +96,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_vmid(struct kvm *kvm);
>>
>> 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 6dfb404..fad598c 100644
>> --- a/arch/arm/include/asm/kvm_host.h
>> +++ b/arch/arm/include/asm/kvm_host.h
>> @@ -220,6 +220,18 @@ static inline void __cpu_init_hyp_mode(phys_addr_t boot_pgd_ptr,
>> kvm_call_hyp((void*)hyp_stack_ptr, vector_ptr, pgd_ptr);
>> }
>>
>> +/**
>> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries
>
> this name is not matching the function
Yes leftover from previous version, will update.
>
>> + * @kvm: pointer to kvm structure.
>> + *
>> + * Interface to HYP function to flush all VM TLB entries without address
>> + * parameter.
>> + */
>> +static inline void kvm_flush_remote_tlbs(struct kvm *kvm)
>> +{
>> + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>> +}
>> +
>> static inline int kvm_arch_dev_ioctl_check_extension(long ext)
>> {
>> return 0;
>> diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig
>> index 466bd29..a099df4 100644
>> --- a/arch/arm/kvm/Kconfig
>> +++ b/arch/arm/kvm/Kconfig
>> @@ -23,6 +23,7 @@ config KVM
>> select HAVE_KVM_CPU_RELAX_INTERCEPT
>> select KVM_MMIO
>> select KVM_ARM_HOST
>> + select HAVE_KVM_ARCH_TLB_FLUSH_ALL
>> depends on ARM_VIRT_EXT && ARM_LPAE
>> ---help---
>> Support hosting virtualized guest machines. You will also
>> diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
>> index 01dcb0e..79caf79 100644
>> --- a/arch/arm/kvm/interrupts.S
>> +++ b/arch/arm/kvm/interrupts.S
>> @@ -66,6 +66,17 @@ ENTRY(__kvm_tlb_flush_vmid_ipa)
>> bx lr
>> ENDPROC(__kvm_tlb_flush_vmid_ipa)
>>
>> +/**
>> + * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs
>> + *
>> + * Reuses __kvm_tlb_flush_vmid_ipa() for ARMv7, without passing address
>> + * parameter
>> + */
>> +
>> +ENTRY(__kvm_tlb_flush_vmid)
>> + b __kvm_tlb_flush_vmid_ipa
>> +ENDPROC(__kvm_tlb_flush_vmid)
>> +
>> /********************************************************************
>> * Flush TLBs and instruction caches of all CPUs inside the inner-shareable
>> * domain, for all VMIDs
>> --
>> 1.7.9.5
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-07 20:46 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07 0:40 [PATCH v13 4/7] arm: KVM: Add ARMv7 API to flush TLBs Mario Smarduch
2014-11-07 9:44 ` Marc Zyngier
2014-11-07 18:58 ` Mario Smarduch
2014-11-07 20:18 ` Christoffer Dall
2014-11-07 20:46 ` Mario Smarduch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox