summaryrefslogtreecommitdiff
path: root/arch/arm64/include/asm/kvm_emulate.h
diff options
context:
space:
mode:
authorMostafa Saleh <smostafa@google.com>2023-06-14 12:25:59 +0000
committerOliver Upton <oliver.upton@linux.dev>2023-06-14 15:17:32 +0000
commit8c15c2a0281087d19f62d7c2b5ab1f9e961b8d97 (patch)
tree3d1494098df6e6b73a903c1f8e4a8bbff854e963 /arch/arm64/include/asm/kvm_emulate.h
parent21e87daece5aed25f47f051af5fccbbd39164c88 (diff)
KVM: arm64: Use different pointer authentication keys for pKVM
When the use of pointer authentication is enabled in the kernel it applies to both the kernel itself as well as KVM's nVHE hypervisor. The same keys are used for both the kernel and the nVHE hypervisor, which is less than desirable for pKVM as the host is not trusted at runtime. Naturally, the fix is to use a different set of keys for the hypervisor when running in protected mode. Have the host generate a new set of keys for the hypervisor before deprivileging the kernel. While there might be other sources of random directly available at EL2, this keeps the implementation simple, and the host is trusted anyways until it is deprivileged. Since the host and hypervisor no longer share a set of pointer authentication keys, start context switching them on the host entry/exit path exactly as we do for guest entry/exit. There is no need to handle CPU migration as the nVHE code is not migratable in the first place. Signed-off-by: Mostafa Saleh <smostafa@google.com> Link: https://lore.kernel.org/r/20230614122600.2098901-1-smostafa@google.com Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'arch/arm64/include/asm/kvm_emulate.h')
0 files changed, 0 insertions, 0 deletions