linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Make INVALID_PHYS_ADDR a generic macro
@ 2025-10-21  2:56 Anshuman Khandual
  2025-10-21  8:48 ` Alexander Gordeev
  0 siblings, 1 reply; 2+ messages in thread
From: Anshuman Khandual @ 2025-10-21  2:56 UTC (permalink / raw)
  To: linux-mm
  Cc: Anshuman Khandual, linux-kernel, iommu, linux-s390,
	linux-arm-kernel, virtualization

INVALID_PHYS_ADDR has very similar definitions across the code base. Hence
just move that inside header <liux/mm.h> for more generic usage. Also drop
the now redundant ones which are no longer required.

Cc: linux-kernel@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: iommu@lists.linux.dev
Cc: linux-s390@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: virtualization@lists.linux.dev
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
 arch/arm64/mm/mmu.c                  | 2 --
 arch/s390/boot/vmem.c                | 1 -
 drivers/vdpa/vdpa_user/iova_domain.h | 2 --
 include/linux/mm.h                   | 2 ++
 kernel/dma/swiotlb.c                 | 2 --
 5 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index e80bb623ef53..1da02d908c30 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -470,8 +470,6 @@ static void __create_pgd_mapping(pgd_t *pgdir, phys_addr_t phys,
 	mutex_unlock(&fixmap_lock);
 }
 
-#define INVALID_PHYS_ADDR	(-1ULL)
-
 static phys_addr_t __pgd_pgtable_alloc(struct mm_struct *mm, gfp_t gfp,
 				       enum pgtable_type pgtable_type)
 {
diff --git a/arch/s390/boot/vmem.c b/arch/s390/boot/vmem.c
index cea3de4dce8c..fbe64ffdfb96 100644
--- a/arch/s390/boot/vmem.c
+++ b/arch/s390/boot/vmem.c
@@ -16,7 +16,6 @@
 #include "decompressor.h"
 #include "boot.h"
 
-#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
 struct ctlreg __bootdata_preserved(s390_invalid_asce);
 
 #ifdef CONFIG_PROC_FS
diff --git a/drivers/vdpa/vdpa_user/iova_domain.h b/drivers/vdpa/vdpa_user/iova_domain.h
index 775cad5238f3..a923971a64f5 100644
--- a/drivers/vdpa/vdpa_user/iova_domain.h
+++ b/drivers/vdpa/vdpa_user/iova_domain.h
@@ -17,8 +17,6 @@
 
 #define IOVA_START_PFN 1
 
-#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
-
 #define BOUNCE_MAP_SHIFT	12
 #define BOUNCE_MAP_SIZE	(1 << BOUNCE_MAP_SHIFT)
 #define BOUNCE_MAP_MASK	(~(BOUNCE_MAP_SIZE - 1))
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d16b33bacc32..543a5f780874 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -105,6 +105,8 @@ extern int mmap_rnd_compat_bits __read_mostly;
 # endif
 #endif
 
+#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
+
 #include <asm/page.h>
 #include <asm/processor.h>
 
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 0d37da3d95b6..a547c7693135 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -61,8 +61,6 @@
  */
 #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT)
 
-#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
-
 /**
  * struct io_tlb_slot - IO TLB slot descriptor
  * @orig_addr:	The original address corresponding to a mapped entry.
-- 
2.30.2



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm: Make INVALID_PHYS_ADDR a generic macro
  2025-10-21  2:56 [PATCH] mm: Make INVALID_PHYS_ADDR a generic macro Anshuman Khandual
@ 2025-10-21  8:48 ` Alexander Gordeev
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Gordeev @ 2025-10-21  8:48 UTC (permalink / raw)
  To: Anshuman Khandual
  Cc: linux-mm, linux-kernel, iommu, linux-s390, linux-arm-kernel,
	virtualization

On Tue, Oct 21, 2025 at 03:56:38AM +0100, Anshuman Khandual wrote:
> INVALID_PHYS_ADDR has very similar definitions across the code base. Hence
> just move that inside header <liux/mm.h> for more generic usage. Also drop
> the now redundant ones which are no longer required.
> 
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-mm@kvack.org
> Cc: iommu@lists.linux.dev
> Cc: linux-s390@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: virtualization@lists.linux.dev
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
>  arch/arm64/mm/mmu.c                  | 2 --
>  arch/s390/boot/vmem.c                | 1 -
>  drivers/vdpa/vdpa_user/iova_domain.h | 2 --
>  include/linux/mm.h                   | 2 ++
>  kernel/dma/swiotlb.c                 | 2 --
>  5 files changed, 2 insertions(+), 7 deletions(-)
...
> diff --git a/arch/s390/boot/vmem.c b/arch/s390/boot/vmem.c
> index cea3de4dce8c..fbe64ffdfb96 100644
> --- a/arch/s390/boot/vmem.c
> +++ b/arch/s390/boot/vmem.c
> @@ -16,7 +16,6 @@
>  #include "decompressor.h"
>  #include "boot.h"
>  
> -#define INVALID_PHYS_ADDR (~(phys_addr_t)0)
>  struct ctlreg __bootdata_preserved(s390_invalid_asce);
>  
>  #ifdef CONFIG_PROC_FS

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>	# s390

Thanks!


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-10-21  8:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-21  2:56 [PATCH] mm: Make INVALID_PHYS_ADDR a generic macro Anshuman Khandual
2025-10-21  8:48 ` Alexander Gordeev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox