Re: + x86-fix-handling-of-the-reservetop-boot-option.patch added to-mm tree

From: Liang Li
Date: Thu Apr 08 2010 - 01:01:48 EST


On Wed, Apr 07, 2010 at 09:30:39PM -0700, Yinghai wrote:
> On 04/07/2010 06:53 PM, Liang Li wrote:
> > Does this similar modification like this is more preferred?
> >
> > diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> > index a1dcfa3..30a3e97 100644
> > --- a/arch/x86/include/asm/io.h
> > +++ b/arch/x86/include/asm/io.h
> > @@ -347,6 +347,7 @@ extern void __iomem *early_ioremap(resource_size_t phys_addr,
> > extern void __iomem *early_memremap(resource_size_t phys_addr,
> > unsigned long size);
> > extern void early_iounmap(void __iomem *addr, unsigned long size);
> > +extern void fixup_early_ioremap(void);
> >
> > #define IO_SPACE_LIMIT 0xffff
> >
> > diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
> > index ea82ef0..fe06296 100644
> > --- a/arch/x86/mm/ioremap.c
> > +++ b/arch/x86/mm/ioremap.c
> > @@ -448,6 +448,23 @@ static inline void __init early_clear_fixmap(enum fixed_addresses idx)
> > static void __iomem *prev_map[FIX_BTMAPS_SLOTS] __initdata;
> > static unsigned long prev_size[FIX_BTMAPS_SLOTS] __initdata;
> >
> > +void __init fixup_early_ioremap(void)
> > +{
> > + int i;
> > + for (i = 0; i < FIX_BTMAPS_SLOTS; i++) {
> > + if (prev_map[i])
> > + break;
> > + }
> > +
> > + if (i == FIX_BTMAPS_SLOTS)
> <
> > + WARN_ON(1);
> BUG_ON()
> > +
> > + for (i = 0; i < FIX_BTMAPS_SLOTS; i++)
> > + slot_virt[i] = __fix_to_virt(FIX_BTMAP_BEGIN - NR_FIX_BTMAPS * i);
> > +
> need to clear the old PMD, and set new PMD.
>
> so you can clear old PMD and call early_ioremap_init() in fixup_early_ioremap()

Call early_ioremap_init will do the update PMD work. So the preferred
patch would be:
---------------