From: Huang Ying <ying.huang@intel.com>
To: Simon Horman <horms@verge.net.au>
Cc: nigel@nigel.suspend2.net,
Kexec Mailing List <kexec@lists.infradead.org>,
linux-kernel@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Machek <pavel@ucw.cz>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
mingo@elte.hu, Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [PATCH] kexec jump: fix code size checking
Date: Wed, 13 Aug 2008 11:05:15 +0800 [thread overview]
Message-ID: <1218596715.24951.69.camel@caritas-dev.intel.com> (raw)
In-Reply-To: <20080813024701.GA19201@verge.net.au>
On Wed, 2008-08-13 at 12:47 +1000, Simon Horman wrote:
> On Wed, Aug 13, 2008 at 09:04:35AM +0800, Huang Ying wrote:
> > Fix building issue when CONFIG_KEXEC=n. Thanks to Vivek Goyal for his
> > reminding.
> >
> > Signed-off-by: Huang Ying <ying.huang@intel.com>
> >
> > ---
> > include/asm-x86/kexec.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > --- a/include/asm-x86/kexec.h
> > +++ b/include/asm-x86/kexec.h
> > @@ -43,6 +43,9 @@
> >
> > #ifdef CONFIG_X86_32
> > # define KEXEC_CONTROL_CODE_MAX_SIZE 2048
> > +# ifndef CONFIG_KEXEC
> > +# define kexec_control_code_size 0
> > +# endif
> > #endif
> >
> > #ifndef __ASSEMBLY__
>
> Is it impossible to skip the linker check in the !CONFIG_KEXEC case?
It is possible. I think there are several ways to do that.
1) use #ifdef in vmlinux_32.lds.S, such as:
#ifdef CONFIG_KEXEC
ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
"kexec control code size is too big")
#endif
2) #define a macro for kexec check ld script in asm/kexec.h, such as:
#define LD_CHECK_KEXEC() ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE, \
"kexec control code size is too big")
and use that in vmlinux_32.lds.S.
3) #define kexec_control_code_size 0. So that the check can be passed
always. And, code size = 0 is reasonable for no code (CONFIG_KEXEC=n).
I think 3) is better. What do you think about?
Best Regards,
Huang Ying
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Huang Ying <ying.huang@intel.com>
To: Simon Horman <horms@verge.net.au>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Machek <pavel@ucw.cz>,
nigel@nigel.suspend2.net, "Rafael J. Wysocki" <rjw@sisk.pl>,
Andrew Morton <akpm@linux-foundation.org>,
Vivek Goyal <vgoyal@redhat.com>,
mingo@elte.hu, Linus Torvalds <torvalds@linux-foundation.org>,
Kexec Mailing List <kexec@lists.infradead.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kexec jump: fix code size checking
Date: Wed, 13 Aug 2008 11:05:15 +0800 [thread overview]
Message-ID: <1218596715.24951.69.camel@caritas-dev.intel.com> (raw)
In-Reply-To: <20080813024701.GA19201@verge.net.au>
On Wed, 2008-08-13 at 12:47 +1000, Simon Horman wrote:
> On Wed, Aug 13, 2008 at 09:04:35AM +0800, Huang Ying wrote:
> > Fix building issue when CONFIG_KEXEC=n. Thanks to Vivek Goyal for his
> > reminding.
> >
> > Signed-off-by: Huang Ying <ying.huang@intel.com>
> >
> > ---
> > include/asm-x86/kexec.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > --- a/include/asm-x86/kexec.h
> > +++ b/include/asm-x86/kexec.h
> > @@ -43,6 +43,9 @@
> >
> > #ifdef CONFIG_X86_32
> > # define KEXEC_CONTROL_CODE_MAX_SIZE 2048
> > +# ifndef CONFIG_KEXEC
> > +# define kexec_control_code_size 0
> > +# endif
> > #endif
> >
> > #ifndef __ASSEMBLY__
>
> Is it impossible to skip the linker check in the !CONFIG_KEXEC case?
It is possible. I think there are several ways to do that.
1) use #ifdef in vmlinux_32.lds.S, such as:
#ifdef CONFIG_KEXEC
ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
"kexec control code size is too big")
#endif
2) #define a macro for kexec check ld script in asm/kexec.h, such as:
#define LD_CHECK_KEXEC() ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE, \
"kexec control code size is too big")
and use that in vmlinux_32.lds.S.
3) #define kexec_control_code_size 0. So that the check can be passed
always. And, code size = 0 is reasonable for no code (CONFIG_KEXEC=n).
I think 3) is better. What do you think about?
Best Regards,
Huang Ying
next prev parent reply other threads:[~2008-08-13 3:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-13 1:04 [PATCH] kexec jump: fix code size checking Huang Ying
2008-08-13 1:04 ` Huang Ying
2008-08-13 2:47 ` Simon Horman
2008-08-13 2:47 ` Simon Horman
2008-08-13 3:05 ` Huang Ying [this message]
2008-08-13 3:05 ` Huang Ying
2008-08-13 3:40 ` Eric W. Biederman
2008-08-13 3:40 ` Eric W. Biederman
2008-08-13 5:18 ` Huang Ying
2008-08-13 5:18 ` Huang Ying
2008-08-13 5:51 ` Simon Horman
2008-08-13 5:51 ` Simon Horman
2008-08-13 3:48 ` Simon Horman
2008-08-13 3:48 ` Simon Horman
2008-08-13 13:21 ` Vivek Goyal
2008-08-13 13:21 ` Vivek Goyal
2008-08-13 13:19 ` Vivek Goyal
2008-08-13 13:19 ` Vivek Goyal
2008-08-13 17:07 ` Andrew Morton
2008-08-13 17:07 ` Andrew Morton
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=1218596715.24951.69.camel@caritas-dev.intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=horms@verge.net.au \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nigel@nigel.suspend2.net \
--cc=pavel@ucw.cz \
--cc=rjw@sisk.pl \
--cc=torvalds@linux-foundation.org \
--cc=vgoyal@redhat.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 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.