[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Any better way to access CPUArchState in vl.c?

From: Wei-Ren Chen
Subject: Re: [Qemu-devel] Any better way to access CPUArchState in vl.c?
Date: Tue, 19 Jun 2012 17:02:30 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Andreas,

> Poisoned is the "env" variable. You cannot just #include "dyngen-exec.h"
> and expect it to be usable since AREG0 targets don't guarantee it's set
> properly (may be NULL even with traditional targets at times).

  Oops, I miss that point.
> CPUArchState should currently be usable in vl.c, you just need explicit
> access to it (e.g., a function argument).
> Question is, what are you trying to do? In particular, of which CPU
> (think SMP) are you trying to print ->some_field? :)

  Currently we only consider single CPU ARM guest, so there should be only one
env we need to take care of. We add some fields into CPUState and want to print
their value when the VM is terminated. For example,

static void main_loop(void)
    do {
        nonblocking = !kvm_enabled() && last_io > 0;
        last_io = main_loop_wait(nonblocking);
    } while (!main_loop_should_exit());

    // print env->some_field1
    // print env->some_field2

If we can access env in vl.c directly, it would make the task easier.


Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj

reply via email to

[Prev in Thread] Current Thread [Next in Thread]