File tree Expand file tree Collapse file tree 3 files changed +6
-11
lines changed
Documentation/admin-guide Expand file tree Collapse file tree 3 files changed +6
-11
lines changed Original file line number Diff line number Diff line change 24692469
24702470 protected: nVHE-based mode with support for guests whose
24712471 state is kept private from the host.
2472- Not valid if the kernel is running in EL2.
24732472
24742473 Defaults to VHE/nVHE based on hardware support. Setting
24752474 mode to "protected" will disable kexec and hibernation
Original file line number Diff line number Diff line change @@ -1974,15 +1974,7 @@ static void cpu_enable_mte(struct arm64_cpu_capabilities const *cap)
19741974#ifdef CONFIG_KVM
19751975static bool is_kvm_protected_mode (const struct arm64_cpu_capabilities * entry , int __unused )
19761976{
1977- if (kvm_get_mode () != KVM_MODE_PROTECTED )
1978- return false;
1979-
1980- if (is_kernel_in_hyp_mode ()) {
1981- pr_warn ("Protected KVM not available with VHE\n" );
1982- return false;
1983- }
1984-
1985- return true;
1977+ return kvm_get_mode () == KVM_MODE_PROTECTED ;
19861978}
19871979#endif /* CONFIG_KVM */
19881980
Original file line number Diff line number Diff line change @@ -2273,7 +2273,11 @@ static int __init early_kvm_mode_cfg(char *arg)
22732273 return - EINVAL ;
22742274
22752275 if (strcmp (arg , "protected" ) == 0 ) {
2276- kvm_mode = KVM_MODE_PROTECTED ;
2276+ if (!is_kernel_in_hyp_mode ())
2277+ kvm_mode = KVM_MODE_PROTECTED ;
2278+ else
2279+ pr_warn_once ("Protected KVM not available with VHE\n" );
2280+
22772281 return 0 ;
22782282 }
22792283
You can’t perform that action at this time.
0 commit comments