Nullify the sched_clock save/restore hooks when using VMware's version of
sched_clock.  This will allow extending paravirt_set_sched_clock() to set
the save/restore hooks, without having to simultaneously change the
behavior of VMware guests.

Note, it's not at all obvious that it's safe/correct for VMware guests to
do nothing on suspend/resume, but that's a pre-existing problem.  Leave it
for a VMware expert to sort out.

Signed-off-by: Sean Christopherson <sea...@google.com>
---
 arch/x86/kernel/cpu/vmware.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index d6f079a75f05..d6eadb5b37fd 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -344,8 +344,11 @@ static void __init vmware_paravirt_ops_setup(void)
 
        vmware_cyc2ns_setup();
 
-       if (vmw_sched_clock)
+       if (vmw_sched_clock) {
                paravirt_set_sched_clock(vmware_sched_clock);
+               x86_platform.save_sched_clock_state = NULL;
+               x86_platform.restore_sched_clock_state = NULL;
+       }
 
        if (vmware_is_stealclock_available()) {
                has_steal_clock = true;
-- 
2.48.1.711.g2feabab25a-goog


Reply via email to