From mboxrd@z Thu Jan 1 00:00:00 1970 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 457BEC433FE for ; Thu, 10 Nov 2022 17:11:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231296AbiKJRLk (ORCPT ); Thu, 10 Nov 2022 12:11:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230234AbiKJRL2 (ORCPT ); Thu, 10 Nov 2022 12:11:28 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70F2A45A1D for ; Thu, 10 Nov 2022 09:10:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668100228; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3XBNZVfwHOyxrKzEqgSDBaV/kDGeCsLaREPRXxkN8EM=; b=bSmu2RAUiPP+uyo1YY4ieRzl9cShG71GbLpnBxH2iT03EesUvtjp48uwtHrt5Mtdb/GbJx 3Bmk3RSSqk5MkKvhFrJaxVIH+zm8UugH4OueDyc3RVnqPvVn6Vday7YjCE1XwOVbwCt/Nc 337UpDRnVVttpGEttl8herIPp31QH1Y= Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-660-R0BBjPXYMumhLIIcIZ-KhA-1; Thu, 10 Nov 2022 12:10:27 -0500 X-MC-Unique: R0BBjPXYMumhLIIcIZ-KhA-1 Received: by mail-il1-f199.google.com with SMTP id s4-20020a056e02216400b003021b648144so1987533ilv.19 for ; Thu, 10 Nov 2022 09:10:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3XBNZVfwHOyxrKzEqgSDBaV/kDGeCsLaREPRXxkN8EM=; b=t1TBSXsYn5Vlf33ZUWFKWbQgZ7t3H89pVwvtqwNLS37hJo9fVP7tYTGuXBxPLwvzmj przbrkvIFSgQTJTbPSl6Pz1BUtfRE+keaizp4Z5oCE5WdmJ5wWciMYl0jU1vInDUF+2U ymsmNO+kB2wJpfGvBNuzynzNcY8l/WWPdDMQ1fzRpEshMkvmAaO8c16QlR2nXMfbPL/q 1mzyuESklwEytM3WNj1O4ERTPFGJKpfRv3zhraXk/s5kQjPdeQAG8P1n7OhqlfFyden1 C3M3GWEFzqrzo1ODgwOU9GvPo7iN/r+XWVdAnzPhj6uDoTdhuJV6XprhBHrI1ondZlwS fpCQ== X-Gm-Message-State: ACrzQf3B0mA/JxeViDiqWNIuFy3C7qZUCowlaG4Hay5jMT3F/MxKCMcM eMKpndkdXM0JvgSfML7Z59jGXxOOQz4cYsMiu6z5yMU1pTWMXWLLqKi4h92HuG2k1A9N/TLPHIC qictX/Yv/9MxC X-Received: by 2002:a05:6638:4413:b0:374:fbbe:2da6 with SMTP id bp19-20020a056638441300b00374fbbe2da6mr3149406jab.163.1668100226562; Thu, 10 Nov 2022 09:10:26 -0800 (PST) X-Google-Smtp-Source: AMsMyM5st2ROvi8y5IPXYSHhk18Mv2oS6m3aLQCRNeAm9L0KyqI2dN1lMnwqPxWnGmIZODwHu3sF6g== X-Received: by 2002:a05:6638:4413:b0:374:fbbe:2da6 with SMTP id bp19-20020a056638441300b00374fbbe2da6mr3149377jab.163.1668100226283; Thu, 10 Nov 2022 09:10:26 -0800 (PST) Received: from redhat.com ([38.15.36.239]) by smtp.gmail.com with ESMTPSA id m1-20020a924a01000000b002f9652849f6sm30029ilf.67.2022.11.10.09.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 09:10:25 -0800 (PST) Date: Thu, 10 Nov 2022 10:10:23 -0700 From: Alex Williamson To: "Tian, Kevin" Cc: Jason Gunthorpe , Alexander Gordeev , David Airlie , Tony Krowiak , "Christian Borntraeger" , Cornelia Huck , Daniel Vetter , Diana Craciun , "dri-devel@lists.freedesktop.org" , "Eric Auger" , Eric Farman , "Harald Freudenberger" , Vasily Gorbik , Heiko Carstens , "intel-gfx@lists.freedesktop.org" , "intel-gvt-dev@lists.freedesktop.org" , "iommu@lists.linux.dev" , Jani Nikula , "Jason Herne" , Joonas Lahtinen , Joerg Roedel , "kvm@vger.kernel.org" , "linux-s390@vger.kernel.org" , Longfang Liu , "Matthew Rosato" , Peter Oberparleiter , Halil Pasic , Robin Murphy , "Vivi, Rodrigo" , "Shameer Kolothum" , Sven Schnelle , Tvrtko Ursulin , Vineeth Vijayan , Will Deacon , Yishai Hadas , Zhenyu Wang , "Wang, Zhi A" , Lu Baolu , Nicolin Chen , "Liu, Yi L" Subject: Re: [PATCH v2 10/11] vfio: Make vfio_container optionally compiled Message-ID: <20221110101023.28e7a790.alex.williamson@redhat.com> In-Reply-To: References: <0-v2-65016290f146+33e-vfio_iommufd_jgg@nvidia.com> <10-v2-65016290f146+33e-vfio_iommufd_jgg@nvidia.com> <20221108152831.1a2ed3df.alex.williamson@redhat.com> <20221109101809.2ff08303.alex.williamson@redhat.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, 10 Nov 2022 06:57:57 +0000 "Tian, Kevin" wrote: > > From: Jason Gunthorpe > > Sent: Thursday, November 10, 2022 3:53 AM > > > > On Wed, Nov 09, 2022 at 10:18:09AM -0700, Alex Williamson wrote: > > > > > DPDK supports no-iommu mode. > > > > Er? Huh? How? I thought no-iommu was for applications that didn't do > > DMA? How is DPDK getting packets in/out without DMA? I guess it snoops > > in /proc/ or something to learn PFNs of mlock'd memory? > > iirc dpdk started with UIO plus various tricks (root privilege, hugepage, etc.) > to lock and learn PFN's from pagemap. Then when migrating it to vfio the > no-iommu option was introduced to provide UIO compatibility. IIRC, we essentially introduced no-iommu mode vfio because DPDK started pushing for extending interrupt support in uio-pci-generic. The UIO driver is also only meant for devices that don't do DMA, but obviously DPDK didn't care about that. Rather than extend UIO, we offered this no-iommu mode in vfio since we already had more extensive MSI support, were better able to impose restrictions on access to the device, and using the same device access makes the transition to proper IOMMU backed configurations more seamless. Thanks, Alex