mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kirti Wankhede <kwankhede@nvidia.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: <intel-gvt-dev@lists.freedesktop.org>,
	Alex Williamson <alex.williamson@redhat.com>,
	<kvm@vger.kernel.org>, open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] vfio: add edid support to mbochs sample driver
Date: Fri, 28 Sep 2018 14:10:26 +0530	[thread overview]
Message-ID: <646427f9-7bed-43aa-6aba-9b5e82eecb68@nvidia.com> (raw)
In-Reply-To: <20180928054056.vjqwxvaj7sjmsozh@sirius.home.kraxel.org>



On 9/28/2018 11:10 AM, Gerd Hoffmann wrote:
>>> +	case MBOCHS_EDID_REGION_INDEX:
>>> +		ext->base.argsz = sizeof(*ext);
>>> +		ext->base.offset = MBOCHS_EDID_OFFSET;
>>> +		ext->base.size = MBOCHS_EDID_SIZE;
>>> +		ext->base.flags = (VFIO_REGION_INFO_FLAG_READ  |
>>> +				   VFIO_REGION_INFO_FLAG_WRITE |
>>> +				   VFIO_REGION_INFO_FLAG_CAPS);
>>
>> Any reason to not to use _MMAP flag?
> 
> There is no page backing this.  Also it is not performance-critical,
> edid updates should be rare, so the extra code for mmap support doesn't
> look like it is worth it.
> 
> Also for the virtual registers (especially link_state) it is probably
> useful to have the write callback of the mdev driver called to get
> notified about the change.
> 
>> How would QEMU side code read this region? will it be always trapped?
> 
> qemu uses read & write syscalls (well, pread & pwrite actually).
> 
>> If vendor driver sets _MMAP flag, will QEMU side handle that case as well?
> 
> The current test branch doesn't, it expects read+write to work.
>   https://git.kraxel.org/cgit/qemu/log/?h=sirius/edid-vfio
> 

Ok.
Can you add a comment in vfio.h that this region is non-mmappable?

>> I think since its blob, edid could be read by QEMU using one memcpy
>> rather than adding multiple memcpy of 4 or 8 bytes.
> 
> From qemu it's a single pwrite syscall actually.  mbochs_write() splits
> it into 4 byte writes and calls mbochs_access() for each of them.  One
> could probably add a special case for the EDID blob to mbochs_write().
> But again: doesn't seem worth the effort given that edid updates should
> be a rare event.
> 

Ok.

Thanks,
Kirti

> cheers,
>   Gerd
> 

  reply	other threads:[~2018-09-28  8:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180921083013.15028-1-kraxel@redhat.com>
2018-09-21  8:30 ` [PATCH v3 1/2] vfio: add edid api for display (vgpu) devices Gerd Hoffmann
2018-09-21  8:30 ` [PATCH v3 2/2] vfio: add edid support to mbochs sample driver Gerd Hoffmann
2018-09-27 19:57   ` Kirti Wankhede
2018-09-27 20:17     ` Alex Williamson
2018-09-28  5:40     ` Gerd Hoffmann
2018-09-28  8:40       ` Kirti Wankhede [this message]
2018-09-28 12:49         ` Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=646427f9-7bed-43aa-6aba-9b5e82eecb68@nvidia.com \
    --to=kwankhede@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®