Julius Werner has posted comments on this change. ( https://review.coreboot.org/28100 )
Change subject: libpayload/x86/exception: Add ability to handle user defined interrupts ......................................................................
Patch Set 1:
(2 comments)
https://review.coreboot.org/#/c/28100/1/payloads/libpayload/arch/x86/excepti... File payloads/libpayload/arch/x86/exception.c:
https://review.coreboot.org/#/c/28100/1/payloads/libpayload/arch/x86/excepti... PS1, Line 165: /* Handle user defined vectors */ Not opposed to adding this capability in general, but I don't think it would be a good fit for the APIC timer stuff if we want to add it architecturally. In that case, I'd just hardcode an interrupt number for that and check it here directly. There can be only one exception hook, and that's currently used by GDB, so if you'd implement the APIC stuff through there you'd be breaking that. (The alternative would be to expand the hook system to a linked list.)
https://review.coreboot.org/#/c/28100/1/payloads/libpayload/arch/x86/excepti... PS1, Line 167: die_if(!hook || !hook(vec), I don't think this does what you want, since even if hook(vec) returns true, you'll keep running through the code below and hit the vec >= EXC_COUNT. I think you meant to return here?