Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp343024imm; Thu, 27 Sep 2018 22:43:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV631uNMYNjrwdNFoNIF+ZYOwgU2c97nUcNjDaELQcfYzdoX55depxpMNOCo8x5RWoOlgOtiq X-Received: by 2002:aa7:8895:: with SMTP id l21-v6mr2586527pfo.74.1538113383889; Thu, 27 Sep 2018 22:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538113383; cv=none; d=google.com; s=arc-20160816; b=z3D9Ha50njo4rtAH9dVI0Ad9dDO7Fy3ALypj3TBU/05sWsnGPyR2LU96kLUjryh/tY /itrxH0oI7vjX+NdU8mGxZP3dGXJmW75plyHEXkwIk8o/zJ0pkJOOSsMoia3yfbwqt0t kahY1KzphPMEnjU+GZrc2M0i+JDFV6MDDaZbpOTyOF/l7p/beMw7ZXMVo46igmNwm1xe c4ASH+v4gWv9B97CmsvfoxtBpKcc2C6JNfV9DXUtE9w/GTCrloYQMQBCKaJ06nioDCZJ 95MoqcECD7cRm+Tul9wE8QB4yWqb1op5QHntKrF0JwEsgW8DF3KFBGhFCBq2dHaH+6JG asjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fKQWjYdPljjPzf8R11ichvzuzv08B4nuNfeHI8oPwJ4=; b=YwWdyHVYV5O4ywbaWiGjQHf+ebQYvrIhngjeRgGOmEQBb2eot92TX/OBop/q9DzRBp v14Pq4piBVLtNmZYr5RzvaGoRbFI5aKnjRUGHl5BWNVc67FFYWlH8U8DUu8SmhixyH2V HKzn4PqJ0a9o2fPCncCe4gYwY6OqQnbt/AsFiUcq/2eQc6JqImhkqESlX8P98ayG9eSO 3SjSetMayorEjAY7+oSGSwd+XK3GZNYDKss4uA8HJE1mT0xWfAkjnZvVbBwVQrM3wcvC oZqR7Oago1YgFmBBqKw6iBmJhXoPQH0Wz1StEONak1abQRXzxwlxwNLHFY8QFV9sNhzZ nGDQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d28-v6si4090753pgn.203.2018.09.27.22.42.47; Thu, 27 Sep 2018 22:43:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728960AbeI1MDA (ORCPT + 99 others); Fri, 28 Sep 2018 08:03:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57648 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726271AbeI1MDA (ORCPT ); Fri, 28 Sep 2018 08:03:00 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 359A55F730; Fri, 28 Sep 2018 05:41:00 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06455600C1; Fri, 28 Sep 2018 05:40:58 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id EEE217724; Fri, 28 Sep 2018 07:40:56 +0200 (CEST) Date: Fri, 28 Sep 2018 07:40:56 +0200 From: Gerd Hoffmann To: Kirti Wankhede Cc: intel-gvt-dev@lists.freedesktop.org, Alex Williamson , kvm@vger.kernel.org, open list Subject: Re: [PATCH v3 2/2] vfio: add edid support to mbochs sample driver Message-ID: <20180928054056.vjqwxvaj7sjmsozh@sirius.home.kraxel.org> References: <20180921083013.15028-1-kraxel@redhat.com> <20180921083013.15028-3-kraxel@redhat.com> <4b9847dd-c37d-1d5d-3343-7030e62894fb@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4b9847dd-c37d-1d5d-3343-7030e62894fb@nvidia.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 28 Sep 2018 05:41:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + 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 > 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. cheers, Gerd