All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@shadowen.org>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: linux-mm@kvack.org
Subject: Re: VMALLOC_END definition?
Date: Thu, 23 Nov 2006 10:42:21 +0000	[thread overview]
Message-ID: <45657B0D.3040207@shadowen.org> (raw)
In-Reply-To: <20061123084940.GA8009@osiris.boeblingen.de.ibm.com>

Heiko Carstens wrote:
> Hi,
> 
> I just stumbled across the VMALLOC_END definition: I'm not entirely sure
> what the meaning of this is: is it the last _valid_ address of the
> vmalloc area or is it the first address _after_ the vmalloc area?
> 
> Reading the code in mm/vmalloc.c it seems to be the last valid address,
> which IMHO is the only thing that makes sense... how would one express
> the first address after 0xffffffff on a 32bit architecture?
> Whatever it is, it looks like half of the architectures got it wrong.
> 
> We have a lot of these:
> 
> e.g. powerpc:
> #define VMALLOC_START ASM_CONST(0xD000000000000000)
> #define VMALLOC_SIZE  ASM_CONST(0x80000000000)
> #define VMALLOC_END   (VMALLOC_START + VMALLOC_SIZE)
> 
> but also a lot of these:
> 
> e.g. x86_64
> 
> #define VMALLOC_START    0xffffc20000000000UL
> #define VMALLOC_END      0xffffe1ffffffffffUL

A quick grep shows that most architectures are assuming vmalloc space is
VMALLOC_START >= addr < VMALLOC_END.  x86_64 seems to be an odd one out
with the following construct in architecture specific code:

arch/x86_64/mm/fault.c: for (address = start; address <= VMALLOC_END;
address += PGDIR_SIZE) {

However, it also has this:

arch/x86_64/mm/fault.c:               ((address >= VMALLOC_START &&
address < VMALLOC_END))) {

A couple of filesystems and sparsemem also appear to assume the
VMALLOC_START >= addr < VMALLOC_END model.  So it seems likely that the
architectures not using this model are wrong.

-apw

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-11-23 10:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-23  8:49 VMALLOC_END definition? Heiko Carstens
2006-11-23 10:42 ` Andy Whitcroft [this message]
2006-11-23 11:58   ` Heiko Carstens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45657B0D.3040207@shadowen.org \
    --to=apw@shadowen.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-mm@kvack.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.