RE: [patch 02/11] PAT x86: Map only usable memory in x86_64 identity map and kernel text

From: Pallipadi, Venkatesh
Date: Thu Jan 10 2008 - 16:57:54 EST




>-----Original Message-----
>From: Linus Torvalds [mailto:torvalds@xxxxxxxxxxxxxxxxxxxx]
>Sent: Thursday, January 10, 2008 1:05 PM
>To: Pallipadi, Venkatesh
>Cc: ak@xxxxxx; ebiederm@xxxxxxxxxxxx; rdreier@xxxxxxxxx;
>gregkh@xxxxxxx; airlied@xxxxxxxxx; davej@xxxxxxxxxx;
>mingo@xxxxxxx; tglx@xxxxxxxxxxxxx; hpa@xxxxxxxxx;
>akpm@xxxxxxxxxxxxxxxxxxxx; arjan@xxxxxxxxxxxxx; Barnes, Jesse;
>davem@xxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Siddha, Suresh B
>Subject: Re: [patch 02/11] PAT x86: Map only usable memory in
>x86_64 identity map and kernel text
>
>
>
>On Thu, 10 Jan 2008, venkatesh.pallipadi@xxxxxxxxx wrote:
>>
>> x86_64: Map only usable memory in identity map. All reserved
>memory maps to a
>> zero page.
>
>I don't mind this horribly per se, but why a zero page?
>
>Accessing that page without mapping it explicitly would be a bug with
>your change - if only because you'd get the wrong value!
>
>So why map it at all? The only thing mapping it can do is to hide bugs.
>

Yes. I had those pages not mapped at all earlier. The reason I switched
to zero page is to continue support cases like:
BIOS-e820: 0000000000000000 - 000000000009cc00 (usable)
BIOS-e820: 000000000009cc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000cc000 - 00000000000d0000 (reserved)
BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 00000000cff60000 (usable)

In this case if some one does a dd of /dev/mem before they can read the
contents of usable memory in 0x100000-0xcff60000 range. But, if I not
map reserved regions, dd will stop after fist such hole. Even though
this may not be a good usage model, I thought there may be apps
depending on such things. Having said that, I do not like having dummy
zero page there very much. So, if we do not see any regressions due to
usages like above, I will be happy to remove mapping reserved regions
altogether.

Thanks,
Venki
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/