[BitVisor-devel-en:81] How does bitvisor swallow a NMI?

Yuan penhoiyuan at 163.com
Wed Sep 6 22:50:37 JST 2017


Dear all,

I startup PMU In bitvisor to monitor the guest. I want to make this process transparent. Specifically, I hope only bitvisor deals with the NMIs, and the gust does not invoke its NMI handler when resumed. I use the following two methods but both failed (the computer is freezed!). Could some one help me, or give a suggestion?




----------------------Method 1----------------------

vt_nmi_has_come (void)

{

asm_vmread (VMCS_GUEST_INTERRUPTIBILITY_STATE, &is);

- if (is & VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCKING_BY_NMI_BIT)

- return;

+ if (is & VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCKING_BY_NMI_BIT) {

+ if (perf_ovflow_status & 1 == 1)

+ asm(“iret”);

+ else

+ return;

+ }

----------------------end------------------------------




----------------------Method 2----------------------

vt_nmi_has_come (void)

{

asm_vmread (VMCS_GUEST_INTERRUPTIBILITY_STATE, &is);

- if (is & VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCKING_BY_NMI_BIT)

- return;

+ if (is & VMCS_GUEST_INTERRUPTIBILITY_STATE_BLOCKING_BY_NMI_BIT) {

+ if (perf_ovflow_status & 1 == 1)

+ clear_blocking_by_nmi (void);

+ else

+ return;

+ }

----------------------end------------------------------







Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bitvisor.org/archives/bitvisor-devel-en/attachments/20170906/59eaed31/attachment.html>


More information about the BitVisor-devel-en mailing list