[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fd641237-e412-4f32-98a6-b7d733e6819b@lucifer.local>
Date: Mon, 28 Apr 2025 21:18:39 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org, x86@...nel.org,
intel-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-trace-kernel@...r.kernel.org,
Dave Hansen <dave.hansen@...ux.intel.com>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, "H. Peter Anvin" <hpa@...or.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tursulin@...ulin.net>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Andrew Morton <akpm@...ux-foundation.org>,
Steven Rostedt <rostedt@...dmis.org>,
Masami Hiramatsu <mhiramat@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, Jann Horn <jannh@...gle.com>,
Pedro Falcato <pfalcato@...e.de>, Peter Xu <peterx@...hat.com>
Subject: Re: [PATCH v1 08/11] x86/mm/pat: remove strict_prot parameter from
reserve_pfn_range()
On Fri, Apr 25, 2025 at 10:17:12AM +0200, David Hildenbrand wrote:
> Always set to 0, so let's remove it.
>
> Signed-off-by: David Hildenbrand <david@...hat.com>
Ah yes here is where you remove it :)
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
> ---
> arch/x86/mm/pat/memtype.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c
> index 668ebf0065157..57e3ced4c28cb 100644
> --- a/arch/x86/mm/pat/memtype.c
> +++ b/arch/x86/mm/pat/memtype.c
> @@ -858,8 +858,7 @@ int memtype_kernel_map_sync(u64 base, unsigned long size,
> * Reserved non RAM regions only and after successful memtype_reserve,
> * this func also keeps identity mapping (if any) in sync with this new prot.
> */
> -static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
> - int strict_prot)
> +static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot)
> {
> int is_ram = 0;
> int ret;
> @@ -895,8 +894,7 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
> return ret;
>
> if (pcm != want_pcm) {
> - if (strict_prot ||
> - !is_new_memtype_allowed(paddr, size, want_pcm, pcm)) {
> + if (!is_new_memtype_allowed(paddr, size, want_pcm, pcm)) {
> memtype_free(paddr, paddr + size);
> pr_err("x86/PAT: %s:%d map pfn expected mapping type %s for [mem %#010Lx-%#010Lx], got %s\n",
> current->comm, current->pid,
> @@ -906,10 +904,6 @@ static int reserve_pfn_range(u64 paddr, unsigned long size, pgprot_t *vma_prot,
> cattr_name(pcm));
> return -EINVAL;
> }
> - /*
> - * We allow returning different type than the one requested in
> - * non strict case.
> - */
> pgprot_set_cachemode(vma_prot, pcm);
> }
>
> @@ -959,7 +953,7 @@ int pfnmap_track(unsigned long pfn, unsigned long size, pgprot_t *prot)
> {
> const resource_size_t paddr = (resource_size_t)pfn << PAGE_SHIFT;
>
> - return reserve_pfn_range(paddr, size, prot, 0);
> + return reserve_pfn_range(paddr, size, prot);
> }
>
> void pfnmap_untrack(unsigned long pfn, unsigned long size)
> --
> 2.49.0
>
Powered by blists - more mailing lists