From patchwork Sat May 13 13:21:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi Liu X-Patchwork-Id: 13240171 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60D20C7EE25 for ; Sat, 13 May 2023 13:21:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238193AbjEMNVs (ORCPT ); Sat, 13 May 2023 09:21:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237878AbjEMNVq (ORCPT ); Sat, 13 May 2023 09:21:46 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D6A540EA; Sat, 13 May 2023 06:21:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683984105; x=1715520105; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qN4HM5ImPoRe5kczhtMbmX4n3XHxYESenqa+cBcxH44=; b=bA+hmX7UPhduKuPVqTf+52+yBen/jFN/5QdSjwenkIl1HYfgXen1f3ev 8fRLD8s3b9miJjzDZdsibO147ecRP+CJnenXz+2aAsOfTjuK7a0PN838S n3y5xHot6qc4w9Z9MiFTTuwyBeI1y0Eks4erhNoczRILMaACph5AYRCpM hU2BVROJQVRUX2fKFWlOMB5ZzWCfUtTNkZcDMx/n7hoZL6gNEzoOOETn+ TeVbKfSCviBDa5YhJxVO0aKUyDEXBzg2JNqeiWJGVWLvkQA9FXvC5BvAm /J0j9ErNzDpsy73Wkf/0FxhqBu5POs7TIbgdqmBOvKEnrEeIZpootLQhA A==; X-IronPort-AV: E=McAfee;i="6600,9927,10708"; a="416598981" X-IronPort-AV: E=Sophos;i="5.99,272,1677571200"; d="scan'208";a="416598981" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2023 06:21:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10708"; a="790126451" X-IronPort-AV: E=Sophos;i="5.99,272,1677571200"; d="scan'208";a="790126451" Received: from 984fee00a4c6.jf.intel.com ([10.165.58.231]) by FMSMGA003.fm.intel.com with ESMTP; 13 May 2023 06:21:43 -0700 From: Yi Liu To: alex.williamson@redhat.com, jgg@nvidia.com, kevin.tian@intel.com Cc: joro@8bytes.org, robin.murphy@arm.com, cohuck@redhat.com, eric.auger@redhat.com, nicolinc@nvidia.com, kvm@vger.kernel.org, mjrosato@linux.ibm.com, chao.p.peng@linux.intel.com, yi.l.liu@intel.com, yi.y.sun@linux.intel.com, peterx@redhat.com, jasowang@redhat.com, shameerali.kolothum.thodi@huawei.com, lulu@redhat.com, suravee.suthikulpanit@amd.com, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-s390@vger.kernel.org, xudong.hao@intel.com, yan.y.zhao@intel.com, terrence.xu@intel.com, yanting.jiang@intel.com, zhenzhong.duan@intel.com, clegoate@redhat.com Subject: [PATCH v5 04/10] vfio: Mark cdev usage in vfio_device Date: Sat, 13 May 2023 06:21:30 -0700 Message-Id: <20230513132136.15021-5-yi.l.liu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230513132136.15021-1-yi.l.liu@intel.com> References: <20230513132136.15021-1-yi.l.liu@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Use it to differentiate whether to report group_id or devid in the revised VFIO_DEVICE_GET_PCI_HOT_RESET_INFO ioctl. At this moment, no cdev path yet, so the vfio_device_cdev_opened() helper always returns false. Reviewed-by: Kevin Tian Signed-off-by: Yi Liu --- include/linux/vfio.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/vfio.h b/include/linux/vfio.h index 16fd04490550..a61130bc06a2 100644 --- a/include/linux/vfio.h +++ b/include/linux/vfio.h @@ -140,6 +140,11 @@ int vfio_iommufd_emulated_attach_ioas(struct vfio_device *vdev, u32 *pt_id); ((int (*)(struct vfio_device *vdev, u32 *pt_id)) NULL) #endif +static inline bool vfio_device_cdev_opened(struct vfio_device *device) +{ + return false; +} + /** * struct vfio_migration_ops - VFIO bus device driver migration callbacks *