cam iosched: Add a handler for the quanta sysctl to enforce valid values
Invalid values can result in devision-by-zero panics or other
undefined behaviour so lets not allow them. Example panic:
Fatal trap 18: integer divide fault while in kernel mode cpuid = 0; apic id = 00 instruction pointer = 0x20:0xffffffff802998e5 stack pointer = 0x28:0xfffffe01ea3bf8d0 frame pointer = 0x28:0xfffffe01ea3bf900 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 12 (swi4: clock (0)) trap number = 18 panic: integer divide fault cpuid = 0 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01ea3bf510 vpanic() at vpanic+0x186/frame 0xfffffe01ea3bf590 panic() at panic+0x43/frame 0xfffffe01ea3bf5f0 trap_fatal() at trap_fatal+0x322/frame 0xfffffe01ea3bf640 trap() at trap+0x5e/frame 0xfffffe01ea3bf800 calltrap() at calltrap+0x8/frame 0xfffffe01ea3bf800 --- trap 0x12, rip = 0xffffffff802998e5, rsp = 0xfffffe01ea3bf8d0, rbp = 0xfffffe01ea3bf900 --- cam_iosched_ticker() at cam_iosched_ticker+0x25/frame 0xfffffe01ea3bf900 softclock_call_cc() at softclock_call_cc+0x13e/frame 0xfffffe01ea3bf9b0 softclock() at softclock+0xb9/frame 0xfffffe01ea3bf9e0 intr_event_execute_handlers() at intr_event_execute_handlers+0xec/frame 0xfffffe01ea3bfa20 ithread_loop() at ithread_loop+0xd6/frame 0xfffffe01ea3bfa70 fork_exit() at fork_exit+0x85/frame 0xfffffe01ea3bfab0 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe01ea3bfab0 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 2h29m20s Dumping 1165 out of 8055 MB:..2%..11%..21%..31%..42%..51%..61%..71%..81%..91%
PR: 221957
Obtained from: ElectroBSD