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: <03daf175-fcab-45a4-812b-9a338415565e@arm.com>
Date: Mon, 12 Jan 2026 12:43:53 +0000
From: Robin Murphy <robin.murphy@....com>
To: Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>, lkp@...el.com,
 mick@....forth.gr, Marek Szyprowski <m.szyprowski@...sung.com>
Cc: iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
 llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
 akpm@...ux-foundation.org, alex@...ti.fr, aou@...s.berkeley.edu,
 hch@...radead.org, linux-mm@...ck.org, linux-riscv@...ts.infradead.org,
 palmer@...belt.com, paul.walmsley@...ive.com
Subject: Re: [PATCH v2] dma-pool: don't allocate DMA32 pool if no 32-bit
 memory

On 2026-01-12 6:58 am, Vladimir Kondratiev wrote:
> If system have no 32-bit memory, GFP_DMA32 pool allocation will
> obviously fail, so skip it.

Note that the rest of the code doesn't quite work right if 
CONFIG_ZONE_DMA32 is enabled but atomic_pool_dma32 is NULL - seems such 
a setup wasn't really anticipated. Funnily enough, I also recently wrote 
a patch series to improve this more generally, but hadn't got round to 
writing a cover letter yet - lemme finish that up and post it...

Thanks,
Robin.

> Changes in v2: use arch-independent "memblock_start_of_DRAM" to get
> DRAM base address
> 
> Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@...ileye.com>
> ---
>   kernel/dma/pool.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
> index ee45dee33d49..ecd77a0272f2 100644
> --- a/kernel/dma/pool.c
> +++ b/kernel/dma/pool.c
> @@ -209,7 +209,7 @@ static int __init dma_atomic_pool_init(void)
>   		if (!atomic_pool_dma)
>   			ret = -ENOMEM;
>   	}
> -	if (IS_ENABLED(CONFIG_ZONE_DMA32)) {
> +	if (IS_ENABLED(CONFIG_ZONE_DMA32) && memblock_start_of_DRAM() < BIT_ULL(32)) {
>   		atomic_pool_dma32 = __dma_atomic_pool_init(atomic_pool_size,
>   						GFP_KERNEL | GFP_DMA32);
>   		if (!atomic_pool_dma32)
> 
> base-commit: 7d0a66e4bb9081d75c82ec4957c50034cb0ea449


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ