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: <ed63c117-610c-ea49-f45e-727be220745f@nxp.com>
Date:   Thu, 16 May 2019 11:49:31 +0000
From:   Laurentiu Tudor <laurentiu.tudor@....com>
To:     Fredrik Noring <noring@...rew.org>
CC:     Robin Murphy <robin.murphy@....com>, "hch@....de" <hch@....de>,
        "stern@...land.harvard.edu" <stern@...land.harvard.edu>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
        "marex@...x.de" <marex@...x.de>,
        "JuergenUrban@....de" <JuergenUrban@....de>,
        Leo Li <leoyang.li@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2 0/3] prerequisites for device reserved local mem
 rework

Hi Fredrick,

On 15.05.2019 19:28, Fredrik Noring wrote:
> Hi Lauretniu,
> 
>> I think that any recent kernel will do, so I'd say your current branch
>> should be fine.
> 
> The kernel oopses with "unable to handle kernel paging request at virtual
> address 000aba0b" in hcd_alloc_coherent via usb_hcd_map_urb_for_dma. This
> relates to patch 2/3 that I didn't quite understand, where
> 
> -	retval = dma_declare_coherent_memory(dev, mem->start,
> -					 mem->start - mem->parent->start,
> -					 resource_size(mem));
> 
> becomes
> 
> +	retval = gen_pool_add_virt(hcd->localmem_pool,
> +				   (unsigned long)mem->start -
> +					mem->parent->start,
> +				   mem->start, resource_size(mem),
> 
> so that arguments two and three switch places. Given
> 
> int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
> 				dma_addr_t device_addr, size_t size);
> 
> and
> 
> int gen_pool_add_virt(struct gen_pool *pool, unsigned long virt, phys_addr_t phys
> 		 size_t size, int nid)
> 
> it seems that the device address (dma_addr_t device_addr) now becomes a
> virtual address (unsigned long virt). Is that intended?
> 
> My corresponding patch is below for reference. I applied your 1/3 patch
> to test it.

I took your code, added the missing mapping and placed it in a patch. 
Please see attached (compile tested only).

---
Thanks & Best Regards, Laurentiu

View attachment "0001-usb-host-ohci-ps2-init-genalloc-for-local-memory.patch" of type "text/x-patch" (3428 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ