Skip to content

RFC ARM[64]: kernel mode NEON in atomic contexts

Catalin Marinas linux-arm-kernel 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest4 of 7 patches 0 repliesNew
  2. v2 RFC3 of 4 patches 0 repliesSuperseded

4 of 7 patches are in this archive. The cover letter announces 7.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7ARM: add support for kernel mode NEON in atomic context+0 -01 reply
1/7ARM: add support for kernel mode NEON in atomic context+0 -00 replies
3/7ARM64: defer reloading a task's FPSIMD state to userland resume+0 -01 reply
3/7ARM64: defer reloading a task's FPSIMD state to userland resume+0 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [RFC v3 PATCH 0/7] ARM[64]: kernel mode NEON in atomic contexts
Quoted 25 lines · Nicolas Pitre
Quoted 18 lines · Ard Biesheuvel
Quoted 11 lines · Nicolas Pitre
Quoted 8 lines · Ard Biesheuvel

The stack area is allocated by DEFINE_NEON_REGSTACK[_PARTIAL](varname), where the partial version takes an additional int num_regs indicating how many registers need to be freed up.

In the !in_interrupt() case, these functions operate as before, and the regstack is defined to minimal size in this case as it will remain unused anyway. In the in_interrupt() case, 'num_regs' (or all) NEON registers are stacked/unstacked using the allocated stack region.

Quoted 5 lines

Would have been nice to have the stack simply be a NULL pointer when !in_interrupt() or when the number of regs is 0. This would remove the need for a runtime check on !num_regs. I don't see an obvious way to accomplish that right now though.

Quoted 4 lines

We could address both of these issues by implementing Catalin's suggestion to reserve per-process vfp_states[] for both irq and softirq context in addition to the ordinary one, but it would waste a lot of space imo. What is your take on that?

Quoted 4 lines

I agree that this would be rather wasteful. I really like your current approach of dynamically allocating just the right amount of space on the stack. I'm not a big fan of statically allocated memory which is seldomly used.

I agree here, especially since we need to cover both soft and hard irqs. It would be about 1KB per CPU, not noticeable even on big systems but still looks like it's only going to be used rarely.

Signature · 1 line
Catalin