[Aranym-dev] [Fwd: 68040 MMU possible bug]

Petr Stehlik pstehlik at sophics.cz
Sat Aug 29 21:50:43 CEST 2009

Hi Andreas, Milan, and other MMU experts,

Toni Wilen has implemented ARAnyM's MMU in the WinUAE and says that he
found a bug (please see below). If you can figure out what's wrong
please post a patch (or apply it directly).



-------- Přeposlaná zpráva --------
Od: Toni Wilen <twilen at winuae.net>
Komu: pstehlik at sophics.cz
Předmět: 68040 MMU possible bug
Datum: Sat, 29 Aug 2009 21:49:50 +0300

Hello again.

I think there is small bug in MMU emulation, MMU_DES_USED is set when 
page is indirect page descriptor, which does not have U-bit, corrupting 
the address. (if bit 3 was originally zero). Removing code that sets 
U-bit when indirect fixes Amiga mmulib crash.

    desc = phys_get_long(desc_addr);
    if ((desc & 1) == 0) {
        if ((desc & 2) == 0) {
            D(bug("MMU: invalid page descriptor log=%08lx desc=%08lx 
@%08lx", addr, desc, desc_addr));
            return desc;
        /* indirect */
        if (indirect) {
            D(bug("MMU: double indirect descriptor log=%lx descriptor @ 
%lx", addr, desc_addr));
            return desc;
        wp |= desc;
        if ((desc & MMU_DES_USED) == 0)
            phys_put_long(desc_addr, desc | MMU_DES_USED); <--- this 
does not appear to be right
        desc_addr = desc & MMU_PAGE_INDIRECT_MASK;
        indirect = 1;
        goto get_page_descriptor;

More information about the cz-bobek-lists-aranym mailing list