Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3111710ybi; Fri, 5 Jul 2019 02:07:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaaGMRL8PtuVxawtvlCRuAjsoDc4mzR+VQMIF4BwBcTFxcpp/BLUhbXDTRXV5GU9MS6Y2D X-Received: by 2002:a17:90a:8a0b:: with SMTP id w11mr3916191pjn.125.1562317635528; Fri, 05 Jul 2019 02:07:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562317635; cv=none; d=google.com; s=arc-20160816; b=SsAswn9UzTnNf0insAgdR353oNbXufkSI07CKy1JH+s+CkMeZdXHD11Q6kKkBZ+xOA hHv9W1tGmFYQJ8miYt8GRc1zJ3LVoXoWI+1iW6G/aW5Nf65mGff6pj7ksDmsFKZJdBOj IRWofbvgDnrJ3+/jQzI8pRQH2qHB9ygnfj5mBAdr/i4A0+YMsLnnQqiB8qvNEUqbMawf DbdJllqO9wiLc9EJncx4tugQw3uWNbDwWZbodYaHhmsWXy3bRkgDl6rheWMQY00Dg3wO VUhE6CNjHl7OsrmTBjhkb0qRzGkkDEJbNV8044kU46v9lEdkQf0kbR5cWLSOqFX7NPIk ozIg== 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=kG0lyPwYz7I1h3Ir2W6qrcNhtikOv8hWe6qQnG6jSLw=; b=FAZFF7E48MgCpvzSt1jnVD7jIKiXpg+473A3RSHH/97dz4QI+NicIEkcdODc0iKhxy qqz3ACFcTCpGKH2yK38RYQdokDp6TaQEI/CwwGI4pzlxer5MmmH34PAKbO0mIhS8DG+E t6SdytKjh0HO9uH0rRLKwAKUo1QVHws9iYjXPa/BVf5FW3SlWiw0ZnnH5AIGDzT+5/Pl bDU80SUGxHt28sKKWV6nuIwwNaSjMYSHxnyPcxnP74xv3GsvZLmCfnIJzMc3rfnCqFG6 Sn6flGgVQkG/7dTY84taZX4kCMko0uy0ENoLEjaXWRVvvqrcVJbbL2SfzWZTrgkeVItz avHw== 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 y92si8161369plb.209.2019.07.05.02.07.00; Fri, 05 Jul 2019 02:07:15 -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 S1728179AbfGEJGB (ORCPT + 99 others); Fri, 5 Jul 2019 05:06:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50654 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727441AbfGEJGB (ORCPT ); Fri, 5 Jul 2019 05:06:01 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CE86F30860A0; Fri, 5 Jul 2019 09:05:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-90.ams2.redhat.com [10.36.116.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B3281BC67; Fri, 5 Jul 2019 09:05:54 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4FE3116E32; Fri, 5 Jul 2019 11:05:53 +0200 (CEST) Date: Fri, 5 Jul 2019 11:05:53 +0200 From: Gerd Hoffmann To: Chia-I Wu Cc: ML dri-devel , Gurchetan Singh , David Airlie , Daniel Vetter , "open list:VIRTIO GPU DRIVER" , open list Subject: Re: [PATCH v6 15/18] drm/virtio: rework virtio_gpu_transfer_to_host_ioctl fencing Message-ID: <20190705090553.jx5zcdoxeimojq2i@sirius.home.kraxel.org> References: <20190702141903.1131-1-kraxel@redhat.com> <20190702141903.1131-16-kraxel@redhat.com> <20190704115138.ou77sb3rlrex67tj@sirius.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Fri, 05 Jul 2019 09:06:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 04, 2019 at 12:08:14PM -0700, Chia-I Wu wrote: > On Thu, Jul 4, 2019 at 4:51 AM Gerd Hoffmann wrote: > > > > Hi, > > > > > > convert_to_hw_box(&box, &args->box); > > > > if (!vgdev->has_virgl_3d) { > > > > virtio_gpu_cmd_transfer_to_host_2d > > > > - (vgdev, qobj, offset, > > > > + (vgdev, gem_to_virtio_gpu_obj(objs->objs[0]), offset, > > > > box.w, box.h, box.x, box.y, NULL); > > > > + virtio_gpu_array_put_free(objs); > > > Don't we need this in non-3D case as well? > > > > No, ... > > > > > > virtio_gpu_cmd_transfer_to_host_3d > > > > - (vgdev, qobj, > > > > + (vgdev, > > > > vfpriv ? vfpriv->ctx_id : 0, offset, > > > > - args->level, &box, fence); > > > > - reservation_object_add_excl_fence(qobj->base.base.resv, > > > > - &fence->f); > > > > + args->level, &box, objs, fence); > > > > ... 3d case passes the objs list to virtio_gpu_cmd_transfer_to_host_3d, > > so it gets added to the vbuf and released when the command is finished. > Why doesn't this apply to virtio_gpu_cmd_transfer_to_host_2d? Hmm, yes, makes sense to handle both the same way. With virgl=off qemu processes the commands from the guest synchronously, so it'll work fine as-is. So you can't hit the theoretical race window in practice. But depending on that host-side implementation detail isn't a good idea indeed. cheers, Gerd