Commit graph

1066 commits

Author SHA1 Message Date
Rian Quinn
ed5fb3532c
VMX Bug Fix (#633)
Signed-off-by: Rian Quinn <rianquinn@gmail.com>
2018-03-01 09:56:34 -07:00
Chris Pavlina
276db173ca Add platform_info_t, support runtime serial port address (#632)
platform_info_t is used to pass platform-specific information from the
kernel into the vmm. On aarch64, this is used to map the serial
peripheral and pass the resulting virtual address.

Closes #527

Signed-off-by: Chris Pavlina <pavlinac@ainfosec.com>
2018-02-28 08:39:45 -07:00
Connor Davis
8520d9af4f
Merge pull request #630 from boddumanohar/rename
update name in the include header
2018-02-23 13:01:43 -07:00
Manohar Reddy
f30856ef2e change name in the include header from memory_manager_x64 to
memory_manager.h

Signed-off-by: "Manohar Reddy" <"201451024@iiitvadodara.ac.in">
2018-02-23 22:51:25 +05:30
Rian Quinn
503bfb74f1
Additional Changes to support EAPIs (#629)
Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-21 08:46:37 -07:00
Rian Quinn
bf2e7a1882
Disable Cygwin (#628)
Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-20 15:36:37 -07:00
Rian Quinn
4736df450a
Changes to support EAPIs (#627)
The following changes support the EAPIs, as well as provide consistency
across the projects.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-20 15:10:40 -07:00
Rian Quinn
c35711225c
Add support for unordered_map (#625)
This patch adds support for unordered_map. Specifically it adds support
for libm which is needed by unordered_map as it abuses the ceil
function for integer rounding in it's hash function.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-19 12:26:08 -07:00
Connor Davis
d64bc004ac README.md: Update Arch instructions (#624)
- Change 'sync-deps' to 'syncdeps'
- Add clang-tidy-4.0 symlink
2018-02-19 10:22:11 -07:00
Manohar Reddy
179d71e98d Change order of execution of delegates from FILO to FIFO (#623)
Signed-off-by: "Manohar Reddy" <"201451024@iiitvadodara.ac.in">
2018-02-18 12:35:19 -07:00
Rian Quinn
d9bc098344
Relocate / Rename Memory Manager (#618)
This relocates and renames the memory manager to match the new source
tree structure. The code itself still needs a major overhaul, but the
public APIs should not change much after this patch.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-17 10:40:54 -07:00
Jared Wright
c525224c6a
Merge pull request #617 from rianquinn/announcement_613_3
Add IntelliSense Support
2018-02-16 11:49:01 -08:00
Jared Wright
ca51ba7577
Merge pull request #616 from rianquinn/announcement_613_2
Missing Header Guard
2018-02-16 09:33:10 -08:00
“rianquinn”
b85cf538db Add IntelliSense Support
This patch adds support for IntelliSense for VSCode. Specifically, this
provide support for code completion and error checking.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-16 09:36:10 -07:00
Rian Quinn
c6d76209b5
Move Check to Cpp (#615)
The check logic is currently in header files, which causes a lot of
uneeded comilation and complexity. This patch moves the check logic to
source files.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-16 08:05:44 -07:00
“rianquinn”
c1d32d3922 Missing Header Guard
The Intel VCPU was missing it's header guard. Credit:
https://github.com/boddumanohar

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-16 06:32:48 -07:00
Connor Davis
7413bfd9ac
Merge pull request #614 from rianquinn/dev
Mods for EAPIs
2018-02-15 11:08:12 -07:00
“rianquinn”
275468b31c Mods for EAPIs
This patch provides some mods to support the extended APIs.
None of these mods were needed, but it does simplify things and keep the
EAPIs build logic easier to follow

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-15 07:54:49 -07:00
Rian Quinn
b007e14196
Redownload on Error (#612)
This patch adds a redownload on error feature to the dependency macro.
If an error occurs, the macro attempts to redownload the file 5 times
before erroring outRedownload on Error

[ISSUE]: https://github.com/Bareflank/hypervisor/issues/611

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-14 08:55:08 -07:00
Rian Quinn
01842b4c77
Convert Hypervisor to use Delegates (#610)
This patch converts the hypervisor to use delegates, dramatically
reducing the complexity of the hypervisor, while also providing a
cleaner interface for extensions.

[RFC]: https://github.com/Bareflank/hypervisor/issues/602

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-14 05:25:49 -07:00
Connor Davis
5d20e31f41 docs: Update Arch Linux setup instructions (#603)
- Add commands for downloading and installing yaourt
  on a vanilla Arch system.
- Remove the 'yaourt' from the initial 'pacman -S' command
  since it is not an official Arch package.
- Add symlink for run-clang-tidy-4.0.py.
2018-02-07 05:55:30 -07:00
Rian Quinn
ee301c300a
Rename BFVMM Classes (#601)
This patch renames the BFVMM classes to get rid of the "_x64" and
"_intel_x64" names in facvor of namespaces

[RFC]: https://github.com/Bareflank/hypervisor/issues/583

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-02 11:32:44 -07:00
Rian Quinn
9c77652261
Update Example Config (#600)
This patch updates the example config to provide a more complete example
that can actually be used by developers. It also fixes a small bug with
clang tidy and Arch Linux.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-01 12:40:58 -07:00
Rian Quinn
2f6b45411a
Move Debug Intrinsics (#599)
The debug intrinsics are intel specific and should be located in the
intel specific folder with the proper naming.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-02-01 07:43:00 -07:00
Connor Davis
77aaa7f2b7 Add changes required for clean eapis build (#598)
- Add an isr_type in the idt class to avoid compiler cast errors
- Use relative paths with memory_manager/object_allocator.h and user_data.h
- Add trailing slash on the source install path in bfvmm/src/CMakeLists.txt.
  Without the slash, the headers were being installed as
  <prefix>/include/bfvmm/include/...
2018-02-01 05:08:59 -07:00
Connor Davis
4b407b2650
Merge pull request #597 from rianquinn/issue_596
Fix Small Ninja Issue
2018-01-31 19:12:51 -07:00
“rianquinn”
91f5ace0fd Fix Small Ninja Issue
Cleanup some verbosity for ninja

[ISSUE]: https://github.com/Bareflank/hypervisor/issues/596

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-31 15:44:45 -07:00
Connor Davis
4785cf70af
Merge pull request #595 from rianquinn/rfc_583_1
Add BFVMM Namespace
2018-01-31 15:38:11 -07:00
“rianquinn”
a6421d312d Add BFVMM Namespace
This patch adds the bfvmm namesapce to the check logic in the bfvmm.
This is the first of many PRs to add the bfvmm namespace and reduce the
need for hardcoding namespace logic into filenames / variable names

[ISSUE]: https://github.com/Bareflank/hypervisor/issues/583

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-31 14:24:56 -07:00
Rian Quinn
a8e3c06c3d
Change to relative paths (#594)
This patch addresses an issue were attempting to include headers from
bfvmm in extensions results in invalid paths.

[ISSUE]: https://github.com/Bareflank/hypervisor/issues/590

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-31 13:48:02 -07:00
Rian Quinn
655d0cae28
Update README.md 2018-01-31 10:38:41 -07:00
Connor Davis
2806b3307c tests: Fix build errors (#589)
bfm: Add include header for test support
bfvmm: Add narrow cast for pl011 tests
2018-01-30 11:07:55 -07:00
Rian Quinn
55643639ad
Remove CMake variables that cannot be changed in CCMake (#588)
This patch makes sure that the ccmake tool only shows variables that in
theory should be able to be changed prior to running make.

[ISSUE]: https://github.com/Bareflank/hypervisor/issues/587

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-30 08:55:11 -07:00
Rian Quinn
c181daea28
Fix Include Issue / Enable Warnings (#586)
The bfvmm was not installing its headers, but instead was directly
searching for the includes from the source tree, resulting in name
collisions with extensions.

In addition, warnings were never working, and are by default turned off.
Travis however should ensure no warnings occur, which was not working
properly.

[ISSUES]: https://github.com/Bareflank/hypervisor/issues/585

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-30 05:13:50 -07:00
Connor Davis
6c1eefd257 x64/vmcs: Temporarily clear CR3[11:0] on promote (#584)
As part of the PTI patches, Linux now uses PCIDs to reduce the
cost of context switches. The current PCID is given by CR3[11:0],
and if this is not zero when CR4.PCIDE is set on a write to CR4,
a #GP is raised.

The promotion bug described in #573 was due to Bareflank
restoring the guest CR3 (in which CR3[11:0] was nonzero), and
then restoring the guest CR4, which was setting CR4.PCIDE. The
resulting #GP was raised with nothing to handle it, leading to a
triple fault.

Now Bareflank writes a copy of the guest CR3 with bits 11-0
clear, then writes the guest's CR4. Once the CR4 is
written, the guest's original CR3 is restored.
2018-01-28 10:23:58 -07:00
Rian Quinn
ee7b537564
Re-enable Codecov (#582)
This patch re-enables codecov so that it can calculate our
current code coverage. This will likely result in failed tests
until code coverage is fixed.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-27 08:01:24 -07:00
Rian Quinn
38178563fc
Include Path / Library Fix (#581)
This patch fixes two specific issues with extensions:
- The init_project macro was including <path>/../include which it
shouldn't be because we don't know how an extension will be setup, and
this could accidentially include unintended files.
- The add_vmm_exectuable provided to way to link shared and static
libraries at the same time, and as a result, was cumbersome to use.

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-23 17:34:19 -07:00
Rian Quinn
4a872fefd9
Enable More Unit Tests (#580)
This is a small patch that enables more unit tests

[ISSUE]: https://github.com/Bareflank/hypervisor/issues/576

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-23 08:14:34 -07:00
Rian Quinn
573de577bf
Fix crash with Windows (#578)
The latest versions of Windows do not like having aligned memory freed
using "free", resulting in a segfault. Alighed memory is no longer
needed so this can be removed.

[ISSUE]: https://github.com/Bareflank/hypervisor/issues/576

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-23 06:39:10 -07:00
Connor Davis
45832e8989
Merge pull request #579 from rianquinn/fix_protected_delegate
Fix Protected Delegate Issue
2018-01-22 18:10:27 -07:00
“rianquinn”
f1971d4d0c Fix Protected Delegate Issue
Accidentially, the pre and post delegates for the VMCS are protected
when they should be public. This patch fixes this issue.

[ISSUE]: https://github.com/Bareflank/hypervisor/issues/577

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-22 14:42:51 -07:00
Rian Quinn
aab477a590
Build System Bug Fixes (#575)
This patch addresses several bugs with the build system:
- Lack of Windows support
- Clang Tidy was not working properly
- Making modifications to the source code would compile, but would not
re-link resulting in issues
- Removed excess file copying
- Make clean now works
- Removed unused or confusing folders in the build folder as part of the
build process. It is now much easier to traverse the build folder for
dependencies
- The targets didn't work with extensions. This has been fixed.

In addition, the following was also done under this patch
- Intrinsics was moved to the top level and out of the VMM
- Platform files are now in a folder called "platform" instead of
"arch"
- All subprojects have the same include/src/tests files structure
- All intel specific code is properly organized to match intended
namespacing
- Removed dead code
- A small part of the VMCS was converted to use the delegate pattern
- All dependencies are now downloaded at configure time instead of
compile time.
- The cache directory is now cached by Travis CI
- CMake output better matches old build system
- Added make rebuild and separate clean targets to remove various parts
of the build depending on needs.
- Added targets for Clean, Tidy, Rebuild and Format for each subproject
- Re-organized the cmake logic so that macros are not spread out
- New validation removes unneeded complexity
- Removed the need for the compiler wrapper, and in doing so, we now
provide a simpilar set of toolchain files
- Removed the need for Git repos. All external dependencies are
downloaded using a zip or tarball
- Libcxx and Libcxxabi are now in their own files. Much similar logic
- Unit test CMake files have been greatly simplified
- Each subproject is unaware of it's prefix and no long use VMM,
USERSPACE or TEST variables in their cmake files
- Fixed bugs with the flags
- Renamed the varbiables in the default.cmake config to be more
consistent and easier to follow in the rest of the code

Signed-off-by: “rianquinn” <“rianquinn@gmail.com”>
2018-01-22 12:45:07 -07:00
Jared Wright
7fc725a1fa Build system dependency caching (#567)
Adding a new feature to cache build dependencies. This commit addresses
bugs #553 and #564

[RFC] #566

Signed-off-by: JaredWright <jared.wright12@gmail.com>
2017-12-18 11:09:07 -07:00
Chris Pavlina
480cd48003 Fix incorrect types in serial_port_ns16550a (#555)
Signed-off-by: Chris Pavlina <pavlinac@ainfosec.com>
2017-12-18 10:48:52 -07:00
Chris Pavlina
9cd48e7ac7 Add more aarch64 relocations (#559)
Signed-off-by: Chris Pavlina <pavlinac@ainfosec.com>
2017-12-18 10:48:11 -07:00
Jared Wright
ae46465b73 New VMM extension integration mechanism (#560)
1) New vmm_extension() macro for registering bareflank extensions to the
build system from build configuration file

2) New VMM extension-specific config variables and extension-specific macros

3) Added vmm_ex.cmake to be included by all Bareflank extensions

4) Updated build system documentation

[RFC] #545

Signed-off-by: JaredWright <jared.wright12@gmail.com>
2017-12-18 10:47:42 -07:00
Jared Wright
db697782e5 bfdriver double-compile bug (#562)
Partial fix for [BUG] #553 Double/Infinite Compile. This commit removes
double compilation for the bfdriver component only.

Signed-off-by: JaredWright <jared.wright12@gmail.com>
2017-12-15 15:47:40 -07:00
Connor Davis
23d82955b7
Merge pull request #551 from connojd/ninja
[BUILD] Add USES_TERMINAL to targets
2017-12-12 12:53:15 -07:00
Connor Davis
5565d44a71 [BUILD] Add USES_TERMINAL to targets
Custom commands that require user input (e.g. sudo) will hang waiting
for input when using ninja, unless USES_TERMINAL is passed to
add_custom_command. This patch adds the USES_TERMINAL argument to
prevent such hangs.
2017-12-11 20:29:04 -07:00
Chris Pavlina
bd5200d180 Pack struct registers_intel_x64_t (#554)
This is required for reliable access via assembly.

Signed-off-by: Chris Pavlina <pavlinac@ainfosec.com>
2017-12-11 14:33:10 -07:00