Skip to content

Commit

Permalink
Merge pull request #165 from connojd/master
Browse files Browse the repository at this point in the history
Test vmlaunch failure
  • Loading branch information
rianquinn committed Sep 2, 2016
2 parents 7330891 + 998848f commit 9b58419
Show file tree
Hide file tree
Showing 6 changed files with 447 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ matrix:
- COVERALLS=true make
- make test
after_success:
- coveralls --build-root makefiles -e build_libbfc -e build_libcxx -e build_libcxxabi -e build_newlib -e build_scripts -e common -e doc -e extensions -e source_libbfc -e source_libcxx -e source_libcxxabi -e source_llvm -e source_newlib -e sysroot -e tools -e bfc -e bfcxx -e bfdrivers/src/arch -e bfm/src/arch -e include/hippomocks.h -e include/unittest.h -e bfunwind -e bfvmm/src/vcpu_factory/src/vcpu_factory.cpp -e bfvmm/include/intrinsics/intrinsics_x64.h -e bfvmm/include/intrinsics/intrinsics_intel_x64.h -e include/gsl -e include/exception.h -e bfvmm/src/vmcs -e bfvmm/include/vmcs --gcov-options '\-lp'
- coveralls --build-root makefiles -e build_libbfc -e build_libcxx -e build_libcxxabi -e build_newlib -e build_scripts -e common -e doc -e extensions -e source_libbfc -e source_libcxx -e source_libcxxabi -e source_llvm -e source_newlib -e sysroot -e tools -e bfc -e bfcxx -e bfdrivers/src/arch -e bfm/src/arch -e include/hippomocks.h -e include/unittest.h -e bfunwind -e bfvmm/src/vcpu_factory/src/vcpu_factory.cpp -e bfvmm/include/intrinsics/intrinsics_x64.h -e bfvmm/include/intrinsics/intrinsics_intel_x64.h -e include/gsl -e include/exception.h -e bfvmm/src/vmcs/src/vmcs_intel_x64_check_controls.cpp -e bfvmm/src/vmcs/src/vmcs_intel_x64_check_guest.cpp -e bfvmm/src/vmcs/src/vmcs_intel_x64_check_host.cpp -e bfvmm/src/vmcs/src/vmcs_intel_x64_check_misc.cpp -e bfvmm/src/vmcs/src/vmcs_intel_x64_debug.cpp -e bfvmm/src/vmcs/src/vmcs_intel_x64_host_vm_state.cpp -e bfvmm/src/vmcs/src/vmcs_intel_x64_promote.asm -e bfvmm/src/vmcs/src/vmcs_intel_x64_resume.asm -e bfvmm/src/vmcs/src/vmcs_intel_x64_vmm_state.cpp -e bfvmm/include/vmcs/vmcs_intel_x64_host_vm_state.h -e bfvmm/include/vmcs/vmcs_intel_x64_promote.h -e bfvmm/include/vmcs/vmcs_intel_x64_resume.h -e bfvmm/include/vmcs/vmcs_intel_x64_state.h -e bfvmm/include/vmcs/vmcs_intel_x64_vmm_state.h --gcov-options '\-lp'

#
# Coverity
Expand Down
4 changes: 2 additions & 2 deletions bfvmm/include/intrinsics/intrinsics_x64.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,8 @@ class intrinsics_x64
// -----------------------------------------------------------------------------

// Selector Fields
#define SELECTOR_TI_FLAG (0x0004)
#define SELECTOR_RPL_FLAG (0x0003)
#define SELECTOR_TI_FLAG (0x0004UL)
#define SELECTOR_RPL_FLAG (0x0003UL)
#define SELECTOR_INDEX (0xFFF8)
#define SELECTOR_UNUSABLE (1 << 16)

Expand Down
2 changes: 1 addition & 1 deletion bfvmm/src/vmcs/src/vmcs_intel_x64_check_guest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ vmcs_intel_x64::check_guest_verify_ia_32e_mode_disabled()
void
vmcs_intel_x64::check_guest_cr3_for_unsupported_bits()
{
auto cr3 = vmread(VMCS_GUEST_CR0);
auto cr3 = vmread(VMCS_GUEST_CR3);

if (!is_physical_address_valid(cr3))
throw std::logic_error("guest cr3 too large");
Expand Down
11 changes: 10 additions & 1 deletion bfvmm/src/vmcs/test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,17 @@ vmcs_ut::fini()
bool
vmcs_ut::list()
{
// Base vmcs tests
this->test_constructor_null_intrinsics();
this->test_launch_success();
this->test_launch_vmlaunch_failure();
this->test_launch_create_vmcs_region_failure();
this->test_launch_create_exit_handler_stack_failure();
this->test_launch_clear_failure();
this->test_launch_load_failure();
this->test_promote_failure();
this->test_resume_failure();
this->test_vmread_failure();
this->test_vmwrite_failure();

return true;
}
Expand Down
10 changes: 10 additions & 0 deletions bfvmm/src/vmcs/test/test.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,17 @@ class vmcs_ut : public unittest

private:

void test_constructor_null_intrinsics();
void test_launch_success();
void test_launch_vmlaunch_failure();
void test_launch_create_vmcs_region_failure();
void test_launch_create_exit_handler_stack_failure();
void test_launch_clear_failure();
void test_launch_load_failure();
void test_promote_failure();
void test_resume_failure();
void test_vmread_failure();
void test_vmwrite_failure();
};

#endif

0 comments on commit 9b58419

Please sign in to comment.