Skip to content

Commit 8f4566f

Browse files
willdeaconMarc Zyngier
authored andcommitted
arm64: Prevent kexec and hibernation if is_protected_kvm_enabled()
When pKVM is enabled, the hypervisor code at EL2 and its data structures are inaccessible to the host kernel and cannot be torn down or replaced as this would defeat the integrity properies which pKVM aims to provide. Furthermore, the ABI between the host and EL2 is flexible and private to whatever the current implementation of KVM requires and so booting a new kernel with an old EL2 component is very likely to end in disaster. In preparation for uninstalling the hyp stub calls which are relied upon to reset EL2, disable kexec and hibernation in the host when protected KVM is enabled. Cc: Marc Zyngier <[email protected]> Cc: Quentin Perret <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a78738e commit 8f4566f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/arm64/kernel/smp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,5 +1128,6 @@ bool cpus_are_stuck_in_kernel(void)
11281128
{
11291129
bool smp_spin_tables = (num_possible_cpus() > 1 && !have_cpu_die());
11301130

1131-
return !!cpus_stuck_in_kernel || smp_spin_tables;
1131+
return !!cpus_stuck_in_kernel || smp_spin_tables ||
1132+
is_protected_kvm_enabled();
11321133
}

0 commit comments

Comments
 (0)