Hi,

(and sorry for CC-ing you directly, Gunnar: feel free to just ignore
should you be overwhelmed/not interested/whatever) and I'll stop
bothering you :)

One of us (ratten) has made some progress and has an incantation which
shows some kernel messages and ends up in a kernel panic. Progress :-)

I'll repeat the basic coordinates here, then show the kernel logs around
the panic and then put some questions :-)

 - the image is from
   https://raspi.debian.net/tested/20231109_raspi_4_bookworm.img.xz

 - qemu is qemu-system 1:10.0.2+ds-2+deb13u1~bpo12+1 from bookworm
   backports (me) or standard Trixie 1:10.0.6+ds-0+deb13u2 (ratten).

 - we try to boot the thing with kernel, initrd and device tree
   "outside" of the image (in my first question some folks in
   debian-user@ hinted at errors I made here, thanks for that!)

So here is the incantation (sorry for the long lines):

    qemu-system-aarch64 -display none -machine raspi4b -cpu cortex-a72 -m 2G 
-smp 4 \
      -serial stdio -kernel vmlinuz-6.1.0-13-arm64 -dtb bcm2711-rpi-4-b.dtb \
      -drive "file=20231109_raspi_4_bookworm.img,format=raw,index=0,media=disk" 
\
      -initrd initrd.img-6.1.0-13-arm64 \
      -append "earlycon=pl011,mmio32,0xfe201000 rw earlyprintk loglevel=8 
console=ttyAMA0,115200 dwc_otg.lpm_enable=0 rootdelay=1"

Of course I extracted first the kernel, initrd and devtree to the
current dir. This is (an extract of) what happens:

  [    4.138013] Freeing initrd memory: 30236K
  [    4.439597] alg: self-tests for CTR-KDF (hmac(sha256)) passed
  [    4.440807] Block layer SCSI generic (bsg) driver version 0.4 loaded 
(major 247)
  [    4.446983] io scheduler mq-deadline registered
  [    4.465574] Internal error: synchronous external abort: 0000000096000050 
[#1] SMP
  [    4.466456] Modules linked in:
  [    4.467202] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.0-13-arm64 #1  
Debian 6.1.55-1
  [    4.468189] Hardware name: Raspberry Pi 4 Model B (DT)
  [    4.469783] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
  [    4.470955] pc : brcmstb_l2_intc_of_init.constprop.0+0x7c/0x294
  [    4.471898] lr : brcmstb_l2_intc_of_init.constprop.0+0x50/0x294
  [    4.472843] sp : ffff800009fdbaf0
  [    4.473594] x29: ffff800009fdbaf0 x28: 0000000000000000 x27: 
ffff8000096200f0
  [    4.474543] x26: ffff800009706060 x25: 0000000000000006 x24: 
ffff0000037c2c68
  [    4.475795] x23: ffff800009fe5100 x22: 00000000ffffffff x21: 
ffff000037e15068
  [    4.476866] x20: ffff800008d8af78 x19: ffff000002d2a880 x18: 
ffffffffffffffff
  [    4.478499] x17: 0000000071e07e92 x16: 00000000cf9e4ac0 x15: 
0140000000000000
  [    4.479788] x14: ffffffffffffffff x13: 0040000000000001 x12: 
00008000f4f1b000
  [    4.480586] x11: ffff80000a1e5000 x10: ffff800009fe5fff x9 : 
000000000000003f
  [    4.482429] x8 : 00000000fef00000 x7 : ffff800009fe6000 x6 : 
0400000000000001
  [    4.483121] x5 : ffff800009fe6000 x4 : ffff800009fe5fff x3 : 
0000000000000000
  [    4.484110] x2 : 0000000000000000 x1 : ffff0000025c0000 x0 : 
ffff800009fe5110
  [    4.485232] Call trace:
  [    4.487415]  brcmstb_l2_intc_of_init.constprop.0+0x7c/0x294
  [    4.488775]  brcmstb_l2_edge_intc_of_init+0x20/0x2c
  [    4.490352]  platform_irqchip_probe+0x6c/0xe0
  [    4.491156]  platform_probe+0x70/0xcc
  [    4.491897]  really_probe+0xc8/0x3e0
  [    4.492342]  __driver_probe_device+0x84/0x160
  [    4.492866]  driver_probe_device+0x44/0x120
  [    4.493740]  __driver_attach+0xfc/0x204
  [    4.494235]  bus_for_each_dev+0x7c/0xdc
  [    4.494977]  driver_attach+0x2c/0x40
  [    4.495619]  bus_add_driver+0x184/0x240
  [    4.496448]  driver_register+0x80/0x13c
  [    4.497020]  __platform_driver_register+0x30/0x3c
  [    4.498770]  brcmstb_l2_driver_init+0x24/0x30
  [    4.499716]  do_one_initcall+0x60/0x260
  [    4.500360]  kernel_init_freeable+0x2a0/0x310
  [    4.501138]  kernel_init+0x2c/0x140
  [    4.502006]  ret_from_fork+0x10/0x20
  [    4.502887] Code: b9801680 8b0002e0 d50332bf 12800016 (b9000016) 
  [    4.508422] ---[ end trace 0000000000000000 ]---
  [    4.511599] Kernel panic - not syncing: Attempted to kill init! 
exitcode=0x0000000b
  [    4.512605] SMP: stopping secondary CPUs
  [    4.518113] Kernel Offset: disabled
  [    4.518959] CPU features: 0x40000,2003c080,0000421b
  [    4.531559] Memory Limit: none
  [    4.532320] ---[ end Kernel panic - not syncing: Attempted to kill init! 
exitcode=0x0000000b ]---

Now my questions:

- Do I have to extract the kernel, etc. from the image? IOW: is Qemu's
  platform emulation (not yet?) up to the task of doing the boot thing?

  (This one is probably more for the qemu folks (don't get me wrong: I'm
  not complaining, just trying to find out whether it makes sense for
  me to give it a try)

- How do I go about finding such magic incantations for Qemu (short of
  trying out every second recipe on the Internet)?

- Is this interesting for Debian? How else can we support the "Debian
  images for Raspi" effort?

  (This one is probably for you, Gunnar)

- Any useful tips to debug the above kernel failure?

  (I'm already trying to poke at it, but any hint has the potential
  to speed things up significantly ;-)

Thanks for help (or kind words :)

Please, keep ratten@ in CC, since not subscribed to the lists.

Cheers
-- 
tomás

Attachment: signature.asc
Description: PGP signature

Reply via email to