All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger@xenproject.org>,
	"Teddy Astie" <teddy.astie@vates.tech>
Subject: [PATCH 1/5] x86/nmi: Drop {reserve,release}_lapic_nmi()
Date: Wed,  5 Aug 2026 13:45:21 +0100	[thread overview]
Message-ID: <20260805124525.105457-2-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20260805124525.105457-1-andrew.cooper3@citrix.com>

With Oprofile support dropped, there are no more users of these.  Drop them.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <jbeulich@suse.com>
CC: Roger Pau Monné <roger@xenproject.org>
CC: Teddy Astie <teddy.astie@vates.tech>
---
 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



  reply	other threads:[~2026-08-05 12:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-05 12:45 [PATCH 0/5] x86/nmi: Watchdog fixes/improvement Part 1 Andrew Cooper
2026-08-05 12:45 ` Andrew Cooper [this message]
2026-08-05 13:48   ` [PATCH 1/5] x86/nmi: Drop {reserve,release}_lapic_nmi() Jan Beulich
2026-08-05 12:45 ` [PATCH 2/5] x86/nmi: Drop K7_NMI_EVENT Andrew Cooper
2026-08-05 13:49   ` Jan Beulich
2026-08-17 16:24   ` [PATCH 2.5/5] x86/nmi: Remove logic for pre-64bit Pentium 4 CPUs Andrew Cooper
2026-08-18  6:32     ` Jan Beulich
2026-08-05 12:45 ` [PATCH 3/5] x86/nmi: Misc style fixes Andrew Cooper
2026-08-05 13:52   ` Jan Beulich
2026-08-17 16:19     ` Andrew Cooper
2026-08-05 12:45 ` [PATCH 4/5] x86/nmi: Check MSR_MISC_ENABLE for all Intel platforms Andrew Cooper
2026-08-05 14:02   ` Jan Beulich
2026-08-05 12:45 ` [PATCH 5/5] x86/nmi: Don't configure EvtSel repeatedly Andrew Cooper
2026-08-05 14:20   ` Jan Beulich
2026-08-05 15:37     ` Andrew Cooper
2026-08-06  6:57       ` Jan Beulich
2026-08-06  9:40         ` Andrew Cooper
2026-08-17 17:23   ` [PATCH 6/5] x86/nmi: Support watchdogs on Intel Fam18/19 CPUs Andrew Cooper
2026-08-18  7:31     ` Jan Beulich
2026-08-05 13:42 ` [PATCH 0/5] x86/nmi: Watchdog fixes/improvement Part 1 Jan Beulich
2026-08-05 17:56   ` Andrew Cooper
2026-08-06  6:44     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260805124525.105457-2-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=roger@xenproject.org \
    --cc=teddy.astie@vates.tech \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.