[pkvm] arm64: kvm: Fix stage2 pgtable build in EL2 object

Currently, pgtable.c is compiled twice: in the host kernel image as well
as the EL2 hyp object, but the code for stage2 manipulation is only used
by the host kernel (for now), and is mostly dead code at EL2. However,
with Clang and recent GCC versions, linking the EL2 object fails because
of an undefined reference to __flush_dcache_area in the stage2 paths.

Fix this by providing an implementation of __flush_dcache_area() at hyp.
The alternative would be to compile all of cache.S directly in the EL2
object, but that would pull additional dependencies and code with no
users, so let's keep it simple.

Signed-off-by: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <willdeacon@google.com>
3 files changed