Interface guest_vcpu_fault.h

The libsel4vm VCPU fault interface provides a set of useful methods to query and configure vcpu objects that have faulted during execution. This interface is commonly leveraged by VMM’s to process a vcpu fault and handle it accordingly.

Brief content:

Functions:

get_vcpu_fault_address(vcpu)

get_vcpu_fault_ip(vcpu)

get_vcpu_fault_data(vcpu)

get_vcpu_fault_data_mask(vcpu)

get_vcpu_fault_size(vcpu)

is_vcpu_read_fault(vcpu)

set_vcpu_fault_data(vcpu, data)

emulate_vcpu_fault(vcpu, data)

advance_vcpu_fault(vcpu)

restart_vcpu_fault(vcpu)

Functions

The interface guest_vcpu_fault.h defines the following functions.

Function get_vcpu_fault_address(vcpu)

Get current fault address of vcpu

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu

Returns:

  • Current fault address of vcpu

Back to interface description.

Function get_vcpu_fault_ip(vcpu)

Get instruction pointer of current vcpu fault

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu

Returns:

  • Intruction pointer of vcpu fault

Back to interface description.

Function get_vcpu_fault_data(vcpu)

Get the data of the current vcpu fault

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu

Returns:

  • Data of vcpu fault

Back to interface description.

Function get_vcpu_fault_data_mask(vcpu)

Get data mask of the current vcpu fault

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu

Returns:

  • Data mask of vcpu fault

Back to interface description.

Function get_vcpu_fault_size(vcpu)

Get access size of the current vcpu fault

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu

Returns:

  • Access size of vcpu fault

Back to interface description.

Function is_vcpu_read_fault(vcpu)

Is current vcpu fault a read fault

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu

Returns:

  • True if read fault, False if write fault

Back to interface description.

Function set_vcpu_fault_data(vcpu, data)

Set the data of the current vcpu fault

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu
  • data {seL4_Word}: Data to set for current vcpu fault

Returns:

  • 0 for success, otherwise -1 for error

Back to interface description.

Function emulate_vcpu_fault(vcpu, data)

Emulate a read or write fault on a given data value

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu
  • data {seL4_Word}: Data to perform emulate fault on

Returns:

  • Emulation result of vcpu fault over given data value

Back to interface description.

Function advance_vcpu_fault(vcpu)

Advance the current vcpu fault to the next stage/instruction

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu

Returns:

No return

Back to interface description.

Function restart_vcpu_fault(vcpu)

Restart the current vcpu fault

Parameters:

  • vcpu {vm_vcpu_t *}: Handle to vcpu

Returns:

No return

Back to interface description.

Back to top.