Quantcast
Viewing all articles
Browse latest Browse all 248

Hypervisor type 1 external interrupt handling

I have problem handling external interrupt for type 1 hypervisor, type 2 is working fine with windows 10 but type 1 is causing windows 10 to hangup in login screen.

This is how I enable external interrupts:When setting up cpus I enable VM-exit control bit 15 "acknowledge external interrupts" and pin-based bit 0 "external interrupts exiting", and I allocate buffer in each cpu context for pending interrupts.

When VM-exit reason 1 "external interrupt exiting" I do VMX-read 0x4404 "VM-exit interruption information" and I check for bit 31 "Valid" and bits 10:8 "interruption type" equal 0 "external interrupt", also I check bit 11 to VMX-read 0x4406 "exit interruption error code", and before injecting interrupt I check if interruptible VMX-read 0x6820 "guest RFLAGS" bit 9 "Interrupt enable flag" and VMX-read 0x4824 "guest interruptibility state" bit 1 "blocking by mov ss", if guest interruptible VMX-write 0x4016 "VM-entry interruption information field" and VMX-write 0x4018 "VM-entry error code" if error code valid, otherwise I save error code and interrupt information to pending interrupt buffer and set interrupt window exiting primary-proc-based bit 2.

When VM-exit reason 7 "Interrupt window exiting" I search for pending interrupts in allocated buffer, if found inject interrupt otherwise clear interrupt window exiting.


Viewing all articles
Browse latest Browse all 248

Trending Articles