lkml.org 
[lkml]   [2008]   [Aug]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/6] kexec jump: check code size in control page
Hi!

> > PAGE_SIZE/2. This patch adds runtime checking for this.
> >
> > Signed-off-by: Huang Ying <ying.huang@intel.com>
...

> > {
> > if (nx_enabled)
> > set_pages_x(image->control_code_page, 1);
> > +
> > + BUG_ON((unsigned long)kexec_control_page_code_end - \
> > + (unsigned long)relocate_kernel >= PAGE_SIZE/2);
> > +
>

> Run time check is better than nothing but I think in this case it would
> be better if we can catch it at compile time.
>
> One of the methods will be to write a small program of your own and
> put in script/ and at build time check for the size and flag error. May
> be there are other better ways to do this.

BUILD_BUG_ON()?

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


\
 
 \ /
  Last update: 2008-08-07 22:35    [W:0.140 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site