Re: Questions about virtio DMA operations

2021-09-01 Thread Arnabjyoti Kalita
Thank you Peter. This makes it very clear. Best Regards, Arnabjyoti Kalita On Tue, Aug 31, 2021 at 3:32 PM Peter Maydell wrote: > > On Tue, 31 Aug 2021 at 05:48, Arnabjyoti Kalita > wrote: > > > > Dear Peter, > > > > I had a few additional questions with regards to dma_memory_map(). So, > >

Re: Questions about virtio DMA operations

2021-08-31 Thread Peter Maydell
On Tue, 31 Aug 2021 at 05:48, Arnabjyoti Kalita wrote: > > Dear Peter, > > I had a few additional questions with regards to dma_memory_map(). So, > let's say I record the buffer that has been written/read from the > disk. > > iov[num_sg].iov_base = dma_memory_map(vdev->dma_as, pa, , s_write ? >

Re: Questions about virtio DMA operations

2021-08-30 Thread Arnabjyoti Kalita
Dear Peter, I had a few additional questions with regards to dma_memory_map(). So, let's say I record the buffer that has been written/read from the disk. iov[num_sg].iov_base = dma_memory_map(vdev->dma_as, pa, , s_write ? DMA_DIRECTION_FROM_DEVICE :

Re: Questions about virtio DMA operations

2021-08-30 Thread Arnabjyoti Kalita
Thank you for the clarification, Peter. > This sounds to me like the wrong layer to do this. My first > stab at a design for this would be to record and replay > at the disk block API level. Yes, I did follow the upstream record-and-replay feature and did try it. I can see that it has used a

Re: Questions about virtio DMA operations

2021-08-30 Thread Peter Maydell
On Mon, 30 Aug 2021 at 03:30, Arnabjyoti Kalita wrote: > > > That's normal, yes, but you can't guarantee it. The guest can > > choose to program it to any physical memory it likes. > > Is it ? If this is indeterministic, my approach will obviously not > work. It's deterministic to the extent

Re: Questions about virtio DMA operations

2021-08-29 Thread Arnabjyoti Kalita
> That's normal, yes, but you can't guarantee it. The guest can > choose to program it to any physical memory it likes. Is it ? If this is indeterministic, my approach will obviously not work. Is the bounce buffer address determined at initial startup of the guest and does it always stay the same

Re: Questions about virtio DMA operations

2021-08-29 Thread Peter Maydell
On Sun, 29 Aug 2021 at 04:48, Arnabjyoti Kalita wrote: > > Thank you for the detailed explanation, Peter. It makes a lot of things clear > now. > > I see that the virtio block device is accessing guest physical memory that is > not backed by a device. That's normal, yes, but you can't

Re: Questions about virtio DMA operations

2021-08-28 Thread Arnabjyoti Kalita
Thank you for the detailed explanation, Peter. It makes a lot of things clear now. I see that the virtio block device is accessing guest physical memory that is *not* backed by a device. So that would mean, in the normal case, the guest physical memory is probably not being modified by

Re: Questions about virtio DMA operations

2021-08-28 Thread Peter Maydell
On Sat, 28 Aug 2021 at 13:03, Arnabjyoti Kalita wrote: > I am trying to understand how a virtio-block device updates "used" buffers in > the virtqueue. I intend to 'mimic' this process without the actual disk event > happening, by storing the used buffers and then re-using them later. I can >

Questions about virtio DMA operations

2021-08-28 Thread Arnabjyoti Kalita
Hello all, I am trying to understand how a virtio-block device updates "used" buffers in the virtqueue. I intend to 'mimic' this process without the actual disk event happening, by storing the used buffers and then re-using them later. I can see that the function *virtqueue_fill *is primarily