Bug 455423 - x86: insert_resorce for lapic addr after e820_reserve_resources
Summary: x86: insert_resorce for lapic addr after e820_reserve_resources
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Prarit Bhargava
QA Contact: Martin Jenner
URL:
Whiteboard:
Depends On:
Blocks: 455409
TreeView+ depends on / blocked
 
Reported: 2008-07-15 14:02 UTC by Prarit Bhargava
Modified: 2008-08-07 12:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-08-07 12:06:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Upstream fix for this issue (6.20 KB, patch)
2008-07-15 14:02 UTC, Prarit Bhargava
no flags Details | Diff

Description Prarit Bhargava 2008-07-15 14:02:23 UTC
Backport 1e934dda0c77c8ad13fdda02074f2cfcea118a56

    x86: insert_resorce for lapic addr after e820_reserve_resources
    
    when comparing the e820 direct from BIOS, and the one by kexec:
    
     BIOS-provided physical RAM map:
    - BIOS-e820: 0000000000000000 - 0000000000097400 (usable)
    + BIOS-e820: 0000000000000100 - 0000000000097400 (usable)
      BIOS-e820: 0000000000097400 - 00000000000a0000 (reserved)
      BIOS-e820: 00000000000e6000 - 0000000000100000 (reserved)
      BIOS-e820: 0000000000100000 - 00000000dffa0000 (usable)
    - BIOS-e820: 00000000dffae000 - 00000000dffb0000 type 9
    + BIOS-e820: 00000000dffae000 - 00000000dffb0000 (reserved)
      BIOS-e820: 00000000dffb0000 - 00000000dffbe000 (ACPI data)
      BIOS-e820: 00000000dffbe000 - 00000000dfff0000 (ACPI NVS)
      BIOS-e820: 00000000dfff0000 - 00000000e0000000 (reserved)
      BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved)
    - BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
                 =======> that is the local apic address... somewhere we lost it
      BIOS-e820: 00000000ff700000 - 0000000100000000 (reserved)
      BIOS-e820: 0000000100000000 - 0000004020000000 (usable)
    
    found one entry about reserved is missing for the kernel by kexec.
    
    it turns out init_apic_mappings is called before e820_reserve_resources
    in setup_arch. but e820_reserve_resources is using request_resource.
    it will not handle the conflicts.
    
    there are three ways to fix it:
    
    1. change request_resource in e820_reserve_resources to to insert_resource
    2. move init_apic_mappings after e820_reserve_resources
    3. use late_initcall to insert lapic resource.
    
    this patch is using method 3, that is less intrusive.
    
    in later version could consider to use method 1.
    
    before patch
    fed20000-ffffffff : PCI Bus #00
      fee00000-fee00fff : Local APIC
      fefff000-feffffff : pnp 00:09
      ff700000-ffffffff : reserved
    
    with patch will get map in first kernel
    
    fed20000-ffffffff : PCI Bus #00
      fee00000-fee00fff : Local APIC
        fee00000-fee00fff : reserved
      fefff000-feffffff : pnp 00:09
      ff700000-ffffffff : reserved
    
    Signed-off-by: Yinghai Lu <yinghai.lu>
    Signed-off-by: Ingo Molnar <mingo>

Comment 1 Prarit Bhargava 2008-07-15 14:02:23 UTC
Created attachment 311827 [details]
Upstream fix for this issue

Comment 2 Prarit Bhargava 2008-07-21 14:49:46 UTC
I've tried reproducing this issue on a few systems but have been unable to do so.  

Vivek -- do you think we need this patch?

P.

Comment 3 Vivek Goyal 2008-07-24 13:45:29 UTC
Prarit,

I think we might not require this patch. Instead we might require another patch
which changes
request_resource() to insert_resources() in e820_request_resource() function. I
will have to search for commit id.

Before that I need to talk to Yinghai Lu, about the relevance of his changes. My
feeling is that now his patch is redundant. I will send him a mail now..

Vivek

Comment 4 Vivek Goyal 2008-07-24 14:00:17 UTC
Prarit,

IIUC, problem was that in second kernel for kexec, reserved area for LAPIC was
not being reported and that must have run into some issues.

It happened because lapic did resource reservation before e820 could do that. We
could solve the problem by using insert_resource() in e820_reserve_resource()
and I think following patch from yinghai is doing that.

3def3d6ddf43dbe20c00c3cbc38dfacc8586998f

Vivek

Comment 5 Prarit Bhargava 2008-08-07 12:06:40 UTC
NOTABUG.

P.


Note You need to log in before you can comment on or make changes to this bug.