qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] QEMU Exception Handling


From: Wei-Ren Chen
Subject: Re: [Qemu-devel] QEMU Exception Handling
Date: Tue, 23 Apr 2013 09:31:32 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Apr 12, 2013 at 03:14:48PM -0700, Anand Brooks wrote:
> Hello All,
> 
> I ran into an error when testing some code that would generate protection
> faults. I had my exception handler setup so that it expected the EIP and
> Stack not to change, standard behavior on native CPU. But on QEMU both the
> ESP and EIP are changed at fault generation time.

  I remember if exception occured, QEMU have to re-translate the translation
block to locate what PC triggers that exception. The reason behind that is QEMU
won't keep exact PC during the translation (you have to update PC after each
guest instruction, which cost too much). So I guess you can check follow
the control flow and see when/where QEMU get the correct PC, then call your
exception handler instead, not QEMU's one.

HTH,
chenwj

-- 
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]