In a virtual computing machine, a system and method that dynamically
patches the interrupt mechanism (in interrupt vector space) of a host
computing architecture with guest mode software. Significant increases in
performance are achieved without depending on the host code. A patching
mechanism evaluates the operating system version, processor, and code to
be patched. If patchable, low-level interfaces are created dynamically; a
dispatcher is written into an unused location in vector space, and
instructions copied from each interrupt vector to be patched to a guest
interrupt vector. For an interrupt, the new, patched instructions branch
to the dispatcher, which then branches to the appropriate patched
interrupt guest code. If the processor is operating as a virtual machine,
the guest interrupt code handles the interrupt, otherwise the original
copied instructions are replayed, followed by execution at the original
host instruction in vector space that exists after the copied and patched
instructions.