qemu_plugin_write_memory_hwaddr

Function qemu_plugin_write_memory_hwaddr 

Source
pub unsafe extern "C" fn qemu_plugin_write_memory_hwaddr(
    addr: u64,
    data: *mut GByteArray,
) -> qemu_plugin_hwaddr_operation_result
Expand description

qemu_plugin_write_memory_hwaddr() - write to memory using a hardware address

@addr: A physical address to write to @data: A byte array containing the data to write

The contents of @data will be written to memory starting at the hardware address @addr in the current address space for the current vCPU.

This function does not guarantee consistency of writes, nor does it ensure that pending writes are flushed either before or after the write takes place, so callers should take care when calling this function in plugin callbacks to avoid depending on the existence of data written using this function which may be overwritten afterward. In addition, this function requires that the pages containing the address are not locked. Practically, this means that you should not write instruction memory in a current translation block inside a callback registered with qemu_plugin_register_vcpu_tb_trans_cb.

You can, for example, write instruction memory in a current translation block in a callback registered with qemu_plugin_register_vcpu_tb_exec_cb, although be aware that the write will not be flushed until after the translation block has finished executing. In general, this function should be used to write data memory or to patch code at a known address, not in a current translation block.

This function is only valid for softmmu targets.

Returns a qemu_plugin_hwaddr_operation_result indicating the result of the operation.