All of lore.kernel.org
 help / color / mirror / Atom feed
From: linus.ml.walleij@gmail.com (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: ARM926EJ-S TLB lockdown
Date: Wed, 1 Sep 2010 22:01:14 +0200	[thread overview]
Message-ID: <AANLkTinPN1gYoq6xLCynFmYG+3Zkje=rzHzXKvvGJGeC@mail.gmail.com> (raw)
In-Reply-To: <20100901151920.GA6019@sig21.net>

Interesting stuff Johannes!

2010/9/1 Johannes Stezenbach <js@sig21.net>:

> ? ? ? ? ? ? ? ?tlb_lockdown(0xffff0000); ? ? ? // exception vectors

This is probably clever to put in the lockdown TLB

> ? ? ? ? ? ? ? ?tlb_lockdown(0xc0000000); ? ? ? // kernel code / data
> ? ? ? ? ? ? ? ?tlb_lockdown(0xc0100000); ? ? ? // kernel code / data
> ? ? ? ? ? ? ? ?tlb_lockdown(0xc0200000); ? ? ? // kernel code / data
> ? ? ? ? ? ? ? ?tlb_lockdown(0xc0300000); ? ? ? // kernel code / data
> ? ? ? ? ? ? ? ?tlb_lockdown(0xc0400000); ? ? ? // kernel code / data
> ? ? ? ? ? ? ? ?tlb_lockdown(0xc0500000); ? ? ? // kernel code / data
> ? ? ? ? ? ? ? ?tlb_lockdown(0xc0600000); ? ? ? // kernel code / data

But are these really most relevant to lock down?

Since you have a JTAG debugger, can't you profile what
memory pages are actually accessed most often and lock down
these?

But it can be even more elaborate. Profile out the *functions*
most used.

When I've worked with TCM I played with the idea to be able to
tag functions like this:

#define __hotfunc __attribute__((long_call)) __section(.hot.text) noinline
(...)
int __hotfunc foo();

Then have the linker put the hotfuncs into separate pages and
link that.

You can use the same scheme for locked-down TLB:s I believe?
Up to 8 pages of code tagged "hotfunc" will be diverted to these
pages and locked down.

See the stuff in arch/arm/include/asm/tcm.h for the compiler
directives and check the link script in
arch/arm/kernel/vmlinux.lds.S to see how I'm separating the
TCM stuff to separate pages.

Just my ?0.01...

Yours,
Linus Walleij

  reply	other threads:[~2010-09-01 20:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 15:19 ARM926EJ-S TLB lockdown Johannes Stezenbach
2010-09-01 20:01 ` Linus Walleij [this message]
2010-09-02 14:30   ` Johannes Stezenbach

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='AANLkTinPN1gYoq6xLCynFmYG+3Zkje=rzHzXKvvGJGeC@mail.gmail.com' \
    --to=linus.ml.walleij@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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.