[PATCH v5 2/8] KVM: arm64: Fix __pkvm_init_switch_pgd call ABI

Will Deacon will at kernel.org
Thu Jun 20 04:37:35 PDT 2024


On Mon, Jun 10, 2024 at 07:32:31AM +0100, Pierre-Clément Tosi wrote:
> Fix the mismatch between the (incorrect) C signature, C call site, and
> asm implementation by aligning all three on an API passing the
> parameters (pgd and SP) separately, instead of as a bundled struct.
> 
> Remove the now unnecessary memory accesses while the MMU is off from the
> asm, which simplifies the C caller (as it does not need to convert a VA
> struct pointer to PA) and makes the code slightly more robust by
> offsetting the struct fields from C and properly expressing the call to
> the C compiler (e.g. type checker and kCFI).
> 
> Fixes: f320bc742bc2 ("KVM: arm64: Prepare the creation of s1 mappings at EL2")
> Signed-off-by: Pierre-Clément Tosi <ptosi at google.com>
> ---
>  arch/arm64/include/asm/kvm_hyp.h   |  4 ++--
>  arch/arm64/kvm/hyp/nvhe/hyp-init.S | 24 +++++++++++++-----------
>  arch/arm64/kvm/hyp/nvhe/setup.c    |  4 ++--
>  3 files changed, 17 insertions(+), 15 deletions(-)

Acked-by: Will Deacon <will at kernel.org>

Will



More information about the linux-arm-kernel mailing list