public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Shaun Ruffell <sruffell@digium.com>,
	linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
	ebiederm@xmission.com, mjg59@srcf.ucam.org, greg@kroah.com,
	bp@alien8.de, dyoung@redhat.com, chaowang@redhat.com,
	bhe@redhat.com, akpm@linux-foundation.org
Subject: Re: [PATCH 11/15] purgatory: Core purgatory functionality
Date: Mon, 11 Aug 2014 14:02:14 -0400	[thread overview]
Message-ID: <20140811180213.GC1863@redhat.com> (raw)
In-Reply-To: <53E9028E.2070709@zytor.com>

On Mon, Aug 11, 2014 at 10:51:10AM -0700, H. Peter Anvin wrote:
> On 08/11/2014 10:40 AM, Shaun Ruffell wrote:
> > FYI, it looks like the following patch (committed in
> > 8fc5b4d4121c95482b2583) adds a new requirement to use at least gcc
> > 4.4 to build the kernel?
> 
> Well, to build the kernel with that particular new functionality
> enabled, yes.
> 
> However...
> 
> > The above "-mcmodel=large" compiler flag produces the following output on GCC 4.1.2.
> > 
> >   $ make modules_prepare ; gcc --version
> >     CHK     include/config/kernel.release
> >     CHK     include/generated/uapi/linux/version.h
> >     CHK     include/generated/utsrelease.h
> >     CC      arch/x86/purgatory/purgatory.o
> >   arch/x86/purgatory/purgatory.c:1: sorry, unimplemented: code model ‘large’ not supported yet
> >   make[1]: *** [arch/x86/purgatory/purgatory.o] Error 1
> >   make: *** [archprepare] Error 2
> >   gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
> >   Copyright (C) 2006 Free Software Foundation, Inc.
> >   This is free software; see the source for copying conditions.  There is NO
> >   warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > 
> > I did a quick search for a discussion the indicates this compiler is now
> > officially too old to build the kernel but did not find one.
> > 
> > If this is required, maybe Documentation/Changes needs to be updated
> > with the new minimum required version?
> 
> ... I'm having a very, very hard time to picture a reason why the
> "large" model would be necessary or even desirable for the purgatory
> code.  The "small PIC" model seem to fit much better...

Hi hpa,

I took it because kexec-tools uses it and in one of the committs Eric
gave following reasoning.

    On x86_64 use -mcmodel=large so that the code is built without
    any 32bit assumptions.  -mcmodel=medium and -mcmodel=small
    result int code that has 32bit relocations against variables
    that can live anywhere in the address space

We do want to load purgatory anywhere in the address space. 

But if there are other ways to achieve the same thing, I will do that
change.

So when you say "small PIC", I need to use -mcmodel=small and -fPIC?

I can give that a try.

Thanks
Vivek

  reply	other threads:[~2014-08-11 18:03 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 20:33 [PATCH 00/15][V4] kexec: A new system call to allow in kernel loading Vivek Goyal
2014-06-26 20:33 ` [PATCH 01/15] bin2c: Move bin2c in scripts/basic Vivek Goyal
2014-06-26 20:33 ` [PATCH 02/15] kernel: Build bin2c based on config option CONFIG_BUILD_BIN2C Vivek Goyal
2014-06-26 20:33 ` [PATCH 03/15] kexec: rename unusebale_pages to unusable_pages Vivek Goyal
2014-06-26 20:33 ` [PATCH 04/15] kexec: Move segment verification code in a separate function Vivek Goyal
2014-06-26 20:33 ` [PATCH 05/15] kexec: Use common function for kimage_normal_alloc() and kimage_crash_alloc() Vivek Goyal
2014-06-26 20:33 ` [PATCH 06/15] resource: Provide new functions to walk through resources Vivek Goyal
2014-06-26 20:33 ` [PATCH 07/15] kexec: Make kexec_segment user buffer pointer a union Vivek Goyal
2014-06-26 20:33 ` [PATCH 08/15] kexec: New syscall kexec_file_load() declaration Vivek Goyal
2014-06-26 20:43   ` Vivek Goyal
2014-06-26 21:03     ` Andy Lutomirski
2014-06-27 11:50       ` Vivek Goyal
2014-06-27 12:20         ` Michael Kerrisk (man-pages)
2014-06-26 20:33 ` [PATCH 09/15] kexec: Implementation of new syscall kexec_file_load Vivek Goyal
2014-06-26 20:58   ` Andrew Morton
2014-06-27 16:31     ` Vivek Goyal
2014-07-01 20:25       ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 10/15] purgatory/sha256: Provide implementation of sha256 in purgaotory context Vivek Goyal
2014-06-26 20:33 ` [PATCH 11/15] purgatory: Core purgatory functionality Vivek Goyal
2014-08-11 17:40   ` Shaun Ruffell
2014-08-11 17:51     ` H. Peter Anvin
2014-08-11 18:02       ` Vivek Goyal [this message]
2014-08-11 18:08         ` H. Peter Anvin
2014-08-11 18:15           ` Vivek Goyal
2014-08-11 20:23           ` Vivek Goyal
2014-06-26 20:33 ` [PATCH 12/15] kexec: Load and Relocate purgatory at kernel load time Vivek Goyal
2014-06-26 20:33 ` [PATCH 13/15] kexec-bzImage64: Support for loading bzImage using 64bit entry Vivek Goyal
2014-06-26 20:33 ` [PATCH 14/15] kexec: Support for kexec on panic using new system call Vivek Goyal
2014-06-26 20:33 ` [PATCH 15/15] kexec: Support kexec/kdump on EFI systems Vivek Goyal
2014-07-01 19:46   ` Matt Fleming
2014-07-01 20:14     ` Andrew Morton
2014-07-01 20:21       ` Vivek Goyal
2014-07-01 21:23       ` Matt Fleming
2014-07-01 20:09   ` [PATCH 17/15] kexec-bzimage: Change EFI helper function names Vivek Goyal
2014-06-26 20:39 ` [PATCH 00/15][V4] kexec: A new system call to allow in kernel loading Vivek Goyal
2014-06-26 20:58 ` Andrew Morton
2014-06-26 21:21   ` Borislav Petkov
2014-06-27 11:33   ` Vivek Goyal
2014-06-27 16:34 ` [PATCH 16/15] kexec: Fix freeing up for image loader data loading Vivek Goyal

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=20140811180213.GC1863@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhe@redhat.com \
    --cc=bp@alien8.de \
    --cc=chaowang@redhat.com \
    --cc=dyoung@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=greg@kroah.com \
    --cc=hpa@zytor.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=sruffell@digium.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