lkml.org 
[lkml]   [2008]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH -mm 1/2] kexec/i386: kexec page table code clean up - add arch_kimage
From
Date
On Wed, 2008-01-09 at 20:14 -0500, Vivek Goyal wrote:
[...]
> >
> > +static void alloc_page_tables(struct kimage *image)
> > +{
>
> This is too generic a name. How about something like
> arch_alloc_kexec_page_tables()

OK, I will change it.

> > + image->arch_kimage.pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL);
> > +#ifdef CONFIG_X86_PAE
> > + image->arch_kimage.pmd0 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
> > + image->arch_kimage.pmd1 = (pmd_t *)get_zeroed_page(GFP_KERNEL);
> > +#endif
> > + image->arch_kimage.pte0 = (pte_t *)get_zeroed_page(GFP_KERNEL);
> > + image->arch_kimage.pte1 = (pte_t *)get_zeroed_page(GFP_KERNEL);
> > +}
> > +
> > +static void free_page_tables(struct kimage *image)
> > +{
>
> How about arch_free_kexec_page_tables()

OK, I will change it.

> > + free_page((unsigned long)image->arch_kimage.pgd);
> > +#ifdef CONFIG_X86_PAE
> > + free_page((unsigned long)image->arch_kimage.pmd0);
> > + free_page((unsigned long)image->arch_kimage.pmd1);
> > +#endif
> > + free_page((unsigned long)image->arch_kimage.pte0);
> > + free_page((unsigned long)image->arch_kimage.pte1);
> > +}
> > +
> > /*
> > * A architecture hook called to validate the
> > * proposed image and prepare the control pages
> > @@ -83,10 +97,21 @@ static void load_segments(void)
> > * reboot code buffer to allow us to avoid allocations
> > * later.
> > *
> > - * Currently nothing.
> > + * - Allocate page tables
> > */
> > int machine_kexec_prepare(struct kimage *image)
> > {
> > + alloc_page_tables(image);
> > + if (!image->arch_kimage.pgd ||
> > +#ifdef CONFIG_X86_PAE
> > + !image->arch_kimage.pmd0 ||
> > + !image->arch_kimage.pmd1 ||
> > +#endif
> > + !image->arch_kimage.pte0 ||
> > + !image->arch_kimage.pte1) {
> > + free_page_tables(image);
> > + return -ENOMEM;
>
> I think this error handling can be done in alloc_page_tables() itself and
> following will look neater.

OK, I will change it.

Best Regards,
Huang Ying



\
 
 \ /
  Last update: 2008-01-10 03:09    [W:0.070 / U:4.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site