summaryrefslogtreecommitdiff
path: root/arch/csky/abiv1
diff options
context:
space:
mode:
authorGuo Ren <ren_guo@c-sky.com>2019-06-18 20:06:52 +0800
committerGuo Ren <ren_guo@c-sky.com>2019-07-19 14:21:36 +0800
commita231b8839cd4259de1d37a78165739a4d5d08e72 (patch)
treeb258a8e773231f4d76de0a2f8d9e308b1b9daa00 /arch/csky/abiv1
parent9d35dc3006a9865eb5b55cc79df49933601131f8 (diff)
downloadlinux-sh-a231b8839cd4259de1d37a78165739a4d5d08e72.tar.gz
csky: Add new asid lib code from arm
This patch only contains asid help code from arm for next patch to use. The asid allocator use five level check to reduce the cost of switch_mm. 1. Check if the asid version is the same (it's general) 2. Check reserved_asid which is set in rollover flush_context() and key point is to keep the same bit position with the current asid version instead of input version. 3. Check if the position of bitmap is free then it could be set & used directly. 4. find_next_zero_bit() (a little performance cost) 5. flush_context (this is the worst cost with increase current asid version) Check is level by level and cost is also higher with the next level. The reserved_asid and bitmap mechanism prevent unnecessary find_next_zero_bit(). The atomic 64 bit asid is also suitable for 32-bit system and it won't cost a lot in 1th 2th 3th level check. The operation of set/clear mm_cpumask was removed in arm64 compared to arm32. It seems no side effect on current arm64 system, but from software meaning it's wrong. Although csky also needn't it, we add it back for csky. The asid_per_ctxt is no use for csky and it reserves the lowest bits for other use, maybe: trust zone ? Ok, just keep it in csky copy. Seems it also could be used by other archs and it's worth to move asid code to generic in future. Signed-off-by: Guo Ren <ren_guo@c-sky.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Julien Grall <julien.grall@arm.com>
Diffstat (limited to 'arch/csky/abiv1')
0 files changed, 0 insertions, 0 deletions