Re: Kernel versions 6.x don't boot on Amiga 4000

2023-02-23 Thread Michael Schmitz

Correcting myself again...

On 22/02/23 13:53, Michael Schmitz wrote:

Hi Adrian,

On 22/02/23 10:46, John Paul Adrian Glaubitz wrote:

Hi Michael!

On Wed, 2023-02-22 at 10:09 +1300, Michael Schmitz wrote:

a1 is just  before the end of your RAM chunk. If that's a longword


Actually it isn't that close - if I read the stack correctly, we're 
comparing 0xc bytes from 0x0f74 which is to 0x0f7ff.


The post-increment of a5 to 0x0f80 might cause a pre-fetch beyond 
end of memory - how does that get handled?


The stack frame format in this case (at least, going by the 68000 series 
PRM) seems to indicate it's not something to do with prefetch.


Can you try Kars' recent patch? Maybe the old bug calculating the RAM 
end address only now got 'active' on your configuration due to more 
recent MM changes?


Cheers,

    Michaell



access, you'd fall over the edge :) Can you disassemble the code 
snippet

(or memcmp()) so we can see what's happening?

Here you go:

00201d14 :
   201d14:   48e7 301c   moveml %d2-%d3/%a3-%a5,%sp@-
   201d18:   226f 0018   moveal %sp@(24),%a1
   201d1c:   266f 001c   moveal %sp@(28),%a3
   201d20:   206f 0020   moveal %sp@(32),%a0
   201d24:   7003    moveq #3,%d0
   201d26:   b088    cmpl %a0,%d0
   201d28:   650a    bcss 201d34 
   201d2a:   4281    clrl %d1
   201d2c:   b288    cmpl %a0,%d1
   201d2e:   661e    bnes 201d4e 
   201d30:   4280    clrl %d0
   201d32:   6030    bras 201d64 
   201d34:   2a49    moveal %a1,%a5 <===  0x0f74
   201d36:   284b    moveal %a3,%a4
   201d38:   264c    moveal %a4,%a3
   201d3a:   224d    moveal %a5,%a1
   201d3c:   bb8c    cmpml %a4@+,%a5@+ <===  a5 will 
be 0x0f80 after post-increment

   201d3e:   66ea    bnes 201d2a 
   201d40:   5988    subql #4,%a0
   201d42:   7003    moveq #3,%d0
   201d44:   b088    cmpl %a0,%d0
   201d46:   65f0    bcss 201d38 
   201d48:   224d    moveal %a5,%a1
   201d4a:   264c    moveal %a4,%a3
   201d4c:   60dc    bras 201d2a 
   201d4e:   4283    clrl %d3
   201d50:   1631 1800   moveb %a1@(0,%d1:l),%d3
   201d54:   4282    clrl %d2
   201d56:   1433 1800   moveb %a3@(0,%d1:l),%d2
   201d5a:   2003    movel %d3,%d0
   201d5c:   9082    subl %d2,%d0
   201d5e:   5281    addql #1,%d1
   201d60:   b483    cmpl %d3,%d2
   201d62:   67c8    beqs 201d2c 
   201d64:   4cdf 380c   moveml %sp@+,%d2-%d3/%a3-%a5
   201d68:   4e75    rts

The kernel image is actually unstripped. Is there a config option for 
that?
I'm sure the compressed kernel image is stripped but includes the 
kernel symbol table (see below). The symbol table is definitely good 
to have (otherwise you'd have to figure what all the addresses on the 
stack mean from a separate symbol table).

Do we want to keep symbols in a non-debug kernel?


Definitely ...

Cheers,

    Michael

Output of objdump -h:

vmlinux-6.2.0-rc8-atari-fpuemu-atafbfix+: file format elf32-m68k

Sections:
Idx Name  Size  VMA   LMA   File off  Algn
  0 .text 0030169c  1000  1000  1000  2**2
  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 __ex_table    1ab0  003026a0  003026a0  003026a0  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .rodata   000c81e8  00305000  00305000  00305000  2**4
  CONTENTS, ALLOC, LOAD, DATA
  3 __ksymtab 9a14  003cd1e8  003cd1e8  003cd1e8  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 __ksymtab_gpl 57c0  003d6bfc  003d6bfc  003d6bfc  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 __ksymtab_strings 000166a3  003dc3bc  003dc3bc  003dc3bc  2**0
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 __param   06cc  003f2a60  003f2a60  003f2a60  2**1
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 __modver  0088  003f312c  003f312c  003f312c  2**1
  CONTENTS, ALLOC, LOAD, DATA
  8 .notes    0054  003f31b4  003f31b4  003f31b4  2**2
  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .data 00051a20  003f4000  003f4000  003f4000  2**4
  CONTENTS, ALLOC, LOAD, DATA
 10 .bss  0002266c  00445a20  00445a20  00445a20  2**4
  ALLOC
 11 .init.text    00017be0  00469000  00469000  00447000  2**2
  CONTENTS, ALLOC, LOAD, READONLY, CODE
 12 .init.data    4c1c  00480be0  00480be0  0045ebe0  2**2
  CONTENTS, ALLOC, LOAD, DATA
 13 .m68k_fixup   0480  004857fc  004857fc  004637fc  2**0
  CONTENTS, ALLOC, LOAD, DATA
 14 .init_end 0384  

Re: Kernel versions 6.x don't boot on Amiga 4000

2023-02-23 Thread Stephen Walsh
Hi Adrian,

On Tue, 21 Feb 2023 15:50:52 +0100
John Paul Adrian Glaubitz  wrote:

> Will try earlier kernels until I found the one where the breakage was
> introduced. Currently known latest kernel to work is 5.10.5.

From my testing last year trying to boot my Amiga 3000, the break
happens sometime after 5.15.0-2. (The last working kernel for me)

I've not been able to successfully boot any later kernel's since.

All my attempts to compile my own kernel have failed.


-- 
Stephen - Vk3heg



Kernel versions 6.x don't boot on Amiga 4000

2023-02-23 Thread Stephen Walsh
FYI:

Just caught this trying a re-compile of kernel 5.15.2 from kernel org,
under debbootstrap/sbuild and qemu-system-m68k both produce this issue:


  CC  mm/process_vm_access.o
  CC  mm/page_alloc.o
mm/page_alloc.c: In function ‘mem_init_print_info’:
mm/page_alloc.c:8163:27: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8167:9: note: in expansion of macro ‘adj_init_size’
 8167 | adj_init_size(__init_begin, __init_end, init_data_size,
  | ^
mm/page_alloc.c:8163:27: note: use ‘&__init_begin[0] <= &_sinittext[0]’ to 
compare the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8167:9: note: in expansion of macro ‘adj_init_size’
 8167 | adj_init_size(__init_begin, __init_end, init_data_size,
  | ^
mm/page_alloc.c:8163:41: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8167:9: note: in expansion of macro ‘adj_init_size’
 8167 | adj_init_size(__init_begin, __init_end, init_data_size,
  | ^
mm/page_alloc.c:8163:41: note: use ‘&_sinittext[0] < &__init_end[0]’ to compare 
the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8167:9: note: in expansion of macro ‘adj_init_size’
 8167 | adj_init_size(__init_begin, __init_end, init_data_size,
  | ^
mm/page_alloc.c:8163:27: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8169:9: note: in expansion of macro ‘adj_init_size’
 8169 | adj_init_size(_stext, _etext, codesize, _sinittext, 
init_code_size);
  | ^
mm/page_alloc.c:8163:27: note: use ‘&_stext[0] <= &_sinittext[0]’ to compare 
the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8169:9: note: in expansion of macro ‘adj_init_size’
 8169 | adj_init_size(_stext, _etext, codesize, _sinittext, 
init_code_size);
  | ^
mm/page_alloc.c:8163:41: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8169:9: note: in expansion of macro ‘adj_init_size’
 8169 | adj_init_size(_stext, _etext, codesize, _sinittext, 
init_code_size);
  | ^
mm/page_alloc.c:8163:41: note: use ‘&_sinittext[0] < &_etext[0]’ to compare the 
addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8169:9: note: in expansion of macro ‘adj_init_size’
 8169 | adj_init_size(_stext, _etext, codesize, _sinittext, 
init_code_size);
  | ^
mm/page_alloc.c:8163:27: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8170:9: note: in expansion of macro ‘adj_init_size’
 8170 | adj_init_size(_sdata, _edata, datasize, __init_begin, 
init_data_size);
  | ^
mm/page_alloc.c:8163:27: note: use ‘&_sdata[0] <= &__init_begin[0]’ to compare 
the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8170:9: note: in expansion of macro ‘adj_init_size’
 8170 | adj_init_size(_sdata, _edata, datasize, __init_begin, 
init_data_size);
  | ^
mm/page_alloc.c:8163:41: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8170:9: note: in expansion of macro ‘adj_init_size’
 8170 | adj_init_size(_sdata, _edata, datasize, __init_begin, 
init_data_size);
  | ^
mm/page_alloc.c:8163:41: note: use ‘&__init_begin[0] < &_edata[0]’ to compare 
the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8170:9: note: in expansion of macro ‘adj_init_size’
 8170 | adj_init_size(_sdata, _edata, datasize, __init_begin, 
init_data_size);
  | ^
mm/page_alloc.c:8163:27: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && si

Re: Kernel versions 6.x don't boot on Amiga 4000

2023-02-23 Thread Michael Schmitz

Hi Stephen,

that's apparently been corrected in later versions. Commit 
ca831f29f8f25c97182e726429b38c0802200c8f (in from 5.17).


I doubt this would lead to different code generated.

Which was the first broken version you tried? That would narrow down the 
search range considerably...


Cheers,

Michael




Am 24.02.2023 um 14:09 schrieb Stephen Walsh:

FYI:

Just caught this trying a re-compile of kernel 5.15.2 from kernel org,
under debbootstrap/sbuild and qemu-system-m68k both produce this issue:


  CC  mm/process_vm_access.o
  CC  mm/page_alloc.o
mm/page_alloc.c: In function ‘mem_init_print_info’:
mm/page_alloc.c:8163:27: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8167:9: note: in expansion of macro ‘adj_init_size’
 8167 | adj_init_size(__init_begin, __init_end, init_data_size,
  | ^
mm/page_alloc.c:8163:27: note: use ‘&__init_begin[0] <= &_sinittext[0]’ to 
compare the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8167:9: note: in expansion of macro ‘adj_init_size’
 8167 | adj_init_size(__init_begin, __init_end, init_data_size,
  | ^
mm/page_alloc.c:8163:41: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8167:9: note: in expansion of macro ‘adj_init_size’
 8167 | adj_init_size(__init_begin, __init_end, init_data_size,
  | ^
mm/page_alloc.c:8163:41: note: use ‘&_sinittext[0] < &__init_end[0]’ to compare 
the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8167:9: note: in expansion of macro ‘adj_init_size’
 8167 | adj_init_size(__init_begin, __init_end, init_data_size,
  | ^
mm/page_alloc.c:8163:27: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8169:9: note: in expansion of macro ‘adj_init_size’
 8169 | adj_init_size(_stext, _etext, codesize, _sinittext, 
init_code_size);
  | ^
mm/page_alloc.c:8163:27: note: use ‘&_stext[0] <= &_sinittext[0]’ to compare 
the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8169:9: note: in expansion of macro ‘adj_init_size’
 8169 | adj_init_size(_stext, _etext, codesize, _sinittext, 
init_code_size);
  | ^
mm/page_alloc.c:8163:41: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8169:9: note: in expansion of macro ‘adj_init_size’
 8169 | adj_init_size(_stext, _etext, codesize, _sinittext, 
init_code_size);
  | ^
mm/page_alloc.c:8163:41: note: use ‘&_sinittext[0] < &_etext[0]’ to compare the 
addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8169:9: note: in expansion of macro ‘adj_init_size’
 8169 | adj_init_size(_stext, _etext, codesize, _sinittext, 
init_code_size);
  | ^
mm/page_alloc.c:8163:27: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8170:9: note: in expansion of macro ‘adj_init_size’
 8170 | adj_init_size(_sdata, _edata, datasize, __init_begin, 
init_data_size);
  | ^
mm/page_alloc.c:8163:27: note: use ‘&_sdata[0] <= &__init_begin[0]’ to compare 
the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  |   ^~
mm/page_alloc.c:8170:9: note: in expansion of macro ‘adj_init_size’
 8170 | adj_init_size(_sdata, _edata, datasize, __init_begin, 
init_data_size);
  | ^
mm/page_alloc.c:8163:41: warning: comparison between two arrays 
[-Warray-compare]
 8163 | if (start <= pos && pos < end && size > adj) \
  | ^
mm/page_alloc.c:8170:9: note: in expansion of macro ‘adj_init_size’
 8170 | adj_init_size(_sdata, _edata, datasize, __init_begin, 
init_data_size);
  | ^
mm/page_alloc.c:8163:41: note: use ‘&__init_begin[0] < &_edata[0]’ to compare 
the addresses
 8163 | if (start <= pos && pos < end && size > adj) \
  |