linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Suzuki Poulose <suzuki@in.ibm.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>,
	linux ppc dev <linuxppc-dev@lists.ozlabs.org>,
	Dave Hansen <dave@linux.vnet.ibm.com>
Subject: Defintion of kernstart_addr
Date: Wed, 05 Oct 2011 18:19:35 +0530	[thread overview]
Message-ID: <4E8C525F.4090000@in.ibm.com> (raw)

Hi Kumar,

I have been working on the CONFIG_RELOCATABLE support for PPC44x, trying to process
the relocations generated by the compiler. Since the TLB size is 256M, we cannot
enforce a page aligned kernel load address.

I came across some issues with the __va() / __pa() translations, while the kernel
load address is not page aligned.


We have the following definition :

#define __va(x) ((void *)(unsigned long)((phys_addr_t)(x) -
						PHYSICAL_START + KERNELBASE)

where,
	PHYSICAL_START is #define'd to kernstart_addr variable, updated at boot
time.

I would like to know the exact meaning of the value in kerstart_addr.

For e.g:

When we have :

PAGE_OFFSET = KERNELBASE = 0xc0000000,

and
kernel loaded at 64M (0x4000000)
and
we map Physical address 0 to Virtual address 0xc0000000.

What should be the value of kernstart_addr ? Should it be
0 ? Or should it be 0x4000000 ?

If we choose, 0x4000000, we get the translations wrong :

__va(0x1) = 0x1 - 0x4000000 + 0xc0000000

	   = 0xbc000001
If we select 0, we have problems at other places where we assume,
PHYSICAL_START to be the va() of _stext.


Thanks
Suzuki

             reply	other threads:[~2011-10-05 12:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-05 12:49 Suzuki Poulose [this message]
2011-10-05 16:51 ` Defintion of kernstart_addr Dave Hansen

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=4E8C525F.4090000@in.ibm.com \
    --to=suzuki@in.ibm.com \
    --cc=dave@linux.vnet.ibm.com \
    --cc=galak@kernel.crashing.org \
    --cc=jwboyer@linux.vnet.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).