Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\kvmclock.c Create Date:2022-07-28 08:45:17
Last Modify:2020-03-18 12:41:45 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kvmclock_init

Proto:void __init kvmclock_init(void)

Type:void

Parameter:Nothing

312  If Not kvm_para_available() || Not kvmclock Then Return
315  If kvm_para_has_feature(This indicates that the new set of kvmclock msrs* are available. The use of 0x11 and 0x12 is deprecated) Then
316  msr_kvm_system_time = MSR_KVM_SYSTEM_TIME_NEW
317  msr_kvm_wall_clock = Custom MSRs falls in the range 0x4b564d00-0x4b564dff
318  Else if Not kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE) Then
319  Return
322  If puhp_setup_state - Setup hotplug state callbacks with calling the callbacks*@state: The state for which the calls are installed*@name: Name of the callback (will be used in debug output)*@startup: startup callback function*@teardown: teardown callback < 0 Then
324  Return
327  pr_info("kvm-clock: Using msrs %x and %x", msr_kvm_system_time, msr_kvm_wall_clock)
330  this_cpu_write(hv_clock_per_cpu, & hv_clock_boot[0])
331  kvm_register_clock("primary cpu clock")
332  pvclock_set_pvti_cpu0_va(hv_clock_boot)
334  If kvm_para_has_feature(The last 8 bits are used to indicate how to interpret the flags field* in pvclock structure. If no bits are set, all flags are ignored.) Then pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT)
337  flags = pvclock_read_flags( & pvti)
338  kvm_sched_clock_init(flags & PVCLOCK_TSC_STABLE_BIT)
340  calibrate_tsc = If we don't do that, there is the possibility that the guest* will calibrate under heavy load - thus, getting a lower lpj -* and execute the delays themselves without load
341  calibrate_cpu = If we don't do that, there is the possibility that the guest* will calibrate under heavy load - thus, getting a lower lpj -* and execute the delays themselves without load
342  get_wallclock = The wallclock is the time of day when we booted. Since then, some time may* have elapsed since the hypervisor wrote the data. So we try to account for* that with system time
343  set_wallclock = kvm_set_wallclock
347  save_sched_clock_state = kvm_save_sched_clock_state
348  restore_sched_clock_state = kvm_restore_sched_clock_state
349  shutdown = kvm_shutdown
351  crash_shutdown = After the clock is registered, the host will keep writing to the* registered memory location. If the guest happens to shutdown, this memory* won't be valid. In cases like kexec, in which you install a new kernel, this
353  kvm_get_preset_lpj()
363  If boot_cpu_has(TSC ticks at a constant rate ) && boot_cpu_has(TSC does not stop in C states ) && Not check_tsc_unstable() Then rating = 299
368  clocksource_register_hz( & kvm_clock, NSEC_PER_SEC)
369  name = "KVM"
Caller
NameDescribe
kvm_init_platform