All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: enable ARCH_USE_BUILTIN_BSWAP
@ 2012-12-20  1:16 David Woodhouse
  2013-01-28 17:49 ` [PATCH] x86: require MOVBE feature in cpuid when we use it David Woodhouse
  2013-01-29  9:06 ` [tip:x86/asm] x86: Enable ARCH_USE_BUILTIN_BSWAP tip-bot for David Woodhouse
  0 siblings, 2 replies; 4+ messages in thread
From: David Woodhouse @ 2012-12-20  1:16 UTC (permalink / raw)
  To: x86; +Cc: linux-arch

[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]

With -mmovbe enabled (implicit with -march=atom), this allows the
compiler to use the movbe instruction. This doesn't have a significant
effect on code size (unlike on PowerPC), because the movbe instruction
actually takes as many bytes to encode as a simple mov and a bswap. But
for Atom in particular I believe it should give a performance win over
the mov+bswap alternative. That was kind of why movbe was invented in
the first place, after all...

I've done basic functionality testing with IPv6 and Legacy IP, but no
performance testing. The EFI firmware on my test box unfortunately no
longer starts up.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 97f8c5a..2ab0f0c 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -115,6 +115,7 @@ config X86
 	select MODULES_USE_ELF_REL if X86_32
 	select MODULES_USE_ELF_RELA if X86_64
 	select CLONE_BACKWARDS if X86_32
+	select ARCH_USE_BUILTIN_BSWAP
 
 config INSTRUCTION_DECODER
 	def_bool y
-- 
1.8.0.1


-- 
dwmw2


[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

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

* [PATCH] x86: require MOVBE feature in cpuid when we use it
  2012-12-20  1:16 [PATCH] x86: enable ARCH_USE_BUILTIN_BSWAP David Woodhouse
@ 2013-01-28 17:49 ` David Woodhouse
  2013-01-29  9:07   ` [tip:x86/asm] x86: Require " tip-bot for David Woodhouse
  2013-01-29  9:06 ` [tip:x86/asm] x86: Enable ARCH_USE_BUILTIN_BSWAP tip-bot for David Woodhouse
  1 sibling, 1 reply; 4+ messages in thread
From: David Woodhouse @ 2013-01-28 17:49 UTC (permalink / raw)
  To: x86; +Cc: linux-arch

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>

diff --git a/arch/x86/include/asm/required-features.h b/arch/x86/include/asm/required-features.h
index 6c7fc25..5c6e4fb 100644
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
@@ -47,6 +47,12 @@
 # define NEED_NOPL	0
 #endif
 
+#ifdef CONFIG_MATOM
+# define NEED_MOVBE	(1<<(X86_FEATURE_MOVBE & 31))
+#else
+# define NEED_MOVBE	0
+#endif
+
 #ifdef CONFIG_X86_64
 #ifdef CONFIG_PARAVIRT
 /* Paravirtualized systems may not have PSE or PGE available */
@@ -80,7 +86,7 @@
 
 #define REQUIRED_MASK2	0
 #define REQUIRED_MASK3	(NEED_NOPL)
-#define REQUIRED_MASK4	0
+#define REQUIRED_MASK4	(NEED_MOVBE)
 #define REQUIRED_MASK5	0
 #define REQUIRED_MASK6	0
 #define REQUIRED_MASK7	0

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation




[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]

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

* [tip:x86/asm] x86: Enable ARCH_USE_BUILTIN_BSWAP
  2012-12-20  1:16 [PATCH] x86: enable ARCH_USE_BUILTIN_BSWAP David Woodhouse
  2013-01-28 17:49 ` [PATCH] x86: require MOVBE feature in cpuid when we use it David Woodhouse
@ 2013-01-29  9:06 ` tip-bot for David Woodhouse
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for David Woodhouse @ 2013-01-29  9:06 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dwmw2, tglx, hpa, David.Woodhouse

Commit-ID:  83a57a4de1a222c351667ef9a0fedaac1295e85b
Gitweb:     http://git.kernel.org/tip/83a57a4de1a222c351667ef9a0fedaac1295e85b
Author:     David Woodhouse <dwmw2@infradead.org>
AuthorDate: Thu, 20 Dec 2012 01:16:20 +0000
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Mon, 28 Jan 2013 08:48:57 -0800

x86: Enable ARCH_USE_BUILTIN_BSWAP

With -mmovbe enabled (implicit with -march=atom), this allows the
compiler to use the movbe instruction. This doesn't have a significant
effect on code size (unlike on PowerPC), because the movbe instruction
actually takes as many bytes to encode as a simple mov and a bswap. But
for Atom in particular I believe it should give a performance win over
the mov+bswap alternative. That was kind of why movbe was invented in
the first place, after all...

I've done basic functionality testing with IPv6 and Legacy IP, but no
performance testing. The EFI firmware on my test box unfortunately no
longer starts up.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Link: http://lkml.kernel.org/r/1355966180.18919.102.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 79795af..3e941aa 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -114,6 +114,7 @@ config X86
 	select MODULES_USE_ELF_RELA if X86_64
 	select CLONE_BACKWARDS if X86_32
 	select GENERIC_SIGALTSTACK
+	select ARCH_USE_BUILTIN_BSWAP
 
 config INSTRUCTION_DECODER
 	def_bool y

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

* [tip:x86/asm] x86: Require MOVBE feature in cpuid when we use it
  2013-01-28 17:49 ` [PATCH] x86: require MOVBE feature in cpuid when we use it David Woodhouse
@ 2013-01-29  9:07   ` tip-bot for David Woodhouse
  0 siblings, 0 replies; 4+ messages in thread
From: tip-bot for David Woodhouse @ 2013-01-29  9:07 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dwmw2, tglx, hpa, David.Woodhouse

Commit-ID:  2b9b6d8c715b23fa119261c32ad360681f4464a9
Gitweb:     http://git.kernel.org/tip/2b9b6d8c715b23fa119261c32ad360681f4464a9
Author:     David Woodhouse <dwmw2@infradead.org>
AuthorDate: Mon, 28 Jan 2013 17:49:50 +0000
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Mon, 28 Jan 2013 16:59:55 -0800

x86: Require MOVBE feature in cpuid when we use it

Add MOVBE to asm/required-features.h so we check for it during startup
and don't bother checking for it later.

CONFIG_MATOM is used because it corresponds to -march=atom in the
Makefiles.  If the rules get more complicated it may be necessary to
make this an explicit Kconfig option which uses -mmovbe/-mno-movbe to
control the use of this instruction explicitly.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Link: http://lkml.kernel.org/r/1359395390.3529.65.camel@shinybook.infradead.org
[ hpa: added a patch description ]
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/required-features.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/required-features.h b/arch/x86/include/asm/required-features.h
index 6c7fc25..5c6e4fb 100644
--- a/arch/x86/include/asm/required-features.h
+++ b/arch/x86/include/asm/required-features.h
@@ -47,6 +47,12 @@
 # define NEED_NOPL	0
 #endif
 
+#ifdef CONFIG_MATOM
+# define NEED_MOVBE	(1<<(X86_FEATURE_MOVBE & 31))
+#else
+# define NEED_MOVBE	0
+#endif
+
 #ifdef CONFIG_X86_64
 #ifdef CONFIG_PARAVIRT
 /* Paravirtualized systems may not have PSE or PGE available */
@@ -80,7 +86,7 @@
 
 #define REQUIRED_MASK2	0
 #define REQUIRED_MASK3	(NEED_NOPL)
-#define REQUIRED_MASK4	0
+#define REQUIRED_MASK4	(NEED_MOVBE)
 #define REQUIRED_MASK5	0
 #define REQUIRED_MASK6	0
 #define REQUIRED_MASK7	0

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

end of thread, other threads:[~2013-01-29  9:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20  1:16 [PATCH] x86: enable ARCH_USE_BUILTIN_BSWAP David Woodhouse
2013-01-28 17:49 ` [PATCH] x86: require MOVBE feature in cpuid when we use it David Woodhouse
2013-01-29  9:07   ` [tip:x86/asm] x86: Require " tip-bot for David Woodhouse
2013-01-29  9:06 ` [tip:x86/asm] x86: Enable ARCH_USE_BUILTIN_BSWAP tip-bot for David Woodhouse

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.