All of lore.kernel.org
 help / color / mirror / Atom feed
* Regression: Can't compile x86_64 with 32 Bit userland: arch/x86/purgatory/purgatory.c:1:0: error: code model 'large' not supported in the 32 bit mode
@ 2014-08-20  6:04 Thomas Glanzmann
  2014-08-20  6:24 ` REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland Thomas Glanzmann
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Glanzmann @ 2014-08-20  6:04 UTC (permalink / raw)
  To: LKML

Hello,
I used to compile 64 Bit Kernel on 32 Bit Userland and until v3.16 it
worked. But with todays git head from Linus it does not:

(mini) [~/work/linux-2.6] make                                                                                                                                                                         scripts/kconfig/conf --silentoldconfig Kconfig
  CHK     include/config/kernel.release
  UPD     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CC      arch/x86/purgatory/purgatory.o
arch/x86/purgatory/purgatory.c:1:0: error: code model 'large' not supported in the 32 bit mode
make[1]: *** [arch/x86/purgatory/purgatory.o] Error 1
make: *** [archprepare] Error 2

I'll do git bisect to identify the offending commit.

I'm using Debian Wheezy 7 32 Bit on x86 with gcc version 4.7.2 (Debian
4.7.2-5).

Cheers,
        Thomas

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

* REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland
  2014-08-20  6:04 Regression: Can't compile x86_64 with 32 Bit userland: arch/x86/purgatory/purgatory.c:1:0: error: code model 'large' not supported in the 32 bit mode Thomas Glanzmann
@ 2014-08-20  6:24 ` Thomas Glanzmann
  2014-08-20 12:56   ` Vivek Goyal
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Glanzmann @ 2014-08-20  6:24 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: LKML, Andrew Morton, Andy Lutomirski, Baoquan He,
	Borislav Petkov, Dave Young, Eric Biederman, Greg Kroah-Hartman,
	H. Peter Anvin, Linus Torvalds, Matthew Garrett, Michael Kerrisk,
	Stephen Rothwell, WANG Chao, Yinghai Lu, ubuntu

Hello Vivek,
commit 8fc5b4d introduces a regression that no longer allows to compile
x86_64 kernel under x86_32 userland. TJ on freenode/#kernel did analyze
it:

> (mini) [~/work/linux-2.6] make
> scripts/kconfig/conf --silentoldconfig Kconfig
>   CHK     include/config/kernel.release
>   UPD     include/config/kernel.release
>   CHK     include/generated/uapi/linux/version.h
>   CHK     include/generated/utsrelease.h
>   UPD     include/generated/utsrelease.h
>   CC      arch/x86/purgatory/purgatory.o
> arch/x86/purgatory/purgatory.c:1:0: error: code model 'large' not supported in the 32 bit mode
> make[1]: *** [arch/x86/purgatory/purgatory.o] Error 1
> make: *** [archprepare] Error 2

08:10 < TJ-> Glanzmann: The purgatory code from kexec is specifying ".code64"
08:11 < TJ-> Glanzmann: so when your local 32-bit linker tries to deal with that ... it errors
08:14 < TJ-> Glanzmann: there's only one introducing the purgatory stuff
08:14 < TJ-> 8fc5b4d Fri Aug 8 15:57:32 2014 -0700 Vivek Goyal purgatory: core purgatory functionality

Cheers,
        Thomas

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

* Re: REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland
  2014-08-20  6:24 ` REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland Thomas Glanzmann
@ 2014-08-20 12:56   ` Vivek Goyal
  2014-08-20 15:07     ` H. Peter Anvin
  2014-08-20 16:16     ` Thomas Glanzmann
  0 siblings, 2 replies; 8+ messages in thread
From: Vivek Goyal @ 2014-08-20 12:56 UTC (permalink / raw)
  To: Thomas Glanzmann, LKML, Andrew Morton, Andy Lutomirski,
	Baoquan He, Borislav Petkov, Dave Young, Eric Biederman,
	Greg Kroah-Hartman, H. Peter Anvin, Linus Torvalds,
	Matthew Garrett, Michael Kerrisk, Stephen Rothwell, WANG Chao,
	Yinghai Lu, ubuntu

On Wed, Aug 20, 2014 at 08:24:08AM +0200, Thomas Glanzmann wrote:
> Hello Vivek,
> commit 8fc5b4d introduces a regression that no longer allows to compile
> x86_64 kernel under x86_32 userland. TJ on freenode/#kernel did analyze
> it:
> 
> > (mini) [~/work/linux-2.6] make
> > scripts/kconfig/conf --silentoldconfig Kconfig
> >   CHK     include/config/kernel.release
> >   UPD     include/config/kernel.release
> >   CHK     include/generated/uapi/linux/version.h
> >   CHK     include/generated/utsrelease.h
> >   UPD     include/generated/utsrelease.h
> >   CC      arch/x86/purgatory/purgatory.o
> > arch/x86/purgatory/purgatory.c:1:0: error: code model 'large' not supported in the 32 bit mode
> > make[1]: *** [arch/x86/purgatory/purgatory.o] Error 1
> > make: *** [archprepare] Error 2
> 
> 08:10 < TJ-> Glanzmann: The purgatory code from kexec is specifying ".code64"
> 08:11 < TJ-> Glanzmann: so when your local 32-bit linker tries to deal with that ... it errors
> 08:14 < TJ-> Glanzmann: there's only one introducing the purgatory stuff
> 08:14 < TJ-> 8fc5b4d Fri Aug 8 15:57:32 2014 -0700 Vivek Goyal purgatory: core purgatory functionality

Hi Thomas,

Thanks for the report. I think this is also happening because purgatory is
right now being compiled with compiler option -mcmodel=large. There was
another report where older version of gcc did not support -mcmodel=large.

A patch is sitting in akpm's tree. That patch puts the new code under
a new config option CONFIG_KEXEC_FILE. So as long as you don't enable
CONFIG_KEXEC_FILE=y, you should be fine. This should not impact any of
the existing functionality. Just that you will not get the benefit of
new system call.

http://ozlabs.org/~akpm/mmotm/broken-out/kexec-create-a-new-config-option-config_kexec_file-for-new-syscall.patch

I hope this patch gets merged soon.

In the mean time I am trying to figure out how can I move away from
using -mcmodel=large for purgatory.

Thanks
Vivek

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

* Re: REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland
  2014-08-20 12:56   ` Vivek Goyal
@ 2014-08-20 15:07     ` H. Peter Anvin
  2014-08-20 15:48       ` Vivek Goyal
  2014-08-20 16:16     ` Thomas Glanzmann
  1 sibling, 1 reply; 8+ messages in thread
From: H. Peter Anvin @ 2014-08-20 15:07 UTC (permalink / raw)
  To: Vivek Goyal, Thomas Glanzmann, LKML, Andrew Morton,
	Andy Lutomirski, Baoquan He, Borislav Petkov, Dave Young,
	Eric Biederman, Greg Kroah-Hartman, Linus Torvalds,
	Matthew Garrett, Michael Kerrisk, Stephen Rothwell, WANG Chao,
	Yinghai Lu, ubuntu

It says "32-bit mode" which means it is another issue: we are dropping -m64 at some point.

On August 20, 2014 7:56:30 AM CDT, Vivek Goyal <vgoyal@redhat.com> wrote:
>On Wed, Aug 20, 2014 at 08:24:08AM +0200, Thomas Glanzmann wrote:
>> Hello Vivek,
>> commit 8fc5b4d introduces a regression that no longer allows to
>compile
>> x86_64 kernel under x86_32 userland. TJ on freenode/#kernel did
>analyze
>> it:
>> 
>> > (mini) [~/work/linux-2.6] make
>> > scripts/kconfig/conf --silentoldconfig Kconfig
>> >   CHK     include/config/kernel.release
>> >   UPD     include/config/kernel.release
>> >   CHK     include/generated/uapi/linux/version.h
>> >   CHK     include/generated/utsrelease.h
>> >   UPD     include/generated/utsrelease.h
>> >   CC      arch/x86/purgatory/purgatory.o
>> > arch/x86/purgatory/purgatory.c:1:0: error: code model 'large' not
>supported in the 32 bit mode
>> > make[1]: *** [arch/x86/purgatory/purgatory.o] Error 1
>> > make: *** [archprepare] Error 2
>> 
>> 08:10 < TJ-> Glanzmann: The purgatory code from kexec is specifying
>".code64"
>> 08:11 < TJ-> Glanzmann: so when your local 32-bit linker tries to
>deal with that ... it errors
>> 08:14 < TJ-> Glanzmann: there's only one introducing the purgatory
>stuff
>> 08:14 < TJ-> 8fc5b4d Fri Aug 8 15:57:32 2014 -0700 Vivek Goyal
>purgatory: core purgatory functionality
>
>Hi Thomas,
>
>Thanks for the report. I think this is also happening because purgatory
>is
>right now being compiled with compiler option -mcmodel=large. There was
>another report where older version of gcc did not support
>-mcmodel=large.
>
>A patch is sitting in akpm's tree. That patch puts the new code under
>a new config option CONFIG_KEXEC_FILE. So as long as you don't enable
>CONFIG_KEXEC_FILE=y, you should be fine. This should not impact any of
>the existing functionality. Just that you will not get the benefit of
>new system call.
>
>http://ozlabs.org/~akpm/mmotm/broken-out/kexec-create-a-new-config-option-config_kexec_file-for-new-syscall.patch
>
>I hope this patch gets merged soon.
>
>In the mean time I am trying to figure out how can I move away from
>using -mcmodel=large for purgatory.
>
>Thanks
>Vivek

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

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

* Re: REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland
  2014-08-20 15:07     ` H. Peter Anvin
@ 2014-08-20 15:48       ` Vivek Goyal
  2014-08-20 16:21         ` Thomas Glanzmann
  2014-08-20 16:56         ` H. Peter Anvin
  0 siblings, 2 replies; 8+ messages in thread
From: Vivek Goyal @ 2014-08-20 15:48 UTC (permalink / raw)
  To: H. Peter Anvin, Thomas Glanzmann
  Cc: LKML, Andrew Morton, Andy Lutomirski, Baoquan He,
	Borislav Petkov, Dave Young, Eric Biederman, Greg Kroah-Hartman,
	Linus Torvalds, Matthew Garrett, Michael Kerrisk,
	Stephen Rothwell, WANG Chao, Yinghai Lu, ubuntu

On Wed, Aug 20, 2014 at 10:07:01AM -0500, H. Peter Anvin wrote:
> It says "32-bit mode" which means it is another issue: we are dropping -m64 at some point.

Thanks hpa. I am not adding -m64 to kbuild flags at all. So 32bit tool
chain must be assuming -m32 by default, and probably that's the issue.

Thomas, 

Can you please try attached single line patch and see if it fixes the
issue for you.

Thanks
Vivek


---
 arch/x86/purgatory/Makefile |    1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6/arch/x86/purgatory/Makefile
===================================================================
--- linux-2.6.orig/arch/x86/purgatory/Makefile	2014-08-20 11:32:21.723559119 -0400
+++ linux-2.6/arch/x86/purgatory/Makefile	2014-08-20 11:32:23.654570231 -0400
@@ -11,6 +11,7 @@ targets += purgatory.ro
 # sure how to relocate those. Like kexec-tools, use custom flags.
 
 KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -MD -Os -mcmodel=large
+KBUILD_CFLAGS += -m$(BITS)
 
 $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
 		$(call if_changed,ld)

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

* Re: REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland
  2014-08-20 12:56   ` Vivek Goyal
  2014-08-20 15:07     ` H. Peter Anvin
@ 2014-08-20 16:16     ` Thomas Glanzmann
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Glanzmann @ 2014-08-20 16:16 UTC (permalink / raw)
  To: Vivek Goyal; +Cc: LKML

Hello Vivek,

* Vivek Goyal <vgoyal@redhat.com> [2014-08-20 15:53]:
> A patch is sitting in akpm's tree. That patch puts the new code under
> a new config option CONFIG_KEXEC_FILE. So as long as you don't enable
> CONFIG_KEXEC_FILE=y, you should be fine. This should not impact any of
> the existing functionality. Just that you will not get the benefit of
> new system call.

> http://ozlabs.org/~akpm/mmotm/broken-out/kexec-create-a-new-config-option-config_kexec_file-for-new-syscall.patch

> I hope this patch gets merged soon.

> In the mean time I am trying to figure out how can I move away from
> using -mcmodel=large for purgatory.

perfect. I tried the patch and with the patch the kernel compiles again.

Cheers,
        Thomas

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

* Re: REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland
  2014-08-20 15:48       ` Vivek Goyal
@ 2014-08-20 16:21         ` Thomas Glanzmann
  2014-08-20 16:56         ` H. Peter Anvin
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Glanzmann @ 2014-08-20 16:21 UTC (permalink / raw)
  To: Vivek Goyal
  Cc: H. Peter Anvin, LKML, Andrew Morton, Andy Lutomirski, Baoquan He,
	Borislav Petkov, Dave Young, Eric Biederman, Greg Kroah-Hartman,
	Linus Torvalds, Matthew Garrett, Michael Kerrisk,
	Stephen Rothwell, WANG Chao, Yinghai Lu, ubuntu

Hello Vivek,

* Vivek Goyal <vgoyal@redhat.com> [2014-08-20 17:48]:
> --- linux-2.6.orig/arch/x86/purgatory/Makefile	2014-08-20 11:32:21.723559119 -0400
> +++ linux-2.6/arch/x86/purgatory/Makefile	2014-08-20 11:32:23.654570231 -0400
> @@ -11,6 +11,7 @@ targets += purgatory.ro
>  # sure how to relocate those. Like kexec-tools, use custom flags.

>  KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -MD -Os -mcmodel=large
> +KBUILD_CFLAGS += -m$(BITS)

>  $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
>  		$(call if_changed,ld)

> Can you please try attached single line patch and see if it fixes the
> issue for you.

I tested the same and it works.

Tested-by: Thomas Glanzmann <thomas@glanzmann.de>

...
  CC      arch/x86/purgatory/purgatory.o
  AS      arch/x86/purgatory/stack.o
  AS      arch/x86/purgatory/setup-x86_64.o
  CC      arch/x86/purgatory/sha256.o
  AS      arch/x86/purgatory/entry64.o
  CC      arch/x86/purgatory/string.o
  LD      arch/x86/purgatory/purgatory.ro
  BIN2C   arch/x86/purgatory/kexec-purgatory.c
...

I also made sure that I backed out the other patch _before_ I tried this one.

Cheers,
        Thomas

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

* Re: REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland
  2014-08-20 15:48       ` Vivek Goyal
  2014-08-20 16:21         ` Thomas Glanzmann
@ 2014-08-20 16:56         ` H. Peter Anvin
  1 sibling, 0 replies; 8+ messages in thread
From: H. Peter Anvin @ 2014-08-20 16:56 UTC (permalink / raw)
  To: Vivek Goyal, Thomas Glanzmann
  Cc: LKML, Andrew Morton, Andy Lutomirski, Baoquan He,
	Borislav Petkov, Dave Young, Eric Biederman, Greg Kroah-Hartman,
	Linus Torvalds, Matthew Garrett, Michael Kerrisk,
	Stephen Rothwell, WANG Chao, Yinghai Lu, ubuntu

Yes, that is exactly right.  The lack of -m64 is a bug.

On August 20, 2014 10:48:18 AM CDT, Vivek Goyal <vgoyal@redhat.com> wrote:
>On Wed, Aug 20, 2014 at 10:07:01AM -0500, H. Peter Anvin wrote:
>> It says "32-bit mode" which means it is another issue: we are
>dropping -m64 at some point.
>
>Thanks hpa. I am not adding -m64 to kbuild flags at all. So 32bit tool
>chain must be assuming -m32 by default, and probably that's the issue.
>
>Thomas, 
>
>Can you please try attached single line patch and see if it fixes the
>issue for you.
>
>Thanks
>Vivek
>
>
>---
> arch/x86/purgatory/Makefile |    1 +
> 1 file changed, 1 insertion(+)
>
>Index: linux-2.6/arch/x86/purgatory/Makefile
>===================================================================
>--- linux-2.6.orig/arch/x86/purgatory/Makefile	2014-08-20
>11:32:21.723559119 -0400
>+++ linux-2.6/arch/x86/purgatory/Makefile	2014-08-20 11:32:23.654570231
>-0400
>@@ -11,6 +11,7 @@ targets += purgatory.ro
> # sure how to relocate those. Like kexec-tools, use custom flags.
> 
>KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
>-fno-zero-initialized-in-bss -fno-builtin -ffreestanding -c -MD -Os
>-mcmodel=large
>+KBUILD_CFLAGS += -m$(BITS)
> 
> $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
> 		$(call if_changed,ld)

-- 
Sent from my mobile phone.  Please pardon brevity and lack of formatting.

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

end of thread, other threads:[~2014-08-20 16:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20  6:04 Regression: Can't compile x86_64 with 32 Bit userland: arch/x86/purgatory/purgatory.c:1:0: error: code model 'large' not supported in the 32 bit mode Thomas Glanzmann
2014-08-20  6:24 ` REGRESSION: 8fc5b4d: Unable to compile x86_64 kernel with x86_32 userland Thomas Glanzmann
2014-08-20 12:56   ` Vivek Goyal
2014-08-20 15:07     ` H. Peter Anvin
2014-08-20 15:48       ` Vivek Goyal
2014-08-20 16:21         ` Thomas Glanzmann
2014-08-20 16:56         ` H. Peter Anvin
2014-08-20 16:16     ` Thomas Glanzmann

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.