All of lore.kernel.org
 help / color / mirror / Atom feed
From: christoffer.dall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
Date: Fri, 7 Nov 2014 21:20:41 +0100	[thread overview]
Message-ID: <20141107202041.GH22848@cbox> (raw)
In-Reply-To: <1412908447-28247-4-git-send-email-m.smarduch@samsung.com>

On Thu, Oct 09, 2014 at 07:34:07PM -0700, Mario Smarduch wrote:
> This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
> 
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
>  arch/arm/include/asm/kvm_host.h | 12 ------------
>  arch/arm/kvm/arm.c              |  9 ---------
>  arch/arm/kvm/mmu.c              | 17 +++++++++++------
>  arch/arm64/kvm/Kconfig          |  2 +-
>  4 files changed, 12 insertions(+), 28 deletions(-)
> 
> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> index 12311a5..59565f5 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -220,18 +220,6 @@ 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_arch_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/arm.c b/arch/arm/kvm/arm.c
> index 0546fa3..6a6fd6b 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>  				   const struct kvm_memory_slot *old,
>  				   enum kvm_mr_change change)
>  {
> -#ifdef CONFIG_ARM
>  	/*
>  	 * At this point memslot has been committed and there is an
>  	 * allocated dirty_bitmap[], dirty pages will be be tracked while the
> @@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>  	 */
>  	if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
>  		kvm_mmu_wp_memory_region(kvm, mem->slot);
> -#endif
>  }
>  
>  void kvm_arch_flush_shadow_all(struct kvm *kvm)
> @@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>  	}
>  }
>  
> -#ifdef CONFIG_ARM64
> -int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
> -{
> -	return -EINVAL;
> -}
> -#endif
> -
>  static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
>  					struct kvm_arm_device_addr *dev_addr)
>  {
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index df1a5a3..8c0f9f2 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
>  
>  static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
>  {
> -#ifdef CONFIG_ARM
>  	return !!memslot->dirty_bitmap;
> -#else
> -	return false;
> -#endif
> +}
> +
> +/**
> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
> + * @kvm:	pointer to kvm structure.
> + *
> + * Interface to HYP function to flush all VM TLB entries
> + */
> +inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
> +{
> +	kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>  }
>  
>  static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
> @@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
>  	return false;
>  }
>  
> -#ifdef CONFIG_ARM
>  /**
>   * stage2_wp_ptes - write protect PMD range
>   * @pmd:	pointer to pmd entry
> @@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
>  
>  	stage2_wp_range(kvm, start, end);
>  }
> -#endif
>  
>  static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>  			  struct kvm_memory_slot *memslot,
> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> index 40a8d19..a1a35809 100644
> --- a/arch/arm64/kvm/Kconfig
> +++ b/arch/arm64/kvm/Kconfig
> @@ -26,7 +26,7 @@ config KVM
>  	select KVM_ARM_HOST
>  	select KVM_ARM_VGIC
>  	select KVM_ARM_TIMER
> -	select HAVE_KVM_ARCH_DIRTY_LOG
> +	select HAVE_KVM_ARCH_TLB_FLUSH_ALL
>  	---help---
>  	  Support hosting virtualized guest machines.
>  
> -- 
> 1.9.1
> 

this patch needs to be rebased onto the newest version of your v7 patch,
but otherwise it looks roughly ok.

-Christoffer

WARNING: multiple messages have this Message-ID (diff)
From: Christoffer Dall <christoffer.dall@linaro.org>
To: Mario Smarduch <m.smarduch@samsung.com>
Cc: kvm@vger.kernel.org, marc.zyngier@arm.com,
	catalin.marinas@arm.com, gleb@kernel.org, pbonzini@redhat.com,
	kvmarm@lists.cs.columbia.edu,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code
Date: Fri, 7 Nov 2014 21:20:41 +0100	[thread overview]
Message-ID: <20141107202041.GH22848@cbox> (raw)
In-Reply-To: <1412908447-28247-4-git-send-email-m.smarduch@samsung.com>

On Thu, Oct 09, 2014 at 07:34:07PM -0700, Mario Smarduch wrote:
> This patch enables ARMv8 dirty page logging and unifies ARMv7/ARMv8 code.
> 
> Signed-off-by: Mario Smarduch <m.smarduch@samsung.com>
> ---
>  arch/arm/include/asm/kvm_host.h | 12 ------------
>  arch/arm/kvm/arm.c              |  9 ---------
>  arch/arm/kvm/mmu.c              | 17 +++++++++++------
>  arch/arm64/kvm/Kconfig          |  2 +-
>  4 files changed, 12 insertions(+), 28 deletions(-)
> 
> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> index 12311a5..59565f5 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -220,18 +220,6 @@ 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_arch_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/arm.c b/arch/arm/kvm/arm.c
> index 0546fa3..6a6fd6b 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -242,7 +242,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>  				   const struct kvm_memory_slot *old,
>  				   enum kvm_mr_change change)
>  {
> -#ifdef CONFIG_ARM
>  	/*
>  	 * At this point memslot has been committed and there is an
>  	 * allocated dirty_bitmap[], dirty pages will be be tracked while the
> @@ -250,7 +249,6 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
>  	 */
>  	if ((change != KVM_MR_DELETE) && (mem->flags & KVM_MEM_LOG_DIRTY_PAGES))
>  		kvm_mmu_wp_memory_region(kvm, mem->slot);
> -#endif
>  }
>  
>  void kvm_arch_flush_shadow_all(struct kvm *kvm)
> @@ -783,13 +781,6 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>  	}
>  }
>  
> -#ifdef CONFIG_ARM64
> -int kvm_arch_vm_ioctl_get_dirty_log(struct kvm *kvm, struct kvm_dirty_log *log)
> -{
> -	return -EINVAL;
> -}
> -#endif
> -
>  static int kvm_vm_ioctl_set_device_addr(struct kvm *kvm,
>  					struct kvm_arm_device_addr *dev_addr)
>  {
> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
> index df1a5a3..8c0f9f2 100644
> --- a/arch/arm/kvm/mmu.c
> +++ b/arch/arm/kvm/mmu.c
> @@ -49,11 +49,18 @@ static phys_addr_t hyp_idmap_vector;
>  
>  static bool kvm_get_logging_state(struct kvm_memory_slot *memslot)
>  {
> -#ifdef CONFIG_ARM
>  	return !!memslot->dirty_bitmap;
> -#else
> -	return false;
> -#endif
> +}
> +
> +/**
> + * kvm_arch_flush_remote_tlbs() - flush all VM TLB entries for ARMv7/8
> + * @kvm:	pointer to kvm structure.
> + *
> + * Interface to HYP function to flush all VM TLB entries
> + */
> +inline void kvm_arch_flush_remote_tlbs(struct kvm *kvm)
> +{
> +	kvm_call_hyp(__kvm_tlb_flush_vmid, kvm);
>  }
>  
>  static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa)
> @@ -769,7 +776,6 @@ static bool transparent_hugepage_adjust(pfn_t *pfnp, phys_addr_t *ipap)
>  	return false;
>  }
>  
> -#ifdef CONFIG_ARM
>  /**
>   * stage2_wp_ptes - write protect PMD range
>   * @pmd:	pointer to pmd entry
> @@ -917,7 +923,6 @@ void kvm_mmu_write_protect_pt_masked(struct kvm *kvm,
>  
>  	stage2_wp_range(kvm, start, end);
>  }
> -#endif
>  
>  static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
>  			  struct kvm_memory_slot *memslot,
> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
> index 40a8d19..a1a35809 100644
> --- a/arch/arm64/kvm/Kconfig
> +++ b/arch/arm64/kvm/Kconfig
> @@ -26,7 +26,7 @@ config KVM
>  	select KVM_ARM_HOST
>  	select KVM_ARM_VGIC
>  	select KVM_ARM_TIMER
> -	select HAVE_KVM_ARCH_DIRTY_LOG
> +	select HAVE_KVM_ARCH_TLB_FLUSH_ALL
>  	---help---
>  	  Support hosting virtualized guest machines.
>  
> -- 
> 1.9.1
> 

this patch needs to be rebased onto the newest version of your v7 patch,
but otherwise it looks roughly ok.

-Christoffer

  reply	other threads:[~2014-11-07 20:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10  2:34 [PATCH 0/3] arm/arm64: Add dirty page logging for ARMv8 Mario Smarduch
2014-10-10  2:34 ` Mario Smarduch
2014-10-10  2:34 ` [PATCH 1/3] arm64: ARMv8 headers changes for dirty page logging Mario Smarduch
2014-10-10  2:34   ` Mario Smarduch
2014-11-07 20:20   ` Christoffer Dall
2014-11-07 20:20     ` Christoffer Dall
2014-11-07 20:49     ` Mario Smarduch
2014-11-07 20:49       ` Mario Smarduch
2014-10-10  2:34 ` [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires Mario Smarduch
2014-10-10  2:34   ` Mario Smarduch
2014-11-07 20:20   ` Christoffer Dall
2014-11-07 20:20     ` Christoffer Dall
2014-11-07 20:50     ` Mario Smarduch
2014-11-07 20:50       ` Mario Smarduch
2014-10-10  2:34 ` [PATCH 3/3] arm/arm64: Enable Dirty Page logging for ARMv8 move log read, tlb flush to generic code Mario Smarduch
2014-10-10  2:34   ` Mario Smarduch
2014-11-07 20:20   ` Christoffer Dall [this message]
2014-11-07 20:20     ` Christoffer Dall
2014-11-07 20:51     ` Mario Smarduch
2014-11-07 20:51       ` Mario Smarduch
2014-11-19 14:39       ` Christoffer Dall
2014-11-19 14:39         ` Christoffer Dall
2014-11-19 20:15         ` Mario Smarduch
2014-11-19 20:15           ` Mario Smarduch
2014-11-21 10:09           ` Christoffer Dall
2014-11-21 10:09             ` Christoffer Dall
2014-11-22  0:42             ` Mario Smarduch
2014-11-22  0:42               ` 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=20141107202041.GH22848@cbox \
    --to=christoffer.dall@linaro.org \
    --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.