Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Harald Koerfgen <harald.koerfgen@netcologne.de>
To: linux-mips@fnet.fr
Cc: Vladimir Roganov <roganov@niisi.msk.ru>, linux@cthulhu.engr.sgi.com
Subject: Re: get_mmu_context()
Date: Wed, 21 Oct 1998 21:31:40 +0200 (MEST)	[thread overview]
Message-ID: <XFMail.981021213140.harald.koerfgen@netcologne.de> (raw)
In-Reply-To: <19981019121804.F387@uni-koblenz.de>

On 19-Oct-98 ralf@uni-koblenz.de wrote:
> On Sun, Oct 18, 1998 at 09:53:18PM +0200, Harald Koerfgen wrote:

[...]
> There is a number of machines, most popular some DECstation, which are
> available with both CPU architectures.

Yup.
 
> The other location for which patching might be useful are primarily the
> differences between the R3000 and R4000 status register, especially the
> KU rsp. KSU bits.  What other places do you have in mind?

Agreed. There are indeed other places where code could be reintegrated,
r2300_switch.S and r4k_switch.S come to mind.

On the other hand, there is code which should be seperated for performance reasons,
mainly the RESTORE_ALL macros thus affecting entry.S and scall_o32.S. Actually these
problems are solved by conditional compiling.
 
>> To make those changes generic needs either a reasonable amount of hacking or
>> avoidable code duplication. In fact, if we really don't care about self
>> modifying code we should be able to remove some code duplication, for
>> example in the fpu stuff.
> 
> People should consider that we'll be able to hide the self modifications
> in C code very nicely.  I would not go for anything which I consider a
> maintenance problem or major uglyness.

Good.
 
> Let me explain how the approach from my recent patch works:

[explanation snipped]
 
> Todo: we don't want a separate section per patched instruction.  Easy to
> fix.  We also want to get rid of the special section just like other
> initfunc stuff.

That sounds great. We could even put all ISA dependant code into seperate
sections and get rid of all the ISA sections, which aren't needed.
 
> The next class of things to patch are the zillion of function calls using
> function pointers.  We can insert a jal instruction and patch it's
> destination address.  Candidates for that include calls to flush_cache_all,
> flush_cache_mm, flush_cache_range, flush_cache_page, flush_cache_sigtramp,
> flush_tlb_all, flush_tlb_mm, flush_tlb_range, flush_tlb_page, add_wired_entry,
> clear_page, copy_page.
> 
> Both parts, patching immediate opperands and function calls can be dealt
> with similar to the approach in the userland dynamic linker, that initially
> the function called is the dynamic linker's kernel equivalent which will
> choose the right thing to do.
> 
> Extra goodie for the R3000 fraction: Many functions called via above
> mentioned pointers are empty, calls to them may be eleminated by overwriting
> the calling jal with nops.  Say goodbye to another hand full of cycles.

That sounds even better :-).
---
Regards,
Harald

  parent reply	other threads:[~1998-10-21 19:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-13 19:59 get_mmu_context() ralf
     [not found] ` <Pine.LNX.3.96.981014144230.10483B-100000@mirkwood.dummy.home>
1998-10-14 23:49   ` get_mmu_context() ralf
     [not found] ` <3625D799.7D923FA9@niisi.msk.ru>
1998-10-15 20:21   ` get_mmu_context() ralf
     [not found]     ` <Pine.SV4.3.91.981016185136.876A-100000@mech.math.msu.su>
1998-10-18 19:53       ` get_mmu_context() Harald Koerfgen
1998-10-19 10:18         ` get_mmu_context() ralf
1998-10-20  4:07           ` get_mmu_context() Warner Losh
1998-10-20 17:31             ` get_mmu_context() ralf
1998-10-20 23:36               ` get_mmu_context() Warner Losh
1998-10-21 19:31           ` Harald Koerfgen [this message]
1998-10-19  1:29       ` get_mmu_context() ralf
1998-10-16 22:44   ` get_mmu_context() ralf
  -- strict thread matches above, loose matches on Subject: below --
1998-10-20  4:21 get_mmu_context() Ariel Faigon
1998-10-20  4:21 ` get_mmu_context() Ariel Faigon

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=XFMail.981021213140.harald.koerfgen@netcologne.de \
    --to=harald.koerfgen@netcologne.de \
    --cc=linux-mips@fnet.fr \
    --cc=linux@cthulhu.engr.sgi.com \
    --cc=roganov@niisi.msk.ru \
    /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