WHPX: TSC get and set should be dependent on VM state
commit6785e767017a3fcc39e245b7bca2c383b8bf39ef
authorSunil Muthuswamy <sunilmut@microsoft.com>
Wed, 26 Feb 2020 20:54:39 +0000 (26 20:54 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 16 Mar 2020 22:02:21 +0000 (16 23:02 +0100)
treec1a080df48d48a2bf309cad33773793e3a0d1689
parent27f08ea1c7abf04125f6f9f23b8ba2f8c20e95b6
WHPX: TSC get and set should be dependent on VM state

Currently, TSC is set as part of the VM runtime state. Setting TSC at
runtime is heavy and additionally can have side effects on the guest,
which are not very resilient to variances in the TSC. This patch uses
the VM state to determine whether to set TSC or not. Some minor
enhancements for getting TSC values as well that considers the VM state.

Additionally, while setting the TSC, the partition is suspended to
reduce the variance in the TSC value across vCPUs.

Signed-off-by: Sunil Muthuswamy <sunilmut@microsoft.com>
Message-Id: <SN4PR2101MB08804D23439166E81FF151F7C0EA0@SN4PR2101MB0880.namprd21.prod.outlook.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/sysemu/whpx.h
target/i386/whp-dispatch.h
target/i386/whpx-all.c