forked from luck/tmp_suning_uos_patched
KVM: Fix preemption counter leak in kvm_timer_init()
Based on a patch from Thomas Meyer. Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
73c1160ce3
commit
3e26f23091
@ -4564,9 +4564,11 @@ static void kvm_timer_init(void)
|
||||
#ifdef CONFIG_CPU_FREQ
|
||||
struct cpufreq_policy policy;
|
||||
memset(&policy, 0, sizeof(policy));
|
||||
cpufreq_get_policy(&policy, get_cpu());
|
||||
cpu = get_cpu();
|
||||
cpufreq_get_policy(&policy, cpu);
|
||||
if (policy.cpuinfo.max_freq)
|
||||
max_tsc_khz = policy.cpuinfo.max_freq;
|
||||
put_cpu();
|
||||
#endif
|
||||
cpufreq_register_notifier(&kvmclock_cpufreq_notifier_block,
|
||||
CPUFREQ_TRANSITION_NOTIFIER);
|
||||
|
Loading…
Reference in New Issue
Block a user