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: <20180927154733.GA15985@infradead.org>
Date:   Thu, 27 Sep 2018 08:47:33 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Guo Ren <ren_guo@...ky.com>
Cc:     akpm@...ux-foundation.org, arnd@...db.de,
        daniel.lezcano@...aro.org, davem@...emloft.net,
        gregkh@...uxfoundation.org, jason@...edaemon.net,
        marc.zyngier@....com, mark.rutland@....com,
        mchehab+samsung@...nel.org, peterz@...radead.org, robh@...nel.org,
        robh+dt@...nel.org, tglx@...utronix.de,
        linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
        devicetree@...r.kernel.org, green.hu@...il.com
Subject: Re: [PATCH V6 07/33] csky: MMU and page table management

> +static void *csky_dma_alloc_atomic(
> +	struct device *dev,
> +	size_t size,
> +	dma_addr_t *dma_handle
> +	)

Can you please use normal kernel coding style?  Closing brace on the
same line, either two tab indents for the arguments or align them to the
first argument:

static void *csky_dma_alloc_atomic(struct device *dev, size_t size,
		dma_addr_t *dma_handle)

or:

static void *csky_dma_alloc_atomic(struct device *dev, size_t size,
				   dma_addr_t *dma_handle)

> +	if (DMA_ATTR_NON_CONSISTENT & attrs)
> +		BUG();

Please don't bug on unknown attributs, they can be safely ignored.

> +void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
> +			      size_t size, enum dma_data_direction dir)
> +{
> +	struct page *page = pfn_to_page(paddr >> PAGE_SHIFT);
> +	unsigned long offset = paddr & ~PAGE_MASK;
> +	unsigned long vaddr;
> +
> +	if (PageHighMem(page))
> +		vaddr = (unsigned long) kmap_atomic(page);

This isn't going to work as the size might be larger than PAGE_SIZE.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ