linux-mips
[Top] [All Lists]

Warning about add_wired_entry

To: linux-mips@linux-mips.org
Subject: Warning about add_wired_entry
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 7 Dec 2009 15:02:36 +0000
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.20 (2009-08-17)
The earlier posting wrt. add_wired_entry reminded my of this long standing
issue.

The kernel does not reserve any address space for use by add_wired_entry().
In other words there is the possibility that vmalloc, ioremap or other
kernel APIs will use the same address space resulting in a crash or worse.

Currently there are three users of add_wired_entry:

 - Alchemy
 - Cavium
 - Jazz

The interface itself also is hostile as it directly exposes the MIPS TLB
registers to the C programmer so should die.  And often wiring a TLB entry
is a bad idea.  TLB entries are a scarce resource and wasting them unwisely
may impact performance.  Especially on the lowest-end CPUs with just
16 TLB entries this can be significant but even on the high-end TLBs with
64 entries it's not always clear if wiring entries is a good idea.  And
there are a few core types that don't even have the capability of wiring
entries.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>