linux-next: manual merge of the kvm-arm tree with the arm64 tree

Message ID 20230206124451.11532a04@canb.auug.org.au
State New
Headers
Series linux-next: manual merge of the kvm-arm tree with the arm64 tree |

Commit Message

Stephen Rothwell Feb. 6, 2023, 1:44 a.m. UTC
  Hi all,

Today's linux-next merge of the kvm-arm tree got a conflict in:

  arch/arm64/kernel/hyp-stub.S

between commit:

  f122576f3533 ("arm64/sme: Enable host kernel to access ZT0")

from the arm64 tree and commit:

  e2d4f5ae1771 ("KVM: arm64: Introduce finalise_el2_state macro")

from the kvm-arm tree.

I fixed it up (the code modified by the former was moved by the latter,
so I applied the following merge fix patch) and can carry the fix as
necessary. This is now fixed as far as linux-next is concerned, but any
non trivial conflicts should be mentioned to your upstream maintainer
when your tree is submitted for merging.  You may also want to consider
cooperating with the maintainer of the conflicting tree to minimise any
particularly complex conflicts.

I hope I got this right :-)

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 6 Feb 2023 12:40:16 +1100
Subject: [PATCH] fix up for "KVM: arm64: Introduce finalise_el2_state macro"

interacting with "arm64/sme: Enable host kernel to access ZT0"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/arm64/include/asm/el2_setup.h | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Stephen Rothwell Feb. 6, 2023, 4:21 a.m. UTC | #1
Hi all,

On Mon, 6 Feb 2023 12:44:51 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> Today's linux-next merge of the kvm-arm tree got a conflict in:
> 
>   arch/arm64/kernel/hyp-stub.S
> 
> between commit:
> 
>   f122576f3533 ("arm64/sme: Enable host kernel to access ZT0")
> 
> from the arm64 tree and commit:
> 
>   e2d4f5ae1771 ("KVM: arm64: Introduce finalise_el2_state macro")
> 
> from the kvm-arm tree.
> 
> I fixed it up (the code modified by the former was moved by the latter,
> so I applied the following merge fix patch) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.
> 
> I hope I got this right :-)
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Mon, 6 Feb 2023 12:40:16 +1100
> Subject: [PATCH] fix up for "KVM: arm64: Introduce finalise_el2_state macro"
> 
> interacting with "arm64/sme: Enable host kernel to access ZT0"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  arch/arm64/include/asm/el2_setup.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h
> index 0bd6ed77e4a5..5f821e5c52a9 100644
> --- a/arch/arm64/include/asm/el2_setup.h
> +++ b/arch/arm64/include/asm/el2_setup.h
> @@ -269,6 +269,12 @@
>  	orr	x0, x0, SMCR_ELx_FA64_MASK
>  .Lskip_sme_fa64_\@:
>  
> +	// ZT0 available?
> +	__check_override id_aa64smfr0 ID_AA64SMFR0_EL1_SMEver_SHIFT 4 .Linit_sme_zt0_\@ .Lskip_sme_zt0_\@
> +.Linit_sme_zt0_\@:
> +	orr	x0, x0, SMCR_ELx_EZT0_MASK
> +.Lskip_sme_zt0_\@:
> +
>  	orr	x0, x0, #SMCR_ELx_LEN_MASK	// Enable full SME vector
>  	msr_s	SYS_SMCR_EL2, x0		// length for EL1.
>  

I got it wrong, of course :-)

I have added the following fix up patch (and will combine the 2 from
tomorrow):

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 6 Feb 2023 15:05:33 +1100
Subject: [PATCH] fix for "fix up for "KVM: arm64: Introduce finalise_el2_state macro""

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/arm64/include/asm/el2_setup.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h
index 5f821e5c52a9..f5b608758741 100644
--- a/arch/arm64/include/asm/el2_setup.h
+++ b/arch/arm64/include/asm/el2_setup.h
@@ -270,7 +270,7 @@
 .Lskip_sme_fa64_\@:
 
 	// ZT0 available?
-	__check_override id_aa64smfr0 ID_AA64SMFR0_EL1_SMEver_SHIFT 4 .Linit_sme_zt0_\@ .Lskip_sme_zt0_\@
+	__check_override id_aa64smfr0, ID_AA64SMFR0_EL1_SMEver_SHIFT, 4, .Linit_sme_zt0_\@, .Lskip_sme_zt0_\@, x1, x2
 .Linit_sme_zt0_\@:
 	orr	x0, x0, SMCR_ELx_EZT0_MASK
 .Lskip_sme_zt0_\@:
  
Marc Zyngier Feb. 6, 2023, 8:37 a.m. UTC | #2
On Mon, 06 Feb 2023 01:44:51 +0000,
Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> [1  <text/plain; US-ASCII (quoted-printable)>]
> Hi all,
> 
> Today's linux-next merge of the kvm-arm tree got a conflict in:
> 
>   arch/arm64/kernel/hyp-stub.S
> 
> between commit:
> 
>   f122576f3533 ("arm64/sme: Enable host kernel to access ZT0")
> 
> from the arm64 tree and commit:
> 
>   e2d4f5ae1771 ("KVM: arm64: Introduce finalise_el2_state macro")
> 
> from the kvm-arm tree.
> 
> I fixed it up (the code modified by the former was moved by the latter,
> so I applied the following merge fix patch) and can carry the fix as
> necessary. This is now fixed as far as linux-next is concerned, but any
> non trivial conflicts should be mentioned to your upstream maintainer
> when your tree is submitted for merging.  You may also want to consider
> cooperating with the maintainer of the conflicting tree to minimise any
> particularly complex conflicts.
> 
> I hope I got this right :-)

Thanks for giving it a go!

Catalin, we'll probably end-up taking the arm64/for-next/tpidr2 branch
into the kvmarm tree in order to minimise the damage.

Please shout if you want to solve this the other way around (taking
the finalise_el2_state refactoring in the arm64 tree).

	M.
  
Marc Zyngier Feb. 6, 2023, 8:43 a.m. UTC | #3
On Mon, 06 Feb 2023 08:37:35 +0000,
Marc Zyngier <maz@kernel.org> wrote:
> 
> On Mon, 06 Feb 2023 01:44:51 +0000,
> Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> > 
> > [1  <text/plain; US-ASCII (quoted-printable)>]
> > Hi all,
> > 
> > Today's linux-next merge of the kvm-arm tree got a conflict in:
> > 
> >   arch/arm64/kernel/hyp-stub.S
> > 
> > between commit:
> > 
> >   f122576f3533 ("arm64/sme: Enable host kernel to access ZT0")
> > 
> > from the arm64 tree and commit:
> > 
> >   e2d4f5ae1771 ("KVM: arm64: Introduce finalise_el2_state macro")
> > 
> > from the kvm-arm tree.
> > 
> > I fixed it up (the code modified by the former was moved by the latter,
> > so I applied the following merge fix patch) and can carry the fix as
> > necessary. This is now fixed as far as linux-next is concerned, but any
> > non trivial conflicts should be mentioned to your upstream maintainer
> > when your tree is submitted for merging.  You may also want to consider
> > cooperating with the maintainer of the conflicting tree to minimise any
> > particularly complex conflicts.
> > 
> > I hope I got this right :-)
> 
> Thanks for giving it a go!
> 
> Catalin, we'll probably end-up taking the arm64/for-next/tpidr2 branch
> into the kvmarm tree in order to minimise the damage.

Scratch that, it is the sme2 branch.

	M.
  

Patch

diff --git a/arch/arm64/include/asm/el2_setup.h b/arch/arm64/include/asm/el2_setup.h
index 0bd6ed77e4a5..5f821e5c52a9 100644
--- a/arch/arm64/include/asm/el2_setup.h
+++ b/arch/arm64/include/asm/el2_setup.h
@@ -269,6 +269,12 @@ 
 	orr	x0, x0, SMCR_ELx_FA64_MASK
 .Lskip_sme_fa64_\@:
 
+	// ZT0 available?
+	__check_override id_aa64smfr0 ID_AA64SMFR0_EL1_SMEver_SHIFT 4 .Linit_sme_zt0_\@ .Lskip_sme_zt0_\@
+.Linit_sme_zt0_\@:
+	orr	x0, x0, SMCR_ELx_EZT0_MASK
+.Lskip_sme_zt0_\@:
+
 	orr	x0, x0, #SMCR_ELx_LEN_MASK	// Enable full SME vector
 	msr_s	SYS_SMCR_EL2, x0		// length for EL1.