Re: [PATCH] x86/e820: make e820 type string uniform

From: Yajun Deng
Date: Thu Oct 20 2022 - 22:52:19 EST


October 20, 2022 11:44 PM, "Dave Hansen" <dave.hansen@xxxxxxxxx> wrote:

> On 10/20/22 04:56, Yajun Deng wrote:
>
>> /proc/iomem:
>> ...
>> 00000000-00000fff : Reserved
>> 00001000-0005efff : System RAM
>> 0005f000-0005ffff : Reserved
>> 00060000-0009ffff : System RAM
>> 000a0000-000fffff : Reserved
>> 000a0000-000bffff : PCI Bus 0000:00
>> 000c0000-000cddff : Video ROM
>> 000f0000-000fffff : System ROM
>> 00100000-80ff3017 : System RAM
>> 80ff3018-81003e57 : System RAM (kernel)
>> 81003e58-81004017 : System RAM
>> 81004018-81023c57 : System RAM (kernel)
>> 81023c58-87672fff : System RAM
>
> I guess this is a pretty minimal change. It definitely makes
> /proc/iomem more human-readable.
>
> Did you consider if this change might break any users of this file?

Yes, it may be.
I don't know how many users use this file, but I think the impact of this change is limited.

1st: This is not the first time this file has been changed. In commit
ad5fb870c486("e820, efi: add ACPI 6.0 persistent memory types"), the E820_PRAM changed
from "Persistent RAM" to "Persistent Memory (legacy)".

2nd: only super users can access the full information from /proc/iomem, which means the users
of this file are limited.
In commit 51d7b120418e("/proc/iomem: only expose physical resource addresses to privileged users")

3rd: The E820_TYPE_RESERVED_KERN changed from "System RAM" to "System RAM (kernel)" is a minimal change,
and it also contains the "System RAM" string.