]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: pkvm: Simplify BTI handling on CPU boot
authorMarc Zyngier <maz@kernel.org>
Sat, 21 Mar 2026 21:24:16 +0000 (21:24 +0000)
committerMarc Zyngier <maz@kernel.org>
Mon, 23 Mar 2026 11:03:53 +0000 (11:03 +0000)
commit1536a0b1386850b67a9ea840e57b7b475e895fed
tree79bfb114ca3f13d5b8ae70d6479e07b81cede603
parent4ebfa3230b40728638a6acceb709f900f920f921
KVM: arm64: pkvm: Simplify BTI handling on CPU boot

In order to perform an indirect branch to kvm_host_psci_cpu_entry()
on a BTI-aware system, we first branch to a 'BTI j' landing pad,
and from there branch again to the target.

While this works, this is really not required:

- BLR works with 'BTI c' and 'PACIASP' as the landing pad

- Even if LR gets clobbered by BLR, we are going to restore the
  host's registers, so it is pointless to try and avoid touching
  LR

Given the above, drop the veneer and directly call into C code.
If we were to come back from it, we'd directly enter the error
handler.

Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260321212419.2803972-3-maz@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/host.S
arch/arm64/kvm/hyp/nvhe/hyp-init.S