[PATCH v2 18/18] virtio: pci: Make use of dm_pci_map_bar()

Felix Yan felixonmars at archlinux.org
Thu Aug 25 10:01:18 CEST 2022


Hi,

Today I discovered a failure which bisected to this commit.

When running QEMU with libvirt, which created some pcie devices, U-boot 
fails on autoboot with:

Unhandled exception: Load access fault
EPC: 00000000bff7c46e RA: 00000000bff7c46c TVAL: 0000000040200014
EPC: 000000008002446e RA: 000000008002446c reloc adjusted

Code: 8082 1141 e022 e406 842e 40ef dc5f 611c (c783 0147)

I have tried to minimize the command line that makes the difference.

This works:

-device 
'{"driver":"virtio-blk-pci","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":1}'

This doesn't work:

-device 
'{"driver":"virtio-blk-pci","bus":"pci.2","addr":"0x0","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":1}'

I have tried this on multiple machines, different U-boot tags, mmode or 
smode with OpenSBI, all with the same behavior. Latest U-boot master 
with this commit reverted works fine on both cases.

I am very new to U-boot, please do let me know if more info are to be 
provided.

Attached the full command line, for reference:

/usr/bin/qemu-system-riscv64  \
-machine virt  \
-bios u-boot/u-boot.bin  \
-m 1024  \
-device 
'{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' 
  \
-device 
'{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' 
  \
-blockdev 
'{"driver":"file","filename":"archriscv-2022-08-24.qcow2","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' 
  \
-blockdev 
'{"node-name":"libvirt-2-format","read-only":false,"driver":"qcow2","file":"libvirt-2-storage","backing":null}' 
  \
-device 
'{"driver":"virtio-blk-pci","bus":"pci.2","addr":"0x0","drive":"libvirt-2-format","id":"virtio-disk0","bootindex":1}' 
  \
-nographic

-- 
Regards,
Felix Yan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20220825/c9011e70/attachment.sig>


More information about the U-Boot mailing list