qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/7] [s390] reset avail and used index on reboot


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 4/7] [s390] reset avail and used index on reboot
Date: Thu, 26 Apr 2012 16:26:24 +0200

On 26.04.2012, at 15:56, Christian Borntraeger wrote:

>>> @@ -250,6 +251,12 @@ void s390_virtio_device_sync(VirtIOS390Device *dev)
>>>        vring = s390_virtio_next_ring(bus);
>>>        virtio_queue_set_addr(dev->vdev, i, vring);
>>>        virtio_queue_set_vector(dev->vdev, i, i);
>>> +        idx_addr = virtio_queue_get_avail_addr(dev->vdev, i) +
>>> +                     VIRTIO_VRING_AVAIL_IDX_OFFS;
>>> +        stw_phys(idx_addr, 0);
>>> +        idx_addr = virtio_queue_get_used_addr(dev->vdev, i) +
>>> +                     VIRTIO_VRING_USED_IDX_OFFS;
>>> +        stw_phys(idx_addr, 0);
>> 
>> Are you sure this is correct to do in the sync callback? The idea of "sync" 
>> was to have a callback that can be called every time config information 
>> changes.
>> 
>> That could even be something as simple as a byte changing in the virtio 
>> device specific config space. But because we don't get callbacks when the 
>> guest accesses them, we need to synchronize it with real memory.
> 
> Hmm, currently it is only called on init and virtio reset hypercall. Are you 
> talking about
> an intended user which is not yet finished?

It's about the intended idea behind the "sync", yeah. So far, all virtio 
devices are ok with a simple workflow, where they never touch the config space 
again once they're initialized. But we can't guarantee that this will always be 
the case.

How about resetting the queues only on reset?


Alex




reply via email to

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