On 9 February 2017 at 20:03, Richard Henderson <r...@twiddle.net> wrote: > On 02/09/2017 11:31 AM, Peter Maydell wrote: >> Review from somebody who understands how the unassigned_access >> hooks are supposed to work appreciated.
> The unassigned_access hook was (unfortunately) designed after the > unaligned_access hook. The later *can* usefully return to indicate that the > cpu bit that enforces alignment traps is off. > > Any unassigned_access hook that doesn't longjmp could be > considered buggy. I use the M profile unassigned_access hook to implement the "high addresses are magic, but only if you're in Handler mode" behaviour. So for Thread mode I want the default handling. You could argue that this is kind of abusing the hook, though. Microblaze returns from the hook in the case where the processor version register bit says "this CPU doesn't generate exceptions for instruction/data aborts". Since it looks like you can have a CPU config that chooses to generate an exception for insn abort but not data abort (or vice-versa), this looks like a valid case for allowing the hook to return (you need the hook for the case which you want to have throw exceptions, but it gets called for the other case too and needs to be able to say "nope" there). The sparc code is too complicated for me to be able to judge whether its non-longjmping codepaths are valid or bugs. thanks -- PMM