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 DA109C6FD1E for ; Fri, 10 Mar 2023 09:55:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231269AbjCJJzH (ORCPT ); Fri, 10 Mar 2023 04:55:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230448AbjCJJyy (ORCPT ); Fri, 10 Mar 2023 04:54:54 -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 A5EFA99BDC for ; Fri, 10 Mar 2023 01:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678442030; 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=BJZ+haSRLZgV6ZdKradu2QUHXRi+jxvd6L7UDmrPOnQ=; b=d9cXpbYPZvVAan4JDepSbLnd7G2tffrlJi29x4zegDUBxSfuB40t53P2EiK33ZY/AxfnK4 gxgoCGUzWC+V7V7fzByVDjLSJZV6ZkgTV2LGCz5fHTtiRzlDMIeWq/Gjlv+yxMYmNRVSQ5 E2cqKrQrI/vD0nis8Ff9inp6K9KG494= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-FgS735voNzeQwjEbO0PPiA-1; Fri, 10 Mar 2023 04:53:49 -0500 X-MC-Unique: FgS735voNzeQwjEbO0PPiA-1 Received: by mail-ed1-f70.google.com with SMTP id da22-20020a056402177600b004c60694083eso6932605edb.5 for ; Fri, 10 Mar 2023 01:53:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678442028; h=in-reply-to:content-transfer-encoding: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=BJZ+haSRLZgV6ZdKradu2QUHXRi+jxvd6L7UDmrPOnQ=; b=lhvt5CjQDQvxOTGXPYDeROb6zzHskBV8wRitSz1UX6R/mrHtpeeHrqjf0bJHpe95bt oYKRP4BSHZb/VPSUCoM5+aevi6rKjQNbyuQlrHimSPTxceHQMEwD+XVPhIITtHrAeuIJ xdZgTFEw2lvrTEPgGRhTV0IIWwiNEHRfey8ShZfX6YYHzZu77BPbbF6iZquLzso5MA6Z PMWURJr7F4ciPE8f4MsWQ8cD7EZS3DsnvGd1VKM7mAhKnUThuY+TpZwdl6MSLfuqspvr QFRePJwwp3LYL/CvXYqd62ZLRrdu3Q8SZzlZ90434eMMFE5ilSA6Ai/KaPQpkwBTs3SM SrMw== X-Gm-Message-State: AO0yUKXnBz7CWDzX2QO0c75c4zuWQSMWxjVnXNJBFfSt4ty1hbXfKYQI h1m2w8WghVW6173/YmhUXlHTJisK8C8Df9rQ5Ld8RM+G36x+6neGO1xLdm3BgXm88BO6rITfR9o 3aLak7KqzDptb X-Received: by 2002:a17:907:c24c:b0:8af:2b57:b80f with SMTP id tj12-20020a170907c24c00b008af2b57b80fmr26919607ejc.55.1678442028257; Fri, 10 Mar 2023 01:53:48 -0800 (PST) X-Google-Smtp-Source: AK7set84hVHKVbQM3/doo56JfwRs1MHyLT3B6JMxFy3rht/7SrZaJgsFx7Yr+6LNKTCvUqzlg4M8yA== X-Received: by 2002:a17:907:c24c:b0:8af:2b57:b80f with SMTP id tj12-20020a170907c24c00b008af2b57b80fmr26919592ejc.55.1678442027988; Fri, 10 Mar 2023 01:53:47 -0800 (PST) Received: from redhat.com ([2.52.9.88]) by smtp.gmail.com with ESMTPSA id op7-20020a170906bce700b008e2dfc6382asm750509ejb.125.2023.03.10.01.53.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 01:53:47 -0800 (PST) Date: Fri, 10 Mar 2023 04:53:42 -0500 From: "Michael S. Tsirkin" To: Jason Wang Cc: Jason Gunthorpe , Nanyong Sun , joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, wangrong68@huawei.com, Cindy Lu Subject: Re: [PATCH v2] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI Message-ID: <20230310045100-mutt-send-email-mst@kernel.org> References: <20230207120843.1580403-1-sunnanyong@huawei.com> <20230217051158-mutt-send-email-mst@kernel.org> <20230310034101-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, Mar 10, 2023 at 05:45:46PM +0800, Jason Wang wrote: > On Fri, Mar 10, 2023 at 4:41 PM Michael S. Tsirkin wrote: > > > > On Mon, Feb 20, 2023 at 10:37:18AM +0800, Jason Wang wrote: > > > On Fri, Feb 17, 2023 at 8:43 PM Jason Gunthorpe wrote: > > > > > > > > On Fri, Feb 17, 2023 at 05:12:29AM -0500, Michael S. Tsirkin wrote: > > > > > On Thu, Feb 16, 2023 at 08:14:50PM -0400, Jason Gunthorpe wrote: > > > > > > On Tue, Feb 07, 2023 at 08:08:43PM +0800, Nanyong Sun wrote: > > > > > > > From: Rong Wang > > > > > > > > > > > > > > Once enable iommu domain for one device, the MSI > > > > > > > translation tables have to be there for software-managed MSI. > > > > > > > Otherwise, platform with software-managed MSI without an > > > > > > > irq bypass function, can not get a correct memory write event > > > > > > > from pcie, will not get irqs. > > > > > > > The solution is to obtain the MSI phy base address from > > > > > > > iommu reserved region, and set it to iommu MSI cookie, > > > > > > > then translation tables will be created while request irq. > > > > > > > > > > > > Probably not what anyone wants to hear, but I would prefer we not add > > > > > > more uses of this stuff. It looks like we have to get rid of > > > > > > iommu_get_msi_cookie() :\ > > > > > > > > > > > > I'd like it if vdpa could move to iommufd not keep copying stuff from > > > > > > it.. > > > > > > > > > > Absolutely but when is that happening? > > > > > > > > Don't know, I think it has to come from the VDPA maintainers, Nicolin > > > > made some drafts but wasn't able to get it beyond that. > > > > > > Cindy (cced) will carry on the work. > > > > > > Thanks > > > > Hmm didn't see anything yet. Nanyong Sun maybe you can take a look? > > Just to clarify, Cindy will work on the iommufd conversion for > vhost-vDPA, the changes are non-trivial and may take time. Before we > are able to achieve that, I think we still need something like this > patch to make vDPA work on software managed MSI platforms. > > Maybe Nanyong can post a new version that addresses the comment so far? > > Thanks Maybe but an ack from iommu maintainers will be needed anyway. Let's see that version, maybe split the export to a patch by itself to make the need for that ack clear. > > > > > > > > > > Please have people who need more iommu platform enablement to pick it > > > > up instead of merging hacks like this.. > > > > > > > > We are very close to having nested translation on ARM so anyone who is > > > > serious about VDPA on ARM is going to need iommufd anyhow. > > > > > > > > Jason > > > > > >