[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/APIC: make a few interrupt handler functions static


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Nov 2022 15:46:30 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nkwFHbC0MWN5CvPtGpC2i6/DPJmntDCL5dGfW1ggJPE=; b=Fs/BrAeO6NyQjclIaJdzTgCmiFAVmEfYa3CCKpowpkoD7AT9gEUBj7a1mFqZfo2aogYS4Siwj1BH4eg4rEtSw1L7kskA/yKngeVkUbU1ayHNs/uDo+F+9valbdFU6W2Cx8IYdU25/j8nwRKXDcvPY1xHbr4d05jyhym2qxEIOy+AumpBOGeQ3ihS5UepPseGcmlGTZGz2QYY/WsDx/hS6uHSMYVFTA5HQxeVlIdhgRGVAno+rJIBRPR1DqL3EA0zzGlfqMck/eKOGV9hIwRZu28IUVuKlOCv23PK3zY33Av9k278Ao6QyFv9JlI89gVYaNuCEmo4klnwWZq7ihtGXg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BKj35mhKFKOpZErM/DWLt14BcvquE6CqfMWApGnjSAvEvEbGGKpBeHdzhDNqVjv6YGIs6jiDb7XkyAoNA6tBS3wdMKaPRobcz2IAI4nvjw/8OXetfoIrkc2JAYgAJeVOwDyQRkCVH+HB09qzBpNEr/00yegvll27aqOsLk21jxiz1bubl2UHtZicon9tT5EIUq7NTZAb3zH3TmfyiiPI0El+rdb317sNIdSKpxpapJHpZ7cR4l+Fuim87f4+nPsVP9VpHVlyY0lSpPUoWFpQ+9rlhJ6O8jJichp6MRZ3TpMn+PKlsa+mxsbx5s/t+bKQ+adsOXQtxD82ArNgJIV20Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 29 Nov 2022 14:47:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Four of them are used in apic.c only and hence better wouldn't be
exposed to other CUs. To avoid the need for forward declarations, move
apic_intr_init() past the four handlers.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -127,21 +127,6 @@ void ack_bad_irq(unsigned int irq)
         ack_APIC_irq();
 }
 
-void __init apic_intr_init(void)
-{
-    smp_intr_init();
-
-    /* self generated IPI for local APIC timer */
-    set_direct_apic_vector(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
-
-    /* IPI vectors for APIC spurious and error interrupts */
-    set_direct_apic_vector(SPURIOUS_APIC_VECTOR, spurious_interrupt);
-    set_direct_apic_vector(ERROR_APIC_VECTOR, error_interrupt);
-
-    /* Performance Counters Interrupt */
-    set_direct_apic_vector(PMU_APIC_VECTOR, pmu_apic_interrupt);
-}
-
 /* Using APIC to generate smp_local_timer_interrupt? */
 static bool __read_mostly using_apic_timer;
 
@@ -1363,7 +1348,7 @@ int reprogram_timer(s_time_t timeout)
     return apic_tmict || !timeout;
 }
 
-void cf_check apic_timer_interrupt(struct cpu_user_regs *regs)
+static void cf_check apic_timer_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
     perfc_incr(apic_timer);
@@ -1382,7 +1367,7 @@ void smp_send_state_dump(unsigned int cp
 /*
  * Spurious interrupts should _never_ happen with our APIC/SMP architecture.
  */
-void cf_check spurious_interrupt(struct cpu_user_regs *regs)
+static void cf_check spurious_interrupt(struct cpu_user_regs *regs)
 {
     /*
      * Check if this is a vectored interrupt (most likely, as this is probably
@@ -1413,7 +1398,7 @@ void cf_check spurious_interrupt(struct
  * This interrupt should never happen with our APIC/SMP architecture
  */
 
-void cf_check error_interrupt(struct cpu_user_regs *regs)
+static void cf_check error_interrupt(struct cpu_user_regs *regs)
 {
     static const char *const esr_fields[] = {
         "Send CS error",
@@ -1446,12 +1431,27 @@ void cf_check error_interrupt(struct cpu
  * This interrupt handles performance counters interrupt
  */
 
-void cf_check pmu_apic_interrupt(struct cpu_user_regs *regs)
+static void cf_check pmu_apic_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
     vpmu_do_interrupt(regs);
 }
 
+void __init apic_intr_init(void)
+{
+    smp_intr_init();
+
+    /* self generated IPI for local APIC timer */
+    set_direct_apic_vector(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
+
+    /* IPI vectors for APIC spurious and error interrupts */
+    set_direct_apic_vector(SPURIOUS_APIC_VECTOR, spurious_interrupt);
+    set_direct_apic_vector(ERROR_APIC_VECTOR, error_interrupt);
+
+    /* Performance Counters Interrupt */
+    set_direct_apic_vector(PMU_APIC_VECTOR, pmu_apic_interrupt);
+}
+
 /*
  * This initializes the IO-APIC and APIC hardware if this is
  * a UP kernel.
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -96,10 +96,6 @@ static inline struct cpu_user_regs *set_
 void cf_check event_check_interrupt(struct cpu_user_regs *regs);
 void cf_check invalidate_interrupt(struct cpu_user_regs *regs);
 void cf_check call_function_interrupt(struct cpu_user_regs *regs);
-void cf_check apic_timer_interrupt(struct cpu_user_regs *regs);
-void cf_check error_interrupt(struct cpu_user_regs *regs);
-void cf_check pmu_apic_interrupt(struct cpu_user_regs *regs);
-void cf_check spurious_interrupt(struct cpu_user_regs *regs);
 void cf_check irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
 uint8_t alloc_hipriority_vector(void);



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.