Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4ecdf82 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Peter Anvin:
 "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"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/amd/numa: Fix northbridge quirk to assign correct NUMA node
  x86, fpu: Check tsk_used_math() in kernel_fpu_end() for eager FPU
parents cee152ff 847d7970
Loading
Loading
Loading
Loading
+12 −3
Original line number Original line Diff line number Diff line
@@ -86,11 +86,20 @@ EXPORT_SYMBOL(__kernel_fpu_begin);


void __kernel_fpu_end(void)
void __kernel_fpu_end(void)
{
{
	if (use_eager_fpu())
	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();
			math_state_restore();
	else
	} else {
		stts();
		stts();
	}
	}
}
EXPORT_SYMBOL(__kernel_fpu_end);
EXPORT_SYMBOL(__kernel_fpu_end);


void unlazy_fpu(struct task_struct *tsk)
void unlazy_fpu(struct task_struct *tsk)
+1 −1
Original line number Original line Diff line number Diff line
@@ -529,7 +529,7 @@ static void quirk_amd_nb_node(struct pci_dev *dev)
		return;
		return;


	pci_read_config_dword(nb_ht, 0x60, &val);
	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,
	 * Some hardware may return an invalid node ID,
	 * so check it first:
	 * so check it first: