[Top][All Lists]

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

Re: [Qemu-devel] [5849] Change MMIO callbacks to use offsets, not absol

From: Paul Brook
Subject: Re: [Qemu-devel] [5849] Change MMIO callbacks to use offsets, not absolute addresses.
Date: Tue, 24 Feb 2009 22:28:10 +0000
User-agent: KMail/1.9.9

> > Bits of both. The TLB is tightly tied into the code generator. Once we
> > get out of the first-level TLB lookup you've not got anywhere near enough
> > information to be able to restore the CPU state. The only way to raise
> > exceptions from within an IO handler is to sync CPU state before every
> > memory access, and you really don't want to do that. This is why the
> > existing unassigned access fault code is busted.
> But because of possible MMU and unaligned access faults we already
> save PC and NPC (not in all cases).  Handling of those faults works, 
> it's really needed for correct operation. For some faults PC/NPC save
> is not necessary, the fault handler can calculate env->pc from host
> PC. Why would the unassigned fault be different?

I'm not sure how I can be any clearer. 

You either have to explicitly sync state (In teh case of SPARC this means 
saving PC and NPC), or you have to know about the fault in the low-level TLB 
processing code where you still have enough information to recover this 
information. Once you get into an IO handler you've no way of figuring out 
what the current CPU state is. The "not in all cases"/"some faults" you 
mention above is relatively rare instructions that may fault v.s. every 
memory access.


reply via email to

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