Re: Oopses and invalid addresses under Hatari

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

 



Hi Eero,

Am 15.04.2019 um 10:49 schrieb Eero Tamminen:
Hi,

On 4/13/19 2:11 AM, Michael Schmitz wrote:
[...]
Here problem is the second value in stack.

Maybe missing auto-increment when auto-increment instruction page faults
causes later issues, when bus errors with them are ignored.
=> I'll discuss this on Hatari list

Toni's reply:
---------------------------------------------------
I guess this means CPU does increment (and pre-decrement, possibly even
flags are partially set at this point depending on instruction) before
MMU detects the fault and because MMU is not fully integrated to CPU
(like in 68040+. 68030 is basically 68020+68851+data cache integrated in
single package with reduced 68851 instruction set), it is MMU's task to
handle the exception logic which means there is only fault address that
needs to be known (source of address is irrelevant at this point) and
CPU only needs to know where to continue execution after RTE. 68030
continues after MMU fault, 68040+ restarts.

Current emulation can't handle this because whole instruction is retried
(with already executed memory writes skipped and already executed reads
returning "cached" values to simulate continuation). Most likely new
"68030 MMU continuation" CPU core would be needed to fully emulate this
behavior.

Fortunately this is undocumented behavior so no "normal" program should
care except perhaps some debugger like programs.
---------------------------------------------------

OK, so we should not expect address registers involved in the faulting instruction to be accurate then.

I hope the effect of the instruction retry is identical to real processor behaviour in case of a page fault...



Yes, missing auto-increment or additional stack fixup that the m68k
kernel does not expect might cause trouble later on. My hack to
sidestep bus error to the parent process may also have unintended side
effects.

You mean things like bus_error030() function and the faulting functions
list of clobbered instructions and stack fixup not matching each other
yet, even on real HW?

I'm sure stack save and restore on the bus error entry and return path in the Linux kernel match. Register a0 is one of the saved registers, so the missing postincrement of that register will be retained after returning from the exception.

I understood you to mean that the emulator does additional stack fixup on returning from exception. As long as that's just done in order to retry the faulting instruction, I expect it'll be fine as well.

Cheers,

	Michael




The kernel didn't crash yet, but there's no load to speak of on that
system.

You were using SLAB allocator, so I think I need to test that now
(instead of default SLUB).


    - Eero



[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux