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 17FA2C433EF for ; Thu, 12 May 2022 17:28:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357030AbiELR2B (ORCPT ); Thu, 12 May 2022 13:28:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357028AbiELR2A (ORCPT ); Thu, 12 May 2022 13:28:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ADE2A994C8 for ; Thu, 12 May 2022 10:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652376478; h=from:from:reply-to: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=tCD+8lP+xu7DSPBX9O/+vBKxjmnHI/OPG8q73tAYrnQ=; b=TvN+aQBLFLfxLPR8eW2oWY6hztnqgAGQknqw0kIw3ImybpEbqAaeRInqJgEczVV7nFZX9D a1NeWE+9pkdT823YSOnIJTixzmrBLIvTmtkFmu7/Sutbe26V01KzRpro+KNuIypadHyX4c +LswKhVrAWI3h0A66Q5l6CaxPBzxPZE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-kPMfk2IuN-e0Fj_skP7TdQ-1; Thu, 12 May 2022 13:27:52 -0400 X-MC-Unique: kPMfk2IuN-e0Fj_skP7TdQ-1 Received: by mail-wm1-f71.google.com with SMTP id c125-20020a1c3583000000b0038e3f6e871aso1887766wma.8 for ; Thu, 12 May 2022 10:27:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=tCD+8lP+xu7DSPBX9O/+vBKxjmnHI/OPG8q73tAYrnQ=; b=OQhqoN+gGp2YWd07WDqzk8IVVL0EEq1Sb/bAMnoMHkDiCuLKKZLw/kVr9XOHe2GhcN Vk+6eXNAuhX6DtLAE8Z6NUiMewlX68Vhh93pEvJ2wBeXFvG37jh2ESUk63vDEtP4clVP tIXT2N1HCyOj8ZauF9bfziBrJwMh+L5FgpqbUfeBMXvJwYZ3/JOO9/vHpNpVQcQbmaCK otD8Ayqa89FXWRph8K5I1ko4aRl36wry5k8GDfedz79IiL4C8Jq0on7P5IpQx3NB0F4w jONuzlLWcpM3kaQr2wrkpYFGH55IfGSNdtOUP7YUru4TG28VmkLMlR1QCSoGzgRmGexp aFcw== X-Gm-Message-State: AOAM533CGrgy0jN2CnikTJCDYzMPRD+nVXvjXUyOCRZn1A5bAAytcA1e aeQMdADAUEvyLILfk1vi3iJu4fdHWMC5bYiktL57QuVwnWs7W+lpWRUCWMrxnofusKLpKV/AofJ 524mJQHOkjqO+ X-Received: by 2002:a5d:47a7:0:b0:20c:5b3e:ff7 with SMTP id 7-20020a5d47a7000000b0020c5b3e0ff7mr683062wrb.362.1652376470552; Thu, 12 May 2022 10:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3srJE4qB6x11g/cGuO/5n+uGKjdPkkRDRS6CiXRIBa/uR33ZYaYztU6Mw7Uixet5KfvEsQQ== X-Received: by 2002:a5d:47a7:0:b0:20c:5b3e:ff7 with SMTP id 7-20020a5d47a7000000b0020c5b3e0ff7mr683049wrb.362.1652376470345; Thu, 12 May 2022 10:27:50 -0700 (PDT) Received: from ?IPV6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id l7-20020a1ced07000000b0038eba413181sm3361695wmh.1.2022.05.12.10.27.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 10:27:49 -0700 (PDT) Message-ID: <5cdb2ddb-eef1-e522-d41d-7ba0facf6dd7@redhat.com> Date: Thu, 12 May 2022 19:27:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Reply-To: eric.auger@redhat.com Subject: Re: [PATCH] vfio: Remove VFIO_TYPE1_NESTING_IOMMU Content-Language: en-US To: Jason Gunthorpe , Robin Murphy Cc: Cornelia Huck , Alex Williamson , iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon , Vivek Kumar Gautam , Jean-Philippe Brucker References: <0-v1-0093c9b0e345+19-vfio_no_nesting_jgg@nvidia.com> <0e2f7cb8-f0d9-8209-6bc2-ca87fff57f1f@arm.com> <20220510181327.GM49344@nvidia.com> From: Eric Auger In-Reply-To: <20220510181327.GM49344@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi, On 5/10/22 20:13, Jason Gunthorpe wrote: > On Tue, May 10, 2022 at 06:52:06PM +0100, Robin Murphy wrote: >> On 2022-05-10 17:55, Jason Gunthorpe via iommu wrote: >>> This control causes the ARM SMMU drivers to choose a stage 2 >>> implementation for the IO pagetable (vs the stage 1 usual default), >>> however this choice has no visible impact to the VFIO user. Further qemu >>> never implemented this and no other userspace user is known. >>> >>> The original description in commit f5c9ecebaf2a ("vfio/iommu_type1: add >>> new VFIO_TYPE1_NESTING_IOMMU IOMMU type") suggested this was to "provide >>> SMMU translation services to the guest operating system" however the rest >>> of the API to set the guest table pointer for the stage 1 was never >>> completed, or at least never upstreamed, rendering this part useless dead >>> code. >>> >>> Since the current patches to enable nested translation, aka userspace page >>> tables, rely on iommufd and will not use the enable_nesting() >>> iommu_domain_op, remove this infrastructure. However, don't cut too deep >>> into the SMMU drivers for now expecting the iommufd work to pick it up - >>> we still need to create S2 IO page tables. >>> >>> Remove VFIO_TYPE1_NESTING_IOMMU and everything under it including the >>> enable_nesting iommu_domain_op. >>> >>> Just in-case there is some userspace using this continue to treat >>> requesting it as a NOP, but do not advertise support any more. >> I assume the nested translation/guest SVA patches that Eric and Vivek were >> working on pre-IOMMUFD made use of this, and given that they got quite far >> along, I wouldn't be too surprised if some eager cloud vendors might have >> even deployed something based on the patches off the list. thank you Robin for the heads up. > With upstream there is no way to make use of this flag, if someone is > using it they have other out of tree kernel, vfio, kvm and qemu > patches to make it all work. > > You can see how much is still needed in Eric's tree: > > https://github.com/eauger/linux/commits/v5.15-rc7-nested-v16 > >> I can't help feeling a little wary about removing this until IOMMUFD >> can actually offer a functional replacement - is it in the way of >> anything upcoming? > From an upstream perspective if someone has a patched kernel to > complete the feature, then they can patch this part in as well, we > should not carry dead code like this in the kernel and in the uapi. On the other end the code is in the kernel for 8 years now, I think we could wait for some additional weeks/months until the iommufd nested integration arises and gets tested. Thanks Eric > > It is not directly in the way, but this needs to get done at some > point, I'd rather just get it out of the way. > > Thanks, > Jason > 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 smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14628C433FE for ; Thu, 12 May 2022 17:28:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 9F82F82718; Thu, 12 May 2022 17:28:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6fHjQdLOD-kg; Thu, 12 May 2022 17:28:02 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6ED4182503; Thu, 12 May 2022 17:28:02 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 43D31C0039; Thu, 12 May 2022 17:28:02 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 881D8C002D for ; Thu, 12 May 2022 17:28:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 763E1402C6 for ; Thu, 12 May 2022 17:28:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gLDOXnBTSfUa for ; Thu, 12 May 2022 17:28:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id 64A22409F5 for ; Thu, 12 May 2022 17:28:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652376479; h=from:from:reply-to: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=tCD+8lP+xu7DSPBX9O/+vBKxjmnHI/OPG8q73tAYrnQ=; b=Q61b+iQ7rLu3HIFJqAStXbCCQ+k0zQbSRRgIiuGw6VxlmlKCKCzn56XCRnPVEBUW9TIrRn M1kwFHbycl39m8OXihISmes4BXeeCtHU1DfUio1uXiK2CSno6Scruc7AEc1Jnz7dQJt2o7 Xhza4eALAnIYsgyCL1byR390JThdS3c= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-6vmS73jNMHCiW5yOenaJ1g-1; Thu, 12 May 2022 13:27:51 -0400 X-MC-Unique: 6vmS73jNMHCiW5yOenaJ1g-1 Received: by mail-wm1-f72.google.com with SMTP id p24-20020a1c5458000000b003945d2ffc6eso1887921wmi.5 for ; Thu, 12 May 2022 10:27:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=tCD+8lP+xu7DSPBX9O/+vBKxjmnHI/OPG8q73tAYrnQ=; b=yhULKAzpM9V0jRTgEl6SX7C6zbjHIhouugAcVJAVySgb/nSPBxCoaC9VujDjBT8j9Q tRcV3CEpyliBbByjl+ZYSmciZeubB2ljcaTeW+tM2ozoZXhZ1iJFOEUdheJBQznP2rdN a2MFb4ADgyYAJnP5G0qAem0yWAr/yCGKMozgRr/9XunoXCBJlk29zSnB2FlFzsWQyliY basrXm8brJcPhu28yq1x+ZRd/WxFc7PB7MQhwBiBpfQq8jOoDa6S3eVzVGha6NpJME39 ggL6TR0bk8WlvdFJSDbyfiDEaRKH0WgjFiE+nVgC4tDr7/gwVVgC1Haw8ntansKNgoZX 7y8A== X-Gm-Message-State: AOAM530vNeJwm+gjmKCm8R555tMc6IHDi56G/1BUCTDV3nEfThsUJemf 0mjyma61PWp5pKhzIAN7Ut/kM8CupaajmWBiNtUGkgzehQ/C1xD+IDWAfn38LZDFiR2gjaKOX58 OEAHVvAfnQ7FlhbX6/EZvVS2VQReljw== X-Received: by 2002:a5d:47a7:0:b0:20c:5b3e:ff7 with SMTP id 7-20020a5d47a7000000b0020c5b3e0ff7mr683059wrb.362.1652376470552; Thu, 12 May 2022 10:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3srJE4qB6x11g/cGuO/5n+uGKjdPkkRDRS6CiXRIBa/uR33ZYaYztU6Mw7Uixet5KfvEsQQ== X-Received: by 2002:a5d:47a7:0:b0:20c:5b3e:ff7 with SMTP id 7-20020a5d47a7000000b0020c5b3e0ff7mr683049wrb.362.1652376470345; Thu, 12 May 2022 10:27:50 -0700 (PDT) Received: from ?IPV6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id l7-20020a1ced07000000b0038eba413181sm3361695wmh.1.2022.05.12.10.27.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 10:27:49 -0700 (PDT) Message-ID: <5cdb2ddb-eef1-e522-d41d-7ba0facf6dd7@redhat.com> Date: Thu, 12 May 2022 19:27:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] vfio: Remove VFIO_TYPE1_NESTING_IOMMU To: Jason Gunthorpe , Robin Murphy References: <0-v1-0093c9b0e345+19-vfio_no_nesting_jgg@nvidia.com> <0e2f7cb8-f0d9-8209-6bc2-ca87fff57f1f@arm.com> <20220510181327.GM49344@nvidia.com> From: Eric Auger In-Reply-To: <20220510181327.GM49344@nvidia.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Cc: Jean-Philippe Brucker , kvm@vger.kernel.org, Cornelia Huck , iommu@lists.linux-foundation.org, Vivek Kumar Gautam , Alex Williamson , Will Deacon , linux-arm-kernel@lists.infradead.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: eric.auger@redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" Hi, On 5/10/22 20:13, Jason Gunthorpe wrote: > On Tue, May 10, 2022 at 06:52:06PM +0100, Robin Murphy wrote: >> On 2022-05-10 17:55, Jason Gunthorpe via iommu wrote: >>> This control causes the ARM SMMU drivers to choose a stage 2 >>> implementation for the IO pagetable (vs the stage 1 usual default), >>> however this choice has no visible impact to the VFIO user. Further qemu >>> never implemented this and no other userspace user is known. >>> >>> The original description in commit f5c9ecebaf2a ("vfio/iommu_type1: add >>> new VFIO_TYPE1_NESTING_IOMMU IOMMU type") suggested this was to "provide >>> SMMU translation services to the guest operating system" however the rest >>> of the API to set the guest table pointer for the stage 1 was never >>> completed, or at least never upstreamed, rendering this part useless dead >>> code. >>> >>> Since the current patches to enable nested translation, aka userspace page >>> tables, rely on iommufd and will not use the enable_nesting() >>> iommu_domain_op, remove this infrastructure. However, don't cut too deep >>> into the SMMU drivers for now expecting the iommufd work to pick it up - >>> we still need to create S2 IO page tables. >>> >>> Remove VFIO_TYPE1_NESTING_IOMMU and everything under it including the >>> enable_nesting iommu_domain_op. >>> >>> Just in-case there is some userspace using this continue to treat >>> requesting it as a NOP, but do not advertise support any more. >> I assume the nested translation/guest SVA patches that Eric and Vivek were >> working on pre-IOMMUFD made use of this, and given that they got quite far >> along, I wouldn't be too surprised if some eager cloud vendors might have >> even deployed something based on the patches off the list. thank you Robin for the heads up. > With upstream there is no way to make use of this flag, if someone is > using it they have other out of tree kernel, vfio, kvm and qemu > patches to make it all work. > > You can see how much is still needed in Eric's tree: > > https://github.com/eauger/linux/commits/v5.15-rc7-nested-v16 > >> I can't help feeling a little wary about removing this until IOMMUFD >> can actually offer a functional replacement - is it in the way of >> anything upcoming? > From an upstream perspective if someone has a patched kernel to > complete the feature, then they can patch this part in as well, we > should not carry dead code like this in the kernel and in the uapi. On the other end the code is in the kernel for 8 years now, I think we could wait for some additional weeks/months until the iommufd nested integration arises and gets tested. Thanks Eric > > It is not directly in the way, but this needs to get done at some > point, I'd rather just get it out of the way. > > Thanks, > Jason > _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9982FC433EF for ; Thu, 12 May 2022 17:31:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References: Cc:To:Subject:MIME-Version:Date:Message-ID:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hQ8y/GhsEv0oujSnv6W+Aj4CWxb2+cx7B2YzDXTb8CM=; b=glq+YbZsSc0qKJ 5K66GY1QO1bpUX6yfCgVyEVl/TnOzV3BA2IcY/1yy/xTSiFPHLGFgD+WWDNFwL0dEwVdT4qiZUruY HpQS9oXgq4ZS7fgu4fB2GHdY5/WfITfzAjXSuWZzq0u1WbU9FCHMUbVo7ot8tbe+ipfQMKiCN/5h1 m45j/OPqkeF2+1mLGCobtBplv3T0/HAcbhDzN9mZg+EK8Hmd71ZkmDVprZqIeQGAz9IOHYr8I7pbn LW9yzNxlDgtO0oca/gzxdyrpsaLTKCxLe21VAgmdNycj6DLkqKt10Bw4NLieJeaB9r4K2ucm4NHHV 9Z5dJweKjBNvOMWslrsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1npCdc-00D0NV-Ju; Thu, 12 May 2022 17:30:08 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1npCdY-00D0MS-Il for linux-arm-kernel@lists.infradead.org; Thu, 12 May 2022 17:30:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652376601; h=from:from:reply-to: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=tCD+8lP+xu7DSPBX9O/+vBKxjmnHI/OPG8q73tAYrnQ=; b=PodV4x28Q9LeKjRKZUqb9PujjZgzjoaIZ8QbdvA6ZS7bffkOsVfLyaLL8YpFFmJRMZ4Ckn 5DeXDNHi4VOHO/+wU/pU8Jh5mDCd7e8w9U8bOSquPa0wlsVJg4dlQA2db4F5ofxiNAW8yt vwnd6lteIWAMQX0Atj+VkkI4CB/5gFM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-101-m_JJsEnONIKFgUyyMKuRAg-1; Thu, 12 May 2022 13:27:51 -0400 X-MC-Unique: m_JJsEnONIKFgUyyMKuRAg-1 Received: by mail-wm1-f72.google.com with SMTP id r186-20020a1c44c3000000b00393f52ed5ceso4662856wma.7 for ; Thu, 12 May 2022 10:27:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:reply-to :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=tCD+8lP+xu7DSPBX9O/+vBKxjmnHI/OPG8q73tAYrnQ=; b=Mwt00pHiFKYsmDzHt4sy7V1lns9gEHNDGm2zkRoAvve9MJa/+i6bGtrpN65SQkw7K/ 3srvcMGp87pTN5//gVC11HUH861cZujlEOFIEI/6XUdOWYBC9Y/vEVfeqHfcspQ7x2S7 HNEfM0pLRwuHHWrOrvgzlEQgUvOAlIZGbbniqBlZnX5GUjCn+ITH+VHmF8Ly061roBVl ggG+TWlpPJD8WlXVpBZ7W+0wn4oaqyaXYRG4RASmqH3clih7aihIs33CuLi8AOara4mP Ed6GZbDqYg+zR4xL2bf5Q15FdbRQ3tY8Spcre5JengZmhhcw9XVVjjMwFyq3tG0ElBSn rr7g== X-Gm-Message-State: AOAM533NfnVA9wsmcMGoFeOsTI3rQjaUXkyoo04wVRiP9s0XOzKEgiqN aCTzxkVKRyrFVUuOlFpgzlCC7aG1HHrrW4STDYlOHD/WvBkavugBH7n7UtuFusca5J7zOWoJRqe e3I9V9CUrthgQsC1yS9lr8TxTC/faSs2RYwo= X-Received: by 2002:a5d:47a7:0:b0:20c:5b3e:ff7 with SMTP id 7-20020a5d47a7000000b0020c5b3e0ff7mr683064wrb.362.1652376470553; Thu, 12 May 2022 10:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3srJE4qB6x11g/cGuO/5n+uGKjdPkkRDRS6CiXRIBa/uR33ZYaYztU6Mw7Uixet5KfvEsQQ== X-Received: by 2002:a5d:47a7:0:b0:20c:5b3e:ff7 with SMTP id 7-20020a5d47a7000000b0020c5b3e0ff7mr683049wrb.362.1652376470345; Thu, 12 May 2022 10:27:50 -0700 (PDT) Received: from ?IPV6:2a01:e0a:59e:9d80:527b:9dff:feef:3874? ([2a01:e0a:59e:9d80:527b:9dff:feef:3874]) by smtp.gmail.com with ESMTPSA id l7-20020a1ced07000000b0038eba413181sm3361695wmh.1.2022.05.12.10.27.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 10:27:49 -0700 (PDT) Message-ID: <5cdb2ddb-eef1-e522-d41d-7ba0facf6dd7@redhat.com> Date: Thu, 12 May 2022 19:27:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] vfio: Remove VFIO_TYPE1_NESTING_IOMMU To: Jason Gunthorpe , Robin Murphy Cc: Cornelia Huck , Alex Williamson , iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Will Deacon , Vivek Kumar Gautam , Jean-Philippe Brucker References: <0-v1-0093c9b0e345+19-vfio_no_nesting_jgg@nvidia.com> <0e2f7cb8-f0d9-8209-6bc2-ca87fff57f1f@arm.com> <20220510181327.GM49344@nvidia.com> From: Eric Auger In-Reply-To: <20220510181327.GM49344@nvidia.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=eric.auger@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220512_103004_727675_9ABFB327 X-CRM114-Status: GOOD ( 29.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: eric.auger@redhat.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 5/10/22 20:13, Jason Gunthorpe wrote: > On Tue, May 10, 2022 at 06:52:06PM +0100, Robin Murphy wrote: >> On 2022-05-10 17:55, Jason Gunthorpe via iommu wrote: >>> This control causes the ARM SMMU drivers to choose a stage 2 >>> implementation for the IO pagetable (vs the stage 1 usual default), >>> however this choice has no visible impact to the VFIO user. Further qemu >>> never implemented this and no other userspace user is known. >>> >>> The original description in commit f5c9ecebaf2a ("vfio/iommu_type1: add >>> new VFIO_TYPE1_NESTING_IOMMU IOMMU type") suggested this was to "provide >>> SMMU translation services to the guest operating system" however the rest >>> of the API to set the guest table pointer for the stage 1 was never >>> completed, or at least never upstreamed, rendering this part useless dead >>> code. >>> >>> Since the current patches to enable nested translation, aka userspace page >>> tables, rely on iommufd and will not use the enable_nesting() >>> iommu_domain_op, remove this infrastructure. However, don't cut too deep >>> into the SMMU drivers for now expecting the iommufd work to pick it up - >>> we still need to create S2 IO page tables. >>> >>> Remove VFIO_TYPE1_NESTING_IOMMU and everything under it including the >>> enable_nesting iommu_domain_op. >>> >>> Just in-case there is some userspace using this continue to treat >>> requesting it as a NOP, but do not advertise support any more. >> I assume the nested translation/guest SVA patches that Eric and Vivek were >> working on pre-IOMMUFD made use of this, and given that they got quite far >> along, I wouldn't be too surprised if some eager cloud vendors might have >> even deployed something based on the patches off the list. thank you Robin for the heads up. > With upstream there is no way to make use of this flag, if someone is > using it they have other out of tree kernel, vfio, kvm and qemu > patches to make it all work. > > You can see how much is still needed in Eric's tree: > > https://github.com/eauger/linux/commits/v5.15-rc7-nested-v16 > >> I can't help feeling a little wary about removing this until IOMMUFD >> can actually offer a functional replacement - is it in the way of >> anything upcoming? > From an upstream perspective if someone has a patched kernel to > complete the feature, then they can patch this part in as well, we > should not carry dead code like this in the kernel and in the uapi. On the other end the code is in the kernel for 8 years now, I think we could wait for some additional weeks/months until the iommufd nested integration arises and gets tested. Thanks Eric > > It is not directly in the way, but this needs to get done at some > point, I'd rather just get it out of the way. > > Thanks, > Jason > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel