[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKXUXMxQ83T7beOTuZ928=-eo2Tsr94TGxsaYh3+MHOJrDO8Bg@mail.gmail.com>
Date: Tue, 3 Aug 2021 17:12:47 +0200
From: Lukas Bulwahn <lukas.bulwahn@...il.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>, Randy Dunlap <rdunlap@...radead.org>,
"H . Peter Anvin" <hpa@...or.com>,
Darren Hart <dvhart@...radead.org>,
Andy Shevchenko <andy@...radead.org>,
Lubomir Rintel <lkundrak@...sk>, Pavel Machek <pavel@....cz>,
Lee Jones <lee.jones@...aro.org>,
"Rafael J . Wysocki" <rafael.j.wysocki@...el.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Linus Walleij <linus.walleij@...aro.org>,
platform-driver-x86@...r.kernel.org,
kernel-janitors <kernel-janitors@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH 0/9] Kconfig symbol clean-up on ./arch/x86/
On Tue, Aug 3, 2021 at 4:32 PM Dave Hansen <dave.hansen@...el.com> wrote:
>
> 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;
> ...
>
Yes, that is what I referred to.
> That came from here:
>
> > commit a4866aa812518ed1a37d8ea0c881dc946409de94
> > Author: Kees Cook <keescook@...omium.org>
> > 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.
Thanks, Dave.
If the maintainers consider updates to comments making them consistent
with the code as worth being picked, I will turn your analysis into a
proper commit message and provide a patch to update that comment.
Lukas
Powered by blists - more mailing lists