On Wed, Aug 10, 2022, Manali Shukla wrote: > static void svm_nm_test(void) IMO, this should be renamed to svm_no_nm_test(). > { > handle_exception(NM_VECTOR, guest_test_nm_handler); > write_cr0(read_cr0() & ~X86_CR0_TS); > test_set_guest(svm_nm_test_guest); > > - vmcb->save.cr0 = vmcb->save.cr0 | X86_CR0_TS; > - report(svm_vmrun() == SVM_EXIT_VMMCALL && nm_test_counter == 1, > - "fnop with CR0.TS set in L2, #NM is triggered"); > - > - vmcb->save.cr0 = (vmcb->save.cr0 & ~X86_CR0_TS) | X86_CR0_EM; > - report(svm_vmrun() == SVM_EXIT_VMMCALL && nm_test_counter == 2, > - "fnop with CR0.EM set in L2, #NM is triggered"); > - > vmcb->save.cr0 = vmcb->save.cr0 & ~(X86_CR0_TS | X86_CR0_EM); > - report(svm_vmrun() == SVM_EXIT_VMMCALL && nm_test_counter == 2, > + report(svm_vmrun() == SVM_EXIT_VMMCALL && nm_test_counter == 0, > "fnop with CR0.TS and CR0.EM unset no #NM excpetion"); No need to keep the #NM handler, just rely on the VMMCAL assertion and the fact that an unexpected #NM will also cause a test failure.