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: <77f411d3-379a-421c-bd41-55e4de6fa8c0@samsung.com>
Date: Mon, 14 Apr 2025 12:02:20 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: Christian König <christian.koenig@....com>, Balbir
	Singh <balbirs@...dia.com>, Christoph Hellwig <hch@...radead.org>
Cc: iommu@...ts.linux.dev, linux-kernel@...r.kernel.org, Robin Murphy
	<robin.murphy@....com>, Ingo Molnar <mingo@...nel.org>, Kees Cook
	<kees@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>, Linus Torvalds
	<torvalds@...ux-foundation.org>, Peter Zijlstra <peterz@...radead.org>, Andy
	Lutomirski <luto@...nel.org>, Alex Deucher <alexander.deucher@....com>, Bert
	Karwatzki <spasswolf@....de>
Subject: Re: [RFC] dma/mapping.c: WARN_ONCE on dma_addressing_limited()
 being true

On 14.04.2025 11:45, Christian König wrote:
> Am 14.04.25 um 10:25 schrieb Balbir Singh:
>> On 4/14/25 15:54, Christoph Hellwig wrote:
>>> On Sat, Apr 12, 2025 at 07:41:10PM +1000, Balbir Singh wrote:
>>>> In the debug and resolution of an issue involving forced use of bounce
>>>> buffers, 7170130e4c72 ("x86/mm/init: Handle the special case of device
>>>> private pages in add_pages(), to not increase max_pfn and trigger
>>>> dma_addressing_limited() bounce buffers"). It would have been easier
>>>> to debug the issue if dma_addressing_limited() had a warning about a
>>>> device not being able to address all of memory and thus forcing all
>>>> accesses through a bounce buffer. Please see[2].
>>>>
>>>> A warning would have let the user of the system know that in their
>>>> particular case, use_dma32 is set due to the addressing limitation
>>>> and this would impact performance of the driver in use.
>>>>
>>>> Implement a WARN_ONCE() to point to the potential use of bounce buffers
>>>> when we hit the condition. When swiotlb is used,
>>>> dma_addressing_limited() is used to determine the size of maximum dma
>>>> buffer size in dma_direct_max_mapping_size(). The warning could be
>>>> triggered in that check as well.
>>> dma_addressing_limited is a perfectly expected condition, and returns
>>> true for many devices and still plenty system configuation.  A kernel
>>> warning with a stacktrace is not acceptable for that.  A simple one-line
>>> dev_info might be ok, but could still be rather spammy on many systems.
>>>
>> Thanks for the review!
>>
>> I'll convert it to a dev_info(). We can remove it, if it causes confusion
>> or users complain about it?
> I would even say that this should be only debugging level.
>
> As Christoph explained it is perfectly normal for device to not be able to address everything in the system. So even an info print sounds like to much.
>
> But I totally agree that it is interesting for debugging, that issue was really hard to nail down.

Right, please use dev_debug().

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ