System report Int 6 error if E820 table reserve the memory above 4G
A message that is not in the archive (sent off-list or not yet received): [email protected]/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · [email protected] wrote:
http://bugzilla.kernel.org/show_bug.cgi?id=13484
--- Comment #3 from Peer Chen <[email protected]> 2009-06-08 05:43:25 --- I'm using 64bit CPU, Intel P8400.
Yes, if set
CONFIG_PHYS_ADDR_T_64BIT, the problem goes away.
please check
--- drivers/firmware/memmap.c | 12 +++++------- include/linux/firmware-map.h | 12 ++++-------- 2 files changed, 9 insertions(+), 15 deletions(-)
drivers/firmware/memmap.c +5 -7
@@ -31,8 +31,8 @@* information is necessary as for the resource tree. */ struct firmware_map_entry { -resource_size_t start;/* start of the memory range */ -resource_size_t end;/* end of the memory range (incl.) */ +u64 start;/* start of the memory range */ +u64 end;/* end of the memory range (incl.) */ const char *type;/* type of the memory range */ struct list_head list;/* entry for the linked list */ struct kobject kobj;/* kobject for each entry */
@@ -101,7 +101,7 @@ static LIST_HEAD(map_entries);* Common implementation of firmware_map_add() and firmware_map_add_early() * which expects a pre-allocated struct firmware_map_entry. **/ -static int firmware_map_add_entry (resource_size_t start,resource_size_t end, +static int firmware_map_add_entry (u64 start,u64 end,const char *type,struct firmware_map_entry *entry) {
@@ -132,8 +132,7 @@ static int firmware_map_add_entry(resour* * Returns 0 on success, or -ENOMEM if no memory could be allocated. **/ -int firmware_map_add (resource_size_t start,resource_size_t end, -const char *type) +int firmware_map_add (u64 start,u64 end,const char *type) {struct firmware_map_entry *entry;
@@ -157,8 +156,7 @@ int firmware_map_add(resource_size_t sta* * Returns 0 on success, or -ENOMEM if no memory could be allocated. **/ -int __init firmware_map_add_early (resource_size_t start,resource_size_t end, -const char *type) +int __init firmware_map_add_early (u64 start,u64 end,const char *type) {struct firmware_map_entry *entry;
include/linux/firmware-map.h +4 -8
@@ -24,21 +24,17 @@*/ #ifdef CONFIG_FIRMWARE_MEMMAP -int firmware_map_add (resource_size_t start,resource_size_t end, -const char *type); -int firmware_map_add_early (resource_size_t start,resource_size_t end, -const char *type); +int firmware_map_add (u64 start,u64 end,const char *type); +int firmware_map_add_early (u64 start,u64 end,const char *type);#else /* CONFIG_FIRMWARE_MEMMAP */ -static inline int firmware_map_add (resource_size_t start,resource_size_t end, -const char *type) +static inline int firmware_map_add (u64 start,u64 end,const char *type) {return 0 ; } -static inline int firmware_map_add_early (resource_size_t start, -resource_size_t end,const char *type) +static inline int firmware_map_add_early (u64 start,u64 end,const char *type) {return 0 ; }
Yinghai,
The patch works, thanks.
BRs
Peer Chen
Quoted 4 lines
-----Original Message-----
From: Yinghai Lu [mailto:[email protected]]
Sent: Monday, June 08, 2009 2:50 PM
To: [email protected]; Ingo Molnar; H. Peter Anvin;
Thomas Gleixner; H. Peter Anvin; [email protected];
Quoted 2 lines
Peer Chen; Bernhard Walle
Subject: Re: [Bug 13484] System report Int 6 error if E820 table
reserve the memory above 4G
Quoted 9 lines
Quoted 7 lines · [email protected] wrote:
http://bugzilla.kernel.org/show_bug.cgi?id=13484
--- Comment #3 from Peer Chen <[email protected]> 2009-06-08
05:43:25 ---
Quoted 17 lines
Quoted 4 lines
I'm using 64bit CPU, Intel P8400.
Yes, if set
CONFIG_PHYS_ADDR_T_64BIT, the problem goes away.please check
--- drivers/firmware/memmap.c | 12 +++++------- include/linux/firmware-map.h | 12 ++++-------- 2 files changed, 9 insertions(+), 15 deletions(-)Index:
linux-2.6/drivers/firmware/memmap.c
===================================================================
drivers/firmware/memmap.c line 35
Quoted 5 lines
drivers/firmware/memmap.c +0
-2@@ -31,8 +31,8 @@* information is necessary as for the resource tree. */ struct firmware_map_entry { -resource_size_t start;/* start of the memory range */ -resource_size_t end;/* end of the memory range
(incl.) */
drivers/firmware/memmap.c line 35
Quoted 2 lines
drivers/firmware/memmap.c +2
-0+u64 start;/* start of the memory range */ +u64 end;/* end of the memory range
(incl.) */
drivers/firmware/memmap.c static LIST_HEAD(map_entries); · line 101
Quoted 5 lines
drivers/firmware/memmap.c +0
-0const char *type;/* type of the memory range */ struct list_head list;/* entry for the linked list */ struct kobject kobj;/* kobject for each entry */ @@ -101,7 +101,7 @@ static LIST_HEAD(map_entries);* Common implementation of firmware_map_add() and
firmware_map_add_early()
drivers/firmware/memmap.c static LIST_HEAD(map_entries);
Quoted 3 lines
drivers/firmware/memmap.c +0
-1* which expects a pre-allocated struct firmware_map_entry. **/ -static int firmware_map_add_entry(resource_size_t start,
resource_size_t end,
Quoted 15 lines
drivers/firmware/memmap.c +2
-2+static int firmware_map_add_entry (u64 start,u64 end,const char *type,struct firmware_map_entry *entry) {@@ -132,8 +132,7 @@ static int firmware_map_add_entry(resour* * Returns 0 on success, or -ENOMEM if no memory could be allocated. **/ -int firmware_map_add (resource_size_t start,resource_size_t end, -const char *type) +int firmware_map_add (u64 start,u64 end,const char *type) {struct firmware_map_entry *entry;
drivers/firmware/memmap.c int firmware_map_add(resource_size_t sta · line 160
Quoted 4 lines
drivers/firmware/memmap.c +0
-1@@ -157,8 +156,7 @@ int firmware_map_add(resource_size_t sta* * Returns 0 on success, or -ENOMEM if no memory could be allocated. **/ -int __init firmware_map_add_early(resource_size_t start,
resource_size_t end,
drivers/firmware/memmap.c int firmware_map_add(resource_size_t sta · line 159
Quoted 2 lines
drivers/firmware/memmap.c +1
-1- const char *type) +int __init firmware_map_add_early(u64 start, u64 end, const char
*type)
Quoted 8 lines
drivers/firmware/memmap.c +0
-0{struct firmware_map_entry *entry;Index:
linux-2.6/include/linux/firmware-map.h
===================================================================
include/linux/firmware-map.h line 29
Quoted 6 lines
include/linux/firmware-map.h +0
-3@@ -24,21 +24,17 @@*/ #ifdef CONFIG_FIRMWARE_MEMMAP -int firmware_map_add (resource_size_t start,resource_size_t end, -const char *type); -int firmware_map_add_early(resource_size_t start, resource_size_t
end,
include/linux/firmware-map.h
Quoted 7 lines
include/linux/firmware-map.h +2
-2- const char *type); +int firmware_map_add (u64 start,u64 end,const char *type); +int firmware_map_add_early (u64 start,u64 end,const char *type);#else /* CONFIG_FIRMWARE_MEMMAP */ -static inline int firmware_map_add(resource_size_t start,
resource_size_t end,
include/linux/firmware-map.h line 32
Quoted 2 lines
include/linux/firmware-map.h +1
-1- const char *type) +static inline int firmware_map_add(u64 start, u64 end, const char
*type)
include/linux/firmware-map.h
Quoted 6 lines
include/linux/firmware-map.h +0
-2{return 0 ; } -static inline int firmware_map_add_early (resource_size_t start, - resource_size_t end, const char
*type)
include/linux/firmware-map.h line 37
Quoted 1 line
include/linux/firmware-map.h +1
-0+static inline int firmware_map_add_early(u64 start, u64 end, const
char *type)
include/linux/firmware-map.h line 35
Quoted 3 lines
include/linux/firmware-map.h +0
-0{return 0 ; }
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
PATCH 1/1 firmware_map: fix hang with x86/32bit
http://bugzilla.kernel.org/show_bug.cgi?id=13484
Peer reported:
| The bug is introduced from kernel 2.6.27, if E820 table reserve the memory | above 4G in 32bit OS(BIOS-e820: 00000000fff80000 - 0000000120000000 | (reserved)), system will report Int 6 error and hang up. The bug is caused by | the following code in drivers/firmware/memmap.c, the resource_size_t is 32bit | variable in 32bit OS, the BUG_ON() will be invoked to result in the Int 6 | error. I try the latest 32bit Ubuntu and Fedora distributions, all hit this | bug. |====== |static int firmware_map_add_entry(resource_size_t start, resource_size_t end, | const char *type, | struct firmware_map_entry *entry)
and it only happen with CONFIG_PHYS_ADDR_T_64BIT is not set.
it turns out we need to pass u64 instead of resource_size_t for that.
--- drivers/firmware/memmap.c | 12 +++++------- include/linux/firmware-map.h | 12 ++++-------- 2 files changed, 9 insertions(+), 15 deletions(-)
drivers/firmware/memmap.c +5 -7
@@ -31,8 +31,8 @@* information is necessary as for the resource tree. */ struct firmware_map_entry { -resource_size_t start;/* start of the memory range */ -resource_size_t end;/* end of the memory range (incl.) */ +u64 start;/* start of the memory range */ +u64 end;/* end of the memory range (incl.) */ const char *type;/* type of the memory range */ struct list_head list;/* entry for the linked list */ struct kobject kobj;/* kobject for each entry */
@@ -101,7 +101,7 @@ static LIST_HEAD(map_entries);* Common implementation of firmware_map_add() and firmware_map_add_early() * which expects a pre-allocated struct firmware_map_entry. **/ -static int firmware_map_add_entry (resource_size_t start,resource_size_t end, +static int firmware_map_add_entry (u64 start,u64 end,const char *type,struct firmware_map_entry *entry) {
@@ -132,8 +132,7 @@ static int firmware_map_add_entry(resour* * Returns 0 on success, or -ENOMEM if no memory could be allocated. **/ -int firmware_map_add (resource_size_t start,resource_size_t end, -const char *type) +int firmware_map_add (u64 start,u64 end,const char *type) {struct firmware_map_entry *entry;
@@ -157,8 +156,7 @@ int firmware_map_add(resource_size_t sta* * Returns 0 on success, or -ENOMEM if no memory could be allocated. **/ -int __init firmware_map_add_early (resource_size_t start,resource_size_t end, -const char *type) +int __init firmware_map_add_early (u64 start,u64 end,const char *type) {struct firmware_map_entry *entry;
include/linux/firmware-map.h +4 -8
@@ -24,21 +24,17 @@*/ #ifdef CONFIG_FIRMWARE_MEMMAP -int firmware_map_add (resource_size_t start,resource_size_t end, -const char *type); -int firmware_map_add_early (resource_size_t start,resource_size_t end, -const char *type); +int firmware_map_add (u64 start,u64 end,const char *type); +int firmware_map_add_early (u64 start,u64 end,const char *type);#else /* CONFIG_FIRMWARE_MEMMAP */ -static inline int firmware_map_add (resource_size_t start,resource_size_t end, -const char *type) +static inline int firmware_map_add (u64 start,u64 end,const char *type) {return 0 ; } -static inline int firmware_map_add_early (resource_size_t start, -resource_size_t end,const char *type) +static inline int firmware_map_add_early (u64 start,u64 end,const char *type) {return 0 ; }