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 0AB05C48260 for ; Thu, 8 Feb 2024 15:42:39 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=c3yz1swJsflMh4HzVktZyqWhGNlPBzRE7fYYMa0WVUg=; b=ZCrRemqOVWZo+t 9HiOrVLwB8Zu74FjpdOpZaMgpCNOIsPzlzGK0wDS2ucJ4D04ETFfrq6wJy81zZhUXriAXH8GFP4W6 qCMfFOcHDD8bs9912sbm1I66AiSZ4eFrVdB1RU30tgfnA7NLqJiXRNekjB4ghVOtBDqX2g0qXS18+ YX4fbs3kwWT7KibwcBk+BsYWaDbUWCji62+BaXpIV/q5pwpSl3XBcRrkH8BuI6Rmvchep8K8qWSWU 75/sNMFKwshEROIqhFhEnG1tkFsHaDwSxORwDXANEelEQhXJ5F2MGYHyzDIw1d2EVRfYVFt4ePrUp iILBpWmoZAy0kIqtMTsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY6XZ-0000000ECBY-1hGq; Thu, 08 Feb 2024 15:42:17 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY6XX-0000000ECAV-0oRS for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2024 15:42:16 +0000 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3bfeb155d31so1004528b6e.1 for ; Thu, 08 Feb 2024 07:42:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1707406932; x=1708011732; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=EZJRasN3voplU9h3tHiXSxFIE9VtiGQfUESd73+6hoQ=; b=HE6yV870b/ZDh1svBQzlQdAI8HNYXvYZhl5ta04znvMMd9a579HD4w6SZC+tWSi4TB 0OVLbtbtkVS9VUNrkFQ47c7yiOiqplF5LsDkfnVHwWfKORtMefenN1G4zgPigHorZym+ 1BDPhYPmut6adWFZBZCXJ/JiVsPp6K0cqzjipAD5U8Bn+7UIEM1xIEA+ibSIL5OgNftz e90GqvWxrkS7Y1uBNtWX4MP9DIe3mv2MAwl1JkPoYnA/ovzzKuudEj452j6MIpReT3xB IJi4ieNPTmfAF5S2eCQffzeCJbn4sCerVE7S006IACM/Y8Om3Fd7A42TsXKg3VcGb5NY Ln0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707406932; x=1708011732; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EZJRasN3voplU9h3tHiXSxFIE9VtiGQfUESd73+6hoQ=; b=Vp9m6l+Cv3Aut1HKqodRey3fXFUTBZrlZAPWe0IXRHPLQZh88Ys3cTxzQlXCNYk4ve 2pGGsoCOApF8EJyc39utfArdHCPA702p2YqrzR751FWitDAKR0EiQWmL+d5KQ+snN+xP IcrxsFBnbjr0g6rQVEHQM21GEYUCrn97xN8lZGvHjJb9TJln9fOS2U03R85h76xAsri7 T46ztZbGJjeTA84PHISym7La2PI01xGo79M95mutMfrf/tpWPy5wpovYSSb3Lnj4Ceqv uuZtUxMGYJ3QNLv8FtkPekIv35/DP+yBXvbEzxJ5JkjST7IX+0tyJ4CHkPbiuCPqqsnz eIRQ== X-Forwarded-Encrypted: i=1; AJvYcCUnR00MxQW8KXxaEOORBsLhf5pHsc7hBD/uk5JN3FRG/M0RRGCPb+69MaOgKg+rDPFlZXS2ipZcdIeKUM04WEYrnO/AwF53kkuqTkKY1naQWfdBbu8= X-Gm-Message-State: AOJu0Yw0nBCgRyasYHbaNAAJXsuEIsgYMAwLhENCNkp8Z9ThRmEGxEwK TA0z0ME051XxV1nR/Eeo02X+JzCC74820KARJkIX29cVCv+F0DcIJhigQMFROp4= X-Google-Smtp-Source: AGHT+IE3PwfxQpURBGAAKaS3krlWGtNcCQFNQCbN63NLhkJIwKeSQRRw4QXog/PeEJJ9jtMeD7pbPQ== X-Received: by 2002:a05:6870:a549:b0:219:6e95:c0b with SMTP id p9-20020a056870a54900b002196e950c0bmr9212306oal.31.1707406932405; Thu, 08 Feb 2024 07:42:12 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUJRKIjOTasKsfvjMG41fg04Gz0N8nhUWcyJoueInvQQj1iWgoAI0nY50rdIYU8xWMPhvKfmuq3c9Sby/wV8segekKILQ9yhLUq1xIoDEYUkUfJt03JzScQHC1VvH4cfiroLmGzW07CPGzqv94eX9A2WbgOLad9lAKDmF7zEXJY1tQaY+USY4MyH+ArCgX50PFUXuVoeR4yFn7EaG+60KuYq0TVz60HhXknNfm5Zz7YzZTXEzV77E4ZWRmzFmrnQtd4aaZ7Gd+ejrROXK9Eb9q4yoIx14Bomks+X8zxEI1Tq/tTWuxGys7Ysi0+nxjO296l1W6GLgmF+VxI3SQ6DYqCWr/WpchzRutRQCJFBASfcXA4Rm+P0OV7j51wkihCQFJVDS/hHzWLflTcWcpOyW5rIVSb0lB5JWUBiphnWaxKfXnfl16OLYdWaJCU Received: from ziepe.ca (hlfxns017vw-142-68-80-239.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.80.239]) by smtp.gmail.com with ESMTPSA id eg50-20020a05687098b200b00210cc6cc9eesm777401oab.33.2024.02.08.07.42.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 07:42:11 -0800 (PST) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1rY6XS-00Etmp-Pg; Thu, 08 Feb 2024 11:42:10 -0400 Date: Thu, 8 Feb 2024 11:42:10 -0400 From: Jason Gunthorpe To: Shameer Kolothum , Sean Christopherson Cc: kvmarm@lists.linux.dev, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linuxarm@huawei.com, kevin.tian@intel.com, alex.williamson@redhat.com, maz@kernel.org, oliver.upton@linux.dev, will@kernel.org, robin.murphy@arm.com, jean-philippe@linaro.org, jonathan.cameron@huawei.com Subject: Re: [RFC PATCH v2 4/7] iommufd: Associate kvm pointer to iommufd ctx Message-ID: <20240208154210.GP31743@ziepe.ca> References: <20240208151837.35068-1-shameerali.kolothum.thodi@huawei.com> <20240208151837.35068-5-shameerali.kolothum.thodi@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240208151837.35068-5-shameerali.kolothum.thodi@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_074215_252908_C7DD3687 X-CRM114-Status: GOOD ( 15.07 ) 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: , 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 On Thu, Feb 08, 2024 at 03:18:34PM +0000, Shameer Kolothum wrote: > diff --git a/drivers/iommu/iommufd/iommufd_private.h b/drivers/iommu/iommufd/iommufd_private.h > index 991f864d1f9b..28ede82bb1a6 100644 > --- a/drivers/iommu/iommufd/iommufd_private.h > +++ b/drivers/iommu/iommufd/iommufd_private.h > @@ -16,6 +16,7 @@ struct iommu_domain; > struct iommu_group; > struct iommu_option; > struct iommufd_device; > +struct kvm; > > struct iommufd_ctx { > struct file *file; > @@ -27,6 +28,8 @@ struct iommufd_ctx { > /* Compatibility with VFIO no iommu */ > u8 no_iommu_mode; > struct iommufd_ioas *vfio_ioas; > + /* Associated KVM pointer */ > + struct kvm *kvm; > }; Associating the KVM with the entire iommufd is a big hammer, is this what we want to do? I know it has to be linked to domain allocation and the coming "viommu" object, and it is already linked to VFIO. It means we support one KVM per iommufd (which doesn't seem unreasonable, but also the first time we've had such a limitation) The other option would be to pass in the kvm to the individual sub objects. Kevin? Sean would you be OK with this approach considering your other series to try to make more of this private? Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel