Re: [hatari-devel] MegaSTE cache emulation issues |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] MegaSTE cache emulation issues
- From: Eero Tamminen <oak@xxxxxxxxxxxxxx>
- Date: Tue, 1 Jul 2025 01:14:36 +0300
- Dkim-filter: OpenDKIM Filter v2.11.0 smtp.dnamail.fi E5F072113E03
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=helsinkinet.fi; s=2025-03; t=1751321676; bh=ydx5ipGr+kAbpCdti4ELnDqEIyQLV227FSkB+0NAnn4=; h=Date:Subject:To:References:From:In-Reply-To:From; b=iUQkLUb8mRubkf8/apOj5EBxLkIc3YTxKBn9qLHmOSvOMyAi2+scWThWXlikrgKTc nsqqNE0jsMSU9Nb28FFaAeef4J1eTvHlqbT7UP+b4xbD9NbcwliVHptSR5JGokVCZE svvKrt0e34bq90Zxg4L5oTPsYh7oJT8Ik9DC6uBEmQDGVSmeZhRlvKINhnyEDVgQ/A lFOQ78hP8GN/0KiIP37wJMdvNk6DbqPD56A0iL/O8q22ePJBHa7ln/QLGzIgkF20t8 kIXH1N/ro5MM76FsbSTfe1UdZDpwAyfiign8DvlBFkanI3MZvG5K1xq8eEqG3dDJaV gYYeqLnu1APLA==
Hi,
On 30.6.2025 0.00, Nicolas Pomarède wrote:
Le 29/06/2025 à 19:36, Eero Tamminen a écrit :
Sorry, the attached patch was missing compile fixes (forgot to commit
them before "git format-patch"). Attached is the correct one.
patch looks ok to me, thanks for going though this gemdos code (and
thanks to Christian for pointing to the faulty part)
Good, pushed.
[...]
I used a function with the addr/len as parameter in case someone in the
future would like to make a more fine-grained version that would
invalidate only the changed bytes from the cache.
But this can be quite complicated to do, because this part would need to
know the inner work of all 680x0 cpu with a cache + megaSte cache, which
would duplicate a lot of code / complexity from the cpu part.
Fair enough.
In the meantime, the function indeed flushes the whole cache. This might
impact performance, but as gemdos HD emulation is not cycle exact
anyway, this should not be a problem.
Also note that TOS itself will flush caches under certain conditions
when reading data from disk to RAM, doing the same in gemdos hd part is
not very different.
On re-reading the patch, I was a bit worried about adding flushing to
Super() call, but then noticed that flush is only on the no-TOS test
path. :-)
- Eero
Nicolas
On 29.6.2025 20.33, Eero Tamminen wrote:
On 29.6.2025 0.15, Nicolas Pomarède wrote:
Le 28/06/2025 à 21:27, Christian Zietz a écrit :
This is indeed a missing flush ; it's done in PopulateDTA,
GemDOS_Read or GemDOS_SFirst but not in this case :( An in-depth
review of gemdos.c would be needed to ensure this is the only
missing case.
I checked all places in gemdos.c where emulated memory is written,
but flush is missing. There were quite a few places, see the
attached patch. Does it look OK?
Btw. I looked into m68000.c, and noticed it ignoring the memory
addresses / sizes given for the flush functions. It always flushes
the whole (16KB) MegaSTE cache even when only few bytes need to be
uncached.
Meaning that some things which on real device would be cached, won't
be with Hatari, at least after the updated GEMDOS HD fuctions are
called.
I think this should affect only timings, which are unlikely to be
that critical after OS calls => I don't think it to be an issue, just
something that may need to be documented.