Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202511250700.kAutzJFm-lkp@intel.com/
Link: https://msgid.link/20251124235409.1731253-1-oupton@kernel.org
Signed-off-by: Oliver Upton <oupton@kernel.org>

+7
+7
arch/arm64/kvm/at.c
··· 1697 1697 } 1698 1698 } 1699 1699 1700 + #ifdef CONFIG_ARM64_LSE_ATOMICS 1700 1701 static int __lse_swap_desc(u64 __user *ptep, u64 old, u64 new) 1701 1702 { 1702 1703 u64 tmp = old; ··· 1722 1721 1723 1722 return ret; 1724 1723 } 1724 + #else 1725 + static int __lse_swap_desc(u64 __user *ptep, u64 old, u64 new) 1726 + { 1727 + return -EINVAL; 1728 + } 1729 + #endif 1725 1730 1726 1731 static int __llsc_swap_desc(u64 __user *ptep, u64 old, u64 new) 1727 1732 {