All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SGI UV: TLB shootdown extended apic mode
@ 2008-07-08 20:01 Cliff Wickman
  2008-07-18 16:45 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Cliff Wickman @ 2008-07-08 20:01 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel



From: Cliff Wickman <cpw@sgi.com>

Set or clear the UV hub's extended apic mode based on the kernel's setting.
This cannot be done safely in the prom, as the kernel may set the mode.

The kernel's setting of extended apic mode is indicated by global "x2apic".

Diffed against 2.6.26-rc9 (Ingo's tip-latest)

Signed-off-by: Cliff Wickman <cpw@sgi.com>
---
 arch/x86/kernel/tlb_uv.c     |   12 ++++++++++++
 include/asm-x86/uv/uv_bau.h  |    1 +
 include/asm-x86/uv/uv_mmrs.h |    5 +++++
 3 files changed, 18 insertions(+)

Index: linux/arch/x86/kernel/tlb_uv.c
===================================================================
--- linux.orig/arch/x86/kernel/tlb_uv.c
+++ linux/arch/x86/kernel/tlb_uv.c
@@ -741,6 +741,18 @@ static int __init uv_init_blade(int blad
 		uv_write_global_mmr64(pnode, UVH_BAU_DATA_CONFIG,
 				      ((apicid << 32) | UV_BAU_MESSAGE));
 	}
+
+	/*
+	 * The hub's extended apic mode must agree with the kernel's setting,
+	 * which is indicated by global "x2apic".
+	 */
+	pa = uv_read_global_mmr64(pnode, UVH_LB_BAU_MISC_CONTROL);
+	if (!x2apic && (pa & UVH_LB_BAU_MISC_CONTROL_APIC_MODE_MASK))
+		pa &= ~UVH_LB_BAU_MISC_CONTROL_APIC_MODE_MASK;
+	else if (x2apic && (!(pa & UVH_LB_BAU_MISC_CONTROL_APIC_MODE_MASK)))
+		pa |= UVH_LB_BAU_MISC_CONTROL_APIC_MODE_MASK;
+	uv_write_global_mmr64(pnode, UVH_LB_BAU_MISC_CONTROL, pa);
+
 	return 0;
 }
 
Index: linux/include/asm-x86/uv/uv_bau.h
===================================================================
--- linux.orig/include/asm-x86/uv/uv_bau.h
+++ linux/include/asm-x86/uv/uv_bau.h
@@ -333,5 +333,6 @@ static inline void bau_cpubits_clear(str
 extern int uv_flush_tlb_others(cpumask_t *, struct mm_struct *, unsigned long);
 extern void uv_bau_message_intr1(void);
 extern void uv_bau_timeout_intr1(void);
+extern int x2apic;
 
 #endif /* __ASM_X86_UV_BAU__ */
Index: linux/include/asm-x86/uv/uv_mmrs.h
===================================================================
--- linux.orig/include/asm-x86/uv/uv_mmrs.h
+++ linux/include/asm-x86/uv/uv_mmrs.h
@@ -1291,5 +1291,10 @@ union uvh_si_alias2_overlay_config_u {
     } s;
 };
 
+/* ========================================================================= */
+/*                         UVH_LB_BAU_MISC_CONTROL                           */
+/* ========================================================================= */
+#define UVH_LB_BAU_MISC_CONTROL 0x320170UL
+#define UVH_LB_BAU_MISC_CONTROL_APIC_MODE_MASK 0x0000000000000100UL
 
 #endif /* __ASM_X86_UV_MMRS__ */

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-18 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08 20:01 [PATCH] SGI UV: TLB shootdown extended apic mode Cliff Wickman
2008-07-18 16:45 ` Ingo Molnar
2008-07-18 16:53   ` Ingo Molnar

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.