]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
x86/mm/pat: remove strict_prot parameter from reserve_pfn_range()
authorDavid Hildenbrand <david@redhat.com>
Mon, 12 May 2025 12:34:20 +0000 (14:34 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 May 2025 21:55:37 +0000 (14:55 -0700)
Always set to 0, so let's remove it.

Link: https://lkml.kernel.org/r/20250512123424.637989-8-david@redhat.com
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: Ingo Molnar <mingo@kernel.org> [x86 bits]
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Betkov <bp@alien8.de>
Cc: Dave Airlie <airlied@gmail.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jann Horn <jannh@google.com>
Cc: Jonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: Tvrtko Ursulin <tursulin@ursulin.net>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/mm/pat/memtype.c

index c88d1cbdc1de179adf85819f4a278d1bc6a94772..ccc55c00b4c8b92449d98067f0e0841ef18348ca 100644 (file)
@@ -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)