Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1142587ybz; Wed, 22 Apr 2020 14:27:45 -0700 (PDT) X-Google-Smtp-Source: APiQypJjEO6hLmo1IGSJ6f7wAdYEKtblmuMGFhlDhh6nH8oGKl3JqEccR5UlBPk1uqdCS2FH5b5d X-Received: by 2002:a17:906:bcec:: with SMTP id op12mr270745ejb.245.1587590864904; Wed, 22 Apr 2020 14:27:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587590864; cv=none; d=google.com; s=arc-20160816; b=Zf7mZiK123H2H5ZPZKzlSJrb60qQV5MRtikg6LZB3G3ZSlfplNXT0stuPLwUeq09ci m/snRVfCStD9fXw3VPwsfe+MLh6/wuQwGNYRYk9Y6CXfW9TIc+Yw/YkmbbyFEuNDKK7A MKp3GK/B8X9rTC506jWENS0TMtF1vbsL+WTNmJ0+34ZC2KMSV9Iaa+g6VPpXel1JCyVZ SxxZ9opww53F2kh5BRGwE7YksppQAEl82Pw68KKDGPJGPFaX/iegpvHF7EBV7CfoP/t7 Fx68QLuLlMH9k1uLbF3xn1uuFLmyryFjfV1hb8lWKZWC6N1O/NE7xiaomkI6MH4Z56Wo 0S3Q== 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=yRWrSisQQpY8wbjXn0iTmjToXXRth4qPvwTQ6Ad/CXE=; b=nUs+0GpCMQTi65kCkLTKumzUkcWQRA0AvgC5BdYFJmIwk3YO4UGdzIC9jLX8M2QCX1 xLuj1A3ebHjw1cJqhCs6lDjfzqxIQGanYmmb6OkjiI0L7Snb8vRWJpSkRLdN7AfydIlL PlzzFwKh8xplY4EuWyTgLxsPQgzDmmWgq0//ateCjdEpZptrKVrccRQfoYxPQwR/I+Nd 8l0NF69IEF5b3f7a4HeMc/bsIVB6lsirtPvl2NfCvpjhEXDgE9Isz2OdLP5emHxv+mY1 YbnU28nvlwgqcUEF9ZNz8CTTrpwup2Mz/KWXO6wx7vLENz4WNSyPmG4OeL+xJjkjBCdR l7Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=hRjZLZSP; 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 p12si198911ejo.516.2020.04.22.14.27.22; Wed, 22 Apr 2020 14:27:44 -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=hRjZLZSP; 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 S1726457AbgDVVYY (ORCPT + 99 others); Wed, 22 Apr 2020 17:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726116AbgDVVYY (ORCPT ); Wed, 22 Apr 2020 17:24:24 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C293C03C1A9 for ; Wed, 22 Apr 2020 14:24:24 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id p16so2682910edm.10 for ; Wed, 22 Apr 2020 14:24:23 -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=yRWrSisQQpY8wbjXn0iTmjToXXRth4qPvwTQ6Ad/CXE=; b=hRjZLZSP41fQmWqXoFu0uMVGr5+fbRGYYJ7JqVPFOLUI80SYtPgeBODoIP+jTzQE0A LvwfljRzDnz0pqQ8XV/j4e65bWWxGRzcX9aqxFcYUyvsohgV9Mseeh1CoXzpmmoMqLm2 PZkr5FTjKeb2qsVvQ5ZZJ9tk212oX/dPiVnZid1lZ8QYGUa485x/l8p+YzNSfl0cfUCF UeksZGJll/cGu9FFxsvnhBJGh9020ED/FIg5bq4nehIIxxUZrzvqFOc4x6/cDEaKq2uo +eh7FmdGU69lMG24JYdqoMzep30dL/8nqK0gRu/ucI4iEQH2ICs8GXLYOaI5YdWaMtKV G0Hw== 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=yRWrSisQQpY8wbjXn0iTmjToXXRth4qPvwTQ6Ad/CXE=; b=EB/kCB3u6DV8FoqBvPrCIi8RYg9It3qXFu9cPnuWnJCOOlt6DWmG0kKUz2AZSbChBf w9itwbeA020z3ohdIJqdVR93m/TO8pgSDARn5WWc/EcO9ezyPe4imO5mYZKe1GO2rlmh JfvCAN4q//cRj0g4YVUpn/Anm3etT2k6jMaw2UXYvifhsD1vPMm/LzSPypA8TewZbDd8 YUh6Tzsp5lKlVpi9JFltRNGeNpvD7BZ2eR+0ZibrKnjBg8PifIRJecTIEJ4bYgcNfeUS yTm6qt+k6m8HwqNrBjf0akhJ+1DNoaNJhIvYkia1lbfsNXuG1vGVLJzJxJAR27yX5nzT I85w== X-Gm-Message-State: AGi0PubMFp1wkca2KH7JMYtdQLAC79DN8xitKfm1tD5JJQ4GLK4pvkI7 dJ/7YiGsf8IFEcXQN3iJ5jUL0iyDCfLoxzpv8SnTZg== X-Received: by 2002:a50:ee86:: with SMTP id f6mr498361edr.123.1587590662775; Wed, 22 Apr 2020 14:24:22 -0700 (PDT) MIME-Version: 1.0 References: <158751095889.36773.6009825070990637468.stgit@djiang5-desk3.ch.intel.com> <20200421235442.GO11945@mellanox.com> In-Reply-To: <20200421235442.GO11945@mellanox.com> From: Dan Williams Date: Wed, 22 Apr 2020 14:24:11 -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@intel.com, "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 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.