Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\mshyperv.c Create Date:2022-07-28 08:15:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:ms_hyperv_init_platform

Proto:static void __init ms_hyperv_init_platform(void)

Type:void

Parameter:Nothing

226  features = CPUID functions returning a single datum
227  misc_features = cpuid_edx(HYPERV_CPUID_FEATURES)
228  hints = CPUID functions returning a single datum
230  pr_info("Hyper-V: features 0x%x, hints 0x%x\n", features, hints)
233  max_vp_index = CPUID functions returning a single datum
234  max_lp_index = cpuid_ebx(HYPERV_CPUID_IMPLEMENT_LIMITS)
236  pr_debug("Hyper-V: max %u virtual processors, %u logical processors\n", max_vp_index, max_lp_index)
242  If CPUID functions returning a single datum >= HYPERV_CPUID_VERSION Then
244  hv_host_info_eax = CPUID functions returning a single datum
245  hv_host_info_ebx = cpuid_ebx(HYPERV_CPUID_VERSION)
246  hv_host_info_ecx = cpuid_ecx(HYPERV_CPUID_VERSION)
247  hv_host_info_edx = cpuid_edx(HYPERV_CPUID_VERSION)
249  pr_info("Hyper-V Host Build:%d-%d.%d-%d-%d.%d\n", hv_host_info_eax, hv_host_info_ebx >> 16, hv_host_info_ebx & 0xFFFF, hv_host_info_ecx, hv_host_info_edx >> 24, hv_host_info_edx & 0xFFFFFF)
255  If features & There is a single feature flag that signifies if the partition has access* to MSRs with local APIC and TSC frequencies. && misc_features & Frequency MSRs available Then
257  calibrate_tsc = hv_get_tsc_khz
258  calibrate_cpu = hv_get_tsc_khz
261  If hints & Recommend using enlightened VMCS Then
262  nested_features = CPUID functions returning a single datum
290  shutdown = hv_machine_shutdown
291  crash_shutdown = hv_machine_crash_shutdown
293  If features & AccessTscInvariantControls privilege Then
294  wrmsrl(TSC invariant control , 0x1)
295  setup_force_cpu_cap(TSC is known to be reliable )
296  Else
297  mark_tsc_unstable("running on Hyper-V")
304  If efi_enabled(Were we booted from EFI? ) Then get_nmi_reason = hv_get_nmi_reason
315  i8253_clear_counter_on_shutdown = false
321  apic_post_init = hyperv_init
322  hyperv_setup_mmu_ops()
324  alloc_intr_gate(Vector on which hypervisor callbacks will be delivered , hyperv_callback_vector)
327  If features & AccessReenlightenmentControls privilege Then alloc_intr_gate(HYPERV_REENLIGHTENMENT_VECTOR, hyperv_reenlightenment_vector)
332  If misc_features & stimer Direct Mode is available Then alloc_intr_gate(HYPERV_STIMER0_VECTOR, hv_stimer0_callback_vector)
352  hv_init_clocksource()