Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,vbabka@kernel.org,surenb@google.com,
	stable@vger.kernel.org,rppt@kernel.org,pfalcato@suse.de,mhocko@suse.com,
	ljs@kernel.org,liam@infradead.org,jannh@google.com,david@kernel.org,
	ivanrwcm25@gmail.com,akpm@linux-foundation.org
Subject: [merged mm-hotfixes-stable] mm-use-pfn_phys-in-phys_mem_access_prot.patch removed from -mm tree
Date: Sun, 22 Nov 2026 22:25:11 -0800	[thread overview]
Message-ID: <20261123062511.A48F81F000C6@smtp.kernel.org> (raw)
In-Reply-To: <20261113193812.1239880-1-ivanrwcm25@gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2323 bytes --]


The quilt patch titled
     Subject: mm: use PFN_PHYS() in phys_mem_access_prot()
has been removed from the -mm tree.  Its filename was
     mm-use-pfn_phys-in-phys_mem_access_prot.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Iván Ezequiel Rodriguez <ivanrwcm25@gmail.com>
Subject: mm: use PFN_PHYS() in phys_mem_access_prot()
Date: Fri, 13 Nov 2026 16:38:12 -0300

phys_mem_access_prot() stores "pfn << PAGE_SHIFT" in a phys_addr_t.  The
shift is evaluated as unsigned long, so on a 32-bit kernel with
CONFIG_PHYS_ADDR_T_64BIT an address above 4 GiB is truncated before
uncached_access() compares it with __pa(high_memory).

mmap_mem_prepare() already shifts in phys_addr_t, so the mapping is
accepted and then left cacheable.  PFN_PHYS() casts before the shift.

On a MIPS32 XPA Malta guest, mmap of /dev/mem at 0xf00000000 without
O_DSYNC used the boot CCA.  The same mapping with O_DSYNC was uncached. 
With PFN_PHYS() both are uncached.

Link: https://patch.msgid.link/20261113193812.1239880-1-ivanrwcm25@gmail.com
Fixes: 7e6735c3578e ("/dev/mem: use phys_addr_t for physical addresses")
Signed-off-by: Iván Ezequiel Rodriguez <ivanrwcm25@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Lorenzo Stoakes (ARM) <ljs@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Jann Horn <jannh@google.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: <stable@vger.kernel.org>

 mm/char-mem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/char-mem.c~mm-use-pfn_phys-in-phys_mem_access_prot
+++ a/mm/char-mem.c
@@ -272,7 +272,7 @@ static pgprot_t phys_mem_access_prot(str
 				     unsigned long size, pgprot_t vma_prot)
 {
 #ifdef pgprot_noncached
-	phys_addr_t offset = pfn << PAGE_SHIFT;
+	phys_addr_t offset = PFN_PHYS(pfn);
 
 	if (uncached_access(file, offset))
 		return pgprot_noncached(vma_prot);
_

Patches currently in -mm which might be from ivanrwcm25@gmail.com are



      parent reply	other threads:[~2026-11-23  6:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 19:38 [PATCH] mm: use PFN_PHYS() in phys_mem_access_prot() Ivan Ezequiel Rodriguez
2026-11-13 20:18 ` David Hildenbrand (Arm)
2026-11-15  6:47 ` Mike Rapoport
2026-11-15 12:27 ` Lorenzo Stoakes (ARM)
2026-11-23  6:25 ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123062511.A48F81F000C6@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=ivanrwcm25@gmail.com \
    --cc=jannh@google.com \
    --cc=liam@infradead.org \
    --cc=ljs@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=pfalcato@suse.de \
    --cc=rppt@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox