[Top][All Lists]

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

Re: [Qemu-discuss] 答复: How to execute an image under QEMU

From: Peter Maydell
Subject: Re: [Qemu-discuss] 答复: How to execute an image under QEMU
Date: Fri, 12 Dec 2014 12:17:22 +0000

On 12 December 2014 at 03:52,  <address@hidden> wrote:
> Hi, Peter and all
>    I am still confused on that problem, I delete the code "((int 
> (*)(void))(env->eip))();" and just change env->eip to my image entrypoint, In 
> the end the qemu is crash with useful information. After executing my helper 
> function, EIP cannot go to entrypoint, but to physical address 0. After 
> sequential execution(0->4->8->C->10...) , EIP = 0xAFFFC. Please help me to 
> check these error message, Thank you very much.

 * changing EIP is a (computed) jump, so make sure that when you're
   generating the code to call your helper function you also set
   is_jmp appropriately to end the TB
 * make sure you have the 'exec' and 'int' tracing enabled so you
   can see if (for instance) the CPU takes an exception because
   you told it to jump to an invalid address
 * make sure you're clear about the difference between physical and
   virtual addresses -- you seem to be using sec_base both as an
   argument to cpu_ldl_data() [implying that it's a physical addr]
   and as the value to put in EIP [implying that it's a virtual addr]

Beyond that, I think I'll leave you to debug on your own. This
is a really complicated bit of functionality you're trying to
add, and so you need to be able to deal with relatively
straightforward issues like "why is it not doing what I
expect" yourself, I think.

-- PMM

reply via email to

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