Fix processor accounting on non-x86
The underlying problem with processor accounting on non-x86 appears intr_event_handle() was designed for large numbers of assembly-language to C bridges and few cascaded PICs (similar to x86 with 5 bridges and only 2 cascades). Whereas all other architectures have a single bridge and many cascading PICs.
Issue is if a cascading PIC calls intr_event_handle() from an interrupt handle, curthread->td_intr_nesting_level will be 2 and the timeslice will be accounted as being consumed by interrupt handling. Due to the speed of modern processors the error in time accounting may not be huge, but it is lurking.
This resolves the issue by moving ++curthread->td_intr_nesting_level, pushing of curthread->td_intr_frame and the critical_enter() out of intr_event_handle() and into the bridge points.
Thank you for taking the time to contribute to FreeBSD! There is an issue that needs to be fixed:
- Missing Signed-off-by lines (7b678d670ff6d653edc7ebf03635b032a77e86db, 2fe9835d618555ace745ac7b5862d2c045d9b6c9, d7d1ba81c95cc987049627adca450fe3b5cfa8e6, 58447f8d51efeffed6d72a94acd534a77c792c19, 92c8694426af21df84c851ec193ab145531f4fa6, 0994def83062ff57f9d8d1689c0d321a954235ba, f977973ef46d1f53b7a473a9c75a67d48ab49ba4)
Please review CONTRIBUTING.md, then update and push your branch again.
Unlike many of my patch series, this series is mostly independent of one-another. They're a bit interesting to reorder, but should be doable in most any order. Is notable the first is the highest value (since it is a bugfix), whereas the rest are somewhere closer to cleanup/reduction in stack size.
@chmeeedalf #1748 should be of interest to you. I notice several PowerPC PICs have issues due to what this is pointing at.
Looks like OpenSSL fun is now killing builds.
Ping to @bsdjhb (x86), @strejda (INTRNG),and @chmeeedalf (PowerPC) as likely reviewers. The impact might not be all that big, but has been causing errors in time accounting for a long time.