Skip to contentSkip to conversation

mips, nvme/pci boot regression (commit 145e2198d749)

DISCUSSION Klaus Jensen 2 participants 4 messages Jan 17, 2023 – Jan 18, 2023

lore
Share & tools
lore
#0 lore raw

Hi Philippe,

Commit 145e2198d749 ("hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps") broke my mips64 nvme boot test (little-endian host, mips64 and nvme boot device).

The pci device doesn't show up and the kernel panics.

  qemu-system-mips64 \
    -nodefaults -nographic -snapshot -no-reboot \
    -M "malta" -cpu "I6400" -m 512M \
    -nic user,model=pcnet \
    -drive file=images/rootfs.ext2,format=raw,if=none,id=d0 \
    -device nvme,serial=default,drive=d0 \
    -kernel images/vmlinux \
    -append "root=/dev/nvme0n1 console=ttyS0,115200" \
    -serial stdio
#1 lore raw

Hi Klaus,

Quoted 8 lines · Klaus Jensen

Hi Philippe,

Commit 145e2198d749 ("hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps") broke my mips64 nvme boot test (little-endian host, mips64 and nvme boot device).

The pci device doesn't show up and the kernel panics.

Quoted 9 lines
   qemu-system-mips64 \
     -nodefaults -nographic -snapshot -no-reboot \
     -M "malta" -cpu "I6400" -m 512M \
     -nic user,model=pcnet \
     -drive file=images/rootfs.ext2,format=raw,if=none,id=d0 \
     -device nvme,serial=default,drive=d0 \
     -kernel images/vmlinux \
     -append "root=/dev/nvme0n1 console=ttyS0,115200" \
     -serial stdio

How do I get this images/ folder, or how do you generate the kernel / rootfs images?

#2 lore raw
Quoted 21 lines · Philippe Mathieu-Daudé

Hi Klaus,

Quoted 8 lines · Klaus Jensen

Hi Philippe,

Commit 145e2198d749 ("hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps") broke my mips64 nvme boot test (little-endian host, mips64 and nvme boot device).

The pci device doesn't show up and the kernel panics.

Quoted 9 lines
   qemu-system-mips64 \
     -nodefaults -nographic -snapshot -no-reboot \
     -M "malta" -cpu "I6400" -m 512M \
     -nic user,model=pcnet \
     -drive file=images/rootfs.ext2,format=raw,if=none,id=d0 \
     -device nvme,serial=default,drive=d0 \
     -kernel images/vmlinux \
     -append "root=/dev/nvme0n1 console=ttyS0,115200" \
     -serial stdio
Quoted 2 lines

How do I get this images/ folder, or how do you generate the kernel / rootfs images?

It's a buildroot with the qemu_mips64r6_malta_defconfig. However, the kernel must be at least v6.2-rc3 and a potential fix for pin-based interrupts[1] (other fixes are being discussed) must be applied. On older kernels the device should show up, but it will be broken (issue on big-endian with shadow doorbells and occasional timeouts due to the kernel missing interrupts).

If you don't want to mess with that, I put the images on github[2] (the kernel is v6.2-rc4 + my potential nvme driver fix). Just gunzip rootfs.ext2.gz.

[1]: https://lore.kernel.org/linux-nvme/[email protected]/
[2]: https://github.com/birkelund/qemu-nvme-boot

#3 lore raw
Quoted 29 lines · Klaus Jensen
Quoted 18 lines · Philippe Mathieu-Daudé
Quoted 7 lines · Klaus Jensen

Commit 145e2198d749 ("hw/mips/gt64xxx_pci: Endian-swap using PCI_HOST_BRIDGE MemoryRegionOps") broke my mips64 nvme boot test (little-endian host, mips64 and nvme boot device).

The pci device doesn't show up and the kernel panics.

Quoted 9 lines
    qemu-system-mips64 \
      -nodefaults -nographic -snapshot -no-reboot \
      -M "malta" -cpu "I6400" -m 512M \
      -nic user,model=pcnet \
      -drive file=images/rootfs.ext2,format=raw,if=none,id=d0 \
      -device nvme,serial=default,drive=d0 \
      -kernel images/vmlinux \
      -append "root=/dev/nvme0n1 console=ttyS0,115200" \
      -serial stdio
Quoted 2 lines

How do I get this images/ folder, or how do you generate the kernel / rootfs images?

It's a buildroot with the qemu_mips64r6_malta_defconfig. However, the kernel must be at least v6.2-rc3 and a potential fix for pin-based interrupts[1] (other fixes are being discussed) must be applied. On older kernels the device should show up, but it will be broken (issue on big-endian with shadow doorbells and occasional timeouts due to the kernel missing interrupts).

Quoted 6 lines

If you don't want to mess with that, I put the images on github[2] (the kernel is v6.2-rc4 + my potential nvme driver fix). Just gunzip rootfs.ext2.gz.

   [1]: https://lore.kernel.org/linux-nvme/[email protected]/
   [2]: https://github.com/birkelund/qemu-nvme-boot

Thanks Klauss, proposed fix posted:
https://lore.kernel.org/qemu-devel/[email protected]/