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]
Message-Id: <DB4HHQ.1KMN8GNWYJLC1@crapouillou.net>
Date:   Wed, 30 Sep 2020 15:33:13 +0200
From:   Paul Cercueil <paul@...pouillou.net>
To:     Christoph Hellwig <hch@....de>
Cc:     Stephen Rothwell <sfr@...b.auug.org.au>,
        Dave Airlie <airlied@...ux.ie>,
        DRI <dri-devel@...ts.freedesktop.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: linux-next: build failure after merge of the drm tree

Hi Christoph,

Le mer. 30 sept. 2020 à 11:02, Christoph Hellwig <hch@....de> a écrit 
:
> On Mon, Sep 28, 2020 at 03:31:28PM +0200, Paul Cercueil wrote:
>>  It's allocated with dma_alloc_wc, but then it's only accessed as
>>  non-coherent.
>> 
>>  Anyway, for the time being I guess you could revert 37054fc81443. 
>> But I
>>  have patches on top of it in drm-misc-next so it's going to be a 
>> mess.
>> 
>>  If we have time I can come up with a custom dumb_create() fonction, 
>> to make
>>  sure that the GEM buffers are allocated with 
>> dma_alloc_noncoherent(). Is
>>  there a dma_mmap_noncoherent() too?
> 
> Please use the lower-level dma_alloc_pages and then just insert the
> pages directly using remap_pfn_range.  Although it might make sense
> to eventually create a wrapper around remap_pfn_range for all the
> vma sizing sanity checks.

One thing missing for remap_pfn_range(), I have no alternative for this:

vma->vm_page_prot = dma_pgprot(dev, vma->vm_page_prot, 
DMA_ATTR_NON_CONSISTENT);

So I have to do:

vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
pgprot_val(vma->vm_page_prot) &= ~_CACHE_MASK;
pgprot_val(vma->vm_page_prot) |= _CACHE_CACHABLE_NONCOHERENT;

And that will only compile on MIPS, because these _CACHE_* macros are 
only defined there.

I would need something like a pgprot_noncoherent(), I think.

-Paul


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ