Skip to contentSkip to conversation

x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()

PATCH Applied Suresh Siddha 3 participants 3 messages Dec 23, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()

From: Suresh Siddha <[email protected]>
Subject: x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()

These commits:

	commit 95d313cf1c1ecedc8bec5727b09bdacbf67dfc45
	Author: Mike Travis <[email protected]>
	Date:   Tue Dec 16 17:33:54 2008 -0800

	    x86: Add cpu_mask_to_apicid_and

and

	commit 6eeb7c5a99434596c5953a95baa17d2f085664e3
	Author: Mike Travis <[email protected]>
	Date:   Tue Dec 16 17:33:55 2008 -0800

	    x86: update add-cpu_mask_to_apicid_and to use struct cpumask*

broke interrupt delivery on x2apic platforms. As x2apic cluster mode uses logical delivery mode, we need to use logical apicid instead of physical apicid in x2apic_cpu_mask_to_apicid_and()

Impact: fixes the broken interrupt delivery issue on generic x2apic platforms.

---

arch/x86/kernel/genx2apic_cluster.c +3 -3
Index: tip/arch/x86/kernel/genx2apic_cluster.c
===================================================================
@@ -114,7 +114,7 @@
 	int cpu;
 
 	/*
-	 * We're using fixed IRQ delivery, can only return one phys APIC ID.
+	 * We're using fixed IRQ delivery, can only return one logical APIC ID.
 	 * May as well be the first.
 	 */
 	cpu = cpumask_first(cpumask);
@@ -130,14 +130,14 @@
 	int cpu;
 
 	/*
-	 * We're using fixed IRQ delivery, can only return one phys APIC ID.
+	 * We're using fixed IRQ delivery, can only return one logical APIC ID.
 	 * May as well be the first.
 	 */
 	for_each_cpu_and(cpu, cpumask, andmask)
 		if (cpumask_test_cpu(cpu, cpu_online_mask))
 			break;
 	if (cpu < nr_cpu_ids)
-		return per_cpu(x86_cpu_to_apicid, cpu);
+		return per_cpu(x86_cpu_to_logical_apicid, cpu);
 	return BAD_APICID;
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 18 lines · Suresh Siddha

From: Suresh Siddha <[email protected]>
Subject: x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()

These commits:

	commit 95d313cf1c1ecedc8bec5727b09bdacbf67dfc45
	Author: Mike Travis <[email protected]>
	Date:   Tue Dec 16 17:33:54 2008 -0800

	    x86: Add cpu_mask_to_apicid_and

and

	commit 6eeb7c5a99434596c5953a95baa17d2f085664e3
	Author: Mike Travis <[email protected]>
	Date:   Tue Dec 16 17:33:55 2008 -0800

	    x86: update add-cpu_mask_to_apicid_and to use struct cpumask*
Quoted 7 lines

broke interrupt delivery on x2apic platforms. As x2apic cluster mode uses logical delivery mode, we need to use logical apicid instead of physical apicid in x2apic_cpu_mask_to_apicid_and()

Impact: fixes the broken interrupt delivery issue on generic x2apic platforms.

Thanks Suresh for catching this! You can add my

Quoted 32 lines

---

Index: tip/arch/x86/kernel/genx2apic_cluster.c
===================================================================

arch/x86/kernel/genx2apic_cluster.c +3 -3
@@ -114,7 +114,7 @@
 	int cpu;
 
 	/*
-	 * We're using fixed IRQ delivery, can only return one phys APIC ID.
+	 * We're using fixed IRQ delivery, can only return one logical APIC ID.
 	 * May as well be the first.
 	 */
 	cpu = cpumask_first(cpumask);
@@ -130,14 +130,14 @@
 	int cpu;
 
 	/*
-	 * We're using fixed IRQ delivery, can only return one phys APIC ID.
+	 * We're using fixed IRQ delivery, can only return one logical APIC ID.
 	 * May as well be the first.
 	 */
 	for_each_cpu_and(cpu, cpumask, andmask)
 		if (cpumask_test_cpu(cpu, cpu_online_mask))
 			break;
 	if (cpu < nr_cpu_ids)
-		return per_cpu(x86_cpu_to_apicid, cpu);
+		return per_cpu(x86_cpu_to_logical_apicid, cpu);
 	return BAD_APICID;
 }
 
reviewer Applied
#2 lore raw
Quoted 4 lines · Mike Travis
Quoted 3 lines · Suresh Siddha

From: Suresh Siddha <[email protected]>
Subject: x86: use logical apicid in x2apic_cluster's x2apic_cpu_mask_to_apicid_and()

Quoted 8 lines
Quoted 3 lines

Impact: fixes the broken interrupt delivery issue on generic x2apic platforms.

Thanks Suresh for catching this! You can add my

Applied to tip:cpus4096, thanks!

-hpa