Skip to contentSkip to conversation

i386 boot: replace boot_ioremap with enhanced bt_ioremap

PATCH In review Huang, Ying 4 participants 8 messages Jan 15, 2008 – Jan 16, 2008

lore
Share & tools
lore
#0 lore raw

cover i386 boot: replace boot_ioremap with enhanced bt_ioremap

This patchset replaces boot_ioremap with a enhanced version of bt_ioremap and renames the bt_ioremap to early_ioremap. This reduces 12k from .init.data segment and increases the size of memory that can be re-mapped before paging_init to 64k.

This patchset is based on linux-2.6.24-rc5-mm1 + efi-split-efi-tables-parsing-code-from-efi-runtime-service-support-code.patch. It has been tested on i386 with PAE on/off.

Best Regards,
Huang Ying

#1 lore raw
Quoted 4 lines · Huang, Ying

This patchset replaces boot_ioremap with a enhanced version of bt_ioremap and renames the bt_ioremap to early_ioremap. This reduces 12k from .init.data segment and increases the size of memory that can be re-mapped before paging_init to 64k.

in latest x86.git#mm there's an early_ioremap() introduced as part of the PAT series - available on both 32-bit and 64-bit. Could you take a look at it and use that if it's OK for your purposes?

Ingo

#2 lore raw
Quoted 10 lines · Ingo Molnar
Quoted 4 lines · Huang, Ying

This patchset replaces boot_ioremap with a enhanced version of bt_ioremap and renames the bt_ioremap to early_ioremap. This reduces 12k from .init.data segment and increases the size of memory that can be re-mapped before paging_init to 64k.

in latest x86.git#mm there's an early_ioremap() introduced as part of the PAT series - available on both 32-bit and 64-bit. Could you take a look at it and use that if it's OK for your purposes?

After checking the early_ioremap() implementation in arch/x86/kernel/setup_32.c, I found that it is a duplication of bt_ioremap() implementation in arch/x86/mm/ioremap_32.c. Both implementations use set_fixmap(), so they can be used only after paging_init().

The early_ioremap implementation provided in this patchset works as follow:

- Enhances bt_ioremap, make it usable before paging_init() via a dedicated PTE page.
- Rename bt_ioremap to early_ioremap

So I think maybe we should replace the early_ioremap() implementation in PAT series with that of this series.

Best Regards,
Huang Ying

#3 lore raw
Quoted 10 lines · Ying

After checking the early_ioremap() implementation in arch/x86/kernel/setup_32.c, I found that it is a duplication of bt_ioremap() implementation in arch/x86/mm/ioremap_32.c. Both implementations use set_fixmap(), so they can be used only after paging_init().

The early_ioremap implementation provided in this patchset works as follow:

Quoted 7 lines

- Enhances bt_ioremap, make it usable before paging_init() via a dedicated PTE page.
- Rename bt_ioremap to early_ioremap

So I think maybe we should replace the early_ioremap() implementation in PAT series with that of this series.

I did a quick scan over the patchset (not quite awake yet, so I may very well have missed something), but it looks like EFI (again!) is the only user of ioremapping before paging_init(). This makes me wonder if that code can't be restructured so that isn't necessary.

-hpa

#4 lore raw
Quoted 4 lines · H. Peter Anvin

I did a quick scan over the patchset (not quite awake yet, so I may very well have missed something), but it looks like EFI (again!) is the only user of ioremapping before paging_init(). This makes me wonder if that code can't be restructured so that isn't necessary.

i think that in general making access to unmapped memory a bit easier is generally a good robustness idea as ACPI could be impacted by it as well.

Fundamentally, paging_init() has obvious dependency on "figuring out the memory setup" of the box, and "figuring out the memory setup" means interpreting various data structures passed in by the BIOS - some of which might be in not yet mapped areas or iommu areas (if we have to do some early quirk). So having a robust implementation of ioremap_early() sounds like a definitive plus.

Ingo

#5 lore raw
Quoted 8 lines · Ingo Molnar
Quoted 1 line · H. Peter Anvin

I did a quick scan over the patchset (not quite awake yet, so I may very well have missed something), but it looks like EFI (again!) is the only user of ioremapping before paging_init(). This makes me wonder if that code can't be restructured so that isn't necessary.

i think that in general making access to unmapped memory a bit easier is generally a good robustness idea as ACPI could be impacted by it as well.

Fundamentally, paging_init() has obvious dependency on "figuring out the memory setup" of the box, and "figuring out the memory setup" means interpreting various data structures passed in by the BIOS - some of which might be in not yet mapped areas or iommu areas (if we have to do some early quirk). So having a robust implementation of ioremap_early() sounds like a definitive plus.

Fair enough. If it's generally useful, I certainly have no objections.

-hpa

#6 lore raw
In reply to Huang, Ying
Quoted 13 lines · Huang, Ying
Quoted 3 lines

in latest x86.git#mm there's an early_ioremap() introduced as part of the PAT series - available on both 32-bit and 64-bit. Could you take a look at it and use that if it's OK for your purposes?

After checking the early_ioremap() implementation in arch/x86/kernel/setup_32.c, I found that it is a duplication of bt_ioremap() implementation in arch/x86/mm/ioremap_32.c. Both implementations use set_fixmap(), so they can be used only after paging_init().

The early_ioremap implementation provided in this patchset works as follow:

Quoted 6 lines

- Enhances bt_ioremap, make it usable before paging_init() via a dedicated PTE page.
- Rename bt_ioremap to early_ioremap

So I think maybe we should replace the early_ioremap() implementation in PAT series with that of this series.

yep, agreed, that would be nice.

Ingo

#7 lore raw

RE: [PATCH -mm 0/3] i386 boot: replace boot_ioremap with enhancedbt_ioremap

In reply to Huang, Ying
Quoted 36 lines

-----Original Message-----
From: Huang, Ying
Sent: Tuesday, January 15, 2008 1:49 AM
To: Ingo Molnar; Pallipadi, Venkatesh
Cc: [email protected]; H. Peter Anvin; Thomas Gleixner; Ingo Molnar; Andi Kleen; [email protected]
Subject: Re: [PATCH -mm 0/3] i386 boot: replace boot_ioremap with enhancedbt_ioremap

Quoted 4 lines · Ingo Molnar
Quoted 2 lines · Huang, Ying

This patchset replaces boot_ioremap with a enhanced version of bt_ioremap and renames the bt_ioremap to early_ioremap.

This reduces

Quoted 1 line
Quoted 1 line

12k from .init.data segment and increases the size of

memory that can

Quoted 3 lines
Quoted 1 line

be re-mapped before paging_init to 64k.

in latest x86.git#mm there's an early_ioremap() introduced

as part of

Quoted 1 line

the PAT series - available on both 32-bit and 64-bit. Could

you take a

Quoted 1 line

look at it and use that if it's OK for your purposes?

After checking the early_ioremap() implementation in arch/x86/kernel/setup_32.c, I found that it is a duplication of bt_ioremap() implementation in arch/x86/mm/ioremap_32.c. Both implementations use set_fixmap(), so they can be used only after paging_init().

The early_ioremap implementation provided in this patchset works as follow:

Quoted 8 lines

- Enhances bt_ioremap, make it usable before paging_init() via a dedicated PTE page.
- Rename bt_ioremap to early_ioremap

So I think maybe we should replace the early_ioremap() implementation in
PAT series with that of this series.

Agreed. PAT can use this for early mappings. Thanks for the patches :)

-Venki