All of lore.kernel.org
 help / color / mirror / Atom feed
From: agraf@suse.de (Alexander Graf)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v11 1/6] KVM: Add architecture-specific TLB flush implementations
Date: Wed, 15 Oct 2014 13:17:25 +0200	[thread overview]
Message-ID: <543E57C5.5070205@suse.de> (raw)
In-Reply-To: <1411433690-8104-2-git-send-email-m.smarduch@samsung.com>



On 23.09.14 02:54, Mario Smarduch wrote:
> Add support to declare architecture specific TLB flush function, for now ARMv7.
> 
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
>  include/linux/kvm_host.h |    1 +
>  virt/kvm/Kconfig         |    3 +++
>  virt/kvm/kvm_main.c      |    4 ++++
>  3 files changed, 8 insertions(+)
> 
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index ec4e3bd..a49a6df 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -592,6 +592,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
>  void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
>  
>  void kvm_flush_remote_tlbs(struct kvm *kvm);
> +void kvm_arch_flush_remote_tlbs(struct kvm *kvm);
>  void kvm_reload_remote_mmus(struct kvm *kvm);
>  void kvm_make_mclock_inprogress_request(struct kvm *kvm);
>  void kvm_make_scan_ioapic_request(struct kvm *kvm);
> diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig
> index 13f2d19..f1efaa5 100644
> --- a/virt/kvm/Kconfig
> +++ b/virt/kvm/Kconfig
> @@ -34,3 +34,6 @@ config HAVE_KVM_CPU_RELAX_INTERCEPT
>  
>  config KVM_VFIO
>         bool
> +
> +config HAVE_KVM_ARCH_TLB_FLUSH_ALL
> +       bool
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 4b6c01b..d0a24f5 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -186,12 +186,16 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
>  
>  void kvm_flush_remote_tlbs(struct kvm *kvm)
>  {
> +#ifdef CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL

Please make this an #ifndef on the outer definition and just define your
own copy of this function inside of arch/arm/kvm :).


Alex

> +	kvm_arch_flush_remote_tlbs(kvm);
> +#else
>  	long dirty_count = kvm->tlbs_dirty;
>  
>  	smp_mb();
>  	if (make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH))
>  		++kvm->stat.remote_tlb_flush;
>  	cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);
> +#endif
>  }
>  EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs);
>  
> 

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Mario Smarduch <m.smarduch@samsung.com>,
	kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org,
	marc.zyngier@arm.com, pbonzini@redhat.com, gleb@kernel.org,
	borntraeger@de.ibm.com, cornelia.huck@de.ibm.com,
	xiaoguangrong@linux.vnet.ibm.com, ralf@linux-mips.org,
	catali.marinas@arm.com
Cc: steve.capper@arm.com, peter.maydell@linaro.org,
	kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v11 1/6] KVM: Add architecture-specific TLB flush implementations
Date: Wed, 15 Oct 2014 13:17:25 +0200	[thread overview]
Message-ID: <543E57C5.5070205@suse.de> (raw)
In-Reply-To: <1411433690-8104-2-git-send-email-m.smarduch@samsung.com>



On 23.09.14 02:54, Mario Smarduch wrote:
> Add support to declare architecture specific TLB flush function, for now ARMv7.
> 
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
>  include/linux/kvm_host.h |    1 +
>  virt/kvm/Kconfig         |    3 +++
>  virt/kvm/kvm_main.c      |    4 ++++
>  3 files changed, 8 insertions(+)
> 
> diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
> index ec4e3bd..a49a6df 100644
> --- a/include/linux/kvm_host.h
> +++ b/include/linux/kvm_host.h
> @@ -592,6 +592,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
>  void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
>  
>  void kvm_flush_remote_tlbs(struct kvm *kvm);
> +void kvm_arch_flush_remote_tlbs(struct kvm *kvm);
>  void kvm_reload_remote_mmus(struct kvm *kvm);
>  void kvm_make_mclock_inprogress_request(struct kvm *kvm);
>  void kvm_make_scan_ioapic_request(struct kvm *kvm);
> diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig
> index 13f2d19..f1efaa5 100644
> --- a/virt/kvm/Kconfig
> +++ b/virt/kvm/Kconfig
> @@ -34,3 +34,6 @@ config HAVE_KVM_CPU_RELAX_INTERCEPT
>  
>  config KVM_VFIO
>         bool
> +
> +config HAVE_KVM_ARCH_TLB_FLUSH_ALL
> +       bool
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 4b6c01b..d0a24f5 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -186,12 +186,16 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req)
>  
>  void kvm_flush_remote_tlbs(struct kvm *kvm)
>  {
> +#ifdef CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL

Please make this an #ifndef on the outer definition and just define your
own copy of this function inside of arch/arm/kvm :).


Alex

> +	kvm_arch_flush_remote_tlbs(kvm);
> +#else
>  	long dirty_count = kvm->tlbs_dirty;
>  
>  	smp_mb();
>  	if (make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH))
>  		++kvm->stat.remote_tlb_flush;
>  	cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);
> +#endif
>  }
>  EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs);
>  
> 

  reply	other threads:[~2014-10-15 11:17 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23  0:54 [PATCH v11 0/6] arm: dirty page logging support for ARMv7 Mario Smarduch
2014-09-23  0:54 ` Mario Smarduch
2014-09-23  0:54 ` [PATCH v11 1/6] KVM: Add architecture-specific TLB flush implementations Mario Smarduch
2014-09-23  0:54   ` Mario Smarduch
2014-10-15 11:17   ` Alexander Graf [this message]
2014-10-15 11:17     ` Alexander Graf
2014-09-23  0:54 ` [PATCH v11 2/6] KVM: Add generic implementation of kvm_vm_ioctl_get_dirty_log Mario Smarduch
2014-09-23  0:54   ` Mario Smarduch
2014-09-29 13:36   ` Christoffer Dall
2014-09-29 13:36     ` Christoffer Dall
2014-09-29 17:18   ` Cornelia Huck
2014-09-29 17:18     ` Cornelia Huck
2014-09-29 18:02     ` Mario Smarduch
2014-09-29 18:02       ` Mario Smarduch
2014-10-15 11:21   ` Alexander Graf
2014-10-15 11:21     ` Alexander Graf
2014-09-23  0:54 ` [PATCH v11 3/6] arm: KVM: Add ARMv7 API to flush TLBs Mario Smarduch
2014-09-23  0:54   ` Mario Smarduch
2014-09-23  0:54 ` [PATCH v11 4/6] arm: KVM: Add initial dirty page locking infrastructure Mario Smarduch
2014-09-23  0:54   ` Mario Smarduch
2014-09-23  0:54 ` [PATCH v11 5/6] arm: KVM: dirty log read write protect support Mario Smarduch
2014-09-23  0:54   ` Mario Smarduch
2014-09-23  0:54 ` [PATCH v11 6/6] arm: KVM: ARMv7 dirty page logging 2nd stage page fault Mario Smarduch
2014-09-23  0:54   ` Mario Smarduch
2014-09-29 13:35   ` Christoffer Dall
2014-09-29 13:35     ` Christoffer Dall
2014-09-29 21:03     ` Mario Smarduch
2014-09-29 21:03       ` Mario Smarduch

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=543E57C5.5070205@suse.de \
    --to=agraf@suse.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.