On 17.04.24 г. 9:30 ч., Xin Li (Intel) wrote:
Add a FRED-specific INT80 handler fred_int80_emulation():
1) As INT instructions and hardware interrupts are separate event
types, FRED does not preclude the use of vector 0x80 for external
interrupts. As a result the FRED setup code does *NOT* reserve
vector 0x80 and calling int80_is_external() is not merely
suboptimal but actively incorrect: it could cause a system call
to be incorrectly ignored.
2) fred_int80_emulation(), only called for handling vector 0x80 of
event type EVENT_TYPE_SWINT, will NEVER be called to handle any
external interrupt (event type EVENT_TYPE_EXTINT).
3) The FRED kernel entry handler does *NOT* dispatch INT instructions,
which is of event type EVENT_TYPE_SWINT, so compared with
do_int80_emulation(), there is no need to do any user mode check.
4) int80_emulation() does a CLEAR_BRANCH_HISTORY, which is likely > overkill for new x86 CPU implementations that support FRED.
Well, that's a bit of an overstatement/speculation, because clear_branch_history will only be effective if the machine is susceptible to the given bug and there isn't a better options (i.e using a hardware bit controlling the respective aspect of the CPU).