mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Minfei Huang <mhuang@redhat.com>
To: Minfei Huang <mnfhuang@gmail.com>
Cc: tglx@linutronix.de, mingo@redhat.com, x86@kernel.org,
	hpa@zytor.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm: Give the correct initail value to the pmd_idx
Date: Tue, 11 Nov 2014 19:36:08 +0800	[thread overview]
Message-ID: <20141111113608.GA3531@dhcp-17-108.nay.redhat.com> (raw)
In-Reply-To: <1415252513-6453-1-git-send-email-mnfhuang@gmail.com>

Could someone who help me review my patch?

Thanks
Minfei

On 11/06/14 at 01:41pm, Minfei Huang wrote:
> The variable value is undefined from the stack eara. So it makes sense to
> init the variable to run process correctly.
> 
> If the variable pmd_idx inits the value more than PTRS_PER_PMD, the
> count may be smaller than the correct value, and the allocated page may
> be not enough for pte entry.
> 
> The kernel may panic cause by the undefine variable which is allocated
> from stack.
> 
> Signed-off-by: Minfei Huang <mnfhuang@gmail.com>
> ---
>  arch/x86/mm/init_32.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
> index c8140e1..c23ab1e 100644
> --- a/arch/x86/mm/init_32.c
> +++ b/arch/x86/mm/init_32.c
> @@ -137,6 +137,7 @@ page_table_range_init_count(unsigned long start, unsigned long end)
>  
>  	vaddr = start;
>  	pgd_idx = pgd_index(vaddr);
> +	pmd_idx = pmd_index(vaddr);
>  
>  	for ( ; (pgd_idx < PTRS_PER_PGD) && (vaddr != end); pgd_idx++) {
>  		for (; (pmd_idx < PTRS_PER_PMD) && (vaddr != end);
> -- 
> 1.8.3.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

      reply	other threads:[~2014-11-11 11:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  5:41 Minfei Huang
2014-11-11 11:36 ` Minfei Huang [this message]

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=20141111113608.GA3531@dhcp-17-108.nay.redhat.com \
    --to=mhuang@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mnfhuang@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®