guest_cpu_write()
Write data to a guest CPU (i.e., a vCPU) or the guest address space
Synopsis:
#include <qvm/guest.h>int guest_cpu_write(struct guest_cpu *gcp,
guest_cpu_access_flags_t flags,
const struct qvm_state_block *blk,
unsigned nblks,
const void *data,
size_t data_len)Arguments:
- gcp
- NULL if you're writing data to the guest address space (i.e., nothing CPU-specific), or a pointer to the vCPU whose registers you're writing.
- flags
- A bitfield of GXF_* flags.
- blk
- A pointer to a qvm_state_block array containing destination information.
- nblks
- The number of blocks in the blk array.
- data
- A pointer to the source data to be written.
- data_len
- The length, in bytes, of the source data.
Description:
Use this function to write data to a guest CPU (i.e., a vCPU) or the guest address space. This function is typically used by the vdev's vread() callback. The exact data written depends on the contents of the blk structure. Usually this function is used to write the CPU state but it can also write to the guest address space, including registers of another vdev.
CAUTION:
Calling this function with any wrong address can lead to unexpected
behavior by the guest.
Returns:
EOK if successful, -1 if an exception should be sent to the guest, or an error otherwise.
Page updated:
