Re: [PATCH 2/3] x86: add a is_e820_ram() helper

From: Christoph Hellwig
Date: Thu Mar 26 2015 - 05:34:34 EST


On Thu, Mar 26, 2015 at 10:02:15AM +0100, Ingo Molnar wrote:
> This is_e820_ram() factoring out becomes really messy in patch #3.
>
> So you left out a bunch of places making comparisons with E820_RAM,
> notably e820_reserve_resources_late() and memblock_x86_fill() - and of
> course those have to be left out, otherwise NVRAM might be registered
> and used as real kernel RAM!
>
> And this shows the weakness and confusion caused by the factoring out
> of is_e820_ram() and then adding E820_PMEM to its definition...
>
> I'd rather you add explicit checks to E820_PMEM (why not E820_PRAM, to
> keep in line with the E820_RAM name?), and not lie about
> is_e820_ram(). It should result in the exact same end result, with
> less confusion.
>
> I have no fundamental objections to the driver otherwise.

Does this patch (replaces patches 2 and 3) look better to you?

---