On Fri, Jan 16, 2026 at 10:51:39AM +0000, Alexander Graf via SeaBIOS wrote:
> Implement catch-all mechanism to handle invalid boot loaders that execute
> random instructions and reach the VGA hole at 0xa0000, which would lead to
> VM crashes with KVM_INTERNAL_ERROR.
> 
> When a BIOS boot loader gets corrupted, it can end up jumping across
> address space and execute stray code. The typical symptom of that is
> that it executes 0x0 (addw) instructions until the code reaches an MMIO
> region, such as the VGA window. When running in KVM, attempting to
> execute code from the MMIO window results in KVM_INTERNAL_ERROR exits
> which crash the VM.
> 
> To prevent VM crashes before we reach such an MMIO window, introduce an
> internal int 0xf0 handler and call it at strategic locations that should
> never get executed in the first place. When we now have stray code
> executing, these int calls cause an emergency print of "BIOS failed to
> boot volume" and cleanly shut down the machine.

Unless I'm missing something, "int 0xf0" isn't a standard.  I don't
think it is a good idea to introduce seabios specific real-mode
software interrupt handlers.  We've avoiding doing this in the past,
because of the confusion it can cause.  (In short, we never know if
some old dos-era program has its own expectations about unusual int
handlers.)

Ralph Brown's interrupt list has this to say about 0xf0:

INT F0 - BASICA.COM, GWBASIC, compiled BASIC - ORIGINAL INT 08 VECTOR
Note:   BASICA.COM does not restore vector on termination
SeeAlso: INT EF"BASIC"

If there is a well defined standard "panic" interrupt handler then we
could use that.  Otherwise, it should also be fine to load code into
the ebda/lowmem areas that somehow panics without relying on a new
interrupt handler.

> 
> This is a nicer experience for users as it prints out why their system
> broke and in addition it avoids KVM_INTERNAL_ERROR calls when a virtual
> machine attempts to execute from MMIO because of a broken boot loader.
> 
> Signed-off-by: Alexander Graf <[email protected]>

Cheers,
-Kevin

_______________________________________________
SeaBIOS mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to