Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4216952pxj; Tue, 8 Jun 2021 09:05:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRM5s7VdVPPeUjGCJNNXN6N3oGkbb8DrEi8y68Hgavt7zAdZhsRSQVh5U9Mh+tV8acNPms X-Received: by 2002:aa7:c547:: with SMTP id s7mr25942176edr.239.1623168345766; Tue, 08 Jun 2021 09:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623168345; cv=none; d=google.com; s=arc-20160816; b=iaQ8h2U6aetOuEu9SPPIpnhRFsgBTnwEMXhi/ucuwZyxl2xtd9cflXQs0m1Lji1Mq2 Fs8dkPFneTyolFx96fpL9tNJMKRUDN01GoO2+iWllTlsacKF72r25q18Z+NH8z3e+0ge GPNop8z7LfafH/7a1hWVwWB1zSL9c+XP3Lc98WNx8WoZ7HSs3Mt++NDGfv+e3X93sGea Qvlr/PjvRHaL0bf9Mmrd5OBf8VRLIN+Ez61Q+9nW8nmZj38L8xKaKVQBlED8IzNI/pyv ffYpLl6RLOv1m7jwFISHStth+h7KKOJjnQePyoARUAXFCZUmHIJPePwkZJWJM4skgvgL K7gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=UQ3DsML59/5P2TafeJfu8qrJBGlnpnNMJr0s7tL0on8=; b=BCK1nIEQdxHgUCSAa3ndCuxLKOyMQ2CKgAeQx5/Coqmz3/c5KQqL78IQWQKGFxta2b UCCAIQo8LVw9cCeVWMI2/wdfuwsIQmZNy4N7jZFEzSMSFejnTcFXlQ4TWcbaaD2nHL4Y 5OSJ+MzWeJdfedtNWKA9jh6J9tPJQ4h5z+9mD9yLi5GzIaBe9rRyVUJTJr1PCJDFP48N 7qjBfjuW7QPrccrzn24SrNDubu4bX8uYpEmL7T+x3P8WsqQ1YYeNzF70ZgRaVUxJAhd+ rNsOYEf5++gS/Q2Us61xee/gp4+4HIgMpzmbztNKUE9ZV/aqFeuZscdNxnxmj+nPQ0xF HtBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si83195edv.199.2021.06.08.09.05.20; Tue, 08 Jun 2021 09:05:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233653AbhFHQE5 (ORCPT + 99 others); Tue, 8 Jun 2021 12:04:57 -0400 Received: from mga02.intel.com ([134.134.136.20]:17023 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233622AbhFHQEz (ORCPT ); Tue, 8 Jun 2021 12:04:55 -0400 IronPort-SDR: UHCdbKtlyzn3buLIOFpjiMite/E6YmGfQSrTuAX3WrHcW8fKHYlE5ST5LBak4pbGyJ6PCcrl2W TIb14BK3Lbpg== X-IronPort-AV: E=McAfee;i="6200,9189,10009"; a="191983999" X-IronPort-AV: E=Sophos;i="5.83,258,1616482800"; d="scan'208";a="191983999" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 09:03:00 -0700 IronPort-SDR: 3Hkk1m8f8AkixH/gVJ42Gf9agNRzt/9wcUiKjw6Zx6w4TBo3blVm+7zkpmi4pC5MWmUIocTLNv 2QHbM8wlTNuA== X-IronPort-AV: E=Sophos;i="5.83,258,1616482800"; d="scan'208";a="449574835" Received: from djiang5-mobl1.amr.corp.intel.com (HELO [10.254.189.206]) ([10.254.189.206]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2021 09:02:59 -0700 Subject: Re: [PATCH v6 00/20] Add VFIO mediated device support and DEV-MSI support for the idxd driver To: Jason Gunthorpe Cc: "Tian, Kevin" , Alex Williamson , Cornelia Huck , Kirti Wankhede , "tglx@linutronix.de" , "vkoul@kernel.org" , "Raj, Ashok" , "Dey, Megha" , "Pan, Jacob jun" , "Liu, Yi L" , "Lu, Baolu" , "Kumar, Sanjay K" , "Luck, Tony" , "Williams, Dan J" , "eric.auger@redhat.com" , "pbonzini@redhat.com" , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" References: <162164243591.261970.3439987543338120797.stgit@djiang5-desk3.ch.intel.com> <20210523232219.GG1002214@nvidia.com> <86cde154-37c7-c00d-b0c6-06b15b50dbf7@intel.com> <20210602231747.GK1002214@nvidia.com> <20210603014932.GN1002214@nvidia.com> <20210603214009.68fac0c4.alex.williamson@redhat.com> <168ee05a-faf4-3fce-e278-d783104fc442@intel.com> <20210607191126.GP1002214@nvidia.com> From: Dave Jiang Message-ID: Date: Tue, 8 Jun 2021 09:02:58 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210607191126.GP1002214@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/7/2021 12:11 PM, Jason Gunthorpe wrote: > On Mon, Jun 07, 2021 at 11:13:04AM -0700, Dave Jiang wrote: > >> So in step 1, we 'tag' the wq to be dedicated to guest usage and put the >> hardware wq into enable state. For a dedicated mode wq, we can definitely >> just register directly and skip the mdev step. For a shared wq mode, we can >> have multiple mdev running on top of a single wq. So we need some way to >> create more mdevs. We can either go with the existing established creation >> path by mdev, or invent something custom for the driver as Jason suggested >> to accomodate additional virtual devices for guests. We implemented the mdev >> path originally with consideration of mdev is established and has a known >> interface already. > It sounds like you could just as easially have a 'create new vfio' > file under the idxd sysfs.. Especially since you already have a bus > and dynamic vfio specific things being created on this bus. Will explore this and using of 'struct vfio_device' without mdev. > > Have you gone over this with Dan? > >> I think things become more complicated when we go from a dedicated wq to >> shared wq where the relationship of wq : mdev is 1 : 1 goes to 1 : N. Also >> needing to keep a consistent user config experience is desired, especially >> we already have such behavior since kernel 5.6 for host usages. So we really >> need try to avoid doing wq configuration differently just for "mdev" wqs. In >> the case suggested above, we basically just flipped the configuration steps. >> Mdev is first created through mdev sysfs interface. And then the device >> paramters are configured. Where for us, we configure the device parameter >> first, and then create the mdev. But in the end, it's still the hybrid mdev >> setup right? > So you don't even use mdev to configure anything? Yuk. > > Jason