Go to the source code of this file.
◆ get_module()
struct module_t* get_module |
( |
int64_t |
index | ) |
|
◆ symbol_length()
uint64_t symbol_length |
( |
const char * |
sym | ) |
|
◆ resolve_symbol()
int64_t resolve_symbol |
( |
const char * |
name, |
|
|
void ** |
sym |
|
) |
| |
◆ execute_symbol()
int64_t execute_symbol |
( |
const char * |
sym, |
|
|
uint64_t |
arg1, |
|
|
uint64_t |
arg2, |
|
|
uint64_t |
cpuid |
|
) |
| |
◆ add_raw_md_to_memory_manager()
int64_t add_raw_md_to_memory_manager |
( |
uint64_t |
virt, |
|
|
uint64_t |
type |
|
) |
| |
◆ add_md_to_memory_manager()
int64_t add_md_to_memory_manager |
( |
struct module_t * |
module | ) |
|
◆ load_elf_file()
int64_t load_elf_file |
( |
struct module_t * |
module | ) |
|
◆ common_vmm_status()
int64_t common_vmm_status |
( |
void |
| ) |
|
VMM Status
- Returns
- returns the current status of the VMM.
Definition at line 227 of file common.c.
◆ common_reset()
int64_t common_reset |
( |
void |
| ) |
|
Reset
This function should not be called directly. Instead, use common_unload. This is only exposed publically for unit testing.
- Returns
- will always return BF_SUCCESS
Definition at line 233 of file common.c.
◆ common_init()
int64_t common_init |
( |
void |
| ) |
|
Initialize Driver Entry
This code should be run as part of the driver entry's init code. This sets up some resources that are needed throughout the lifetime of the driver entry.
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 267 of file common.c.
◆ common_fini()
int64_t common_fini |
( |
void |
| ) |
|
Finalize Driver Entry
This code should be run as part of the driver entry's fini code. This cleans up some resources that were needed throughout the lifetime of the driver entry.
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 273 of file common.c.
◆ common_add_module()
int64_t common_add_module |
( |
const char * |
file, |
|
|
uint64_t |
fsize |
|
) |
| |
Add Module
Add's a module into memory to be executed once start_vmm is run. This function uses the platform functions to allocate memory for the executable. The file that is provided should not be removed until after stop_vmm is run. Removing the file from memory could cause a crash, as the start_vmm function uses the file that is being added to search for symbols that are needed, as well as the stop_vmm function. Once stop_vmm is run, it's safe to remove the files. Also, this function cannot be run if the vmm has already been started.
- Parameters
-
file | the file to add to memory |
fsize | the size of the file in bytes |
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 305 of file common.c.
◆ common_load_vmm()
int64_t common_load_vmm |
( |
void |
| ) |
|
Load VMM
This function loads the vmm (assuming that the modules that were loaded are actually a vmm). Once a VMM is loaded, it is placed in memory, and all of the modules are properly reloacted such that, code within each module is now capable of executing.
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 357 of file common.c.
◆ common_unload_vmm()
int64_t common_unload_vmm |
( |
void |
| ) |
|
Unload VMM
This function unloads the vmm. Once the VMM is unloaded, all of the symbols for the VMM are removed from memory, and are no longer accessible. The VMM cannot be unloaded unless the VMM is already loaded, but is not running.
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 451 of file common.c.
◆ common_start_vmm()
int64_t common_start_vmm |
( |
void |
| ) |
|
Start VMM
This function starts the vmm. Before the VMM can be started, it must first be loaded.
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 490 of file common.c.
◆ common_stop_vmm()
int64_t common_stop_vmm |
( |
void |
| ) |
|
Stop VMM
This function stops the vmm. Before a VMM can be stopped, it must first be loaded, and running.
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 543 of file common.c.
◆ common_dump_vmm()
Dump VMM
This grabs the conents of the debug ring, and dumps the contents to the driver entry's console. This is one of a couple of ways to get feedback from the VMM. Note that the VMM must at least be loaded for this function to work as it has to do a symbol lookup
- Parameters
-
drr | a pointer to the drr provided by the user |
vcpuid | indicates which drr to get as each vcpu has its own drr |
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 592 of file common.c.
◆ common_vmcall()
VMCall
This performs a vmcall on the requested CPU.
- Parameters
-
regs | the vmcall registers used in the vmcall |
cpuid | indicates which cpu to vmcall |
- Returns
- BF_SUCCESS on success, negative error code on failure
Definition at line 610 of file common.c.
◆ g_vmm_status
◆ g_num_modules
int64_t g_num_modules = 0 |
◆ g_modules
◆ g_loader
struct bfelf_loader_t g_loader |
◆ g_num_cpus_started
int64_t g_num_cpus_started = 0 |
◆ g_tls
◆ g_stack
◆ g_tls_size
◆ g_stack_size
uint64_t g_stack_size = 0 |
◆ g_stack_top
◆ execute_entry