On 06/27/2018 13:01, Ryan Stone wrote:
> I would guess that the calibration can fail because when running under
> the hypervisor, the FreeBSD guest code can be descheduled at the wrong
> time.  As I recall, the current algorithm looks like:
> 
> 1. Sample rdtsc
> 2. Use a fixed-frequency timer to busy-wait for exactly 1 second
> 3. Sample rdtsc again
> 4. tsc_freq = sample2 - sample1;
> 
> If we are descheduled between 2 and 3, the time we spend off-cpu will
> not be accounted for at step 4.  On bare-metal this is not possible as
> neither the scheduler nor interrupts are not running yet.
> 
> Although, come to think of it, I seem to recall something about SMI
> interrupts mucking this up long in the past, for exactly the same
> reason.

I think it was legacy USB device emulation for certain Intel
chipset-based motherboards.

Jung-uk Kim

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to