]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
x86/i8253: Disable PIT timer 0 when not in use
authorDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 2 Aug 2024 13:55:54 +0000 (14:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 12:50:12 +0000 (13:50 +0100)
commit25ffe92294ebcbd1109fb515fb0436cb8d10be4d
treef9a1329fc7bf9bdafaf0bc1a0798d76c971a6927
parent552e7938b4d7fe548fbf29b9950a14c6149d0470
x86/i8253: Disable PIT timer 0 when not in use

commit 70e6b7d9ae3c63df90a7bba7700e8d5c300c3c60 upstream.

Leaving the PIT interrupt running can cause noticeable steal time for
virtual guests. The VMM generally has a timer which toggles the IRQ input
to the PIC and I/O APIC, which takes CPU time away from the guest. Even
on real hardware, running the counter may use power needlessly (albeit
not much).

Make sure it's turned off if it isn't going to be used.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Michael Kelley <mhkelley@outlook.com>
Link: https://lore.kernel.org/all/20240802135555.564941-1-dwmw2@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/i8253.c
drivers/clocksource/i8253.c
include/linux/i8253.h