Skip to contentSkip to conversation

KVM: arm64: Fix compilation when CONFIG_ARM64_USE_LSE_ATOMICS=n

PATCH Applied Oliver Upton 1 participant 2 messages Nov 24, 2025

Subsystems (2)
lore
Share & tools
lore

Oliver Upton

author maintainer
#0 lore raw

PATCH 1/1 KVM: arm64: Fix compilation when CONFIG_ARM64_USE_LSE_ATOMICS=n

__lse_swap_desc() is compiled unconditionally, even if LSE is disabled using the config option. Align with the spirit of the config option and fix some build errors due to __LSE_PREAMBLE being undefined with the application of some ifdeffery.

---
 arch/arm64/kvm/at.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm64/kvm/at.c +7 -0
index e39f814d247f..f774a02d9393 100644
@@ -1697,6 +1697,7 @@ int __kvm_find_s1_desc_level(struct kvm_vcpu *vcpu, u64 va, u64 ipa, int *level)
 	}
 }
 
+#ifdef CONFIG_ARM64_LSE_ATOMICS
 static int __lse_swap_desc(u64 __user *ptep, u64 old, u64 new)
 {
 	u64 tmp = old;
@@ -1721,6 +1722,12 @@ static int __lse_swap_desc(u64 __user *ptep, u64 old, u64 new)
 
 	return ret;
 }
+#else
+static int __lse_swap_desc(u64 __user *ptep, u64 old, u64 new)
+{
+	return -EINVAL;
+}
+#endif
 
 static int __llsc_swap_desc(u64 __user *ptep, u64 old, u64 new)
 {
Signature · 1 line
2.47.3
author maintainer Applied
#1 lore raw
Quoted 6 lines · Oliver Upton

__lse_swap_desc() is compiled unconditionally, even if LSE is disabled using the config option. Align with the spirit of the config option and fix some build errors due to __LSE_PREAMBLE being undefined with the application of some ifdeffery.

Applied to next, thanks!

[1/1] KVM: arm64: Fix compilation when CONFIG_ARM64_USE_LSE_ATOMICS=n

      https://git.kernel.org/kvmarm/kvmarm/c/3350cbbc8f7d

--
Best,
Oliver