linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Andy Lutomirski <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: bp@alien8.de, fenghua.yu@intel.com,
	torvalds@linux-foundation.org, quentin.casasnovas@oracle.com,
	mingo@kernel.org, dave.hansen@linux.intel.com, luto@kernel.org,
	sai.praneeth.prakhya@intel.com, linux-kernel@vger.kernel.org,
	oleg@redhat.com, luto@amacapital.net, yu-cheng.yu@intel.com,
	peterz@infradead.org, riel@redhat.com, tglx@linutronix.de,
	hpa@zytor.com
Subject: [tip:x86/fpu] x86/fpu: Speed up lazy FPU restores slightly
Date: Tue, 9 Feb 2016 08:11:16 -0800	[thread overview]
Message-ID: <tip-c6ab109f7e0eae3bae3bb10f8ddb0df67735c150@git.kernel.org> (raw)
In-Reply-To: <980004297e233c27066d54e71382c44cdd36ef7c.1453675014.git.luto@kernel.org>

Commit-ID:  c6ab109f7e0eae3bae3bb10f8ddb0df67735c150
Gitweb:     http://git.kernel.org/tip/c6ab109f7e0eae3bae3bb10f8ddb0df67735c150
Author:     Andy Lutomirski <luto@kernel.org>
AuthorDate: Sun, 24 Jan 2016 14:38:09 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 9 Feb 2016 15:42:56 +0100

x86/fpu: Speed up lazy FPU restores slightly

If we have an FPU, there's no need to check CR0 for FPU emulation.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: yu-cheng yu <yu-cheng.yu@intel.com>
Link: http://lkml.kernel.org/r/980004297e233c27066d54e71382c44cdd36ef7c.1453675014.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/traps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 87f80fe..36a9c01 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -752,7 +752,7 @@ do_device_not_available(struct pt_regs *regs, long error_code)
 	RCU_LOCKDEP_WARN(!rcu_is_watching(), "entry code didn't wake RCU");
 
 #ifdef CONFIG_MATH_EMULATION
-	if (read_cr0() & X86_CR0_EM) {
+	if (!boot_cpu_has(X86_FEATURE_FPU) && (read_cr0() & X86_CR0_EM)) {
 		struct math_emu_info info = { };
 
 		conditional_sti(regs);

  reply	other threads:[~2016-02-09 16:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-24 22:38 [PATCH v2 0/5] x86/fpu: eagerfpu fixes, speedups, and default enablement Andy Lutomirski
2016-01-24 22:38 ` [PATCH v2 1/5] x86/fpu: Fix math emulation in eager fpu mode Andy Lutomirski
2016-02-09 16:10   ` [tip:x86/fpu] " tip-bot for Andy Lutomirski
2016-01-24 22:38 ` [PATCH v2 2/5] x86/fpu: Fix FNSAVE usage in eagerfpu mode Andy Lutomirski
2016-01-25 15:40   ` Dave Hansen
2016-01-25 17:25     ` Andy Lutomirski
2016-01-25 17:26       ` Dave Hansen
2016-02-09 16:10   ` [tip:x86/fpu] " tip-bot for Andy Lutomirski
2016-01-24 22:38 ` [PATCH v2 3/5] x86/fpu: Fold fpu_copy into fpu__copy Andy Lutomirski
2016-02-09 16:10   ` [tip:x86/fpu] x86/fpu: Fold fpu_copy() into fpu__copy() tip-bot for Andy Lutomirski
2016-01-24 22:38 ` [PATCH v2 4/5] x86/fpu: Speed up lazy FPU restores slightly Andy Lutomirski
2016-02-09 16:11   ` tip-bot for Andy Lutomirski [this message]
2016-01-24 22:38 ` [PATCH v2 5/5] x86/fpu: Default eagerfpu=on on all CPUs Andy Lutomirski
2016-02-09 16:11   ` [tip:x86/fpu] " tip-bot for Andy Lutomirski

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=tip-c6ab109f7e0eae3bae3bb10f8ddb0df67735c150@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=quentin.casasnovas@oracle.com \
    --cc=riel@redhat.com \
    --cc=sai.praneeth.prakhya@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yu-cheng.yu@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).