Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1370233ybg; Fri, 18 Oct 2019 16:55:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyRIjeh+unryGG2MD83iV5yM64Aw56QT83mOTnjAk7cKjaKIsEoG1eYe2nA6wzn8+HwyimH X-Received: by 2002:a17:906:6a4a:: with SMTP id n10mr11195782ejs.23.1571442933949; Fri, 18 Oct 2019 16:55:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571442933; cv=none; d=google.com; s=arc-20160816; b=o9O7xI6xmJvMrHwiEcfjv+Qt8DKbGRwLXxdJAwsAtosAuxok9dwPkVWLsIf1uz3vpy YVDDDpcO+nN7IJSHPfthkl2TXLUDfCfw/KOpHzv+rfX6jmHQbl9GWV7iMngFLfBUyr9m 4t3usgu9mh/qSLd6C8TDTBHdbt4BT8X8sF9sqm8rmhzJB6rPaAj3PzLpRoljOGfBVIJM M5F2EVmn+bIj6DYE2ux990Jlwv0tCdXFdZkMlSCaJGjIziPVzOJ09GCjOEWYTKzIo04B Jndujbx1wqfynpaW6JnRu2hrEBkS5sDIXrmi2DCC7tB71gI5cSnTNaNXwXREcpk0M5/3 ZhaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=dTYcvUfYHTTIZDL5B13TMzcwrjn43vWrXUFQr/kgeTM=; b=naDiW6nSoTvWHkkp0mlYy4d1qh52B4NwJfeyoSqC2WftoxepkiJsYJCx3lzUEkz4GT wF6I6ZEFZou0wMDnYuzSxLIMWsDxBWpoqB/V1swHlWXJgsm/m2xgwapE3ekUoOHV+xUf W7pxA4KO7YdkLNSO+E3liG7kKYZ8a6abu831vbghADQqk0XwPCCoqQWJ3D5i36NU/2bV mjH1b0/7j8Za5S6jZJvTFPI38Z8mXAwJrzquBiU7IqejQ1mDbElcJCem7C/647nOJ3lB pIgeDc6aL0fn69y70erDoq9d6ia80S54gIFh/C3A/FekTnfCPniGSeK4nWCpfV4oLvOG uUAQ== 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 oz20si4231226ejb.436.2019.10.18.16.55.09; Fri, 18 Oct 2019 16:55:33 -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 S2393996AbfJRHgA (ORCPT + 99 others); Fri, 18 Oct 2019 03:36:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60296 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727388AbfJRHgA (ORCPT ); Fri, 18 Oct 2019 03:36:00 -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 148FC3071D99; Fri, 18 Oct 2019 07:36:00 +0000 (UTC) Received: from [10.72.12.183] (ovpn-12-183.pek2.redhat.com [10.72.12.183]) by smtp.corp.redhat.com (Postfix) with ESMTP id 249DB5D712; Fri, 18 Oct 2019 07:35:37 +0000 (UTC) Subject: Re: [PATCH V4 4/6] mdev: introduce virtio device and its device ops To: Alex Williamson Cc: kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, kwankhede@nvidia.com, mst@redhat.com, tiwei.bie@intel.com, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, cohuck@redhat.com, maxime.coquelin@redhat.com, cunming.liang@intel.com, zhihong.wang@intel.com, rob.miller@broadcom.com, xiao.w.wang@intel.com, haotian.wang@sifive.com, zhenyuw@linux.intel.com, zhi.a.wang@intel.com, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, airlied@linux.ie, daniel@ffwll.ch, farman@linux.ibm.com, pasic@linux.ibm.com, sebott@linux.ibm.com, oberpar@linux.ibm.com, heiko.carstens@de.ibm.com, gor@linux.ibm.com, borntraeger@de.ibm.com, akrowiak@linux.ibm.com, freude@linux.ibm.com, lingshan.zhu@intel.com, idos@mellanox.com, eperezma@redhat.com, lulu@redhat.com, parav@mellanox.com, christophe.de.dinechin@gmail.com, kevin.tian@intel.com, stefanha@redhat.com References: <20191017104836.32464-1-jasowang@redhat.com> <20191017104836.32464-5-jasowang@redhat.com> <20191017115329.47d4a165@x1.home> From: Jason Wang Message-ID: <24a96fca-926d-38ee-4dab-5f3715ef1433@redhat.com> Date: Fri, 18 Oct 2019 15:35:34 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191017115329.47d4a165@x1.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US 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.47]); Fri, 18 Oct 2019 07:36:00 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/10/18 上午1:53, Alex Williamson wrote: > On Thu, 17 Oct 2019 18:48:34 +0800 > Jason Wang wrote: > >> This patch implements basic support for mdev driver that supports >> virtio transport for kernel virtio driver. >> >> Signed-off-by: Jason Wang >> --- >> drivers/vfio/mdev/mdev_core.c | 12 +++ >> include/linux/mdev.h | 4 + >> include/linux/virtio_mdev.h | 151 ++++++++++++++++++++++++++++++++++ >> 3 files changed, 167 insertions(+) >> create mode 100644 include/linux/virtio_mdev.h >> >> diff --git a/drivers/vfio/mdev/mdev_core.c b/drivers/vfio/mdev/mdev_core.c >> index d0f3113c8071..5834f6b7c7a5 100644 >> --- a/drivers/vfio/mdev/mdev_core.c >> +++ b/drivers/vfio/mdev/mdev_core.c >> @@ -57,6 +57,18 @@ void mdev_set_vfio_ops(struct mdev_device *mdev, >> } >> EXPORT_SYMBOL(mdev_set_vfio_ops); >> >> +/* Specify the virtio device ops for the mdev device, this >> + * must be called during create() callback for virtio mdev device. >> + */ >> +void mdev_set_virtio_ops(struct mdev_device *mdev, >> + const struct virtio_mdev_device_ops *virtio_ops) >> +{ >> + BUG_ON(mdev->class_id); > Nit, this one is a BUG_ON, but the vfio one is a WARN_ON. Thanks, > > Alex Let me fix in next version. Thanks