Skip to contentSkip to conversation

x86 fixes for v3.14-rc7

GIT PULL H. Peter Anvin 1 participant 1 message Mar 14, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Linus,

Two x86 fixes: Suresh's eager FPU fix, and a fix to the NUMA quirk for AMD northbridges.

This only includes Suresh's fix patch, not the "mostly a cleanup" patch which had __init issues.

The following changes since commit fa389e220254c69ffae0d403eac4146171062d08:

Linux 3.14-rc6 (2014-03-09 19:41:57 -0700)

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86-urgent-for-linus

for you to fetch changes up to 847d7970defb45540735b3fb4e88471c27cacd85:

x86/amd/numa: Fix northbridge quirk to assign correct NUMA node (2014-03-14 11:05:36 +0100)

----------------------------------------------------------------
Daniel J Blueman (1):
x86/amd/numa: Fix northbridge quirk to assign correct NUMA node

Suresh Siddha (1):
x86, fpu: Check tsk_used_math() in kernel_fpu_end() for eager FPU

 arch/x86/kernel/i387.c   | 15 ++++++++++++---
 arch/x86/kernel/quirks.c |  2 +-
 2 files changed, 13 insertions(+), 4 deletions(-)
arch/x86/kernel/i387.c +12 -3
index e8368c6dd2a2..d5dd80814419 100644
@@ -86,10 +86,19 @@ EXPORT_SYMBOL(__kernel_fpu_begin);
 
 void __kernel_fpu_end(void)
 {
-	if (use_eager_fpu())
-		math_state_restore();
-	else
+	if (use_eager_fpu()) {
+		/*
+		 * For eager fpu, most the time, tsk_used_math() is true.
+		 * Restore the user math as we are done with the kernel usage.
+		 * At few instances during thread exit, signal handling etc,
+		 * tsk_used_math() is false. Those few places will take proper
+		 * actions, so we don't need to restore the math here.
+		 */
+		if (likely(tsk_used_math(current)))
+			math_state_restore();
+	} else {
 		stts();
+	}
 }
 EXPORT_SYMBOL(__kernel_fpu_end);
 
arch/x86/kernel/quirks.c +1 -1
index 7c6acd4b8995..ff898bbf579d 100644
@@ -529,7 +529,7 @@ static void quirk_amd_nb_node(struct pci_dev *dev)
 		return;
 
 	pci_read_config_dword(nb_ht, 0x60, &val);
-	node = val & 7;
+	node = pcibus_to_node(dev->bus) | (val & 7);
 	/*
 	 * Some hardware may return an invalid node ID,
 	 * so check it first: