Thread (30 messages) 30 messages, 4 authors, 2025-09-23

Re: [PATCH v6 03/16] dma-debug: refactor to use physical addresses for page mapping

From: Marek Szyprowski <m.szyprowski@samsung.com>
Date: 2025-09-11 22:23:24
Also in: linux-block, linux-doc, linux-iommu, linux-mm, linux-nvme, linuxppc-dev, lkml, rust-for-linux, virtualization, xen-devel

On 10.09.2025 07:26, Leon Romanovsky wrote:
quoted hunk ↗ jump to hunk
On Tue, Sep 09, 2025 at 10:37:48PM +0300, Leon Romanovsky wrote:
quoted
On Tue, Sep 09, 2025 at 04:27:31PM +0300, Leon Romanovsky wrote:
quoted
From: Leon Romanovsky <leonro@nvidia.com>
<...>
quoted
  include/linux/page-flags.h         |  1 +
<...>
quoted
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -614,6 +614,7 @@ FOLIO_FLAG(dropbehind, FOLIO_HEAD_PAGE)
   * available at this point.
   */
  #define PageHighMem(__p) is_highmem_idx(page_zonenum(__p))
+#define PhysHighMem(__p) (PageHighMem(phys_to_page(__p)))
This was a not so great idea to add PhysHighMem() because of "else"
below which unfolds to maze of macros and automatically generated
functions with "static inline int Page##uname ..." signature.
quoted
  #define folio_test_highmem(__f)	is_highmem_idx(folio_zonenum(__f))
  #else
  PAGEFLAG_FALSE(HighMem, highmem)
After sleeping over it, the following hunk will help:
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index dfbc4ba86bba2..2a1f346178024 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -614,11 +614,11 @@ FOLIO_FLAG(dropbehind, FOLIO_HEAD_PAGE)
   * available at this point.
   */
  #define PageHighMem(__p) is_highmem_idx(page_zonenum(__p))
-#define PhysHighMem(__p) (PageHighMem(phys_to_page(__p)))
  #define folio_test_highmem(__f)        is_highmem_idx(folio_zonenum(__f))
  #else
  PAGEFLAG_FALSE(HighMem, highmem)
  #endif
+#define PhysHighMem(__p) (PageHighMem(phys_to_page(__p)))

  /* Does kmap_local_folio() only allow access to one page of the folio? */
  #ifdef CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP
Okay, I will add this fixup while applying the patches.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help