diff mbox series

[v1,2/2] KVM: arm64: removed unused kern_hyp_va asm macro

Message ID 20240208105422.3444159-3-joey.gouly@arm.com (mailing list archive)
State New, archived
Headers show
Series small kern_hyp_va() cleanups | expand

Commit Message

Joey Gouly Feb. 8, 2024, 10:54 a.m. UTC
The last usage of this macro was removed in:
    commit 5dc33bd199ca ("KVM: arm64: nVHE: Pass pointers consistently to hyp-init")

Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
---
 arch/arm64/include/asm/kvm_mmu.h | 21 ---------------------
 1 file changed, 21 deletions(-)

Comments

Marc Zyngier Feb. 8, 2024, 12:42 p.m. UTC | #1
On Thu, 08 Feb 2024 10:54:22 +0000,
Joey Gouly <joey.gouly@arm.com> wrote:
> 
> The last usage of this macro was removed in:
>     commit 5dc33bd199ca ("KVM: arm64: nVHE: Pass pointers consistently to hyp-init")
> 
> Signed-off-by: Joey Gouly <joey.gouly@arm.com>
> Cc: Marc Zyngier <maz@kernel.org>
> Cc: Oliver Upton <oliver.upton@linux.dev>
> ---
>  arch/arm64/include/asm/kvm_mmu.h | 21 ---------------------
>  1 file changed, 21 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
> index d248a7ae627a..961d4431654b 100644
> --- a/arch/arm64/include/asm/kvm_mmu.h
> +++ b/arch/arm64/include/asm/kvm_mmu.h
> @@ -53,27 +53,6 @@
>  
>  #include <asm/alternative.h>
>  
> -/*
> - * Convert a kernel VA into a HYP VA.
> - * reg: VA to be converted.
> - *
> - * The actual code generation takes place in kvm_update_va_mask, and
> - * the instructions below are only there to reserve the space and
> - * perform the register allocation (kvm_update_va_mask uses the
> - * specific registers encoded in the instructions).

Consider moving this comment to the C version instead of deleting it
completely (the part about the register allocation is pretty crucial).

Oliver can probably fix this when applying it, and my previous Ack
still stands.

	M.
Oliver Upton Feb. 8, 2024, 1:28 p.m. UTC | #2
On Thu, Feb 08, 2024 at 12:42:25PM +0000, Marc Zyngier wrote:
> On Thu, 08 Feb 2024 10:54:22 +0000,
> Joey Gouly <joey.gouly@arm.com> wrote:
> > 
> > The last usage of this macro was removed in:
> >     commit 5dc33bd199ca ("KVM: arm64: nVHE: Pass pointers consistently to hyp-init")
> > 
> > Signed-off-by: Joey Gouly <joey.gouly@arm.com>
> > Cc: Marc Zyngier <maz@kernel.org>
> > Cc: Oliver Upton <oliver.upton@linux.dev>
> > ---
> >  arch/arm64/include/asm/kvm_mmu.h | 21 ---------------------
> >  1 file changed, 21 deletions(-)
> > 
> > diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
> > index d248a7ae627a..961d4431654b 100644
> > --- a/arch/arm64/include/asm/kvm_mmu.h
> > +++ b/arch/arm64/include/asm/kvm_mmu.h
> > @@ -53,27 +53,6 @@
> >  
> >  #include <asm/alternative.h>
> >  
> > -/*
> > - * Convert a kernel VA into a HYP VA.
> > - * reg: VA to be converted.
> > - *
> > - * The actual code generation takes place in kvm_update_va_mask, and
> > - * the instructions below are only there to reserve the space and
> > - * perform the register allocation (kvm_update_va_mask uses the
> > - * specific registers encoded in the instructions).
> 
> Consider moving this comment to the C version instead of deleting it
> completely (the part about the register allocation is pretty crucial).
> 
> Oliver can probably fix this when applying it, and my previous Ack
> still stands.

Yeah -- this comment is still rather useful. I'll fix it up when I apply
the series.
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h
index d248a7ae627a..961d4431654b 100644
--- a/arch/arm64/include/asm/kvm_mmu.h
+++ b/arch/arm64/include/asm/kvm_mmu.h
@@ -53,27 +53,6 @@ 
 
 #include <asm/alternative.h>
 
-/*
- * Convert a kernel VA into a HYP VA.
- * reg: VA to be converted.
- *
- * The actual code generation takes place in kvm_update_va_mask, and
- * the instructions below are only there to reserve the space and
- * perform the register allocation (kvm_update_va_mask uses the
- * specific registers encoded in the instructions).
- */
-.macro kern_hyp_va	reg
-#ifndef __KVM_VHE_HYPERVISOR__
-alternative_cb ARM64_ALWAYS_SYSTEM, kvm_update_va_mask
-	and     \reg, \reg, #1		/* mask with va_mask */
-	ror	\reg, \reg, #1		/* rotate to the first tag bit */
-	add	\reg, \reg, #0		/* insert the low 12 bits of the tag */
-	add	\reg, \reg, #0, lsl 12	/* insert the top 12 bits of the tag */
-	ror	\reg, \reg, #63		/* rotate back */
-alternative_cb_end
-#endif
-.endm
-
 /*
  * Convert a hypervisor VA to a PA
  * reg: hypervisor address to be converted in place