Crate libafl_qemu_sys
source ·Expand description
libafl_qemu_sys
is the crate exporting C symbols from QEMU.
Have a look at libafl_qemu
for higher-level abstractions.
Warning: The documentation is built by default for x86_64
in usermode
. To access the documentation of other architectures or systemmode, the documentation must be rebuilt with the right features.
Macros§
- Safe linking with of extern “C” functions. This macro makes sure the declared symbol is defined at link time, avoiding declaring non-existant symbols that could be silently ignored during linking if unused.
Structs§
- X86CPU: @env: #CPUX86State @migratable: If set, only migratable flags will be accepted when “enforce” mode is used, and only migratable flags will be included in the “host” CPU model.
- struct BusState: @obj: parent object @parent: parent Device @name: name of bus @hotplug_handler: link to a hotplug handler associated with bus. @max_index: max number of child buses @realized: is the bus itself realized? @full: is the bus full? @num_children: current number of child buses
- CPUClass: @class_by_name: Callback to map -cpu command line model name to an instantiatable CPU type. @parse_features: Callback to parse command line arguments. @reset_dump_flags: #CPUDumpFlags to use for reset logging. @has_work: Callback for checking if there is work to do. @memory_rw_debug: Callback for GDB memory access. @dump_state: Callback for dumping state. @query_cpu_fast: Fill in target specific information for the “query-cpus-fast” QAPI call. @get_arch_id: Callback for getting architecture-dependent CPU ID. @set_pc: Callback for setting the Program Counter register. This should have the semantics used by the target architecture when setting the PC from a source such as an ELF file entry point; for example on Arm it will also set the Thumb mode bit based on the least significant bit of the new PC value. If the target behaviour here is anything other than “set the PC register to the value passed in” then the target must also implement the synchronize_from_tb hook. @get_pc: Callback for getting the Program Counter register. As above, with the semantics of the target architecture. @gdb_read_register: Callback for letting GDB read a register. @gdb_write_register: Callback for letting GDB write a register. @gdb_adjust_breakpoint: Callback for adjusting the address of a breakpoint. Used by AVR to handle a gdb mis-feature with its Harvard architecture split code and data. @gdb_num_core_regs: Number of core registers accessible to GDB. @gdb_core_xml_file: File name for core registers GDB XML description. @gdb_stop_before_watchpoint: Indicates whether GDB expects the CPU to stop before the insn which triggers a watchpoint rather than after it. @gdb_arch_name: Optional callback that returns the architecture name known to GDB. The caller must free the returned string with g_free. @gdb_get_dynamic_xml: Callback to return dynamically generated XML for the gdb stub. Returns a pointer to the XML contents for the specified XML file or NULL if the CPU doesn’t have a dynamically generated content for it. @disas_set_info: Setup architecture specific components of disassembly info @adjust_watchpoint_address: Perform a target-specific adjustment to an address before attempting to match it against watchpoints. @deprecation_note: If this CPUClass is deprecated, this field provides related information.
- CPUState: @cpu_index: CPU index (informative). @cluster_index: Identifies which cluster this CPU is in. For boards which don’t define clusters or for “loose” CPUs not assigned to a cluster this will be UNASSIGNED_CLUSTER_INDEX; otherwise it will be the same as the cluster-id property of the CPU object’s TYPE_CPU_CLUSTER QOM parent. Under TCG this value is propagated to @tcg_cflags. See TranslationBlock::TCG CF_CLUSTER_MASK. @tcg_cflags: Pre-computed cflags for this cpu. @nr_cores: Number of cores within this CPU package. @nr_threads: Number of threads within this CPU core. @running: #true if CPU is currently running (lockless). @has_waiter: #true if a CPU is currently waiting for the cpu_exec_end; valid under cpu_list_lock. @created: Indicates whether the CPU thread has been successfully created. @interrupt_request: Indicates a pending interrupt request. @halted: Nonzero if the CPU is in suspended state. @stop: Indicates a pending stop request. @stopped: Indicates the CPU has been artificially stopped. @unplug: Indicates a pending CPU unplug request. @crash_occurred: Indicates the OS reported a crash (panic) for this CPU @singlestep_enabled: Flags for single-stepping. @icount_extra: Instructions until next timer event. @neg.can_do_io: True if memory-mapped IO is allowed. @cpu_ases: Pointer to array of CPUAddressSpaces (which define the AddressSpaces this CPU has) @num_ases: number of CPUAddressSpaces in @cpu_ases @as: Pointer to the first AddressSpace, for the convenience of targets which only have a single AddressSpace @gdb_regs: Additional GDB registers. @gdb_num_regs: Number of total registers accessible to GDB. @gdb_num_g_regs: Number of registers in GDB ‘g’ packets. @next_cpu: Next CPU sharing TB cache. @opaque: User data. @mem_io_pc: Host Program Counter at which the memory was accessed. @accel: Pointer to accelerator specific state. @kvm_fd: vCPU file descriptor for KVM. @work_mutex: Lock to prevent multiple access to @work_list. @work_list: List of pending asynchronous work. @trace_dstate_delayed: Delayed changes to trace_dstate (includes all changes to @trace_dstate). @trace_dstate: Dynamic tracing state of events for this vCPU (bitmask). @plugin_mask: Plugin event bitmap. Modified only via async work. @ignore_memory_transaction_failures: Cached copy of the MachineState flag of the same name: allows the board to suppress calling of the CPU do_transaction_failed hook function. @kvm_dirty_gfns: Points to the KVM dirty ring for this CPU when KVM dirty ring is enabled. @kvm_fetch_index: Keeps the index that we last fetched from the per-vCPU dirty ring structure.
- struct DeviceClass - The base class for all devices. @props: Properties accessing state fields. @realize: Callback function invoked when the #DeviceState:realized property is changed to %true. @unrealize: Callback function invoked when the #DeviceState:realized property is changed to %false. @hotpluggable: indicates if #DeviceClass is hotpluggable, available as readonly “hotpluggable” property of #DeviceState instance
- struct DeviceState - common device state, accessed with qdev helpers
- An iterator over the variants of MmapPerms
- struct Object:
- struct ObjectClass:
- Property: @set_default: true if the default value should be set from @defval, in which case @info->set_default_value must not be NULL (if false then no default value is set by the property system and the field retains whatever value it was given by instance_init). @defval: default value for the property. This is used only if @set_default is true.
- ResettableState: Structure holding reset related state. The fields should not be accessed directly; the definition is here to allow further inclusion into other objects.
- An iterator over the variants of VerifyAccess
- struct qemu_plugin_hwaddr - opaque hw address handle
Enums§
Constants§
Statics§
Functions§
- cpu_reset: @cpu: The CPU whose state is to be reset.
- free_self_maps: @info: an interval tree
- page_check_range @start: first byte of range @len: length of range @flags: flags required for each page
- qemu_plugin_get_hwaddr() - return handle for memory operation @info: opaque memory info structure @vaddr: the virtual address of the memory operation
- qemu_plugin_hwaddr_phys_addr() - query physical address for memory operation @haddr: address handle from qemu_plugin_get_hwaddr()
- read_self_maps:
- tlb_plugin_lookup: query last TLB lookup @cpu: cpu environment
Type Aliases§
- typedef ObjectFree: @obj: the object being freed
- typedef ObjectPropertyAccessor: @obj: the object that owns the property @v: the visitor that contains the property data @name: the name of the property @opaque: the object property opaque @errp: a pointer to an Error that is filled if getting/setting fails.
- typedef ObjectPropertyInit: @obj: the object that owns the property @prop: the property to set
- typedef ObjectPropertyRelease: @obj: the object that owns the property @name: the name of the property @opaque: the opaque registered with the property
- typedef ObjectPropertyResolve: @obj: the object that owns the property @opaque: the opaque registered with the property @part: the name of the property
- typedef ObjectUnparent: @obj: the object that is being removed from the composition tree
- X86CPU: @env: #CPUX86State @migratable: If set, only migratable flags will be accepted when “enforce” mode is used, and only migratable flags will be included in the “host” CPU model.
- typedef qemu_plugin_meminfo_t - opaque memory transaction handle
- vaddr: Type wide enough to contain any #target_ulong virtual address.