Beispiel #1
0
static void do_vm_stop(RunState state)
{
    if (runstate_is_running()) {
        cpu_disable_ticks();
        pause_all_vcpus();
        runstate_set(state);
        vm_state_notify(0, state);
        qemu_aio_flush();
        bdrv_flush_all();
        monitor_protocol_event(QEVENT_STOP, NULL);
    }
}
Beispiel #2
0
static void do_vm_stop(int reason)
{
    if (vm_running) {
        cpu_disable_ticks();
        vm_running = 0;
        pause_all_vcpus();
        vm_state_notify(0, reason);
        qemu_aio_flush();
        bdrv_flush_all();
        monitor_protocol_event(QEVENT_STOP, NULL);
    }
}
Beispiel #3
0
void tracing_insn_begin(DECAF_Callback_Params* params) {
	CPUState* env = NULL;
#if 0 // AWH
	if (params != NULL) {
		env = params->ib.env;
	}
#else
	if (!params) return;
	env = params->ib.env;
#endif // AWH
	if (DECAF_is_in_kernel(env) && should_trace_all_kernel)
		goto TRACE_KERNEL;

	/* If tracing start condition not satisified, or not tracing return */
	if ((!tracing_start_condition) || (tracepid == 0))
		return;

	/* If not tracing kernel and kernel instruction , return */
	if (DECAF_is_in_kernel(env) && !tracing_kernel())
		return;

	if(DECAF_getPGD(env) != tracecr3 && (!DECAF_is_in_kernel(env)))
		return;

	TRACE_KERNEL:
	cpu_disable_ticks();
	/* Get thread id */
	current_tid = VMI_get_current_tid_c(env);

	/* Clear flags before processing instruction */

	// Flag to be set if the instruction is written
	insn_already_written = 0;

	// Flag to be set if instruction encounters a page fault
	// NOTE: currently not being used. Tracing uses it to avoid logging twice
	// these instructions, but was missing some
	has_page_fault = 0;

	// Flag to be set if instruction accesses user memory
	access_user_mem = 0;

	/* Disassemble the instruction */
	insn_tainted = 0;
	if (skip_decode_address == 0) {
		decode_address(/* AWH cpu_single_*/ env->eip, &eh);
	}
	cpu_enable_ticks();

}
Beispiel #4
0
static int do_vm_stop(RunState state)
{
    int ret = 0;

    if (runstate_is_running()) {
        cpu_disable_ticks();
        pause_all_vcpus();
        runstate_set(state);
        vm_state_notify(0, state);
        monitor_protocol_event(QEVENT_STOP, NULL);
    }

    bdrv_drain_all();
    ret = bdrv_flush_all();

    return ret;
}