1. 32

  2. 6

    Does anyone have pointers to background info on the issue with FreeBSD/NetBSD needing an instruction emulator, for something related to console I/O? Seems like they must be doing something fairly unique there if OpenBSD was able to emulate all these other OSs without needing an instruction emulator, but now needs one for those two.

    1. 1

      Wild guess: it’s the rep prefix.

      1. 3

        I think it’s just the outsb part - copies data from memory to an I/O port, which is obviously not “real” in a VM so the hypervisor needs to do something with it.

        For instance, see how bhyve handles it:

        • vmm/intel/vmx.c – EXIT_REASON_INOUT saves some state and sets exit code to VM_EXITCODE_INOUT.
        • vmm/vmm.c vm_run() on VM_EXITCODE_INOUT calls vm_handle_inout():
        • vmm/vmm_ioport.c - all about emulating IO port calls.
        1. 3

          I’m sitting next to mlarkin at AsiaBSDCon and he says “uhh, no, Ted”. :) (Note this went through several edits to come to “uhh, no” so as not to offend other lobsters.) ;)