From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xishi Qiu Subject: Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting Date: Sat, 16 Feb 2013 09:55:44 +0800 Message-ID: <511EE720.6060907@huawei.com> References: <51074786.5030007@huawei.com> <1359995565.7515.178.camel@mfleming-mobl1.ger.corp.intel.com> <51131248.3080203@huawei.com> <5113450C.1080109@huawei.com> <1360750028.24917.28.camel@mfleming-mobl1.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1360750028.24917.28.camel-ZqTwcBeJ+wsBof6jY8KHXm7IUlhRatedral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Matt Fleming , "Luck, Tony" , fenghua.yu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, Liujiang , Andrew Morton Cc: linux-ia64-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Hanjun Guo , WuJianguo List-Id: linux-efi@vger.kernel.org On 2013/2/13 18:07, Matt Fleming wrote: >> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M" >> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M]. >> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages >> when freeing initrd memory. There are some pages missed at the end of the seciton. >> >> ChangeLog V3: >> fixed vaddr mistake >> ChangeLog V2: >> add invalid pages check when freeing initrd memory >> >> Signed-off-by: Xishi Qiu >> --- >> arch/ia64/mm/init.c | 4 ++++ >> 1 files changed, 4 insertions(+), 0 deletions(-) >> >> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c >> index 082e383..8a269f8 100644 >> --- a/arch/ia64/mm/init.c >> +++ b/arch/ia64/mm/init.c >> @@ -173,6 +173,7 @@ void __init >> free_initrd_mem (unsigned long start, unsigned long end) >> { >> struct page *page; >> + unsigned long pfn; >> /* >> * EFI uses 4KB pages while the kernel can use 4KB or bigger. >> * Thus EFI and the kernel may have different page sizes. It is >> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end) >> for (; start < end; start += PAGE_SIZE) { >> if (!virt_addr_valid(start)) >> continue; >> + pfn = __pa(start) >> PAGE_SHIFT; >> + if (pfn >= max_low_pfn) >> + continue; >> page = virt_to_page(start); >> ClearPageReserved(page); >> init_page_count(page); > > I would have presumed that fixing this bug would involve modifying the > ia64-specific kexec code? > > Tony, Fenghua? Any thoughts? Hi, I had the Spring Festival a few days ago. Please ignore the earlier patch and consider the V3 one above. Thanks, Xishi Qiu From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xishi Qiu Date: Sat, 16 Feb 2013 01:55:44 +0000 Subject: Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting Message-Id: <511EE720.6060907@huawei.com> List-Id: References: <51074786.5030007@huawei.com> <1359995565.7515.178.camel@mfleming-mobl1.ger.corp.intel.com> <51131248.3080203@huawei.com> <5113450C.1080109@huawei.com> <1360750028.24917.28.camel@mfleming-mobl1.ger.corp.intel.com> In-Reply-To: <1360750028.24917.28.camel@mfleming-mobl1.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Matt Fleming , "Luck, Tony" , fenghua.yu@intel.com, Liujiang , Andrew Morton Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-mm@kvack.org, Hanjun Guo , WuJianguo On 2013/2/13 18:07, Matt Fleming wrote: >> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel24M-:600M" >> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M]. >> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages >> when freeing initrd memory. There are some pages missed at the end of the seciton. >> >> ChangeLog V3: >> fixed vaddr mistake >> ChangeLog V2: >> add invalid pages check when freeing initrd memory >> >> Signed-off-by: Xishi Qiu >> --- >> arch/ia64/mm/init.c | 4 ++++ >> 1 files changed, 4 insertions(+), 0 deletions(-) >> >> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c >> index 082e383..8a269f8 100644 >> --- a/arch/ia64/mm/init.c >> +++ b/arch/ia64/mm/init.c >> @@ -173,6 +173,7 @@ void __init >> free_initrd_mem (unsigned long start, unsigned long end) >> { >> struct page *page; >> + unsigned long pfn; >> /* >> * EFI uses 4KB pages while the kernel can use 4KB or bigger. >> * Thus EFI and the kernel may have different page sizes. It is >> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end) >> for (; start < end; start += PAGE_SIZE) { >> if (!virt_addr_valid(start)) >> continue; >> + pfn = __pa(start) >> PAGE_SHIFT; >> + if (pfn >= max_low_pfn) >> + continue; >> page = virt_to_page(start); >> ClearPageReserved(page); >> init_page_count(page); > > I would have presumed that fixing this bug would involve modifying the > ia64-specific kexec code? > > Tony, Fenghua? Any thoughts? Hi, I had the Spring Festival a few days ago. Please ignore the earlier patch and consider the V3 one above. Thanks, Xishi Qiu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx138.postini.com [74.125.245.138]) by kanga.kvack.org (Postfix) with SMTP id 33E0D6B0005 for ; Fri, 15 Feb 2013 20:57:27 -0500 (EST) Message-ID: <511EE720.6060907@huawei.com> Date: Sat, 16 Feb 2013 09:55:44 +0800 From: Xishi Qiu MIME-Version: 1.0 Subject: Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting References: <51074786.5030007@huawei.com> <1359995565.7515.178.camel@mfleming-mobl1.ger.corp.intel.com> <51131248.3080203@huawei.com> <5113450C.1080109@huawei.com> <1360750028.24917.28.camel@mfleming-mobl1.ger.corp.intel.com> In-Reply-To: <1360750028.24917.28.camel@mfleming-mobl1.ger.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Matt Fleming , "Luck, Tony" , fenghua.yu@intel.com, Liujiang , Andrew Morton Cc: linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-mm@kvack.org, Hanjun Guo , WuJianguo On 2013/2/13 18:07, Matt Fleming wrote: >> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M" >> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M]. >> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages >> when freeing initrd memory. There are some pages missed at the end of the seciton. >> >> ChangeLog V3: >> fixed vaddr mistake >> ChangeLog V2: >> add invalid pages check when freeing initrd memory >> >> Signed-off-by: Xishi Qiu >> --- >> arch/ia64/mm/init.c | 4 ++++ >> 1 files changed, 4 insertions(+), 0 deletions(-) >> >> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c >> index 082e383..8a269f8 100644 >> --- a/arch/ia64/mm/init.c >> +++ b/arch/ia64/mm/init.c >> @@ -173,6 +173,7 @@ void __init >> free_initrd_mem (unsigned long start, unsigned long end) >> { >> struct page *page; >> + unsigned long pfn; >> /* >> * EFI uses 4KB pages while the kernel can use 4KB or bigger. >> * Thus EFI and the kernel may have different page sizes. It is >> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end) >> for (; start < end; start += PAGE_SIZE) { >> if (!virt_addr_valid(start)) >> continue; >> + pfn = __pa(start) >> PAGE_SHIFT; >> + if (pfn >= max_low_pfn) >> + continue; >> page = virt_to_page(start); >> ClearPageReserved(page); >> init_page_count(page); > > I would have presumed that fixing this bug would involve modifying the > ia64-specific kexec code? > > Tony, Fenghua? Any thoughts? Hi, I had the Spring Festival a few days ago. Please ignore the earlier patch and consider the V3 one above. Thanks, Xishi Qiu -- 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: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752119Ab3BPB5T (ORCPT ); Fri, 15 Feb 2013 20:57:19 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:59461 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751316Ab3BPB5R (ORCPT ); Fri, 15 Feb 2013 20:57:17 -0500 Message-ID: <511EE720.6060907@huawei.com> Date: Sat, 16 Feb 2013 09:55:44 +0800 From: Xishi Qiu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Matt Fleming , "Luck, Tony" , , Liujiang , Andrew Morton CC: , , , , Hanjun Guo , WuJianguo Subject: Re: [PATCH V3] ia64/mm: fix a bad_page bug when crash kernel booting References: <51074786.5030007@huawei.com> <1359995565.7515.178.camel@mfleming-mobl1.ger.corp.intel.com> <51131248.3080203@huawei.com> <5113450C.1080109@huawei.com> <1360750028.24917.28.camel@mfleming-mobl1.ger.corp.intel.com> In-Reply-To: <1360750028.24917.28.camel@mfleming-mobl1.ger.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.135.74.196] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2013/2/13 18:07, Matt Fleming wrote: >> In efi_init() memory aligns in IA64_GRANULE_SIZE(16M). If set "crashkernel=1024M-:600M" >> and use sparse memory model, when crash kernel booting it changes [128M-728M] to [128M-720M]. >> But initrd memory is in [709M-727M], and virt_addr_valid() *can not* check the invalid pages >> when freeing initrd memory. There are some pages missed at the end of the seciton. >> >> ChangeLog V3: >> fixed vaddr mistake >> ChangeLog V2: >> add invalid pages check when freeing initrd memory >> >> Signed-off-by: Xishi Qiu >> --- >> arch/ia64/mm/init.c | 4 ++++ >> 1 files changed, 4 insertions(+), 0 deletions(-) >> >> diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c >> index 082e383..8a269f8 100644 >> --- a/arch/ia64/mm/init.c >> +++ b/arch/ia64/mm/init.c >> @@ -173,6 +173,7 @@ void __init >> free_initrd_mem (unsigned long start, unsigned long end) >> { >> struct page *page; >> + unsigned long pfn; >> /* >> * EFI uses 4KB pages while the kernel can use 4KB or bigger. >> * Thus EFI and the kernel may have different page sizes. It is >> @@ -213,6 +214,9 @@ free_initrd_mem (unsigned long start, unsigned long end) >> for (; start < end; start += PAGE_SIZE) { >> if (!virt_addr_valid(start)) >> continue; >> + pfn = __pa(start) >> PAGE_SHIFT; >> + if (pfn >= max_low_pfn) >> + continue; >> page = virt_to_page(start); >> ClearPageReserved(page); >> init_page_count(page); > > I would have presumed that fixing this bug would involve modifying the > ia64-specific kexec code? > > Tony, Fenghua? Any thoughts? Hi, I had the Spring Festival a few days ago. Please ignore the earlier patch and consider the V3 one above. Thanks, Xishi Qiu