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:   Mon, 29 Mar 2021 12:30:42 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Stefano Stabellini <sstabellini@...nel.org>,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc:     Christoph Hellwig <hch@....de>, xen-devel@...ts.xensource.com,
        linux-arm-kernel@...ts.infradead.org,
        Marek Szyprowski <m.szyprowski@...sung.com>,
        Robin Murphy <robin.murphy@....com>,
        "open list:SWIOTLB SUBSYSTEM" <iommu@...ts.linux-foundation.org>,
        open list <linux-kernel@...r.kernel.org>,
        Russell King <linux@...linux.org.uk>,
        Mike Rapoport <rppt@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Ard Biesheuvel <ardb@...nel.org>,
        Max Filippov <jcmvbkbc@...il.com>,
        Catalin Marinas <catalin.marinas@....com>, opendmb@...il.com
Subject: Re: [PATCH] ARM: Qualify enabling of swiotlb_init()

On 3/19/21 5:22 PM, Stefano Stabellini wrote:
> On Fri, 19 Mar 2021, Konrad Rzeszutek Wilk wrote:
>> On Fri, Mar 19, 2021 at 02:07:31PM +0100, Christoph Hellwig wrote:
>>> On Thu, Mar 18, 2021 at 09:03:33PM -0700, Florian Fainelli wrote:
>>>>  #ifdef CONFIG_ARM_LPAE
>>>> +	if (swiotlb_force == SWIOTLB_FORCE ||
>>>> +	    max_pfn > arm_dma_pfn_limit)
>>>
>>> Does arm_dma_pfn_limit do the right thing even with the weirdest
>>> remapping ranges?  Maybe a commen here would be useful.
>>>
>>>> +		swiotlb_init(1);
>>>> +	else
>>>> +		swiotlb_force = SWIOTLB_NO_FORCE;
>>>
>>> Konrad: what do you think of setting swiotlb_force to SWIOTLB_NO_FORCE
>>> and only switching it to SWIOTLB_NORMAL when swiotlb_init* is called?
>>> That kind makes more sense than forcing the callers to do it.
>>>
>>> While we're at it, I think swiotlb_force should probably be renamed to
>>> swiotlb_mode or somethng like that.
>>
>> swiotlb_mode sounds good.
>>
>> Also it got me thinking - ARM on Xen at some point was a bit strange, so not sure how
>> the logic works here, Stefano?
> 
> There is nothing strange in regards to swiotlb_force. swiotlb_force is only used
> in swiotlb-xen map_page to figure out whether:
> 
> - we actually have to use the swiotlb bounce buffer (this is the
>   swiotlb_xen == SWIOTLB_FORCE case)
> - or we can use the provided page directly for dma if other conditions
>   are met (dma_capable, !range_straddles_page_boundary, ...)
> 
> 
> I don't think that switching to "swiotlb_mode" would cause any issues.
> 

Should I toss this in Russell's patch tracker or do you need me to make
some changes to the patch?
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ