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

From: Stephen Rothwell
Date: Fri Jun 01 2018 - 02:14:11 EST


Hi all,

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

arch/arm64/include/asm/cpufeature.h

between commits:

a43ae4dfe56a ("arm64: Add 'ssbd' command-line option")
c32e1736ca03 ("arm64: ssbd: Add global mitigation state accessor")
647d0519b53f ("arm64: ssbd: Restore mitigation status on CPU resume")

from the arm64 tree and commit:

31dc52b3c8fa ("arm64/sve: Move read_zcr_features() out of cpufeature.h")

from the kvm-arm tree.

I fixed it up (see below) 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.

--
Cheers,
Stephen Rothwell

diff --cc arch/arm64/include/asm/cpufeature.h
index 55bc1f073bfb,0a6b7133195e..000000000000
--- a/arch/arm64/include/asm/cpufeature.h
+++ b/arch/arm64/include/asm/cpufeature.h
@@@ -510,55 -508,6 +508,28 @@@ static inline bool system_supports_sve(
cpus_have_const_cap(ARM64_SVE);
}

- /*
- * Read the pseudo-ZCR used by cpufeatures to identify the supported SVE
- * vector length.
- *
- * Use only if SVE is present.
- * This function clobbers the SVE vector length.
- */
- static inline u64 read_zcr_features(void)
- {
- u64 zcr;
- unsigned int vq_max;
-
- /*
- * Set the maximum possible VL, and write zeroes to all other
- * bits to see if they stick.
- */
- sve_kernel_enable(NULL);
- write_sysreg_s(ZCR_ELx_LEN_MASK, SYS_ZCR_EL1);
-
- zcr = read_sysreg_s(SYS_ZCR_EL1);
- zcr &= ~(u64)ZCR_ELx_LEN_MASK; /* find sticky 1s outside LEN field */
- vq_max = sve_vq_from_vl(sve_get_vl());
- zcr |= vq_max - 1; /* set LEN field to maximum effective value */
-
- return zcr;
- }
-
+#define ARM64_SSBD_UNKNOWN -1
+#define ARM64_SSBD_FORCE_DISABLE 0
+#define ARM64_SSBD_KERNEL 1
+#define ARM64_SSBD_FORCE_ENABLE 2
+#define ARM64_SSBD_MITIGATED 3
+
+static inline int arm64_get_ssbd_state(void)
+{
+#ifdef CONFIG_ARM64_SSBD
+ extern int ssbd_state;
+ return ssbd_state;
+#else
+ return ARM64_SSBD_UNKNOWN;
+#endif
+}
+
+#ifdef CONFIG_ARM64_SSBD
+void arm64_set_ssbd_mitigation(bool state);
+#else
+static inline void arm64_set_ssbd_mitigation(bool state) {}
+#endif
+
#endif /* __ASSEMBLY__ */

#endif

Attachment: pgpLrDJVgETRL.pgp
Description: OpenPGP digital signature