From: linfeng@cn.fujitsu.com (Lin Feng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] mm: vmemmap: x86: add vmemmap_verify check for hot-add node case
Date: Mon, 08 Apr 2013 18:23:16 +0800 [thread overview]
Message-ID: <51629A94.5000200@cn.fujitsu.com> (raw)
In-Reply-To: <1365415000-10389-2-git-send-email-linfeng@cn.fujitsu.com>
Hi all,
On 04/08/2013 05:56 PM, Lin Feng wrote:
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 474e28f..e2a7277 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -1318,6 +1318,8 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
> if (!p)
> return -ENOMEM;
>
> + vmemmap_verify((pte_t *)p, node, addr, addr + PAGE_SIZE);
> +
> addr_end = addr + PAGE_SIZE;
> p_end = p + PAGE_SIZE;
> } else {
IIUC it seems that the original 'p_end = p + PAGE_SIZE' assignment is buggy, because:
1309 if (!cpu_has_pse) {
1310 next = (addr + PAGE_SIZE) & PAGE_MASK;
1311 pmd = vmemmap_pmd_populate(pud, addr, node);
1312
1313 if (!pmd)
1314 return -ENOMEM;
1315
1316 p = vmemmap_pte_populate(pmd, addr, node);
1317
1318 if (!p)
1319 return -ENOMEM;
1320
1321 addr_end = addr + PAGE_SIZE;
1322 p_end = p + PAGE_SIZE;
The return value of vmemmap_pte_populate() is the virtual address of pte, not the allocated
virtual address, which is different from vmemmap_alloc_block_buf() in cpu_has_pse case, so
the addition PAGE_SIZE in !cpu_has_pse case is nonsense.
Or am I missing something?
thanks,
linfeng
WARNING: multiple messages have this Message-ID (diff)
From: Lin Feng <linfeng@cn.fujitsu.com>
To: akpm@linux-foundation.org, cl@linux.com
Cc: Lin Feng <linfeng@cn.fujitsu.com>,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
yinghai@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com,
arnd@arndb.de, tony@atomide.com, ben@decadent.org.uk,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, x86@kernel.org, linux-mm@kvack.org,
isimatu.yasuaki@jp.fujitsu.com
Subject: Re: [PATCH 1/2] mm: vmemmap: x86: add vmemmap_verify check for hot-add node case
Date: Mon, 08 Apr 2013 18:23:16 +0800 [thread overview]
Message-ID: <51629A94.5000200@cn.fujitsu.com> (raw)
In-Reply-To: <1365415000-10389-2-git-send-email-linfeng@cn.fujitsu.com>
Hi all,
On 04/08/2013 05:56 PM, Lin Feng wrote:
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 474e28f..e2a7277 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -1318,6 +1318,8 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
> if (!p)
> return -ENOMEM;
>
> + vmemmap_verify((pte_t *)p, node, addr, addr + PAGE_SIZE);
> +
> addr_end = addr + PAGE_SIZE;
> p_end = p + PAGE_SIZE;
> } else {
IIUC it seems that the original 'p_end = p + PAGE_SIZE' assignment is buggy, because:
1309 if (!cpu_has_pse) {
1310 next = (addr + PAGE_SIZE) & PAGE_MASK;
1311 pmd = vmemmap_pmd_populate(pud, addr, node);
1312
1313 if (!pmd)
1314 return -ENOMEM;
1315
1316 p = vmemmap_pte_populate(pmd, addr, node);
1317
1318 if (!p)
1319 return -ENOMEM;
1320
1321 addr_end = addr + PAGE_SIZE;
1322 p_end = p + PAGE_SIZE;
The return value of vmemmap_pte_populate() is the virtual address of pte, not the allocated
virtual address, which is different from vmemmap_alloc_block_buf() in cpu_has_pse case, so
the addition PAGE_SIZE in !cpu_has_pse case is nonsense.
Or am I missing something?
thanks,
linfeng
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Lin Feng <linfeng@cn.fujitsu.com>
To: akpm@linux-foundation.org, cl@linux.com
Cc: Lin Feng <linfeng@cn.fujitsu.com>,
tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
yinghai@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com,
arnd@arndb.de, tony@atomide.com, ben@decadent.org.uk,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, x86@kernel.org, linux-mm@kvack.org,
isimatu.yasuaki@jp.fujitsu.com
Subject: Re: [PATCH 1/2] mm: vmemmap: x86: add vmemmap_verify check for hot-add node case
Date: Mon, 08 Apr 2013 18:23:16 +0800 [thread overview]
Message-ID: <51629A94.5000200@cn.fujitsu.com> (raw)
In-Reply-To: <1365415000-10389-2-git-send-email-linfeng@cn.fujitsu.com>
Hi all,
On 04/08/2013 05:56 PM, Lin Feng wrote:
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 474e28f..e2a7277 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -1318,6 +1318,8 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node)
> if (!p)
> return -ENOMEM;
>
> + vmemmap_verify((pte_t *)p, node, addr, addr + PAGE_SIZE);
> +
> addr_end = addr + PAGE_SIZE;
> p_end = p + PAGE_SIZE;
> } else {
IIUC it seems that the original 'p_end = p + PAGE_SIZE' assignment is buggy, because:
1309 if (!cpu_has_pse) {
1310 next = (addr + PAGE_SIZE) & PAGE_MASK;
1311 pmd = vmemmap_pmd_populate(pud, addr, node);
1312
1313 if (!pmd)
1314 return -ENOMEM;
1315
1316 p = vmemmap_pte_populate(pmd, addr, node);
1317
1318 if (!p)
1319 return -ENOMEM;
1320
1321 addr_end = addr + PAGE_SIZE;
1322 p_end = p + PAGE_SIZE;
The return value of vmemmap_pte_populate() is the virtual address of pte, not the allocated
virtual address, which is different from vmemmap_alloc_block_buf() in cpu_has_pse case, so
the addition PAGE_SIZE in !cpu_has_pse case is nonsense.
Or am I missing something?
thanks,
linfeng
next prev parent reply other threads:[~2013-04-08 10:23 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-08 9:56 [PATCH 0/2] mm: vmemmap: add vmemmap_verify check for hot-add node/memory case Lin Feng
2013-04-08 9:56 ` Lin Feng
2013-04-08 9:56 ` Lin Feng
2013-04-08 9:56 ` [PATCH 1/2] mm: vmemmap: x86: add vmemmap_verify check for hot-add node case Lin Feng
2013-04-08 9:56 ` Lin Feng
2013-04-08 9:56 ` Lin Feng
2013-04-08 10:23 ` Lin Feng [this message]
2013-04-08 10:23 ` Lin Feng
2013-04-08 10:23 ` Lin Feng
2013-04-08 9:56 ` [PATCH 2/2] mm: vmemmap: arm64: " Lin Feng
2013-04-08 9:56 ` Lin Feng
2013-04-08 9:56 ` Lin Feng
2013-04-08 10:55 ` Will Deacon
2013-04-08 10:55 ` Will Deacon
2013-04-08 10:55 ` Will Deacon
2013-04-09 2:07 ` Lin Feng
2013-04-09 2:07 ` Lin Feng
2013-04-09 2:07 ` Lin Feng
2013-04-08 18:40 ` [PATCH 0/2] mm: vmemmap: add vmemmap_verify check for hot-add node/memory case Yinghai Lu
2013-04-08 18:40 ` Yinghai Lu
2013-04-08 18:40 ` Yinghai Lu
2013-04-08 20:55 ` Andrew Morton
2013-04-08 20:55 ` Andrew Morton
2013-04-08 20:55 ` Andrew Morton
2013-04-09 1:58 ` Lin Feng
2013-04-09 1:58 ` Lin Feng
2013-04-09 1:58 ` Lin Feng
2013-04-09 2:02 ` Lin Feng
2013-04-09 2:02 ` Lin Feng
2013-04-09 2:02 ` Lin Feng
2013-04-11 7:41 ` Tang Chen
2013-04-11 7:41 ` Tang Chen
2013-04-11 7:41 ` Tang Chen
2013-04-11 15:10 ` Yinghai Lu
2013-04-11 15:10 ` Yinghai Lu
2013-04-11 15:10 ` Yinghai Lu
2013-04-12 1:13 ` Tang Chen
2013-04-12 1:13 ` Tang Chen
2013-04-12 1:13 ` Tang Chen
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=51629A94.5000200@cn.fujitsu.com \
--to=linfeng@cn.fujitsu.com \
--cc=linux-arm-kernel@lists.infradead.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 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.