All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Huang, Ying" <ying.huang@intel.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm 1/2] kexec/i386: kexec page table code clean up - add arch_kimage
Date: Thu, 10 Jan 2008 10:06:11 +0800	[thread overview]
Message-ID: <1199930771.8752.4.camel@caritas-dev.intel.com> (raw)
In-Reply-To: <20080110011423.GB23143@redhat.com>

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


  reply	other threads:[~2008-01-10  2:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09  2:57 [PATCH -mm 1/2] kexec/i386: kexec page table code clean up - add arch_kimage Huang, Ying
2008-01-10  1:14 ` Vivek Goyal
2008-01-10  2:06   ` Huang, Ying [this message]
2008-01-10  8:15   ` Simon Horman
2008-01-14 13:29     ` Ian Campbell
2008-01-15  1:34       ` Simon Horman

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=1199930771.8752.4.camel@caritas-dev.intel.com \
    --to=ying.huang@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.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.