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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d4308ead-d561-19f6-510c-45e61613de54@gmail.com>
Date:   Fri, 19 Mar 2021 10:43:22 -0700
From:   Florian Fainelli <f.fainelli@...il.com>
To:     Christoph Hellwig <hch@....de>
Cc:     linux-arm-kernel@...ts.infradead.org,
        Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
        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/2021 6:07 AM, 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.

It gets assigned to either 0xffffffff or PHYS_OFFSET + arm_dma_zone_size
- 1 which is obtained from the machine descriptor, so I expect it to do
the right thing, it works for a Pi 4 in 32-bit mode for instance. This
is conditional upon enabling CONFIG_ZONE_DMA for ARM, and will otherwise
keep its original value of 0, so this should be safe AFAICT.

> 
>> +		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.
Agreed.
-- 
Florian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ