Hi All,

Has anyone make virtio-vsock on xen work? My dm args as below:

virtio = [
'backend=0,type=virtio,device,transport=pci,bdf=05:00.0,backend_type=qemu,grant_usage=true'
]
device_model_args = [
'-D', '/home/root/qemu_log.txt',
'-d', 
'trace:*vsock*,trace:*vhost*,trace:*virtio*,trace:*pci_update*,trace:*pci_route*,trace:*handle_ioreq*,trace:*xen*',
'-device', 
'vhost-vsock-pci,iommu_platform=false,id=vhost-vsock-pci0,bus=pcie.0,addr=5.0,guest-cid=3']

During my test, it always return failure in dom0 kernel in below code:

vhost_transport_do_send_pkt {
...
               nbytes = copy_to_iter(hdr, sizeof(*hdr), &iov_iter);             
                   
                if (nbytes != sizeof(*hdr)) {                                   
                    
                        vq_err(vq, "Faulted on copying pkt hdr %x %x %x %px\n", 
nbytes, sizeof(*hdr),                        
__builtin_object_size(hdr, 0), &iov_iter);
                        kfree_skb(skb);                                         
                    
                        break;                                                  
                    
                }  
}

I checked copy_to_iter, it is copy data to __user addr, but it never pass, 
the copy to __user addr always return 0 bytes copied.

The asm code "sttr x7, [x6]" will trigger data abort, the kernel will run
into do_page_fault, but lock_mm_and_find_vma report it is VM_FAULT_BADMAP,
that means the __user addr is not mapped, no vma has this addr.

I am not sure what may cause this. Appreciate if any comments.

BTW: I tested blk pci, it works, so the virtio pci should work on my setup.

Thanks,
Peng.

Reply via email to