Skip to contentSkip to conversation

KVM: arm64: nvhe: Fix build failure with gcc

PATCH In review Aneesh Kumar K.V (Arm) 3 participants 4 messages Jun 10, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: arm64: nvhe: Fix build failure with gcc

Address a build failure encountered with aarch64-linux-gnu-gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)

/usr/bin/aarch64-linux-gnu-ld: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.o: in function `__clock_mult_uint128':
/linux/work/arch/arm64/kvm/hyp/nvhe/clock.c:27:(.hyp.text+0x120d8): undefined reference to __kvm_nvhe___lshrti3' /linux/work/arch/arm64/kvm/hyp/nvhe/clock.c:27:(.hyp.text+0x120d8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol __kvm_nvhe___lshrti3'

Similar to commit 9bfe7553fadb ("arm64: Implement __lshrti3 library function"), this change use the added helper.

Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Joey Gouly <[email protected]>
Cc Suzuki K Poulose <[email protected]>
Cc Zenghui Yu <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
---
 arch/arm64/kvm/hyp/nvhe/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/hyp/nvhe/Makefile +1 -1
index a76522d63c3e..3dd2c780bbfc 100644
@@ -17,7 +17,7 @@ ccflags-y += -fno-stack-protector	\
 hostprogs := gen-hyprel
 HOST_EXTRACFLAGS += -I$(objtree)/include
 
-lib-objs := clear_page.o copy_page.o memcpy.o memset.o
+lib-objs := clear_page.o copy_page.o memcpy.o memset.o tishift.o
 lib-objs := $(addprefix ../../../lib/, $(lib-objs))
 
 CFLAGS_switch.nvhe.o += -Wno-override-init
Signature · 1 line
2.43.0
#1 lore raw
Quoted 10 lines · Aneesh Kumar K.V (Arm)

Address a build failure encountered with aarch64-linux-gnu-gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)

/usr/bin/aarch64-linux-gnu-ld: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.o: in function `__clock_mult_uint128':
/linux/work/arch/arm64/kvm/hyp/nvhe/clock.c:27:(.hyp.text+0x120d8): undefined reference to __kvm_nvhe___lshrti3' /linux/work/arch/arm64/kvm/hyp/nvhe/clock.c:27:(.hyp.text+0x120d8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol __kvm_nvhe___lshrti3'

Similar to commit 9bfe7553fadb ("arm64: Implement __lshrti3 library function"), this change use the added helper.

This is with the pkvm tracefs patches found here https://lore.kernel.org/all/[email protected]

Quoted 30 lines
Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Joey Gouly <[email protected]>
Cc Suzuki K Poulose <[email protected]>
Cc Zenghui Yu <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
---
 arch/arm64/kvm/hyp/nvhe/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kvm/hyp/nvhe/Makefile +1 -1
index a76522d63c3e..3dd2c780bbfc 100644
@@ -17,7 +17,7 @@ ccflags-y += -fno-stack-protector	\
 hostprogs := gen-hyprel
 HOST_EXTRACFLAGS += -I$(objtree)/include
 
-lib-objs := clear_page.o copy_page.o memcpy.o memset.o
+lib-objs := clear_page.o copy_page.o memcpy.o memset.o tishift.o
 lib-objs := $(addprefix ../../../lib/, $(lib-objs))
 
 CFLAGS_switch.nvhe.o += -Wno-override-init
Signature · 1 line
2.43.0
maintainer
#2 lore raw
In reply to Aneesh Kumar K.V (Arm)
Quoted 7 lines · Aneesh Kumar K.V (Arm)

Address a build failure encountered with aarch64-linux-gnu-gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)

/usr/bin/aarch64-linux-gnu-ld: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.o: in function `__clock_mult_uint128':
/linux/work/arch/arm64/kvm/hyp/nvhe/clock.c:27:(.hyp.text+0x120d8): undefined reference to __kvm_nvhe___lshrti3' /linux/work/arch/arm64/kvm/hyp/nvhe/clock.c:27:(.hyp.text+0x120d8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol __kvm_nvhe___lshrti3'

$ ls -l arch/arm64/kvm/hyp/nvhe/clock.c
ls: cannot access 'arch/arm64/kvm/hyp/nvhe/clock.c': No such file or directory
Quoted 12 lines

Similar to commit 9bfe7553fadb ("arm64: Implement __lshrti3 library function"), this change use the added helper.

Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Joey Gouly <[email protected]>
Cc Suzuki K Poulose <[email protected]>
Cc Zenghui Yu <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Quoted 2 lines

What was recently introduced that triggers this? I'd like to understand what mandates it, and avoid it of at all possible.

	M.
Signature · 1 line
Jazz isn't dead. It just smells funny.
#3 lore raw
Quoted 6 lines · Marc Zyngier
Quoted 4 lines · Aneesh Kumar K.V (Arm)

Address a build failure encountered with aarch64-linux-gnu-gcc version 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04)

Quoted 6 lines
Quoted 3 lines

/usr/bin/aarch64-linux-gnu-ld: arch/arm64/kvm/hyp/nvhe/kvm_nvhe.o: in function `__clock_mult_uint128':
/linux/work/arch/arm64/kvm/hyp/nvhe/clock.c:27:(.hyp.text+0x120d8): undefined reference to __kvm_nvhe___lshrti3' /linux/work/arch/arm64/kvm/hyp/nvhe/clock.c:27:(.hyp.text+0x120d8): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol __kvm_nvhe___lshrti3'

$ ls -l arch/arm64/kvm/hyp/nvhe/clock.c
ls: cannot access 'arch/arm64/kvm/hyp/nvhe/clock.c': No such file or directory

Hum, this file is for the pKVM tracing support and is not upstream yet:

https://lore.kernel.org/all/[email protected]/

Quoted 24 lines
Quoted 13 lines

Similar to commit 9bfe7553fadb ("arm64: Implement __lshrti3 library function"), this change use the added helper.

Cc Marc Zyngier <[email protected]>
Cc Oliver Upton <[email protected]>
Cc Joey Gouly <[email protected]>
Cc Suzuki K Poulose <[email protected]>
Cc Zenghui Yu <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Will Deacon <[email protected]>
Quoted 2 lines

What was recently introduced that triggers this? I'd like to understand what mandates it, and avoid it of at all possible.

	M.
Signature · 1 line
Jazz isn't dead. It just smells funny.