From: ra7055@freescale.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] [ARM] Introduce patching of phys_to_virt and vice versa
Date: Fri, 02 Jul 2010 10:06:04 -0500 [thread overview]
Message-ID: <1278083164.15298.55.camel@ra7055-laptop> (raw)
In-Reply-To: <1277542025-19881-1-git-send-email-eric.miao@canonical.com>
Eric,
On Sat, 2010-06-26 at 16:47 +0800, eric.miao at canonical.com wrote:
> From: Eric Miao <eric.miao@canonical.com>
>
> In most cases, the delta between PHYS_OFFSET and PAGE_OFFSET is normally
> 16MiB aligned, which means the difference can be handled by a simple ADD
> or SUB instruction with an immediate shift operand in ARM. This will be
> a bit more efficient and generic when PHYS_OFFSET goes run-time.
>
> This idea can be made generic to allow conversions more than phys_to_virt
> and virt_to_phys. A stub instruction is inserted where applicable, and it
> has a form of 'add rn, rd, #imm', where the lowest 8-bit of #imm is used
> to identify the type of patching. Currently, only two types are defined,
> but could be expanded in my POV to definitions like __io(), __mem_pci()
> and so on. A __patch_table section is introduced to include the addresses
> of all these stub instructions.
>
> There are several places for improvement:
>
> 1. constant parameters which can be optimized by the compiler now needs
> one additional instruction (although the optimization is neither
> possible when PHYS_OFFSET goes a variable)
>
> 2. flush_cache_all() when patching is done seems to be brute but simple
> enough here in this patch to show a proof concept
>
> Any thing else?
>
> PS: the general idea comes from Nicolas Pitre, and is drafted at
> https://wiki.ubuntu.com/Specs/ARMSingleKernel
>
Should something more generic like the x86 alternative code be done for
ARM? It's very likely we will need patching in other places like for UP
and SMP in one kernel.
Rob
next prev parent reply other threads:[~2010-07-02 15:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-26 8:47 [PATCH] [ARM] Introduce patching of phys_to_virt and vice versa eric.miao at canonical.com
2010-06-26 8:50 ` Eric Miao
2010-06-26 9:54 ` Russell King - ARM Linux
2010-06-26 18:22 ` Nicolas Pitre
2010-07-02 15:06 ` Rob Herring [this message]
2010-07-20 21:16 ` Russell King - ARM Linux
2010-08-05 8:45 ` Eric Miao
2010-08-05 9:45 ` Russell King - ARM Linux
2010-08-05 13:01 ` Eric Miao
2010-08-06 17:11 ` Nicolas Pitre
2010-08-06 17:07 ` Nicolas Pitre
2010-08-08 22:24 ` Russell King - ARM Linux
2010-08-09 16:55 ` Nicolas Pitre
2010-09-28 13:35 ` Eric Miao
2010-09-28 17:51 ` Nicolas Pitre
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=1278083164.15298.55.camel@ra7055-laptop \
--to=ra7055@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox