Public Types | Public Member Functions
ioctl Class Reference

Public Types

using binary_data = file::binary_data
 
using drr_type = debug_ring_resources_t
 
using drr_pointer = drr_type *
 
using cpuid_type = uint64_t
 
using vcpuid_type = uint64_t
 
using status_type = int64_t
 
using status_pointer = status_type *
 
using registers_type = struct vmcall_registers_t
 
using registers_pointer = registers_type *
 

Public Member Functions

 ioctl ()
 
virtual ~ioctl ()=default
 
virtual void open ()
 
virtual void call_ioctl_add_module (const binary_data &module_data)
 
virtual void call_ioctl_load_vmm ()
 
virtual void call_ioctl_unload_vmm ()
 
virtual void call_ioctl_start_vmm ()
 
virtual void call_ioctl_stop_vmm ()
 
virtual void call_ioctl_dump_vmm (gsl::not_null< drr_pointer > drr, vcpuid_type vcpuid)
 
virtual void call_ioctl_vmm_status (gsl::not_null< status_pointer > status)
 
virtual void call_ioctl_vmcall (gsl::not_null< registers_pointer > regs, cpuid_type cpuid)
 

Detailed Description

IOCTL

Calls into the bareflank driver entry to perform a desired action. Note that for this class to function, the driver entry must be loaded, and bfm must be executed with the proper permissions.

Definition at line 48 of file ioctl.h.

Member Typedef Documentation

◆ binary_data

Definition at line 52 of file ioctl.h.

◆ drr_type

Definition at line 53 of file ioctl.h.

◆ drr_pointer

Definition at line 54 of file ioctl.h.

◆ cpuid_type

using ioctl::cpuid_type = uint64_t

Definition at line 55 of file ioctl.h.

◆ vcpuid_type

using ioctl::vcpuid_type = uint64_t

Definition at line 56 of file ioctl.h.

◆ status_type

using ioctl::status_type = int64_t

Definition at line 57 of file ioctl.h.

◆ status_pointer

Definition at line 58 of file ioctl.h.

◆ registers_type

Definition at line 59 of file ioctl.h.

◆ registers_pointer

Definition at line 60 of file ioctl.h.

Constructor & Destructor Documentation

◆ ioctl()

ioctl::ioctl ( )
noexcept

Default Constructor

Precondition
expects: none
Postcondition
ensures: none

Definition at line 25 of file ioctl.cpp.

◆ ~ioctl()

virtual ioctl::~ioctl ( )
virtualdefault

Destructor

Precondition
expects: none
Postcondition
ensures: none

Member Function Documentation

◆ open()

void ioctl::open ( )
virtual

Open

Open a connection to the bareflank driver.

Precondition
expects: none
Postcondition
ensures: none

Definition at line 30 of file ioctl.cpp.

◆ call_ioctl_add_module()

void ioctl::call_ioctl_add_module ( const binary_data module_data)
virtual

Add Module

Add a module to the driver entry.

Parameters
module_dataELF file to be added to the driver entry
Precondition
expects: none
Postcondition
ensures: none

Definition at line 37 of file ioctl.cpp.

◆ call_ioctl_load_vmm()

void ioctl::call_ioctl_load_vmm ( )
virtual

Load VMM

Loads the VMM

Precondition
expects: none
Postcondition
ensures: none

Definition at line 47 of file ioctl.cpp.

◆ call_ioctl_unload_vmm()

void ioctl::call_ioctl_unload_vmm ( )
virtual

Unload VMM

Unloads the VMM

Precondition
expects: none
Postcondition
ensures: none

Definition at line 54 of file ioctl.cpp.

◆ call_ioctl_start_vmm()

void ioctl::call_ioctl_start_vmm ( )
virtual

Start VMM

Starts the VMM

Precondition
expects: none
Postcondition
ensures: none

Definition at line 61 of file ioctl.cpp.

◆ call_ioctl_stop_vmm()

void ioctl::call_ioctl_stop_vmm ( )
virtual

Stop VMM

Stops the VMM

Precondition
expects: none
Postcondition
ensures: none

Definition at line 68 of file ioctl.cpp.

◆ call_ioctl_dump_vmm()

void ioctl::call_ioctl_dump_vmm ( gsl::not_null< drr_pointer drr,
vcpuid_type  vcpuid 
)
virtual

Dump VMM

Dumps the contents of the VMM's debug ring

Precondition
expects: drr != null;
Postcondition
ensures: none
Parameters
drrpointer a debug_ring_resources_t
vcpuidindicates which drr to get (every vcpu has its own drr)

Definition at line 75 of file ioctl.cpp.

◆ call_ioctl_vmm_status()

void ioctl::call_ioctl_vmm_status ( gsl::not_null< status_pointer status)
virtual

VMM Status

Get the status of the VMM

Precondition
expects: status != nullptr
Postcondition
ensures: none
Parameters
statuspointer to status variable to store the results

Definition at line 82 of file ioctl.cpp.

◆ call_ioctl_vmcall()

void ioctl::call_ioctl_vmcall ( gsl::not_null< registers_pointer regs,
cpuid_type  cpuid 
)
virtual

VMCall

Performs a VMCall

Precondition
expects: status != nullptr
Postcondition
ensures: none
Parameters
regsregister values to send to the hypervisor
cpuidindicates which vcpu to vmcall

Definition at line 89 of file ioctl.cpp.


The documentation for this class was generated from the following files: