Re: [PATCH 0/9] Kconfig symbol clean-up on ./arch/x86/

From: Dave Hansen
Date: Tue Aug 03 2021 - 10:32:46 EST


On 8/3/21 4:35 AM, Lukas Bulwahn wrote:
> - a reference to STRICT_IOMEM in arch/x86/mm/init.c
> unclear to me: which exact config this refers to

Are you referring to the reference in this comment?

> + /*
> + * This must follow RAM test, since System RAM is considered a
> + * restricted resource under CONFIG_STRICT_IOMEM.
> + */
> + if (iomem_is_exclusive(pagenr << PAGE_SHIFT)) {
> + /* Low 1MB bypasses iomem restrictions. */
> + if (pagenr < 256)
> + return 1;
...

That came from here:

> commit a4866aa812518ed1a37d8ea0c881dc946409de94
> Author: Kees Cook <keescook@xxxxxxxxxxxx>
> Date: Wed Apr 5 09:39:08 2017 -0700
>
> mm: Tighten x86 /dev/mem with zeroing reads

Which also added this hunk:

> #ifdef CONFIG_STRICT_DEVMEM
> +static inline int page_is_allowed(unsigned long pfn)
> +{
> + return devmem_is_allowed(pfn);
> +}

and talks about CONFIG_STRICT_DEVMEM in the changelog:

> mm: Tighten x86 /dev/mem with zeroing reads
>
> Under CONFIG_STRICT_DEVMEM, reading System RAM through /dev/mem is
> disallowed. However, on x86, the first 1MB was always allowed for BIOS
...

It's a pretty safe guess that STRICT_IOMEM refers to CONFIG_STRICT_DEVMEM.