[PATCH 1/5] x86/nmi: Drop {reserve,release}_lapic_nmi()
Andrew Cooper <[email protected]> Wed, 5 Aug 2026 13:45:21 +0100
| Newsgroups | gmane.comp.emulators.xen.devel |
|---|---|
| Message-ID | <[email protected]> |
With Oprofile support dropped, there are no more users of these. Drop them. No functional change. Signed-off-by: Andrew Cooper <[email protected]> --- CC: Jan Beulich <[email protected]> CC: Roger Pau Monné <[email protected]> CC: Teddy Astie <[email protected]> --- xen/arch/x86/include/asm/apic.h | 2 -- xen/arch/x86/nmi.c | 50 --------------------------------- 2 files changed, 52 deletions(-) diff --git a/xen/arch/x86/include/asm/apic.h b/xen/arch/x86/include/asm/apic.h index 918f1cee3567..f30d57ad22c5 100644 --- a/xen/arch/x86/include/asm/apic.h +++ b/xen/arch/x86/include/asm/apic.h @@ -174,8 +174,6 @@ extern void setup_boot_APIC_clock (void); extern void setup_secondary_APIC_clock (void); extern void setup_apic_nmi_watchdog (void); extern void disable_lapic_nmi_watchdog(void); -extern int reserve_lapic_nmi(void); -extern void release_lapic_nmi(void); extern void self_nmi(void); extern void disable_timer_nmi_watchdog(void); extern void enable_timer_nmi_watchdog(void); diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c index 91f95fe6d080..616bfdbc9029 100644 --- a/xen/arch/x86/nmi.c +++ b/xen/arch/x86/nmi.c @@ -89,20 +89,6 @@ static int __init cf_check parse_watchdog_timeout(const char *s) } custom_param("watchdog_timeout", parse_watchdog_timeout); -/* - * lapic_nmi_owner tracks the ownership of the lapic NMI hardware: - * - it may be reserved by some other driver, or not - * - when not reserved by some other driver, it may be used for - * the NMI watchdog, or not - * - * This is maintained separately from nmi_active because the NMI - * watchdog may also be driven from the I/O APIC timer. - */ -static DEFINE_SPINLOCK(lapic_nmi_owner_lock); -static unsigned int lapic_nmi_owner; -#define LAPIC_NMI_WATCHDOG (1<<0) -#define LAPIC_NMI_RESERVED (1<<1) - /* nmi_active: * +1: the lapic NMI watchdog is active, but can be disabled * 0: the lapic NMI watchdog has not been set up, and cannot @@ -239,41 +225,6 @@ void disable_lapic_nmi_watchdog(void) nmi_watchdog = NMI_NONE; } -static void enable_lapic_nmi_watchdog(void) -{ - if (nmi_active < 0) { - nmi_watchdog = NMI_LOCAL_APIC; - setup_apic_nmi_watchdog(); - } -} - -int reserve_lapic_nmi(void) -{ - unsigned int old_owner; - - spin_lock(&lapic_nmi_owner_lock); - old_owner = lapic_nmi_owner; - lapic_nmi_owner |= LAPIC_NMI_RESERVED; - spin_unlock(&lapic_nmi_owner_lock); - if (old_owner & LAPIC_NMI_RESERVED) - return -EBUSY; - if (old_owner & LAPIC_NMI_WATCHDOG) - disable_lapic_nmi_watchdog(); - return 0; -} - -void release_lapic_nmi(void) -{ - unsigned int new_owner; - - spin_lock(&lapic_nmi_owner_lock); - new_owner = lapic_nmi_owner & ~LAPIC_NMI_RESERVED; - lapic_nmi_owner = new_owner; - spin_unlock(&lapic_nmi_owner_lock); - if (new_owner & LAPIC_NMI_WATCHDOG) - enable_lapic_nmi_watchdog(); -} - /* * Activate the NMI watchdog via the local APIC. * Original code written by Keith Owens. @@ -417,7 +368,6 @@ void setup_apic_nmi_watchdog(void) return; } - lapic_nmi_owner = LAPIC_NMI_WATCHDOG; nmi_active = 1; } -- 2.34.1