qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v12 09/13] virtio-iommu: Implement fault reporting


From: Peter Xu
Subject: Re: [PATCH v12 09/13] virtio-iommu: Implement fault reporting
Date: Wed, 15 Jan 2020 10:04:42 -0500

On Wed, Jan 15, 2020 at 02:12:20PM +0100, Auger Eric wrote:
> >> +static void virtio_iommu_report_fault(VirtIOIOMMU *viommu, uint8_t reason,
> >> +                                      int flags, uint32_t endpoint,
> >> +                                      uint64_t address)
> >> +{

[...]

> >> +        if (iov_size(elem->in_sg, elem->in_num) < sizeof(fault)) {
> >> +            virtio_error(vdev, "error buffer of wrong size");
> >> +            virtqueue_detach_element(vq, elem, 0);
> >> +            g_free(elem);
> >> +            continue;
> > 
> > If virtio_error(), should we stop rather than continue?
> My understanding is the buffer just popped had a wrong size so it is not
> usable. We skip it we try to use another one if any. Does it make sense?

I'm not very familiar to virtio, but I see that virtio_error marks
vdev->broken to true.  If with that iiuc the next virtqueue_pop() will
fail directly (see the first call to virtio_device_disabled in
virtqueue_pop).  Then I don't see why retry any more...

Thanks,

-- 
Peter Xu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]