-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New VMM extension integration mechanism #560
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# Bareflank Hypervisor | ||
# Copyright (C) 2015 Assured Information Security, Inc. | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
# ------------------------------------------------------------------------------ | ||
# README | ||
# ------------------------------------------------------------------------------ | ||
|
||
# Use this template and the examples below to configure the Bareflank build | ||
# system and add VMM extensions. Remove the '#' symbol to uncomment a line. | ||
# | ||
# For detailed instructions on configuring and building Bareflank, see | ||
# hypervisor/scripts/docs/build_instructions.md. | ||
|
||
# For detailed instructions on configuring and adding VMM extensions, see | ||
# hypervisor/scripts/docs/extension_instructions.md | ||
|
||
# To view all available build system configuration variables, use ccmake or | ||
# cmake-gui from your build directory: | ||
# cd </path/to>/build; ccmake . | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Bareflank Build Configurations | ||
# ------------------------------------------------------------------------------ | ||
|
||
# set(BUILD_TYPE Debug) | ||
# set(BUILD_VMM_STATIC ON) | ||
# set(ENABLE_DEVELOPER_MODE ON) | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Bareflank Extensions | ||
# ------------------------------------------------------------------------------ | ||
|
||
# vmm_extension( | ||
# extended_apis | ||
# GIT_REPOSITORY https://github.com/bareflank/extended_apis.git | ||
# GIT_TAG dev | ||
# ) | ||
|
||
# vmm_extension( | ||
# my_extension | ||
# SOURCE_DIR ~/bareflank/my_extension | ||
# DEPENDS extended_apis | ||
# ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# | ||
# Bareflank Hypervisor | ||
# Copyright (C) 2015 Assured Information Security, Inc. | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
# ------------------------------------------------------------------------------ | ||
# README | ||
# ------------------------------------------------------------------------------ | ||
|
||
# This file defines all configurable cmake variables available to Barefank | ||
# VMM extensions, set to their default value. These configuration are NOT | ||
# available to base Bareflank hypervisor projects. VMM extension projects | ||
# can use both these configurations PLUS the base hypervisor configurations. | ||
|
||
# Each configuration here indicates the Bareflank suggested convention as | ||
# a default value. The goal is to encourage a "convention over configuration" | ||
# mindset for extension developers. If extension developers choose not follow | ||
# a suggested convention, they can override a configuration using two methods: | ||
# | ||
# 1) Specify each configuration as CMAKE_ARGS to the vmm_extension() macro. Ex: | ||
# | ||
# vmm_extension( | ||
# extension_name | ||
# CMAKE_ARGS -DVMM_EX_BUILD_RULES=/path/to/build_rules.cmake | ||
# ) | ||
# | ||
# 2) Override a configuration in the extension's CMakeLists.txt file BEFORE | ||
# calling include(${VMM_EXTENSION}). Ex: | ||
# | ||
# set(VMM_EX_BUILD_RULES "/path/to/build_rules.cmake") | ||
# set(VMM_EX_UNITTEST_PATH "/path/to/the/unit/tests") | ||
# include(${VMM_EXTENSION}) | ||
# | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Source tree structure | ||
# ------------------------------------------------------------------------------ | ||
|
||
add_config( | ||
CONFIG_NAME VMM_EX_TOP_DIR | ||
CONFIG_TYPE PATH | ||
DEFAULT_VAL ${CMAKE_CURRENT_SOURCE_DIR} | ||
DESCRIPTION "Path to the top directory for this VMM extension" | ||
) | ||
|
||
add_config( | ||
CONFIG_NAME VMM_EX_SOURCE_DIR | ||
CONFIG_TYPE PATH | ||
DEFAULT_VAL ${VMM_EX_TOP_DIR}/src | ||
DESCRIPTION "Path to the source code directory for this VMM extension" | ||
SKIP_VALIDATION | ||
) | ||
|
||
add_config( | ||
CONFIG_NAME VMM_EX_INCLUDE_DIR | ||
CONFIG_TYPE PATH | ||
DEFAULT_VAL ${VMM_EX_TOP_DIR}/include | ||
DESCRIPTION "Path to the header include directory for this VMM extension" | ||
SKIP_VALIDATION | ||
) | ||
|
||
add_config( | ||
CONFIG_NAME VMM_EX_UNITTEST_DIR | ||
CONFIG_TYPE PATH | ||
DEFAULT_VAL ${VMM_EX_TOP_DIR}/test | ||
DESCRIPTION "Path to the unit test directory for this VMM extension" | ||
SKIP_VALIDATION | ||
) | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Build system features | ||
# ------------------------------------------------------------------------------ | ||
|
||
add_config( | ||
CONFIG_NAME VMM_EX_CONFIGS | ||
CONFIG_TYPE FILE | ||
DEFAULT_VAL ${VMM_EX_TOP_DIR}/configs.cmake | ||
DESCRIPTION "Path to extention-specific build configurations to be added " | ||
"for this VMM extension" | ||
SKIP_VALIDATION | ||
) | ||
|
||
add_config( | ||
CONFIG_NAME VMM_EX_BUILD_RULES | ||
CONFIG_TYPE FILE | ||
DEFAULT_VAL ${VMM_EX_TOP_DIR}/build_rules.cmake | ||
DESCRIPTION "Path to a build rules file to be validated before building " | ||
"this VMM extension" | ||
SKIP_VALIDATION | ||
) | ||
|
||
# ------------------------------------------------------------------------------ | ||
# Read-only variables | ||
# ------------------------------------------------------------------------------ | ||
|
||
add_config( | ||
CONFIG_NAME VMM_EX_IS_UNITTEST_BUILD | ||
CONFIG_TYPE INTERNAL | ||
DEFAULT_VAL OFF | ||
DESCRIPTION "The build system sets this variable to ON if this extension's " | ||
"unit tests are currently being built, rather than it's source" | ||
SKIP_VALIDATION | ||
) | ||
|
||
if(VMM_EX_IS_UNTTEST_BUILD) | ||
set(_VMM_EX_SYSROOT_DEFAULT ${BUILD_SYSROOT_TEST}) | ||
else() | ||
set(_VMM_EX_SYSROOT_DEFAULT ${BUILD_SYSROOT_VMM}) | ||
endif() | ||
add_config( | ||
CONFIG_NAME VMM_EX_SYSROOT | ||
CONFIG_TYPE INTERNAL | ||
DEFAULT_VAL ${_VMM_EX_SYSROOT_DEFAULT} | ||
DESCRIPTION "Path to this VMM extension's sysroot" | ||
SKIP_VALIDATION | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should provide documentation in the template so that all you have to do is read and modify the template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How much documentation should go in the template? I choose the commented out lines in the template as specific examples of 90% of what you would want to do with this file, namely:
What else should be added? Maybe a link or reference to the build instructions readme? One-sentence descriptions of what each section is for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a fan of redundancy, so in this case I would say adding the build instructions, and then a link to all of the options that are available in another doc would be fine so long as each option is documented somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding something like this:
I've been avoiding creating a file that documents all available build configurations because those things are going to change, get added, and get dropped really fluidly as we continue development. As the build README indicates, the best way to view all of the available configs is to use ccmake or cmake-gui. From those, you can see every available option, the possible values for each, and a description for each. If we go the README route for build configs, we'll have to remember to add/modify two things every time we touch a build config.