Port-alpha archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Some support for VirtIO when running NetBSD/alpha in Qemu



Hey folks…

Something I’ve been playing with for a while, but finally had some spare minutes to carry it across the finish line… I’ve made some small changes to the virtio_pci code to negotiate the ACCESS_PLATFORM feature on the alpha (and sparc64) platforms, which, coupled with some configuration options for Qemu, let’s DMA to PCI VirtIO devices work correctly on those platforms.

This in turns let’s you put the root file system on “sd0" using virtio-scsi-pci rather than “wd0” using cmdide:

[     1.000003] virtio1 at pci0 dev 5 function 0
[     1.000003] virtio1: SCSI device (id 8, rev. 0x01)
[     1.000003] vioscsi0 at virtio1: features: 0x310000000<ACCESS_PLATFORM,V1,INDIRECT_DESC>
[     1.000003] virtio1: allocated 53248 byte for virtqueue 0 for control, size 256
[     1.000003] virtio1: using 40960 byte (2560 entries) indirect descriptors
[     1.000003] virtio1: allocated 53248 byte for virtqueue 1 for event, size 256
[     1.000003] virtio1: using 40960 byte (2560 entries) indirect descriptors
[     1.000003] virtio1: allocated 53248 byte for virtqueue 2 for request, size 256
[     1.000003] virtio1: using 40960 byte (2560 entries) indirect descriptors
[     1.000003] vioscsi0: cmd_per_lun 128 qsize 256 seg_max 254 max_target 255 max_lun 16383
[     1.000003] virtio1: interrupting at dec 6600 irq 24
[     1.000003] scsibus0 at vioscsi0: 256 targets, 16384 luns per target
.
.
.
[     1.498756] sd0: 8192 MB, 16383 cyl, 16 head, 64 sec, 512 bytes/sect x 16777216 sectors
[     1.498756] sd0: async, 8-bit transfers, tagged queueing

Things aren’t perfect, however:

- The virtio-rng-pci device doesn’t work (doesn’t generate any samples).
- The virtio-scsi-pci device can boot the system, but it generates stray interrupts.
- The virtio-blk-pci device appears to work, and the system boots for a while, but it eventually crashes due to a memory management fault, which is probably a bug in the NetBSD driver.

The issues might be relatedto having to use VirtIO 1.0 (rather than 0.9) in order to enable ACCESS_PLATFORM … that code path isn’t well tested in NetBSD, and there are probably bugs in it.

In any case, here are the arguments I’m using to boot NetBSD/alpha with virtio-pci-scsi using the Qemu in pkgsrc:

qemu-system-alpha \
	-bios /usr/pkg/share/qemu/palcode-clipper \
	-kernel /nbsd/src/sys/arch/alpha/compile/GENERIC.QEMU/netbsd \
	-append root=/dev/sd0a \
	-nographic \
	-m 2048 \
	-smp cpus=2 \
	-device virtio-rng-pci \
	-device virtio-scsi-pci,id=scsi0,disable-legacy=on,iommu_platform=on \
	-device scsi-hd,drive=drive0,bus=scsi0.0,channel=0,scsi-id=0,lun=0 \
	-drive file=disk0.raw,if=none,id=drive0 \
	-nic tap,ifname=tap1,script=no

I’m hoping that this will avoid the issues that releng has seen trying to use NetBSD/alpha in Qemu in the automated test machinery (issues with cmdide that I haven’t been able to reproduce).

-- thorpej



Home | Main Index | Thread Index | Old Index