QEMU host page size getter (#73)
* QEMU host page size getter * Rename to sync_exit
This commit is contained in:
parent
a14f8eae8e
commit
9f3e2399ee
@ -22,7 +22,7 @@ void libafl_qemu_trigger_breakpoint(CPUState* cpu);
|
|||||||
enum libafl_exit_reason_kind {
|
enum libafl_exit_reason_kind {
|
||||||
INTERNAL = 0,
|
INTERNAL = 0,
|
||||||
BREAKPOINT = 1,
|
BREAKPOINT = 1,
|
||||||
SYNC_BACKDOOR = 2,
|
SYNC_EXIT = 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
// A breakpoint has been triggered.
|
// A breakpoint has been triggered.
|
||||||
@ -31,7 +31,7 @@ struct libafl_exit_reason_breakpoint {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// A synchronous exit has been triggered.
|
// A synchronous exit has been triggered.
|
||||||
struct libafl_exit_reason_sync_backdoor { };
|
struct libafl_exit_reason_sync_exit { };
|
||||||
|
|
||||||
// QEMU exited on its own for some reason.
|
// QEMU exited on its own for some reason.
|
||||||
struct libafl_exit_reason_internal {
|
struct libafl_exit_reason_internal {
|
||||||
@ -46,7 +46,7 @@ struct libafl_exit_reason {
|
|||||||
union {
|
union {
|
||||||
struct libafl_exit_reason_internal internal;
|
struct libafl_exit_reason_internal internal;
|
||||||
struct libafl_exit_reason_breakpoint breakpoint; // kind == BREAKPOINT
|
struct libafl_exit_reason_breakpoint breakpoint; // kind == BREAKPOINT
|
||||||
struct libafl_exit_reason_sync_backdoor backdoor; // kind == SYNC_BACKDOOR
|
struct libafl_exit_reason_sync_exit sync_exit; // kind == SYNC_EXIT
|
||||||
} data;
|
} data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
|
||||||
|
#ifndef CONFIG_USER_ONLY
|
||||||
|
#include "exec/memory.h"
|
||||||
|
#include "qemu/rcu.h"
|
||||||
|
#include "cpu.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uintptr_t libafl_qemu_host_page_size(void);
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
uint8_t* libafl_paddr2host(CPUState* cpu, hwaddr addr, bool is_write);
|
uint8_t* libafl_paddr2host(CPUState* cpu, hwaddr addr, bool is_write);
|
||||||
#endif
|
#endif
|
||||||
|
@ -110,7 +110,7 @@ void libafl_exit_request_internal(CPUState* cpu, uint64_t pc, ShutdownCause caus
|
|||||||
|
|
||||||
void libafl_exit_request_sync_backdoor(CPUState* cpu, target_ulong pc)
|
void libafl_exit_request_sync_backdoor(CPUState* cpu, target_ulong pc)
|
||||||
{
|
{
|
||||||
last_exit_reason.kind = SYNC_BACKDOOR;
|
last_exit_reason.kind = SYNC_EXIT;
|
||||||
|
|
||||||
prepare_qemu_exit(cpu, pc);
|
prepare_qemu_exit(cpu, pc);
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
|
||||||
#include "exec/memory.h"
|
|
||||||
#include "qemu/rcu.h"
|
|
||||||
#include "cpu.h"
|
|
||||||
|
|
||||||
#include "libafl/utils.h"
|
#include "libafl/utils.h"
|
||||||
|
|
||||||
|
uintptr_t libafl_qemu_host_page_size(void)
|
||||||
|
{
|
||||||
|
return qemu_real_host_page_size();
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef CONFIG_USER_ONLY
|
||||||
uint8_t* libafl_paddr2host(CPUState* cpu, hwaddr addr, bool is_write)
|
uint8_t* libafl_paddr2host(CPUState* cpu, hwaddr addr, bool is_write)
|
||||||
{
|
{
|
||||||
if (addr == -1) {
|
if (addr == -1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user