[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cj2wnrnu56eyyfwqm2avv6njcwugfoczgoexz3cos6246h2gn5@fywejzmsuvpa>
Date: Sat, 19 Apr 2025 14:39:14 +0530
From: Naveen N Rao <naveen@...nel.org>
To: Dan Williams <dan.j.williams@...el.com>
Cc: dave.hansen@...ux.intel.com, Ingo Molnar <mingo@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/3] x86/devmem: Remove duplicate range_is_allowed()
definition
On Thu, Apr 17, 2025 at 11:27:02AM -0700, Dan Williams wrote:
> Naveen N Rao wrote:
> [..]
> > > The pat_enabled check was originally added as a *bypass* of additional
> > > logic in phys_mem_access_prot_allowed() [1] to validate that /dev/mem was
> > > establishing compatible mappings of "System-RAM" via /dev/mem. This
> > > patch maintains that expectation that phys_mem_access_prot_allowed()
> > > returns immediately when there is no potential cache conflict.
> >
> > Thanks for the background, that makes sense.
> >
> > Do we also no longer need the devmem_is_allowed() checks in pat.c if PAT
> > is enabled and !CONFIG_STRICT_DEVMEM?
>
> The only one that is left is the one in phys_mem_access_prot_allowed()
> and that one properly compiles away to nothing in the
> !CONFIG_STRICT_DEVMEM case.
I am probably missing something here, but that's the case I don't fully
understand. Before this patch, it was not compiling away to nothing, and
range_is_allowed() in phys_mem_access_prot_allowed() was calling out to
devmem_is_allowed() when CONFIG_STRICT_DEVMEM was _not_ set.
I'll note that range_is_allowed() implementation in pat/memtype.c is
exactly the inverse of that in drivers/char/mem.c, with respect to what
checks were done with and without CONFIG_STRICT_DEVMEM.
Thanks,
Naveen
Powered by blists - more mailing lists