On Wed, Feb 08, 2012 at 01:56:46PM -0200, Marcelo Tosatti wrote:
> On Wed, Feb 08, 2012 at 04:18:48PM +0100, Joerg Roedel wrote:
> > This is not going to work when tsc-scaling is enabled. The
> > adjust_tsc_offset_host() function just scales the offset the same way
> > the tsc is scaled. But that is broken because the tsc-offset is applied
> > _after_ the tsc-ratio by scaling hardware. So to get the desired
> > tsc-value in the guest the offset needs to be scaled in the opposite
> > direction as the tsc itself. This is rather complicated to implement.
>
> By saying that "tsc-offset is applied _after_ the tsc-ratio by scaling
> hardware" you mean that guest tsc is calculated as
>
> tsc = host_tsc_value * tsc_ratio
> tsc += tsc_offset
>
> ?
>
> If so, that means the tsc_offset must be scaled to guest tsc units.
>
> Which is what both adjust_tsc_offset(host=true) and compute_tsc_offset()
> do.
>
> What am i missing here?
Nothing. You are right, bad math on my side.
Joerg
--
AMD Operating System Research Center
Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html