-
Notifications
You must be signed in to change notification settings - Fork 20
Description
In https://info.varnish-software.com/blog/tinykvm-the-fastest-sandbox it says:
We also enter in usermode and try to avoid kernel mode except where impossible. Did you know that you can handle CPU exceptions in usermode on x86?
However, tinykvm doesn't seem to actually do this.
tinykvm/lib/tinykvm/amd64/idt.cpp
Line 63 in b517667
| set_entry(idt.entry[vec], handler, 0x8, IDT_PRESENT | IDT_CPL0 | IDT_GATE_INTR); |
CPL0), and with ring-0 segment selectors.
I am using tinykvm for a side project which wants specifically ring-3 -> ring-3 interrupts for speed reasons, and so this behavior was surprising to me. I was able to add a second CPL3 gate, along with another usermode accessible mapping of the kernel interrupt code and usermode accessible interrupt stack, fairly easily so this isn't a blocker, but I wasn't sure if this was unintentional behavior or a design decision which has changed since the block post was written.