x86: split e820 reserved entries record to late v2
Quoted 22 lines
From: Ingo Molnar <[email protected]>
To: Yinghai Lu <[email protected]>
Cc: Linus Torvalds <[email protected]>; David Witbrodt <[email protected]>; Thomas Gleixner <[email protected]>; H. Peter Anvin <[email protected]>; Andrew Morton <[email protected]>; Jesse Barnes <[email protected]>; [email protected]
Sent: Thursday, August 28, 2008 4:58:28 PM
Subject: Re: [PATCH] x86: split e820 reserved entries record to late v2Quoted 11 lines · Yinghai Lu
Quoted 8 lines · Linus Torvalds
Quoted 2 lines · Yinghai Lu
v2: insert e820 reserve resources before
pnp_system_initLooks ok by me. Now it just needs testing ;)
Does it actually fix the HPET regression on that odd machine (without the special hacks to recognize HPET explicitly)?
Quoted 8 lines
Quoted 4 lines
David,
can you test attached patch?
also you may try to revert the old patch.great - i've done the revert of
a2bd7274b471and have applied your patch and pushed it out into -tip. David, could you please test whether tip/master works for you out of box?
===== SHELL OUTPUT (for sanity) =====
commit e3fc96d5aca609bcf6ab0327850a109df65c1dbb
Merge: 6b8c836... a36d241...
Author: Ingo Molnar <[email protected]>
Date: Thu Aug 28 22:57:20 2008 +0200
Merge branch 'x86/core'
=====================================
Results: both ECS AMD690GM-M2 machines boot fine...
- no need for "hpet=disable"
- no error messages in 'dmesg' (except that annoying TSC b.s.)
More good news: the user who first reported the regression in May (he uses Intel Q6600 CPU + Abit F-190HD mboard, while I use AMD Athlon 64 X2 3600+ CPU + ECS mboard) posted a followup on his blog:
===== http://ciaranm.wordpress.com/2008/05/18/yay-for-git/#comments ===== Oh good. Looks like git head works just fine now for me, so whatever it was appears to be fixed.
Comment by Ciaran McCreesh — August 26, 2008 @ 6:25 pm
=========================================================================
I was afraid that Yinghai's original patch (many days ago) which worked for me was too AMD-specific, and would not work for this other user experiencing the regression against commit 3def3d6d...
When you (Ingo) and Yinghai made it more generic afterwards, I feared that it was too HPET-specific.
I tried to get Ciaran here, so that the problems he and I were having could both be solved. It's not clear what change solved his regression -- clearly it's not today's patch, since his blog post is dated 2 days ago! -- but I'm glad to see that all is well in the world again.
Ingo, could you do me a favor?
Mr. Anvin's inbox got badly messed up because of me:
Quoted 1 line
From: H. Peter Anvin <[email protected]>
[...]
Quoted 1 line
Sent: Thursday, August 28, 2008 8:21:09 PM
[...]
Quoted 3 lines
This may be a rehash of things previously discussed in this thread; my email seems to be a bit flakey to the point that I don't know if I have gotten all the messages.
Could you explain this to him for me? I don't want to post any more than this one message, just making a bad situation worse. (Sorry about the threading, Peter!)
Since Monday I have gone back to work on my LAN. RAID was quickly set up on the fileserver, but the backup of the P4 isn't finished so I _still_ haven't been able to pull the hard disk from it for the webserver. Only after that will I be able to get the MTA arrangement I want, and banish this webmail client FOREVER! (I should have done all of this while I was helping you troubleshoot the regression, since my 2.6.25 kernels work fine, but I was too excited about being able to help to think that clearly.)
Thanks all!
Dave Witbrodt
Quoted 7 lines · David Witbrodt
===== SHELL OUTPUT (for sanity) =====
commite3fc96d5aca609bcf6ab0327850a109df65c1dbb
Merge: 6b8c836... a36d241...
Author: Ingo Molnar <[email protected]>
Date: Thu Aug 28 22:57:20 2008 +0200
Quoted 8 lines
Merge branch 'x86/core'
=====================================Results: both ECS AMD690GM-M2 machines boot fine...
- no need for "hpet=disable"
- no error messages in 'dmesg' (except that annoying TSC b.s.)
please hang a while, there is some merging problem with current tip/master.
one or two hours later ingo may fix it.
or please try attached two patches....
YH
arch/x86/kernel/e820.c +2 -18
@@ -1271,15 +1271,13 @@ static inline const char *e820_type_to_string(int e820_type)/* * Mark e820 reserved areas as busy for the resource manager. */ -struct resource __initdata *e820_res;void __init e820_reserve_resources (void ) {int i; -u64 end;struct resource *res; +u64 end; res =alloc_bootmem_low (sizeof (struct resource ) * e820.nr_map); - e820_res = res;for (i =0 ; i < e820.nr_map; i++) { end = e820.map[i].addr + e820.map[i].size -1 ;#ifndef CONFIG_RESOURCES_64BIT
@@ -1293,8 +1291,7 @@ void __init e820_reserve_resources(void) res->end = end; res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ; -if (e820.map[i].type !=E820_RESERVED || res->start < (1ULL <<20 )) -insert_resource (&iomem_resource, res); +insert_resource (&iomem_resource, res); res++; }
@@ -1306,19 +1303,6 @@ void __init e820_reserve_resources(void) } } -void __init e820_reserve_resources_late (void ) -{ -int i; -struct resource *res; - - res = e820_res; -for (i =0 ; i < e820.nr_map; i++) { -if (e820.map[i].type ==E820_RESERVED && res->start >= (1ULL <<20 )) -insert_resource (&iomem_resource, res); - res++; - } -} -char *__init default_machine_specific_memory_setup (void ) {char *who ="BIOS-e820" ;
arch/x86/pci/i386.c +0 -79
105 lines not on this page · raw message
include/asm-x86/e820.h +0 -1
@@ -122,7 +122,6 @@ extern void e820_register_active_regions(int nid, unsigned long start_pfn,extern u64 e820_hole_size (u64 start,u64 end);extern void finish_e820_parsing (void );extern void e820_reserve_resources (void ); -extern void e820_reserve_resources_late (void );extern void setup_memory_map (void );extern char *default_machine_specific_memory_setup (void );extern char *machine_specific_memory_setup (void );
From: Yinghai Lu <[email protected]>
Subject: [PATCH] x86: split e820 reserved entries record to late v4
Linus said we should register some entries in e820 later, so could let BAR res register at first, or even pnp?
this one replace
| commit a2bd7274b47124d2fc4dfdb8c0591f545ba749dd | Author: Yinghai Lu <[email protected]> | Date: Mon Aug 25 00:56:08 2008 -0700 | | x86: fix HPET regression in 2.6.26 versus 2.6.25, check hpet against BAR, v3
v2: insert e820 reserve resources before pnp_system_init
v3: fix merging problem in tip/x86/core
please drop the one in tip/x86/core use this one instead
v4: address Linus's review about comments and condition in _late()
--- arch/x86/kernel/e820.c | 24 +++++++++++++++++++++++- arch/x86/pci/i386.c | 3 +++ include/asm-x86/e820.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-)
arch/x86/kernel/e820.c +23 -1
@@ -1271,6 +1271,7 @@ static inline const char *e820_type_to_s/* * Mark e820 reserved areas as busy for the resource manager. */ +static struct resource __initdata *e820_res;void __init e820_reserve_resources (void ) {int i;
@@ -1278,6 +1279,7 @@ void __init e820_reserve_resources(void)u64 end; res =alloc_bootmem_low (sizeof (struct resource ) * e820.nr_map); + e820_res = res;for (i =0 ; i < e820.nr_map; i++) { end = e820.map[i].addr + e820.map[i].size -1 ;#ifndef CONFIG_RESOURCES_64BIT
@@ -1291,7 +1293,14 @@ void __init e820_reserve_resources(void) res->end = end; res->flags =IORESOURCE_MEM |IORESOURCE_BUSY ; -insert_resource (&iomem_resource, res); + +/* +* don't register the region that could be conflicted with +* pci device BAR resource and insert them later in +* pcibios_resource_survey() +*/ +if (e820.map[i].type !=E820_RESERVED || res->start < (1ULL <<20 )) +insert_resource (&iomem_resource, res); res++; }
@@ -1303,6 +1312,19 @@ void __init e820_reserve_resources(void) } } +void __init e820_reserve_resources_late (void ) +{ +int i; +struct resource *res; + + res = e820_res; +for (i =0 ; i < e820.nr_map; i++) { +if (!res->parent && res->end) +insert_resource (&iomem_resource, res); + res++; + } +} +char *__init default_machine_specific_memory_setup (void ) {char *who ="BIOS-e820" ;
arch/x86/pci/i386.c +3 -0
@@ -33,6 +33,7 @@#include <linux/bootmem.h> #include <asm/pat.h> +#include <asm/e820.h> #include "pci.h"
@@ -230,6 +231,8 @@ void __init pcibios_resource_survey(voidpcibios_allocate_bus_resources (&pci_root_buses);pcibios_allocate_resources (0 );pcibios_allocate_resources (1 ); + +e820_reserve_resources_late (); }/**
include/asm-x86/e820.h +1 -0
@@ -122,6 +122,7 @@ extern void e820_register_active_regionsextern u64 e820_hole_size (u64 start,u64 end);extern void finish_e820_parsing (void );extern void e820_reserve_resources (void ); +extern void e820_reserve_resources_late (void );extern void setup_memory_map (void );extern char *default_machine_specific_memory_setup (void );extern char *machine_specific_memory_setup (void );