lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aWUalAtwkLgLNt3F@kernel.org>
Date: Mon, 12 Jan 2026 18:00:20 +0200
From: Mike Rapoport <rppt@...nel.org>
To: Hou Wenlong <houwenlong.hwl@...group.com>
Cc: linux-kernel@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>,
	David Hildenbrand <david@...nel.org>,
	Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
	"Liam R. Howlett" <Liam.Howlett@...cle.com>,
	Vlastimil Babka <vbabka@...e.cz>,
	Suren Baghdasaryan <surenb@...gle.com>,
	Michal Hocko <mhocko@...e.com>, linux-mm@...ck.org
Subject: Re: [PATCH mm-new] mm/early_ioremap: Clean up the use of WARN() for
 debugging

On Mon, Jan 12, 2026 at 08:24:29PM +0800, Hou Wenlong wrote:
> Using WARN() for debugging is strange when nothing is wrong, so replace
> WARN(early_ioremap_debug) with pr_warn() + dump_stack().
> 
> Suggested-by: Mike Rapoport <rppt@...nel.org>
> Signed-off-by: Hou Wenlong <houwenlong.hwl@...group.com>

Acked-by: Mike Rapoport (Microsoft) <rppt@...nel.org>

> ---
>  mm/early_ioremap.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c
> index 3fdde074c9da..96c29b9dc85d 100644
> --- a/mm/early_ioremap.c
> +++ b/mm/early_ioremap.c
> @@ -30,6 +30,14 @@ static int __init early_ioremap_debug_setup(char *str)
>  }
>  early_param("early_ioremap_debug", early_ioremap_debug_setup);
>  
> +#define early_ioremap_dbg(fmt, args...)			\
> +	do {						\
> +		if (unlikely(early_ioremap_debug)) {	\
> +			pr_warn(fmt, ##args);		\
> +			dump_stack();			\
> +		}					\
> +	} while (0)
> +
>  static int after_paging_init __initdata;
>  
>  pgprot_t __init __weak early_memremap_pgprot_adjust(resource_size_t phys_addr,
> @@ -139,8 +147,8 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
>  	if (WARN_ON(nrpages > NR_FIX_BTMAPS))
>  		return NULL;
>  
> -	WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
> -	     __func__, &phys_addr, size, slot, slot_virt[slot], offset);
> +	early_ioremap_dbg("%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
> +			  __func__, &phys_addr, size, slot, slot_virt[slot], offset);
>  
>  	/*
>  	 * Ok, go for it..
> @@ -185,8 +193,7 @@ void __init early_iounmap(void __iomem *addr, unsigned long size)
>  		  __func__, addr, size, slot, prev_size[slot]))
>  		return;
>  
> -	WARN(early_ioremap_debug, "%s(%p, %08lx) [%d]\n",
> -	      __func__, addr, size, slot);
> +	early_ioremap_dbg("%s(%p, %08lx) [%d]\n", __func__, addr, size, slot);
>  
>  	virt_addr = (unsigned long)addr;
>  	if (WARN_ON(virt_addr < fix_to_virt(FIX_BTMAP_BEGIN)))
> 
> base-commit: ab3d40bdac831c67e130fda12f3011505556500f
> -- 
> 2.31.1
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ