[Qemu-devel] [PATCH v2 0/4] i386/kvm: advertise Hyper-V frequency MSRs

Ladi Prosek posted 4 patches 6 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170807085703.32267-1-lprosek@redhat.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
target/i386/kvm.c | 138 ++++++++++++++++++++++++++++--------------------------
1 file changed, 71 insertions(+), 67 deletions(-)
[Qemu-devel] [PATCH v2 0/4] i386/kvm: advertise Hyper-V frequency MSRs
Posted by Ladi Prosek 6 years, 8 months ago
This is the QEMU part of the changes required for nested Hyper-V to read
timestamps with RDTSC + TSC page. Without exposing the frequency MSRs,
Windows with the Hyper-V role enabled use the much slower
HV_X64_MSR_TIME_REF_COUNT (0x40000020) RDMSR to read timestamps.

The new registers are exposed only if the TSC frequency is stable across
migration and known, as suggested by Paolo.

v1->v2:
* deleted an extra empty line in patch 1
* added patch 3 introducing a helper function for the "TSC is stable and
  known" check (David)

Ladi Prosek (4):
  i386/kvm: use a switch statement for MSR detection
  i386/kvm: set tsc_khz before configuring Hyper-V CPUID
  i386/kvm: introduce tsc_is_stable_and_known()
  i386/kvm: advertise Hyper-V frequency MSRs

 target/i386/kvm.c | 138 ++++++++++++++++++++++++++++--------------------------
 1 file changed, 71 insertions(+), 67 deletions(-)

-- 
2.9.3


Re: [Qemu-devel] [PATCH v2 0/4] i386/kvm: advertise Hyper-V frequency MSRs
Posted by Marcelo Tosatti 6 years, 8 months ago
On Mon, Aug 07, 2017 at 10:56:59AM +0200, Ladi Prosek wrote:
> This is the QEMU part of the changes required for nested Hyper-V to read
> timestamps with RDTSC + TSC page. Without exposing the frequency MSRs,
> Windows with the Hyper-V role enabled use the much slower
> HV_X64_MSR_TIME_REF_COUNT (0x40000020) RDMSR to read timestamps.
> 
> The new registers are exposed only if the TSC frequency is stable across
> migration and known, as suggested by Paolo.
> 
> v1->v2:
> * deleted an extra empty line in patch 1
> * added patch 3 introducing a helper function for the "TSC is stable and
>   known" check (David)
> 
> Ladi Prosek (4):
>   i386/kvm: use a switch statement for MSR detection
>   i386/kvm: set tsc_khz before configuring Hyper-V CPUID
>   i386/kvm: introduce tsc_is_stable_and_known()
>   i386/kvm: advertise Hyper-V frequency MSRs
> 
>  target/i386/kvm.c | 138 ++++++++++++++++++++++++++++--------------------------
>  1 file changed, 71 insertions(+), 67 deletions(-)
> 
> -- 
> 2.9.3


Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>


Re: [Qemu-devel] [PATCH v2 0/4] i386/kvm: advertise Hyper-V frequency MSRs
Posted by Konrad Rzeszutek Wilk 6 years, 8 months ago
On Tue, Aug 08, 2017 at 09:50:53PM -0300, Marcelo Tosatti wrote:
> On Mon, Aug 07, 2017 at 10:56:59AM +0200, Ladi Prosek wrote:
> > This is the QEMU part of the changes required for nested Hyper-V to read
> > timestamps with RDTSC + TSC page. Without exposing the frequency MSRs,
> > Windows with the Hyper-V role enabled use the much slower
> > HV_X64_MSR_TIME_REF_COUNT (0x40000020) RDMSR to read timestamps.
> > 
> > The new registers are exposed only if the TSC frequency is stable across
> > migration and known, as suggested by Paolo.
> > 
> > v1->v2:
> > * deleted an extra empty line in patch 1
> > * added patch 3 introducing a helper function for the "TSC is stable and
> >   known" check (David)
> > 
> > Ladi Prosek (4):
> >   i386/kvm: use a switch statement for MSR detection
> >   i386/kvm: set tsc_khz before configuring Hyper-V CPUID
> >   i386/kvm: introduce tsc_is_stable_and_known()
> >   i386/kvm: advertise Hyper-V frequency MSRs
> > 
> >  target/i386/kvm.c | 138 ++++++++++++++++++++++++++++--------------------------
> >  1 file changed, 71 insertions(+), 67 deletions(-)
> > 
> > -- 
> > 2.9.3
> 
> 
> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>

Come again please?

> 

Re: [Qemu-devel] [PATCH v2 0/4] i386/kvm: advertise Hyper-V frequency MSRs
Posted by Paolo Bonzini 6 years, 7 months ago
On 07/08/2017 10:56, Ladi Prosek wrote:
> This is the QEMU part of the changes required for nested Hyper-V to read
> timestamps with RDTSC + TSC page. Without exposing the frequency MSRs,
> Windows with the Hyper-V role enabled use the much slower
> HV_X64_MSR_TIME_REF_COUNT (0x40000020) RDMSR to read timestamps.
> 
> The new registers are exposed only if the TSC frequency is stable across
> migration and known, as suggested by Paolo.
> 
> v1->v2:
> * deleted an extra empty line in patch 1
> * added patch 3 introducing a helper function for the "TSC is stable and
>   known" check (David)
> 
> Ladi Prosek (4):
>   i386/kvm: use a switch statement for MSR detection
>   i386/kvm: set tsc_khz before configuring Hyper-V CPUID
>   i386/kvm: introduce tsc_is_stable_and_known()
>   i386/kvm: advertise Hyper-V frequency MSRs
> 
>  target/i386/kvm.c | 138 ++++++++++++++++++++++++++++--------------------------
>  1 file changed, 71 insertions(+), 67 deletions(-)
> 

Queued, thanks.

Paolo