kvm_main.c (a578a0a9e3526483ad1904fac019d95e7089fb34) kvm_main.c (81a1cf9f89a6b71e71bfd7d43837ce9235e70b38)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Kernel-based Virtual Machine driver for Linux
4 *
5 * This module enables machines with Intel VT-x extensions to run virtual
6 * machines without emulation or binary translation.
7 *
8 * Copyright (C) 2006 Qumranet, Inc.

--- 5888 unchanged lines hidden (view full) ---

5897 perf_register_guest_info_callbacks(&kvm_guest_cbs);
5898}
5899void kvm_unregister_perf_callbacks(void)
5900{
5901 perf_unregister_guest_info_callbacks(&kvm_guest_cbs);
5902}
5903#endif
5904
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Kernel-based Virtual Machine driver for Linux
4 *
5 * This module enables machines with Intel VT-x extensions to run virtual
6 * machines without emulation or binary translation.
7 *
8 * Copyright (C) 2006 Qumranet, Inc.

--- 5888 unchanged lines hidden (view full) ---

5897 perf_register_guest_info_callbacks(&kvm_guest_cbs);
5898}
5899void kvm_unregister_perf_callbacks(void)
5900{
5901 perf_unregister_guest_info_callbacks(&kvm_guest_cbs);
5902}
5903#endif
5904
5905struct kvm_cpu_compat_check {
5906 void *opaque;
5907 int *ret;
5908};
5909
5910static void check_processor_compat(void *data)
5905int kvm_init(unsigned vcpu_size, unsigned vcpu_align, struct module *module)
5911{
5906{
5912 struct kvm_cpu_compat_check *c = data;
5913
5914 *c->ret = kvm_arch_check_processor_compat(c->opaque);
5915}
5916
5917int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
5918 struct module *module)
5919{
5920 struct kvm_cpu_compat_check c;
5921 int r;
5922 int cpu;
5923
5924 if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL))
5925 return -ENOMEM;
5926
5907 int r;
5908 int cpu;
5909
5910 if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL))
5911 return -ENOMEM;
5912
5927 c.ret = &r;
5928 c.opaque = opaque;
5929 for_each_online_cpu(cpu) {
5930 smp_call_function_single(cpu, check_processor_compat, &c, 1);
5931 if (r < 0)
5932 goto out_free_2;
5933 }
5934
5935 r = cpuhp_setup_state_nocalls(CPUHP_AP_KVM_STARTING, "kvm/cpu:starting",
5936 kvm_starting_cpu, kvm_dying_cpu);
5937 if (r)
5938 goto out_free_2;
5939 register_reboot_notifier(&kvm_reboot_notifier);
5940
5941 /* A kmem cache lets us meet the alignment requirements of fx_save. */
5942 if (!vcpu_align)

--- 202 unchanged lines hidden ---
5913 r = cpuhp_setup_state_nocalls(CPUHP_AP_KVM_STARTING, "kvm/cpu:starting",
5914 kvm_starting_cpu, kvm_dying_cpu);
5915 if (r)
5916 goto out_free_2;
5917 register_reboot_notifier(&kvm_reboot_notifier);
5918
5919 /* A kmem cache lets us meet the alignment requirements of fx_save. */
5920 if (!vcpu_align)

--- 202 unchanged lines hidden ---