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: <Pine.LNX.4.64.0609221421170.9495@schroedinger.engr.sgi.com>
Date:	Fri, 22 Sep 2006 14:21:50 -0700 (PDT)
From:	Christoph Lameter <clameter@....com>
To:	Jesse Barnes <jesse.barnes@...el.com>
cc:	Martin Bligh <mbligh@...igh.org>, Andi Kleen <ak@...e.de>,
	Alan Cox <alan@...rguk.ukuu.org.uk>, akpm@...gle.com,
	linux-kernel@...r.kernel.org,
	Christoph Hellwig <hch@...radead.org>,
	James Bottomley <James.Bottomley@...eleye.com>,
	linux-mm@...ck.org
Subject: Re: [RFC] Initial alpha-0 for new page allocator API

On Fri, 22 Sep 2006, Jesse Barnes wrote:

> I was suggesting something like:
> 
> 	high = dev ? dev->coherent_dma_mask : 16*1024*1024;
> 
> instead.  May as well combine your NULL check and your assignment.  It'll 
> also do the right thing for 64 bit devices so we don't put unnecessary 
> pressure on the 32 bit range.  Or am I spacing out and reading the code 
> wrong?

Ahh.. Yes something like this will save a lot of lines:

Index: linux-2.6.18-rc7-mm1/arch/i386/kernel/pci-dma.c
===================================================================
--- linux-2.6.18-rc7-mm1.orig/arch/i386/kernel/pci-dma.c	2006-09-22 15:37:41.000000000 -0500
+++ linux-2.6.18-rc7-mm1/arch/i386/kernel/pci-dma.c	2006-09-22 16:20:49.849799156 -0500
@@ -26,8 +26,6 @@ void *dma_alloc_coherent(struct device *
 			   dma_addr_t *dma_handle, gfp_t gfp)
 {
 	void *ret;
-	unsigned long low = 0L;
-	unsigned long high = 0xffffffff;
 	struct dma_coherent_mem *mem = dev ? dev->dma_mem : NULL;
 	int order = get_order(size);
 	/* ignore region specifiers */
@@ -46,14 +44,9 @@ void *dma_alloc_coherent(struct device *
 			return NULL;
 	}
 
-	if (dev == NULL)
-		/* Apply safe ISA LIMITS */
-		high = 16*1024*1024L;
-	else
-	if (dev->coherent_dma_mask < 0xffffffff)
-		high = dev->coherent_dma_mask;
-
-	ret = page_address(alloc_pages_range(low, high, gfp, order));
+	ret = page_address(alloc_pages_range(0L,
+		dev ? dev->coherent_dma_mask : 16*1024*1024,
+		gfp, order));
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ