Skip to content

Commit

Permalink
KVM: arm64: Fix symbol dependency in __hyp_call_panic_nvhe
Browse files Browse the repository at this point in the history
[ Upstream commit b38b298 ]

__hyp_call_panic_nvhe contains inline assembly which did not declare
its dependency on the __hyp_panic_string symbol.

The static-declared string has previously been kept alive because of a use in
__hyp_call_panic_vhe. Fix this in preparation for separating the source files
between VHE and nVHE when the two users land in two different compilation
units. The static variable otherwise gets dropped when compiling the nVHE
source file, causing an undefined symbol linker error later.

Signed-off-by: David Brazdil <dbrazdil@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20200625131420.71444-2-dbrazdil@google.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
davidbrazdil authored and gregkh committed Sep 3, 2020
1 parent a84a6eb commit 653ae33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm64/kvm/hyp/switch.c
Expand Up @@ -754,7 +754,7 @@ static void __hyp_text __hyp_call_panic_nvhe(u64 spsr, u64 elr, u64 par,
* making sure it is a kernel address and not a PC-relative
* reference.
*/
asm volatile("ldr %0, =__hyp_panic_string" : "=r" (str_va));
asm volatile("ldr %0, =%1" : "=r" (str_va) : "S" (__hyp_panic_string));

__hyp_do_panic(str_va,
spsr, elr,
Expand Down

0 comments on commit 653ae33

Please sign in to comment.