[Letux-kernel] Bug with KVM: arm64: Avoid setting the upper 32 bits of TCR_EL2 and CPTR_EL2 to 1
H. Nikolaus Schaller
hns at goldelico.com
Wed Dec 15 19:40:02 CET 2021
this seems to break build of 5.10.y (and maybe earlier) for me:
CALL scripts/checksyscalls.sh - due to target missing
CALL scripts/atomic/check-atomics.sh - due to target missing
CHK include/generated/compile.h
AS arch/arm64/kvm/hyp/nvhe/hyp-init.nvhe.o - due to target missing
arch/arm64/kvm/hyp/nvhe/hyp-init.S: Assembler messages:
arch/arm64/kvm/hyp/nvhe/hyp-init.S:87: Error: missing ')'
arch/arm64/kvm/hyp/nvhe/hyp-init.S:87: Error: missing ')'
arch/arm64/kvm/hyp/nvhe/hyp-init.S:87: Error: missing ')'
arch/arm64/kvm/hyp/nvhe/hyp-init.S:87: Error: missing ')'
arch/arm64/kvm/hyp/nvhe/hyp-init.S:87: Error: missing ')'
arch/arm64/kvm/hyp/nvhe/hyp-init.S:87: Error: missing ')'
arch/arm64/kvm/hyp/nvhe/hyp-init.S:87: Error: unexpected characters following instruction at operand 2 -- `mov x1,#((1U<<31)|(1<<23))'
arch/arm64/kvm/hyp/nvhe/Makefile:28: recipe for target 'arch/arm64/kvm/hyp/nvhe/hyp-init.nvhe.o' failed
make[5]: *** [arch/arm64/kvm/hyp/nvhe/hyp-init.nvhe.o] Error 1
scripts/Makefile.build:497: recipe for target 'arch/arm64/kvm/hyp/nvhe' failed
make[4]: *** [arch/arm64/kvm/hyp/nvhe] Error 2
scripts/Makefile.build:497: recipe for target 'arch/arm64/kvm/hyp' failed
make[3]: *** [arch/arm64/kvm/hyp] Error 2
scripts/Makefile.build:497: recipe for target 'arch/arm64/kvm' failed
make[2]: *** [arch/arm64/kvm] Error 2
Makefile:1822: recipe for target 'arch/arm64' failed
make[1]: *** [arch/arm64] Error 2
Makefile:336: recipe for target '__build_one_by_one' failed
make: *** [__build_one_by_one] Error 2
Looking at the problematic line 87 of hyp-init.S shows that
there is a macro expansion:
mov x1, #TCR_EL2_RES1
This macro was modified by the $subject patch
(commit c71b5f37b5ff1a673b2e4a91d1b34ea027546e23 in v5.10.y)
and reverting the patch makes the compile succeed.
Now: why does it build for me for v5.15.y and v5.16-rc5?
I think it is because my build system switches to gcc 6.3
instead of gcc 4.9 depending on scripts/min-tool-version.sh.
So I assume that the fix is not compatible with the minimum
requirement for 5.10.y of gcc 4.9 (or even less - I don't know exactly).
Earlier kernels may also be affected if $subject patch was also
backported there, but I have not tested.
This should somehow be fixed so that arch/arm64/include/asm/kvm_arm.h
can be included by older assemblers.
BR and thanks,
Nikolaus Schaller
More information about the Letux-kernel
mailing list