@@ -309,6 +309,8 @@ extern u64 get_host_aperf(void);
extern u64 get_host_mperf(void);
extern void set_guest_aperf(u64 aperf);
extern void set_guest_mperf(u64 mperf);
+extern void restore_host_aperf(void);
+extern void restore_host_mperf(void);
extern void arch_scale_freq_tick(void);
#define arch_scale_freq_tick arch_scale_freq_tick
@@ -135,6 +135,22 @@ void set_guest_mperf(u64 guest_mperf)
}
EXPORT_SYMBOL_GPL(set_guest_mperf);
+void restore_host_aperf(void)
+{
+ WARN_ON_ONCE(!irqs_disabled());
+ wrmsrl(MSR_IA32_APERF, get_host_aperf());
+ this_cpu_write(host_aperf_offset, 0);
+}
+EXPORT_SYMBOL_GPL(restore_host_aperf);
+
+void restore_host_mperf(void)
+{
+ WARN_ON_ONCE(!irqs_disabled());
+ wrmsrl(MSR_IA32_MPERF, get_host_mperf());
+ this_cpu_write(host_mperf_offset, 0);
+}
+EXPORT_SYMBOL_GPL(restore_host_mperf);
+
static bool __init turbo_disabled(void)
{
u64 misc_en;