Re: [PATCH] x86 (64): make calibrate_APIC_clock() SMI-safe (take 3)

From: Ingo Molnar
Date: Sat Jul 26 2008 - 11:40:53 EST



* Martin Wilck <martin.wilck@xxxxxxxxxxxxxxxxxxx> wrote:

> [PATCH] x86 (64): make calibrate_APIC_clock() SMI-safe (take 3)
>
> Non-maskable asynchronous events (e.g. SMIs) which occur during the
> APIC timer calibration can cause timer miscalibrations, sometimes by
> large amounts. This patch fixes this by making sure that no
> significant interruption occurs between APIC and TSC reads. SMIs may
> still occur at some stage in the calibration loop, causing the loop to
> last longer than intended. This doesn't matter though, as long as the
> start and end values are both taken simultaneously.
>
> Changed wrt take 2: Use max. possible start value for the APIC timer
> to avoid underflow.
>
> Signed-off-by: Martin Wilck <martin.wilck@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Gerhard Wichert <gerhard.wichert@xxxxxxxxxxxxxxxxxxx>
>
> --- arch/x86/kernel/apic_64.c 2008-07-25 15:39:51.000000000 +0200
> +++ arch/x86/kernel/apic_64.c.new 2008-07-25 15:55:08.000000000 +0200

nice - could you please implement it symmetrically on 32-bit APIC
calibration as well?

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/