0

In order to virtualize the CPU, the hardware helps the software with trap instruction and interrupt. I was wondering if a hardware does support interrupts and exceptions, but does not trap, will this machine still be able to virtualize the CPU by jumping into the kernel mode?

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
TheKingSid
  • 39
  • 6
  • A system could agree on a specific *exception* corresponded to a system call for example trying to *store* at 0xfeedface; could be interpreted as a syscall op. It is unlikely that you will find hardware that supports any sort of protection model that lacks a syscall style instruction. – mevets Oct 01 '21 at 13:45
  • 1
    Your question title seems different than your question body. Some real-world x86 OSes *did* at one point use the illegal-instruction exception to transfer control to the kernel [as a way to make system calls](https://stackoverflow.com/a/47112309/224132), because on 386 it was faster than `int 0x80`. But your question body is about virtualization. – Peter Cordes Oct 03 '21 at 07:37
  • 1
    The thing with virtualization is that "sensitive" instructions *must* trap. Being *able* to transfer control to the kernel is not the hard part, it's making sure that always happens for every case where a hypervisor needs to step in. Also, what definitions are you using for "exception" vs. "trap"? Those are highly overlapping terms. If you go by the taxonomy in Brendan's answer on [Difference between TRAP and exceptions](https://stackoverflow.com/q/56877451), the only type of exceptions other than traps are aborts, which don't normally allow resuming after. Is that what you mean? – Peter Cordes Oct 03 '21 at 07:41

0 Answers0