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]
Date:   Thu, 14 Sep 2023 07:52:02 +0000
From:   Hui Fang <hui.fang@....com>
To:     "tfiga@...omium.org" <tfiga@...omium.org>,
        "m.szyprowski@...sung.com" <m.szyprowski@...sung.com>,
        "mchehab@...nel.org" <mchehab@...nel.org>
CC:     "linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Anle Pan <anle.pan@....com>, Xuegang Liu <xuegang.liu@....com>
Subject: RE: [PATCH] MA-21654 Use dma_alloc_pages in
 vb2_dma_sg_alloc_compacted

On Thu, Sep 14, 2023 at 15:41 PM Fang Hui <hui.fang@....com> wrote: 
> On system with "CONFIG_ZONE_DMA32=y", if the allocated physical address is
> greater than 4G, swiotlb will be used. It will lead below defects.
> 1) Impact performance due to an extra memcpy.
> 2) May meet below error due to swiotlb_max_mapping_size()
>    is 256K (IO_TLB_SIZE * IO_TLB_SEGSIZE).
> "swiotlb buffer is full (sz: 393216 bytes), total 65536 (slots), used 2358 (slots)"
> 
> To avoid those defects, use dma_alloc_pages() instead of alloc_pages() in
> vb2_dma_sg_alloc_compacted().
> 
> Suggested-by: Tomasz Figa <tfiga@...omium.org>
> Signed-off-by: Fang Hui <hui.fang@....com>
 ---
Two things.
1. For dma_data_direction para (DMA_BIDIRECTIONAL is used) of dma_alloc_pages(),
  maybe better pass from callers? In DeviceAsWebcam case, it's DMA_TO_DEVICE.

2. "MA-21654" (NXP ticket number) should be removed in the comment, need I
  re-push or it will be done on your side, thanks!

BRs,
Fang Hui

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ