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] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260110155721.84af2e403badeeb29c7734e3@linux-foundation.org>
Date: Sat, 10 Jan 2026 15:57:21 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Hou Wenlong <houwenlong.hwl@...group.com>
Cc: linux-kernel@...r.kernel.org, David Hildenbrand <david@...nel.org>,
 Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, "Liam R. Howlett"
 <Liam.Howlett@...cle.com>, Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport
 <rppt@...nel.org>, Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko
 <mhocko@...e.com>, linux-mm@...ck.org
Subject: Re: [PATCH] mm/early_ioremap: Print the starting physical address
 in __early_ioremap()

On Fri,  9 Jan 2026 21:31:51 +0800 Hou Wenlong <houwenlong.hwl@...group.com> wrote:

> The debug WARN() printing occurs after the while loop, so the
> 'phys_addr' reflects the last physical address rather than the actual
> starting physical address, which is not useful for debugging. To
> simplify, the WARN() statement could be moved up before the loop instead
> of introducing a new variable to record the original 'phys_addr' value.
> Additionally, swap the print order of 'slot_virt[slot]' and 'offset', as
> this will enhance output readability.
> 

yep, thanks.

> --- a/mm/early_ioremap.c
> +++ b/mm/early_ioremap.c
> @@ -139,6 +139,9 @@ __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);
> +
>  	/*
>  	 * Ok, go for it..
>  	 */
> @@ -152,8 +155,6 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
>  		--idx;
>  		--nrpages;
>  	}
> -	WARN(early_ioremap_debug, "%s(%pa, %08lx) [%d] => %08lx + %08lx\n",
> -	     __func__, &phys_addr, size, slot, offset, slot_virt[slot]);

It's strange that this code uses WARN when nothing is wrong.  The rest
of the function uses WARN appropriately.  But that's off-topic!

Reviewed-by: Andrew Morton <akpm@...ux-foundation.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ