ACK/cmnt: [PATCH 01/20] [Bionic] (upstream) KVM: PPC: Remove unused kvm_unmap_hva callback

Juerg Haefliger juerg.haefliger at canonical.com
Wed Mar 13 08:57:40 UTC 2019


Limited to power and supposedly tested by IBM. Ack'ing the whole series under
the assumption that SRU information will be added to the bug ticket:

Acked-by: Juerg Haefliger <juergh at canonical.com>

Comments:
- The thread is messed up, the parent should be the cover letter (PATCH 00/20).
- Please do not add '(upstream)' to the patch subjects. The patches are from
  the mainline tree and we will need to delete that prefix from all patches
  before committing them.
- Please do not add 'v4.19' to the 'cherry picked from commit' lines. These are
  all commits from Linus' (mainline) tree, so there is no need to add an
  upstream reference (and v4.19 is not a valid reference anyways). We only need
  that if the commit comes from a different repo (like linux-stable or
  linux-next or something).
- Please add SRU information to https://bugs.launchpad.net/bugs/1788098. See:
  https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template
- Lastly, you probably don't want to cc the upstream authors for all of these patches.

...Juerg


On Mon, 11 Mar 2019 18:39:48 -0300
Leonardo Bras <leonardo at linux.ibm.com> wrote:

> From: Paul Mackerras <paulus at ozlabs.org>
> 
> BugLink: https://bugs.launchpad.net/bugs/1788098
> 
> Since commit fb1522e099f0 ("KVM: update to new mmu_notifier semantic
> v2", 2017-08-31), the MMU notifier code in KVM no longer calls the
> kvm_unmap_hva callback.  This removes the PPC implementations of
> kvm_unmap_hva().
> 
> Signed-off-by: Paul Mackerras <paulus at ozlabs.org>
> (cherry picked from commit 39c983ea0f96a270d4876c4148e3bb2d9cd3294f v4.19)
> Signed-off-by: Leonardo Bras <leonardo at linux.ibm.com>
> ---
>  arch/powerpc/include/asm/kvm_host.h |  1 -
>  arch/powerpc/include/asm/kvm_ppc.h  |  1 -
>  arch/powerpc/kvm/book3s.c           |  6 ------
>  arch/powerpc/kvm/book3s.h           |  1 -
>  arch/powerpc/kvm/book3s_64_mmu_hv.c |  9 ---------
>  arch/powerpc/kvm/book3s_64_vio_hv.c |  2 +-
>  arch/powerpc/kvm/book3s_hv.c        |  1 -
>  arch/powerpc/kvm/book3s_pr.c        | 10 ----------
>  arch/powerpc/kvm/e500_mmu_host.c    |  2 +-
>  arch/powerpc/kvm/trace_pr.h         | 15 ---------------
>  10 files changed, 2 insertions(+), 46 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
> index ab1b968371ef..a7d69db8d37a 100644
> --- a/arch/powerpc/include/asm/kvm_host.h
> +++ b/arch/powerpc/include/asm/kvm_host.h
> @@ -60,7 +60,6 @@
>  
>  #define KVM_ARCH_WANT_MMU_NOTIFIER
>  
> -extern int kvm_unmap_hva(struct kvm *kvm, unsigned long hva);
>  extern int kvm_unmap_hva_range(struct kvm *kvm,
>  			       unsigned long start, unsigned long end);
>  extern int kvm_age_hva(struct kvm *kvm, unsigned long start, unsigned long end);
> diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
> index 28c203003519..8ddc9fd1171e 100644
> --- a/arch/powerpc/include/asm/kvm_ppc.h
> +++ b/arch/powerpc/include/asm/kvm_ppc.h
> @@ -295,7 +295,6 @@ struct kvmppc_ops {
>  				     const struct kvm_userspace_memory_region *mem,
>  				     const struct kvm_memory_slot *old,
>  				     const struct kvm_memory_slot *new);
> -	int (*unmap_hva)(struct kvm *kvm, unsigned long hva);
>  	int (*unmap_hva_range)(struct kvm *kvm, unsigned long start,
>  			   unsigned long end);
>  	int (*age_hva)(struct kvm *kvm, unsigned long start, unsigned long end);
> diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
> index 72d977e30952..b5c92c00a99b 100644
> --- a/arch/powerpc/kvm/book3s.c
> +++ b/arch/powerpc/kvm/book3s.c
> @@ -799,12 +799,6 @@ void kvmppc_core_commit_memory_region(struct kvm *kvm,
>  	kvm->arch.kvm_ops->commit_memory_region(kvm, mem, old, new);
>  }
>  
> -int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
> -{
> -	return kvm->arch.kvm_ops->unmap_hva(kvm, hva);
> -}
> -EXPORT_SYMBOL_GPL(kvm_unmap_hva);
> -
>  int kvm_unmap_hva_range(struct kvm *kvm, unsigned long start, unsigned long end)
>  {
>  	return kvm->arch.kvm_ops->unmap_hva_range(kvm, start, end);
> diff --git a/arch/powerpc/kvm/book3s.h b/arch/powerpc/kvm/book3s.h
> index d2b3ec088b8c..4ad5e287b8bc 100644
> --- a/arch/powerpc/kvm/book3s.h
> +++ b/arch/powerpc/kvm/book3s.h
> @@ -14,7 +14,6 @@
>  
>  extern void kvmppc_core_flush_memslot_hv(struct kvm *kvm,
>  					 struct kvm_memory_slot *memslot);
> -extern int kvm_unmap_hva_hv(struct kvm *kvm, unsigned long hva);
>  extern int kvm_unmap_hva_range_hv(struct kvm *kvm, unsigned long start,
>  				  unsigned long end);
>  extern int kvm_age_hva_hv(struct kvm *kvm, unsigned long start,
> diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> index ef243fed2f2b..a670fa5fbe50 100644
> --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
> @@ -877,15 +877,6 @@ static int kvm_unmap_rmapp(struct kvm *kvm, struct kvm_memory_slot *memslot,
>  	return 0;
>  }
>  
> -int kvm_unmap_hva_hv(struct kvm *kvm, unsigned long hva)
> -{
> -	hva_handler_fn handler;
> -
> -	handler = kvm_is_radix(kvm) ? kvm_unmap_radix : kvm_unmap_rmapp;
> -	kvm_handle_hva(kvm, hva, handler);
> -	return 0;
> -}
> -
>  int kvm_unmap_hva_range_hv(struct kvm *kvm, unsigned long start, unsigned long end)
>  {
>  	hva_handler_fn handler;
> diff --git a/arch/powerpc/kvm/book3s_64_vio_hv.c b/arch/powerpc/kvm/book3s_64_vio_hv.c
> index 648cf6c01348..eeb9e6651cc4 100644
> --- a/arch/powerpc/kvm/book3s_64_vio_hv.c
> +++ b/arch/powerpc/kvm/book3s_64_vio_hv.c
> @@ -452,7 +452,7 @@ long kvmppc_rm_h_put_tce_indirect(struct kvm_vcpu *vcpu,
>  
>  		/*
>  		 * Synchronize with the MMU notifier callbacks in
> -		 * book3s_64_mmu_hv.c (kvm_unmap_hva_hv etc.).
> +		 * book3s_64_mmu_hv.c (kvm_unmap_hva_range_hv etc.).
>  		 * While we have the rmap lock, code running on other CPUs
>  		 * cannot finish unmapping the host real page that backs
>  		 * this guest real page, so we are OK to access the host
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index 0c8a655c2e5d..de214f289ef1 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -4387,7 +4387,6 @@ static struct kvmppc_ops kvm_ops_hv = {
>  	.flush_memslot  = kvmppc_core_flush_memslot_hv,
>  	.prepare_memory_region = kvmppc_core_prepare_memory_region_hv,
>  	.commit_memory_region  = kvmppc_core_commit_memory_region_hv,
> -	.unmap_hva = kvm_unmap_hva_hv,
>  	.unmap_hva_range = kvm_unmap_hva_range_hv,
>  	.age_hva  = kvm_age_hva_hv,
>  	.test_age_hva = kvm_test_age_hva_hv,
> diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
> index 7deaeeb14b93..f15c6699f113 100644
> --- a/arch/powerpc/kvm/book3s_pr.c
> +++ b/arch/powerpc/kvm/book3s_pr.c
> @@ -279,15 +279,6 @@ static void do_kvm_unmap_hva(struct kvm *kvm, unsigned long start,
>  	}
>  }
>  
> -static int kvm_unmap_hva_pr(struct kvm *kvm, unsigned long hva)
> -{
> -	trace_kvm_unmap_hva(hva);
> -
> -	do_kvm_unmap_hva(kvm, hva, hva + PAGE_SIZE);
> -
> -	return 0;
> -}
> -
>  static int kvm_unmap_hva_range_pr(struct kvm *kvm, unsigned long start,
>  				  unsigned long end)
>  {
> @@ -1775,7 +1766,6 @@ static struct kvmppc_ops kvm_ops_pr = {
>  	.flush_memslot = kvmppc_core_flush_memslot_pr,
>  	.prepare_memory_region = kvmppc_core_prepare_memory_region_pr,
>  	.commit_memory_region = kvmppc_core_commit_memory_region_pr,
> -	.unmap_hva = kvm_unmap_hva_pr,
>  	.unmap_hva_range = kvm_unmap_hva_range_pr,
>  	.age_hva  = kvm_age_hva_pr,
>  	.test_age_hva = kvm_test_age_hva_pr,
> diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
> index 423b21393bc9..c878b4ffb86f 100644
> --- a/arch/powerpc/kvm/e500_mmu_host.c
> +++ b/arch/powerpc/kvm/e500_mmu_host.c
> @@ -724,7 +724,7 @@ int kvmppc_load_last_inst(struct kvm_vcpu *vcpu, enum instruction_type type,
>  
>  /************* MMU Notifiers *************/
>  
> -int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
> +static int kvm_unmap_hva(struct kvm *kvm, unsigned long hva)
>  {
>  	trace_kvm_unmap_hva(hva);
>  
> diff --git a/arch/powerpc/kvm/trace_pr.h b/arch/powerpc/kvm/trace_pr.h
> index 85785a370c0e..2f9a8829552b 100644
> --- a/arch/powerpc/kvm/trace_pr.h
> +++ b/arch/powerpc/kvm/trace_pr.h
> @@ -254,21 +254,6 @@ TRACE_EVENT(kvm_exit,
>  		)
>  );
>  
> -TRACE_EVENT(kvm_unmap_hva,
> -	TP_PROTO(unsigned long hva),
> -	TP_ARGS(hva),
> -
> -	TP_STRUCT__entry(
> -		__field(	unsigned long,	hva		)
> -	),
> -
> -	TP_fast_assign(
> -		__entry->hva		= hva;
> -	),
> -
> -	TP_printk("unmap hva 0x%lx\n", __entry->hva)
> -);
> -
>  #endif /* _TRACE_KVM_H */
>  
>  /* This part must be outside protection */

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20190313/fe629c74/attachment.sig>


More information about the kernel-team mailing list