forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 297b60346df8beafee954a0fd7c2d64f33f3b9bc
kernel/arch/x86/kernel/cpu/hypervisor.c
....@@ -26,13 +26,6 @@
2626 #include <asm/processor.h>
2727 #include <asm/hypervisor.h>
2828
29
-extern const struct hypervisor_x86 x86_hyper_vmware;
30
-extern const struct hypervisor_x86 x86_hyper_ms_hyperv;
31
-extern const struct hypervisor_x86 x86_hyper_xen_pv;
32
-extern const struct hypervisor_x86 x86_hyper_xen_hvm;
33
-extern const struct hypervisor_x86 x86_hyper_kvm;
34
-extern const struct hypervisor_x86 x86_hyper_jailhouse;
35
-
3629 static const __initconst struct hypervisor_x86 * const hypervisors[] =
3730 {
3831 #ifdef CONFIG_XEN_PV
....@@ -49,10 +42,21 @@
4942 #ifdef CONFIG_JAILHOUSE_GUEST
5043 &x86_hyper_jailhouse,
5144 #endif
45
+#ifdef CONFIG_ACRN_GUEST
46
+ &x86_hyper_acrn,
47
+#endif
5248 };
5349
5450 enum x86_hypervisor_type x86_hyper_type;
5551 EXPORT_SYMBOL(x86_hyper_type);
52
+
53
+bool __initdata nopv;
54
+static __init int parse_nopv(char *arg)
55
+{
56
+ nopv = true;
57
+ return 0;
58
+}
59
+early_param("nopv", parse_nopv);
5660
5761 static inline const struct hypervisor_x86 * __init
5862 detect_hypervisor_vendor(void)
....@@ -61,6 +65,9 @@
6165 uint32_t pri, max_pri = 0;
6266
6367 for (p = hypervisors; p < hypervisors + ARRAY_SIZE(hypervisors); p++) {
68
+ if (unlikely(nopv) && !(*p)->ignore_nopv)
69
+ continue;
70
+
6471 pri = (*p)->detect();
6572 if (pri > max_pri) {
6673 max_pri = pri;