public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/boot: use .code16 instead of .code16gcc
@ 2014-01-03 22:30 David Woodhouse
  2014-01-03 22:34 ` H. Peter Anvin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Woodhouse @ 2014-01-03 22:30 UTC (permalink / raw)
  To: hpa; +Cc: mingo, tglx, linux-kernel

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

This reverts commit 28b48688 ("x86, boot: use .code16gcc instead
of .code16").

Versions of binutils older than 2.16 are already not working, so this
workaround is no longer necessary either.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
---
Since I just made .code16 work in LLVM, this removes one more barrier to
building the kernel with LLVM/clang. And it looks like 'clang -m16' for
the C code in arch/x86/boot shouldn't actually be that hard to do now
either.

diff --git a/arch/x86/boot/bioscall.S b/arch/x86/boot/bioscall.S
index 1dfbf64..5077937 100644
--- a/arch/x86/boot/bioscall.S
+++ b/arch/x86/boot/bioscall.S
@@ -13,7 +13,7 @@
  * touching registers they shouldn't be.
  */
 
-	.code16gcc
+	.code16
 	.text
 	.globl	intcall
 	.type	intcall, @function
diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S
index 11f272c..07a7a4a 100644
--- a/arch/x86/boot/copy.S
+++ b/arch/x86/boot/copy.S
@@ -14,7 +14,7 @@
  * Memory copy routines
  */
 
-	.code16gcc
+	.code16
 	.text
 
 GLOBAL(memcpy)


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

-- 
dwmw2


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

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

* Re: [PATCH] x86/boot: use .code16 instead of .code16gcc
  2014-01-03 22:30 [PATCH] x86/boot: use .code16 instead of .code16gcc David Woodhouse
@ 2014-01-03 22:34 ` H. Peter Anvin
  2014-01-03 23:12   ` David Woodhouse
  2014-01-03 22:46 ` [tip:x86/build] x86, boot: Use " tip-bot for David Woodhouse
  2014-01-04 22:04 ` tip-bot for David Woodhouse
  2 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2014-01-03 22:34 UTC (permalink / raw)
  To: David Woodhouse; +Cc: mingo, tglx, linux-kernel

On 01/03/2014 02:30 PM, David Woodhouse wrote:
> Since I just made .code16 work in LLVM, this removes one more barrier to
> building the kernel with LLVM/clang. And it looks like 'clang -m16' for
> the C code in arch/x86/boot shouldn't actually be that hard to do now
> either.

Nice.  I would really like a gcc option "-m16" even if all it did was
emit .code16gcc first in any assembly file (a bunch of the options we
need for the 16-bit code is just so gcc doesn't emit code *before* the
.code16gcc directive.)

	-hpa



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

* [tip:x86/build] x86, boot: Use .code16 instead of .code16gcc
  2014-01-03 22:30 [PATCH] x86/boot: use .code16 instead of .code16gcc David Woodhouse
  2014-01-03 22:34 ` H. Peter Anvin
@ 2014-01-03 22:46 ` tip-bot for David Woodhouse
  2014-01-04 22:04 ` tip-bot for David Woodhouse
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for David Woodhouse @ 2014-01-03 22:46 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dwmw2, tglx, hpa, David.Woodhouse

Commit-ID:  c86cd70a46c97b001dd9d8b3e925d2a38b88d3ca
Gitweb:     http://git.kernel.org/tip/c86cd70a46c97b001dd9d8b3e925d2a38b88d3ca
Author:     David Woodhouse <dwmw2@infradead.org>
AuthorDate: Fri, 3 Jan 2014 22:30:42 +0000
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Fri, 3 Jan 2014 14:40:09 -0800

x86, boot: Use .code16 instead of .code16gcc

This reverts commit 28b48688 ("x86, boot: use .code16gcc instead
of .code16").

Versions of binutils older than 2.16 are already not working, so this
workaround is no longer necessary either.  At the same time, some of
the transformations that .code16gcc does can be *extremely*
counterintuitive to a human programmer.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Link: http://lkml.kernel.org/r/1388788242.2391.75.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/boot/bioscall.S | 2 +-
 arch/x86/boot/copy.S     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/bioscall.S b/arch/x86/boot/bioscall.S
index 1dfbf64..5077937 100644
--- a/arch/x86/boot/bioscall.S
+++ b/arch/x86/boot/bioscall.S
@@ -13,7 +13,7 @@
  * touching registers they shouldn't be.
  */
 
-	.code16gcc
+	.code16
 	.text
 	.globl	intcall
 	.type	intcall, @function
diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S
index 11f272c..07a7a4a 100644
--- a/arch/x86/boot/copy.S
+++ b/arch/x86/boot/copy.S
@@ -14,7 +14,7 @@
  * Memory copy routines
  */
 
-	.code16gcc
+	.code16
 	.text
 
 GLOBAL(memcpy)

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

* Re: [PATCH] x86/boot: use .code16 instead of .code16gcc
  2014-01-03 22:34 ` H. Peter Anvin
@ 2014-01-03 23:12   ` David Woodhouse
  2014-01-03 23:18     ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: David Woodhouse @ 2014-01-03 23:12 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: mingo, tglx, linux-kernel

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

On Fri, 2014-01-03 at 14:34 -0800, H. Peter Anvin wrote:
> 
> Nice.  I would really like a gcc option "-m16" even if all it did was
> emit .code16gcc first in any assembly file 

Is there a PR for that specific request?

-- 
dwmw2


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

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

* Re: [PATCH] x86/boot: use .code16 instead of .code16gcc
  2014-01-03 23:12   ` David Woodhouse
@ 2014-01-03 23:18     ` H. Peter Anvin
  0 siblings, 0 replies; 6+ messages in thread
From: H. Peter Anvin @ 2014-01-03 23:18 UTC (permalink / raw)
  To: David Woodhouse; +Cc: mingo, tglx, linux-kernel

On 01/03/2014 03:12 PM, David Woodhouse wrote:
> On Fri, 2014-01-03 at 14:34 -0800, H. Peter Anvin wrote:
>>
>> Nice.  I would really like a gcc option "-m16" even if all it did was
>> emit .code16gcc first in any assembly file 
> 
> Is there a PR for that specific request?
> 

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59672

Just filed it.

	-hpa


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

* [tip:x86/build] x86, boot: Use .code16 instead of .code16gcc
  2014-01-03 22:30 [PATCH] x86/boot: use .code16 instead of .code16gcc David Woodhouse
  2014-01-03 22:34 ` H. Peter Anvin
  2014-01-03 22:46 ` [tip:x86/build] x86, boot: Use " tip-bot for David Woodhouse
@ 2014-01-04 22:04 ` tip-bot for David Woodhouse
  2 siblings, 0 replies; 6+ messages in thread
From: tip-bot for David Woodhouse @ 2014-01-04 22:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, dwmw2, tglx, hpa, David.Woodhouse

Commit-ID:  e24df921af484e9b7095ee06d236dabdb3bd9c1c
Gitweb:     http://git.kernel.org/tip/e24df921af484e9b7095ee06d236dabdb3bd9c1c
Author:     David Woodhouse <dwmw2@infradead.org>
AuthorDate: Fri, 3 Jan 2014 22:30:42 +0000
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Sat, 4 Jan 2014 13:59:06 -0800

x86, boot: Use .code16 instead of .code16gcc

This reverts commit 28b48688 ("x86, boot: use .code16gcc instead
of .code16").

Versions of binutils older than 2.16 are already not working, so this
workaround is no longer necessary either.  At the same time, some of
the transformations that .code16gcc does can be *extremely*
counterintuitive to a human programmer.

[ hpa: folded ret -> retl and call -> calll fixes from followup patch ]

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Link: http://lkml.kernel.org/r/1388788242.2391.75.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/boot/bioscall.S |  2 +-
 arch/x86/boot/copy.S     | 22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/x86/boot/bioscall.S b/arch/x86/boot/bioscall.S
index 1dfbf64..5077937 100644
--- a/arch/x86/boot/bioscall.S
+++ b/arch/x86/boot/bioscall.S
@@ -13,7 +13,7 @@
  * touching registers they shouldn't be.
  */
 
-	.code16gcc
+	.code16
 	.text
 	.globl	intcall
 	.type	intcall, @function
diff --git a/arch/x86/boot/copy.S b/arch/x86/boot/copy.S
index 11f272c..1eb7d29 100644
--- a/arch/x86/boot/copy.S
+++ b/arch/x86/boot/copy.S
@@ -14,7 +14,7 @@
  * Memory copy routines
  */
 
-	.code16gcc
+	.code16
 	.text
 
 GLOBAL(memcpy)
@@ -30,7 +30,7 @@ GLOBAL(memcpy)
 	rep; movsb
 	popw	%di
 	popw	%si
-	ret
+	retl
 ENDPROC(memcpy)
 
 GLOBAL(memset)
@@ -45,25 +45,25 @@ GLOBAL(memset)
 	andw	$3, %cx
 	rep; stosb
 	popw	%di
-	ret
+	retl
 ENDPROC(memset)
 
 GLOBAL(copy_from_fs)
 	pushw	%ds
 	pushw	%fs
 	popw	%ds
-	call	memcpy
+	calll	memcpy
 	popw	%ds
-	ret
+	retl
 ENDPROC(copy_from_fs)
 
 GLOBAL(copy_to_fs)
 	pushw	%es
 	pushw	%fs
 	popw	%es
-	call	memcpy
+	calll	memcpy
 	popw	%es
-	ret
+	retl
 ENDPROC(copy_to_fs)
 
 #if 0 /* Not currently used, but can be enabled as needed */
@@ -71,17 +71,17 @@ GLOBAL(copy_from_gs)
 	pushw	%ds
 	pushw	%gs
 	popw	%ds
-	call	memcpy
+	calll	memcpy
 	popw	%ds
-	ret
+	retl
 ENDPROC(copy_from_gs)
 
 GLOBAL(copy_to_gs)
 	pushw	%es
 	pushw	%gs
 	popw	%es
-	call	memcpy
+	calll	memcpy
 	popw	%es
-	ret
+	retl
 ENDPROC(copy_to_gs)
 #endif

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

end of thread, other threads:[~2014-01-04 22:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-03 22:30 [PATCH] x86/boot: use .code16 instead of .code16gcc David Woodhouse
2014-01-03 22:34 ` H. Peter Anvin
2014-01-03 23:12   ` David Woodhouse
2014-01-03 23:18     ` H. Peter Anvin
2014-01-03 22:46 ` [tip:x86/build] x86, boot: Use " tip-bot for David Woodhouse
2014-01-04 22:04 ` tip-bot for David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox