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 1FC4BC43334 for ; Wed, 6 Jul 2022 18:03:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233259AbiGFSDd (ORCPT ); Wed, 6 Jul 2022 14:03:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232578AbiGFSDd (ORCPT ); Wed, 6 Jul 2022 14:03:33 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E9071140FA for ; Wed, 6 Jul 2022 11:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657130610; 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=VBlFjIiB9ZC4gvoYyy90cQtMpZILwrGOgeqSFzZ8m1s=; b=W2+30qm6LRxDKb5EdriLGiSA/CyflO8u+BQB5X3bVkT7OUUc0NKLyx4dZEXaE2apbtdNIw O1FO/nhwIRDBfuQRDZsk7xwd/KLqhO1NtlB/x+q0oZRyGl9TEvTydgbxCEbFYeFxSPdtBi e96WT8CnIyhXG8KEAZyTp8UttNaqni4= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-252--b-f3zbaN5SwGw3ov3_o6g-1; Wed, 06 Jul 2022 14:03:29 -0400 X-MC-Unique: -b-f3zbaN5SwGw3ov3_o6g-1 Received: by mail-io1-f70.google.com with SMTP id t11-20020a6bdb0b000000b00674fd106c0cso8518067ioc.16 for ; Wed, 06 Jul 2022 11:03:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=VBlFjIiB9ZC4gvoYyy90cQtMpZILwrGOgeqSFzZ8m1s=; b=pTOyO+2GfzY0EGhEQre+UzKoYmqQMepQDC1L2ARiUV3UPLsLG3kQUl3OmnbJUNG/0J wgfOmzgmMJwxpghUyaieNBjgRiwZZP6rFm8XwNGdXLelrimX4t8+bZmPh9MUrRr3Si5j 1KXcNYV/uzei57viaZxXByxOymMOALITUaq3xhoIozLPOsonRBAhn8JJLHHhBe10IxB9 ZM20FgZTKSjfjhlAVhRwVd2FGTzxxWtRJ45JsZZOs1zJXgwSRFH5nZNIALt3E0SdZIdk i/i0aUCK3men/t70dC2mq93mg+7ssq1W48Ap74TL1rEmJ/m8inWvAqh/XgZULX3cL8eM tvFQ== X-Gm-Message-State: AJIora/3Oz3ko3lEBt/XRUkEKX11D8813DvCPLN0i1amO4W6/1qAnN8Y BJC0S5ObWUGSgwj7vWEGaaoKYt5+FVwhKp/6+F0njis/LLPec15NVa6S71E9mkRGi+0LPPTeLBY zOC1n11hcyC9tgnMsF4RxEw== X-Received: by 2002:a05:6638:218f:b0:33c:caf0:a61c with SMTP id s15-20020a056638218f00b0033ccaf0a61cmr26531497jaj.198.1657130608164; Wed, 06 Jul 2022 11:03:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tABH1Ic8RqUAALPXzLJn+RofmhnwMLRPJ18ZPWLjNFSi2aNVbpdWUQPpp6mJB+LAKijjE03g== X-Received: by 2002:a05:6638:218f:b0:33c:caf0:a61c with SMTP id s15-20020a056638218f00b0033ccaf0a61cmr26531473jaj.198.1657130607865; Wed, 06 Jul 2022 11:03:27 -0700 (PDT) Received: from redhat.com ([38.15.36.239]) by smtp.gmail.com with ESMTPSA id co14-20020a0566383e0e00b0033efe711a37sm1538401jab.35.2022.07.06.11.03.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 11:03:27 -0700 (PDT) Date: Wed, 6 Jul 2022 12:03:25 -0600 From: Alex Williamson To: Nicolin Chen Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v5 0/5] cover-letter: Simplify vfio_iommu_type1 attach/detach routine Message-ID: <20220706120325.4741ff34.alex.williamson@redhat.com> In-Reply-To: References: <20220701214455.14992-1-nicolinc@nvidia.com> <20220706114217.105f4f61.alex.williamson@redhat.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On Wed, 6 Jul 2022 10:53:52 -0700 Nicolin Chen wrote: > On Wed, Jul 06, 2022 at 11:42:17AM -0600, Alex Williamson wrote: > > > On Fri, 1 Jul 2022 14:44:50 -0700 > > Nicolin Chen wrote: > > > > > This is a preparatory series for IOMMUFD v2 patches. It enforces error > > > code -EMEDIUMTYPE in iommu_attach_device() and iommu_attach_group() when > > > an IOMMU domain and a device/group are incompatible. It also drops the > > > useless domain->ops check since it won't fail in current environment. > > > > > > These allow VFIO iommu code to simplify its group attachment routine, by > > > avoiding the extra IOMMU domain allocations and attach/detach sequences > > > of the old code. > > > > > > Worths mentioning the exact match for enforce_cache_coherency is removed > > > with this series, since there's very less value in doing that as KVM will > > > not be able to take advantage of it -- this just wastes domain memory. > > > Instead, we rely on Intel IOMMU driver taking care of that internally. > > > > > > This is on github: > > > https://github.com/nicolinc/iommufd/commits/vfio_iommu_attach > > > > How do you foresee this going in, I'm imagining Joerg would merge the > > first patch via the IOMMU tree and provide a topic branch that I'd > > merge into the vfio tree along with the remaining patches. Sound > > right? Thanks, > > We don't have any build dependency between the IOMMU change and > VFIO changes, yet, without the IOMMU one, any iommu_attach_group() > failure now would be a hard failure without a chance falling back > to a new_domain, which is slightly different from the current flow. > > For a potential existing use case that relies on reusing existing > domain, I think it'd be safer to have Joerg acking the first change > so you merge them all? Thank! Works for me, I'll look for buy-in + ack from Joerg. Thanks, Alex