File tree Expand file tree Collapse file tree 5 files changed +20
-8
lines changed
Documentation/admin-guide Expand file tree Collapse file tree 5 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 2365
2365
kvm-arm.mode=
2366
2366
[KVM,ARM] Select one of KVM/arm64's modes of operation.
2367
2367
2368
+ none: Forcefully disable KVM.
2369
+
2368
2370
nvhe: Standard nVHE-based mode, without support for
2369
2371
protected guests.
2370
2372
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ config ARM64
186
186
select HAVE_GCC_PLUGINS
187
187
select HAVE_HW_BREAKPOINT if PERF_EVENTS
188
188
select HAVE_IRQ_TIME_ACCOUNTING
189
+ select HAVE_KVM
189
190
select HAVE_NMI
190
191
select HAVE_PATA_PLATFORM
191
192
select HAVE_PERF_EVENTS
Original file line number Diff line number Diff line change 58
58
enum kvm_mode {
59
59
KVM_MODE_DEFAULT ,
60
60
KVM_MODE_PROTECTED ,
61
+ KVM_MODE_NONE ,
61
62
};
62
63
enum kvm_mode kvm_get_mode (void );
63
64
Original file line number Diff line number Diff line change 4
4
#
5
5
6
6
source "virt/lib/Kconfig"
7
+ source "virt/kvm/Kconfig"
7
8
8
9
menuconfig VIRTUALIZATION
9
10
bool "Virtualization"
@@ -19,7 +20,7 @@ if VIRTUALIZATION
19
20
20
21
menuconfig KVM
21
22
bool "Kernel-based Virtual Machine (KVM) support"
22
- depends on OF
23
+ depends on HAVE_KVM
23
24
select MMU_NOTIFIER
24
25
select PREEMPT_NOTIFIERS
25
26
select HAVE_KVM_CPU_RELAX_INTERCEPT
@@ -43,19 +44,14 @@ menuconfig KVM
43
44
44
45
If unsure, say N.
45
46
46
- if KVM
47
-
48
- source "virt/kvm/Kconfig"
49
-
50
47
config NVHE_EL2_DEBUG
51
48
bool "Debug mode for non-VHE EL2 object"
49
+ depends on KVM
52
50
help
53
51
Say Y here to enable the debug mode for the non-VHE KVM EL2 object.
54
52
Failure reports will BUG() in the hypervisor. This is intended for
55
53
local EL2 hypervisor development.
56
54
57
55
If unsure, say N.
58
56
59
- endif # KVM
60
-
61
57
endif # VIRTUALIZATION
Original file line number Diff line number Diff line change @@ -2087,6 +2087,11 @@ int kvm_arch_init(void *opaque)
2087
2087
return - ENODEV ;
2088
2088
}
2089
2089
2090
+ if (kvm_get_mode () == KVM_MODE_NONE ) {
2091
+ kvm_info ("KVM disabled from command line\n" );
2092
+ return - ENODEV ;
2093
+ }
2094
+
2090
2095
in_hyp_mode = is_kernel_in_hyp_mode ();
2091
2096
2092
2097
if (cpus_have_final_cap (ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE ) ||
@@ -2160,8 +2165,15 @@ static int __init early_kvm_mode_cfg(char *arg)
2160
2165
return 0 ;
2161
2166
}
2162
2167
2163
- if (strcmp (arg , "nvhe" ) == 0 && !WARN_ON (is_kernel_in_hyp_mode ()))
2168
+ if (strcmp (arg , "nvhe" ) == 0 && !WARN_ON (is_kernel_in_hyp_mode ())) {
2169
+ kvm_mode = KVM_MODE_DEFAULT ;
2164
2170
return 0 ;
2171
+ }
2172
+
2173
+ if (strcmp (arg , "none" ) == 0 ) {
2174
+ kvm_mode = KVM_MODE_NONE ;
2175
+ return 0 ;
2176
+ }
2165
2177
2166
2178
return - EINVAL ;
2167
2179
}
You can’t perform that action at this time.
0 commit comments