guest_cpu_read()

Read data from a guest CPU (i.e., a vCPU) or the guest address space

Synopsis:

#include <qvm/guest.h>
int guest_cpu_read(struct guest_cpu *gcp,
                   guest_cpu_access_flags_t flags,
                   const struct qvm_state_block *blk,
                   unsigned nblks,
                   void *data,
                   size_t data_len)

Arguments:

gcp
NULL if you're reading data from the guest address space (i.e., nothing CPU-specific), or a pointer to the vCPU whose registers you're reading.
flags
A bitfield of GXF_* flags.
blk
A pointer to a qvm_state_block array containing source information.
nblks
The number of blocks in the blk array.
data
A pointer to memory for storing the data that gets read.
data_len
The length, in bytes, of the storage buffer.

Description:

Use this function to read data from a guest CPU (i.e., a vCPU) or the guest address space. This function is typically used by the vdev's vwrite() callback. The exact data read depends on the contents of the blk structure. Usually this function is used to read the CPU state but it can also read from the guest address space, including registers of another vdev.

Returns:

EOK if successful, -1 if an exception should be sent to the guest, or an error otherwise.

Page updated: