public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: fernando@oss.ntt.co.jp, patches@x86-64.org, linux-kernel@vger.kernel.org
Subject: [PATCH] [12/34] i386: __send_IPI_dest_field - i386
Date: Mon, 30 Apr 2007 17:49:44 +0200 (CEST)	[thread overview]
Message-ID: <20070430154944.736FF151CA@wotan.suse.de> (raw)
In-Reply-To: <20070430549.617098000@suse.de>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2622 bytes --]


From: Fernando Luis [** ISO-8859-1 charset **] VázquezCao <fernando@oss.ntt.co.jp>
Implement __send_IPI_dest_field which can be used to send IPIs when the
"destination shorthand" field of the ICR is set to 00 (destination
field). Use it whenever possible.

Signed-off-by: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Andi Kleen <ak@suse.de>

---

---
 arch/i386/kernel/smp.c |   47 ++++++++++++++++++-----------------------------
 1 file changed, 18 insertions(+), 29 deletions(-)

Index: linux/arch/i386/kernel/smp.c
===================================================================
--- linux.orig/arch/i386/kernel/smp.c
+++ linux/arch/i386/kernel/smp.c
@@ -165,16 +165,13 @@ void fastcall send_IPI_self(int vector)
 }
 
 /*
- * This is only used on smaller machines.
+ * This is used to send an IPI with no shorthand notation (the destination is
+ * specified in bits 56 to 63 of the ICR).
  */
-void send_IPI_mask_bitmask(cpumask_t cpumask, int vector)
+static inline void __send_IPI_dest_field(unsigned long mask, int vector)
 {
-	unsigned long mask = cpus_addr(cpumask)[0];
 	unsigned long cfg;
-	unsigned long flags;
 
-	local_irq_save(flags);
-	WARN_ON(mask & ~cpus_addr(cpu_online_map)[0]);
 	/*
 	 * Wait for idle.
 	 */
@@ -195,13 +192,25 @@ void send_IPI_mask_bitmask(cpumask_t cpu
 	 * Send the IPI. The write to APIC_ICR fires this off.
 	 */
 	apic_write_around(APIC_ICR, cfg);
+}
 
+/*
+ * This is only used on smaller machines.
+ */
+void send_IPI_mask_bitmask(cpumask_t cpumask, int vector)
+{
+	unsigned long mask = cpus_addr(cpumask)[0];
+	unsigned long flags;
+
+	local_irq_save(flags);
+	WARN_ON(mask & ~cpus_addr(cpu_online_map)[0]);
+	__send_IPI_dest_field(mask, vector);
 	local_irq_restore(flags);
 }
 
 void send_IPI_mask_sequence(cpumask_t mask, int vector)
 {
-	unsigned long cfg, flags;
+	unsigned long flags;
 	unsigned int query_cpu;
 
 	/*
@@ -211,30 +220,10 @@ void send_IPI_mask_sequence(cpumask_t ma
 	 */ 
 
 	local_irq_save(flags);
-
 	for (query_cpu = 0; query_cpu < NR_CPUS; ++query_cpu) {
 		if (cpu_isset(query_cpu, mask)) {
-		
-			/*
-			 * Wait for idle.
-			 */
-			apic_wait_icr_idle();
-		
-			/*
-			 * prepare target chip field
-			 */
-			cfg = __prepare_ICR2(cpu_to_logical_apicid(query_cpu));
-			apic_write_around(APIC_ICR2, cfg);
-		
-			/*
-			 * program the ICR 
-			 */
-			cfg = __prepare_ICR(0, vector);
-			
-			/*
-			 * Send the IPI. The write to APIC_ICR fires this off.
-			 */
-			apic_write_around(APIC_ICR, cfg);
+			__send_IPI_dest_field(cpu_to_logical_apicid(query_cpu),
+					      vector);
 		}
 	}
 	local_irq_restore(flags);

  parent reply	other threads:[~2007-04-30 15:59 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 15:49 [PATCH] [0/34] x86 candidate patches for review VI: MTRR, APIC, more paravirt, misc Andi Kleen
2007-04-30 15:49 ` [PATCH] [1/34] x86_64: Move mtrr prototypes from proto.h to mtrr.h Andi Kleen
2007-04-30 15:49 ` [PATCH] [2/34] x86: Adds mtrr_save_fixed_ranges() for use in two later patches Andi Kleen
2007-04-30 15:49 ` [PATCH] [3/34] x86: Save the MTRRs of the BSP before booting an AP Andi Kleen
2007-04-30 15:49 ` [PATCH] [4/34] x86: Save and restore the fixed-range MTRRs of the BSP when suspending Andi Kleen
2007-04-30 15:49 ` [PATCH] [5/34] i386: Enable support for fixed-range IORRs to keep RdMem & WrMem in sync Andi Kleen
2007-04-30 15:49 ` [PATCH] [6/34] i386: safe_apic_wait_icr_idle - i386 Andi Kleen
2007-04-30 15:49 ` [PATCH] [7/34] x86_64: safe_apic_wait_icr_idle - x86_64 Andi Kleen
2007-04-30 15:49 ` [PATCH] [8/34] i386: use safe_apic_wait_icr_idle - i386 Andi Kleen
2007-04-30 15:49 ` [PATCH] [9/34] x86_64: use safe_apic_wait_icr_idle in smpboot.c - x86_64 Andi Kleen
2007-04-30 15:49 ` [PATCH] [10/34] i386: use safe_apic_wait_icr_idle in smpboot.c Andi Kleen
2007-04-30 15:49 ` [PATCH] [11/34] x86_64: use safe_apic_wait_icr_idle in smpboot.c - x86_64 Andi Kleen
2007-04-30 15:49 ` Andi Kleen [this message]
2007-04-30 15:49 ` [PATCH] [13/34] x86_64: __send_IPI_dest_field " Andi Kleen
2007-04-30 15:49 ` [PATCH] [14/34] i386: Use safe_apic_wait_icr_idle in safe_apic_wait_icr_idle - i386 Andi Kleen
2007-04-30 15:49 ` [PATCH] [15/34] x86_64: Use safe_apic_wait_icr_idle in __send_IPI_dest_field - x86_64 Andi Kleen
2007-04-30 15:49 ` [PATCH] [16/34] i386: fix mtrr sections Andi Kleen
2007-05-02 17:08   ` Bernhard Kaindl
2007-05-03 11:16     ` Bernhard Kaindl
2007-05-03 11:19       ` Andi Kleen
2007-05-03 15:12         ` Randy Dunlap
2007-04-30 15:49 ` [PATCH] [17/34] x86: PARAVIRT: Add a sched_clock paravirt_op Andi Kleen
2007-04-30 15:49 ` [PATCH] [18/34] i386: PARAVIRT: fix startup_ipi_hook config dependency Andi Kleen
2007-04-30 15:49 ` [PATCH] [19/34] x86_64: move __vgetcpu_mode & __jiffies to the vsyscall_2 zone Andi Kleen
2007-04-30 15:49 ` [PATCH] [20/34] i386: avoid checking for cpu gone when CONFIG_HOTPLUG_CPU not defined Andi Kleen
2007-04-30 15:49 ` [PATCH] [21/34] i386: replace spin_lock_irqsave with spin_lock Andi Kleen
2007-04-30 15:49 ` [PATCH] [22/34] i386: clean up flush_tlb_others fn Andi Kleen
2007-04-30 15:49 ` [PATCH] [23/34] i386: check capability Andi Kleen
2007-04-30 15:49 ` [PATCH] [24/34] x86_64: Auto compute __NR_syscall_max at compile time Andi Kleen
2007-04-30 15:49 ` [PATCH] [25/34] x86_64: skip cache_free_alien() on non NUMA Andi Kleen
2007-04-30 15:49 ` [PATCH] [26/34] i386: remove xtime_lock'ing around cpufreq notifier Andi Kleen
2007-04-30 15:50 ` [PATCH] [27/34] i386: pte clear optimization Andi Kleen
2007-04-30 15:50 ` [PATCH] [28/34] i386: pte xchg optimization Andi Kleen
2007-05-02 10:52   ` [patches] " Jan Beulich
2007-05-02 11:05     ` Andi Kleen
2007-05-02 19:19       ` Zachary Amsden
2007-04-30 15:50 ` [PATCH] [29/34] i386: pte simplify ops Andi Kleen
2007-04-30 15:50 ` [PATCH] [30/34] i386: convert the monitor thread to use the kthread API Andi Kleen
2007-04-30 16:55   ` James Bottomley
2007-04-30 17:56     ` Andi Kleen
2007-04-30 15:50 ` [PATCH] [31/34] i386: convert to " Andi Kleen
2007-04-30 15:50 ` [PATCH] [32/34] x86_64: unexport cpu_llc_id Andi Kleen
2007-04-30 15:50 ` [PATCH] [34/34] x86_64: ignore vgacon if hardware not present Andi Kleen

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=20070430154944.736FF151CA@wotan.suse.de \
    --to=ak@suse.de \
    --cc=fernando@oss.ntt.co.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@x86-64.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox