Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2160786ybz; Thu, 23 Apr 2020 12:41:16 -0700 (PDT) X-Google-Smtp-Source: APiQypLwHpr9GIHJPOuEr07RQLZLuUTmJgXAjZanXisXChTgkL7eSmP/TMffau1gKKgkM1hgpMV2 X-Received: by 2002:a50:f29a:: with SMTP id f26mr4038358edm.79.1587670876822; Thu, 23 Apr 2020 12:41:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587670876; cv=none; d=google.com; s=arc-20160816; b=vTZ79H49g6uKj4ZbgCJeCDxYAXCHcvwr6/eEij+OqhQ//FSDEt+n+/GHIHMmvz7jRQ OQ/Zdn5UBMj8cpqp1BT21iJEnqjDlglDpQ36ls/wTRYSnOwmfDwbBM0qvR2190myHTpo nMPdzHl8qFOJ2L6VsB76X0Qi4b9fpjKZvJt5SET4LISNlogSqpjoQFfu04AYaAXuLHGv K2TaThfwONLkh6b6dhfQ0vapToO/M6BNJaqPvKhBwOVLtWMtCF9UgFY2NQokOl92U349 5BF03OdT43qEl37fLakUWPaYLaZH7mswhKtStaQOXPcs8hKJdQX3ob5xgoFWAv+hg0oX gnKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/h4lvV44/Iml02qdfcRqvKqVBnvX1oON2s+bwNOj3Oo=; b=BwCdAymAU7RirE3990LH7uBEWjQWPrZQxAEiZdjgoWmkHxVHwHi8juXpSc3tQMcaTX dDqZp8DoK9s38kGelEKUlIy6pG1AaNEqVaQ5Oy4zGm07FYsUJqFkwSbk0FVSoNUxTBIL 3clouFZmRb8c3/OuclIMqe79MRDti1PcukZsiJ7CJJO8JtJdrrs1DtlQs7Do/K6ZIbr9 e0OJeRhHHHoyE1l65rL/ClDpGjo1LxvT3PxC/hJFDtJxNiavtiDj8t5u5ZecwgJzxgpA cdh1LFUgU1ZZk94E+qr/90rrcnj20axsgtqQXmecYtMB1/J4aWCKXBAlkECzCsM1IQqP B98A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=YxC+xU+Y; 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 m7si1650337edv.557.2020.04.23.12.40.52; Thu, 23 Apr 2020 12:41:16 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=YxC+xU+Y; 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 S1728292AbgDWTSE (ORCPT + 99 others); Thu, 23 Apr 2020 15:18:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbgDWTSD (ORCPT ); Thu, 23 Apr 2020 15:18:03 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394DEC09B042 for ; Thu, 23 Apr 2020 12:18:03 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id p16so5225216edm.10 for ; Thu, 23 Apr 2020 12:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/h4lvV44/Iml02qdfcRqvKqVBnvX1oON2s+bwNOj3Oo=; b=YxC+xU+Y09HjuMPpDqSN8CmD+5az8mm18RjCYhdM+XS1opbZIxIdq1ASW+uaksEq8N YWVDSquZ2oZHTD3rMx/Fv3LiF9M0sbNrAonePEQmO2tHF47R3Jhw3JWt2x4yariAkye/ IeehzJLzL1tqzVZEY2W8ZhRc4R7ikPb4Pb1wGUqxsHISy4z/JSxkyRtFkM6xb+oUtO2C pthvnMpLyZ9WGuSsoMb92OWHMOTcvKIULmBfQbOrnoKDbj8+UxFk5eI5vWua9URK+L2G xRhMUseF/UJd5gRu5uRL7SSGBKYByz6SuJTU22ym9LoQk17TNjwh628AYdpe7Y9tHob+ 9aJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/h4lvV44/Iml02qdfcRqvKqVBnvX1oON2s+bwNOj3Oo=; b=hTptIu2J1c5RE435qSuTF5sbg0B973ttDTsCDPxu1XSj3AV8ZYZ0UvCsGkHJRCY/Qo OpO57uFoEakdLpHEWLV1ep0Vh5CiyFvfUETFpkOl0Vrvzp9FGD6mVewEAGOt9hB7rdlx kSDtO104zOIJXpVLoAIeqYGPe7x9S6il4OtXD7rOHfgjcTiT9sgAAIg4ZCQoI9ZluDxD aLd8nEbhCbACFznfN4eUs0d6+MEeZipx+hp3pn9eDqQ9ec1pMYGiVGyW3c2UQzwXzJag dtILokp4g6KLH49G+M0FQ7YJ4N4NikXKlHW+Z0tGKOtPGWKuWsMnE+hpLOlRbDWefD+H NKew== X-Gm-Message-State: AGi0PuaFSKLX1rdYrtc/M9BUJ+jAFTznjbnxxFJTxLLIoyh5+Eh2sEyL Of1yXm37V5f4gt+V/IcHguifOMmpBSUs8HHOb0/Rhw== X-Received: by 2002:a50:c3c2:: with SMTP id i2mr3938739edf.93.1587669481894; Thu, 23 Apr 2020 12:18:01 -0700 (PDT) MIME-Version: 1.0 References: <158751095889.36773.6009825070990637468.stgit@djiang5-desk3.ch.intel.com> <20200421235442.GO11945@mellanox.com> In-Reply-To: From: Dan Williams Date: Thu, 23 Apr 2020 12:17:50 -0700 Message-ID: Subject: Re: [PATCH RFC 00/15] Add VFIO mediated device support and IMS support for the idxd driver. To: Jason Gunthorpe Cc: Dave Jiang , Vinod Koul , Megha Dey , maz@kernel.org, Bjorn Helgaas , "Rafael J. Wysocki" , Greg KH , Thomas Gleixner , "H. Peter Anvin" , Alex Williamson , Jacob jun Pan , "Raj, Ashok" , Yi L Liu , Baolu Lu , "Tian, Kevin" , Sanjay K Kumar , "Luck, Tony" , Jing Lin , kwankhede@nvidia.com, eric.auger@redhat.com, parav@mellanox.com, dmaengine@vger.kernel.org, Linux Kernel Mailing List , X86 ML , linux-pci@vger.kernel.org, KVM list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 2:24 PM Dan Williams wrote: > > On Tue, Apr 21, 2020 at 4:55 PM Jason Gunthorpe wrote: > > > > On Tue, Apr 21, 2020 at 04:33:46PM -0700, Dave Jiang wrote: > > > The actual code is independent of the stage 2 driver code submission that adds > > > support for SVM, ENQCMD(S), PASID, and shared workqueues. This code series will > > > support dedicated workqueue on a guest with no vIOMMU. > > > > > > A new device type "mdev" is introduced for the idxd driver. This allows the wq > > > to be dedicated to the usage of a VFIO mediated device (mdev). Once the work > > > queue (wq) is enabled, an uuid generated by the user can be added to the wq > > > through the uuid sysfs attribute for the wq. After the association, a mdev can > > > be created using this UUID. The mdev driver code will associate the uuid and > > > setup the mdev on the driver side. When the create operation is successful, the > > > uuid can be passed to qemu. When the guest boots up, it should discover a DSA > > > device when doing PCI discovery. > > > > I'm feeling really skeptical that adding all this PCI config space and > > MMIO BAR emulation to the kernel just to cram this into a VFIO > > interface is a good idea, that kind of stuff is much safer in > > userspace. > > > > Particularly since vfio is not really needed once a driver is using > > the PASID stuff. We already have general code for drivers to use to > > attach a PASID to a mm_struct - and using vfio while disabling all the > > DMA/iommu config really seems like an abuse. > > > > A /dev/idxd char dev that mmaps a bar page and links it to a PASID > > seems a lot simpler and saner kernel wise. > > > > > The mdev utilizes Interrupt Message Store or IMS[3] instead of MSIX for > > > interrupts for the guest. This preserves MSIX for host usages and also allows a > > > significantly larger number of interrupt vectors for guest usage. > > > > I never did get a reply to my earlier remarks on the IMS patches. > > > > The concept of a device specific addr/data table format for MSI is not > > Intel specific. This should be general code. We have a device that can > > use this kind of kernel capability today. > > This has been my concern reviewing the implementation. IMS needs more > than one in-tree user to validate degrees of freedom in the api. I had > been missing a second "in-tree user" to validate the scope of the > flexibility that was needed. Hey Jason, Per Megha's follow-up can you send the details about that other device and help clear a path for a device-specific MSI addr/data table format. Ever since HMM I've been sensitive, perhaps overly-sensitive, to claims about future upstream users. The fact that you have an additional use case is golden for pushing this into a common area and validating the scope of the proposed API.