linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Russ Dill <Russ.Dill@ti.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Grant Likely <grant.likely@secretlab.ca>,
	linux-omap@vger.kernel.org, mans@mansr.com,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: Re: [RFC 0/4] Create infrastructure for running C code from SRAM.
Date: Fri, 6 Sep 2013 12:12:21 +0100	[thread overview]
Message-ID: <20130906111221.GH25647@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1378226665-27090-1-git-send-email-Russ.Dill@ti.com>

On Tue, Sep 03, 2013 at 09:44:21AM -0700, Russ Dill wrote:
> SRAM handling code is in the process of being moved from arch directories
> into drivers/misc/sram.c using device tree and genalloc [1] [2]. This RFC
> patchset builds on that, including the limitation that the SRAM address is
> not known at compile time. Because the SRAM address is not known at compile
> time, the code that runs from SRAM must be compiled with -fPIC. Even if
> the code were loaded to a fixed virtual address, portions of the code must
> often be run with the MMU disabled.

What are you doing about the various gcc utility functions that may be
implicitly called from C code such as memcpy and memset?

> The general idea is that for each SRAM user (such as an SoC specific
> suspend/resume mechanism) to create a group of sections. The section group
> is created with a single macro for each user, but end up looking like this:
> 
> .sram.am33xx : AT(ADDR(.sram.am33xx) - 0) {
>   __sram_am33xx_start = .;
>   *(.sram.am33xx.*)
>   __sram_am33xx_end = .;
> }
> 
> Any data or functions that should be copied to SRAM for this use should be
> maked with an appropriate __section() attribute. A helper is then added for
> translating between the original kernel symbol, and the address of that
> function or variable once it has been copied into SRAM. Once control is
> passed to a function within the SRAM section grouping, it can access any
> variables or functions within that same SRAM section grouping without
> translation.

What about the relocations which will need to be fixed up - eg, addresses
in the literal pool, the GOT table contents, etc?  You say nothing about
this.

  parent reply	other threads:[~2013-09-06 11:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 16:44 [RFC 0/4] Create infrastructure for running C code from SRAM Russ Dill
2013-09-03 16:44 ` [RFC 1/4] Misc: SRAM: Create helpers for loading C code into SRAM Russ Dill
2013-09-03 16:44 ` [RFC 2/4] ARM: SRAM: Add macro for generating SRAM resume trampoline Russ Dill
2013-09-03 16:44 ` [RFC 3/4] Misc: SRAM: Hack for allowing executable code in SRAM Russ Dill
2013-09-04 18:06   ` Tony Lindgren
2013-09-06 20:50     ` Russ Dill
2013-09-03 16:44 ` [RFC 4/4] ARM: AM33XX: Move suspend/resume assembly to C Russ Dill
2013-09-04 19:52 ` [RFC 0/4] Create infrastructure for running C code from SRAM Emilio López
2013-09-04 21:47   ` Russ Dill
2013-09-06 11:02     ` Sekhar Nori
2013-09-06 11:14     ` Russell King - ARM Linux
2013-09-06 16:40       ` Dave Martin
2013-09-06 18:50         ` Russ Dill
2013-09-07  8:57         ` Russell King - ARM Linux
2013-09-06 18:40       ` Russ Dill
2013-09-06 11:12 ` Russell King - ARM Linux [this message]
2013-09-06 16:19   ` Dave Martin
2013-09-06 19:42     ` Russ Dill
2013-09-06 19:32   ` Russ Dill
2013-09-07 16:21     ` Ard Biesheuvel
2013-09-09 23:10       ` Russ Dill

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=20130906111221.GH25647@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=Russ.Dill@ti.com \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mans@mansr.com \
    --cc=p.zabel@pengutronix.de \
    --cc=shawn.guo@linaro.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).