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: <20081001140607.GA22031@flint.arm.linux.org.uk>
Date:	Wed, 1 Oct 2008 15:06:08 +0100
From:	Russell King - ARM Linux <linux@....linux.org.uk>
To:	Christoph Lameter <cl@...ux-foundation.org>
Cc:	Nicolas Pitre <nico@....org>, lkml <linux-kernel@...r.kernel.org>
Subject: Re: wrong usage of MAX_DMA_ADDRESS in bootmem.h

On Wed, Oct 01, 2008 at 07:07:42AM -0500, Christoph Lameter wrote:
> Russell King - ARM Linux wrote:
> 
> > Not correct.  MAX_DMA_ADDRESS is a virtual address.  ISA_DMA_THRESHOLD
> > is the last byte of _physical_ memory which ISA DMA can transfer:
> 
> > include/asm-x86/scatterlist.h:#define ISA_DMA_THRESHOLD (0x00ffffff)
> > 
> > So what you've just suggested is completely insane.
> 
> Someone screwed around with the basics here. MAX_DMA_ADDRESS is no longer
> related to MAX_DMA_PFN for the x86_32 case. What is the point of relating
> MAX_DMA_ADDRESS to PAGE_OFFSET? Looks like we are creating more confusion
> about the strange DMA zone.

Because it is a virtual address.  It has to be.  You're using __pa() on it,
and __pa() ONLY takes a virtual address.

> The best would be to rename these variables to make the semantics clearer
> 
> ZONE_DMA related variables:
> 
> MAX_DMA_PFN -> MAX_ZONE_DMA_PFN
> MAX_DMA_ADDRESS -> MAX_ZONE_DMA_ADDRESS
> 
> MAX_DMA32_PFN -> MAX_ZONE_DMA32_PFN
> MAX_DMA32_ADDRESS -> MAX_ZONE_DMA32_ADDRESS
> 
> Then the general DMAability
> 
> MAX_DMA_ADDRESS -> DMA_LIMIT

That's no clearer.  Are they physical addresses?  Or are they virtual
addresses?  Can't guess that from the names.

> > Incorrect.  MAX_DMA_ADDRESS is the highest possible virtual DMA address:
> 
> MAX_DMA_ADDRESS is the highest possible address for the DMA zone. Not the
> highest possible address that any DMA controller can use.

Semantically disagree.

If you only have a controller which can address 1MB of memory (yes, they do
exist) then MAX_DMA_ADDRESS must be PAGE_OFFSET + 1MB, otherwise you have
precisely NO way to obtain memory from the kernel for this DMA controller
- and that means you want the DMA zone to be sized to 1MB.  So _indirectly_
it's true that MAX_DMA_ADDRESS is the highest possible address for the DMA
zone.
--
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