From: Alex Williamson Subject: Re: [PATCH v3 2/2] vfio: add edid support to mbochs sample driver Date: Fri, 28 Sep 2018 06:49:41 -0600 Message-ID: <20180928064941.4fac51ef@t450s.home> References: <20180921083013.15028-1-kraxel@redhat.com> <20180921083013.15028-3-kraxel@redhat.com> <4b9847dd-c37d-1d5d-3343-7030e62894fb@nvidia.com> <20180928054056.vjqwxvaj7sjmsozh@sirius.home.kraxel.org> <646427f9-7bed-43aa-6aba-9b5e82eecb68@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Gerd Hoffmann , , , open list To: Kirti Wankhede Return-path: In-Reply-To: <646427f9-7bed-43aa-6aba-9b5e82eecb68@nvidia.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Fri, 28 Sep 2018 14:10:26 +0530 Kirti Wankhede wrote: > 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? No, region access mechanisms are self describing through the region info ioctl, it's left to the implementation to decide what to support. The region definition should not impose such a restriction. Thanks, Alex