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

From: Stephen Rothwell
Date: Sun Feb 05 2023 - 23:21:57 EST


Hi all,

On Mon, 6 Feb 2023 12:44:51 +1100 Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxx>
> 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@xxxxxxxxxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxx>
---
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_\@:
--
2.35.1

--
Cheers,
Stephen Rothwell

Attachment: pgpu166yXRXxx.pgp
Description: OpenPGP digital signature