2011/7/17 Stéphanie Ouillon <steph.ouil...@gmail.com>: > I have been facing a problem for 3-4 days with my virtio network device > driver in qemu: when I load the driver, I get the following error: > kvm: virtio: trying to map MMIO memory [...] > Would anybody have a clue about what kind of bug would provoke this error in > qemu ?
It means a descriptor has an addr field that is not a bus address backed by RAM. Instead the incorrect address is to a MMIO memory region. Normally all buffers that you pass via virtio are guest physical RAM addresses, hardware mapped registers (MMIO) should not be passed over virtio and there's usually really no reason to do that. This suggests you are setting an incorrect address in the guest driver or are forgetting to set the address field thereby causing a stale value to be read by QEMU. I suggest adding the following to qemu/hw/virtio.c:virtqueue_map_sg() right before the if statement that checks for failed memory map: fprintf(stderr, "addr " TARGET_FMT_plx " len " TARGET_FMT_plx " is_write %d\n", addr[i], len, is_write); Compare the addresses that QEMU is seeing with those you have given to virtio in the guest kernel. It should be possible to correlate the buffers that the guest wants to give the host with what QEMU sees. Let us know if you need any more help debugging. Stefan