qemu-discuss
[Top][All Lists]
Advanced

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

Re: Questions about virtio DMA operations


From: Arnabjyoti Kalita
Subject: Re: Questions about virtio DMA operations
Date: Mon, 30 Aug 2021 08:00:09 +0530

> 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 during the guest execution?

> I'm not clear on what you're trying to do, but this doesn't
> sound like the right way to go to me.

So I am trying to record and replay virtio block disk I/O events. I
plan to record the disk I/O by recording the "used" buffers that the
virtio block device puts into the virtqueue after the actual disk I/O
is complete. So I am looking at the virtqueue_push function that
actually "fills" the virtqueue and notifies the guest if it wants to
raise an interrupt. I record the members of the "VirtQueueElement"
structure and was wondering if I should record the "in_sg" and
"out_sg" elements as they are involved in mapping and unmapping. I am
actually trying to understand if "in_sg" and "out_sg" would contain
valid buffered disk data and if there is a point in recording them.

During replay, all I would do is call virtqueue_push and pass in the
members of the "VirtQueueElement" structure that I recorded.

I hope this makes it clear. Thank you again for helping out, Peter.

Best Regards,
Arnabjyoti Kalita



On Sun, Aug 29, 2021 at 5:49 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Sun, 29 Aug 2021 at 04:48, Arnabjyoti Kalita
> <akalita@cs.stonybrook.edu> 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 guarantee it. The guest can
> choose to program it to any physical memory it likes.
>
> > Since I'm not doing a live migration, nor I am hot-unplugging the
> > memory DIMM and I just want "used" virtqueue buffers be written
> > to the guest memory, I can possibly just move forward without doing
> > an unmap() in this case.
>
> I'm not clear on what you're trying to do, but this doesn't
> sound like the right way to go to me.
>
> -- PMM



reply via email to

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