0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <linux/export.h>
0013 #include <linux/cache.h>
0014 #include <linux/of.h>
0015
0016 #include <asm/firmware.h>
0017 #include <asm/kvm_guest.h>
0018
0019 #ifdef CONFIG_PPC64
0020 unsigned long powerpc_firmware_features __read_mostly;
0021 EXPORT_SYMBOL_GPL(powerpc_firmware_features);
0022 #endif
0023
0024 #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_KVM_GUEST)
0025 DEFINE_STATIC_KEY_FALSE(kvm_guest);
0026 int __init check_kvm_guest(void)
0027 {
0028 struct device_node *hyper_node;
0029
0030 hyper_node = of_find_node_by_path("/hypervisor");
0031 if (!hyper_node)
0032 return 0;
0033
0034 if (of_device_is_compatible(hyper_node, "linux,kvm"))
0035 static_branch_enable(&kvm_guest);
0036
0037 of_node_put(hyper_node);
0038 return 0;
0039 }
0040 core_initcall(check_kvm_guest);
0041 #endif