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 49F94C61DA4 for ; Mon, 20 Feb 2023 02:37:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229703AbjBTCh0 (ORCPT ); Sun, 19 Feb 2023 21:37:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbjBTChX (ORCPT ); Sun, 19 Feb 2023 21:37:23 -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 207B7976F for ; Sun, 19 Feb 2023 18:36:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676860600; 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: in-reply-to:in-reply-to:references:references; bh=+QRTKe9fslXsmMjbWLGC+1jCq193n05lX0twVp21S3I=; b=hsGpX6976hdhAd1NgH70VDZh0rG01tRZWoHcrTr3H/+aWtrTKiD15S/nkUTGEVJ3N6+cvo oqbg77tBv5eMvPLwey23tOajo+slchKYyv6Dm1KxJkIAiSfjMcQ65hw0h+iKPGfXg24KXO Nph51+kvI6djeAp4kWlnHXexl91LPfs= Received: from mail-oo1-f71.google.com (mail-oo1-f71.google.com [209.85.161.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-642-QNAicvuQNPmdo7STD02-8w-1; Sun, 19 Feb 2023 21:36:38 -0500 X-MC-Unique: QNAicvuQNPmdo7STD02-8w-1 Received: by mail-oo1-f71.google.com with SMTP id w16-20020a4ac190000000b005203424ccbbso472455oop.19 for ; Sun, 19 Feb 2023 18:36:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+QRTKe9fslXsmMjbWLGC+1jCq193n05lX0twVp21S3I=; b=8PH4gE6h94nltm7n+hKzWLvuTqdyw8UdX4S5eZqNcuD1+cXJPENl9ZUsCb8aN+mNAU vPXOwsyCb27HobIEaFWQu9EeNUFnEY7c8WZYnQMV30ajwVYjacG1Gq5PSkMg6O4+mlHi 60hZlOGsHBFpUUP0ang33BWyTosUvPRTGKTPDz7EgieSSHrdcf0w5cUoi2IQOHRIKpWn BOjUZg11x5Md1tsVJofMvkm/+S/UZ5oveJZMHJnugC/Fo0GKxqKPnXJhiVZy41t3terU QuPP8jCZNcM49TiCSATrXZnt87BbrODgAyish92ZCu6rm4Ued4IF7l81y5KeSbAJeJh0 z4OA== X-Gm-Message-State: AO0yUKVdmF0Ihzmo0bEdC1ASMLZ0CXunivEgK0k5fKIHR8RmyzAVglbn tLY+vZIsYNXVgbBrygJwe+E3d1ya9QIA1LteJfIjAtM8s91dSo/1yzt2s48iTiMEFuQEh440sFm MXPuX9wDPPxrhl/4yMC29rD0vwYbDk4qt/Z0JtiCS X-Received: by 2002:a05:6870:610c:b0:171:d1a1:c5cb with SMTP id s12-20020a056870610c00b00171d1a1c5cbmr212604oae.217.1676860598330; Sun, 19 Feb 2023 18:36:38 -0800 (PST) X-Google-Smtp-Source: AK7set+o/PIyYCf/r6enEsMKw/BDh3XyDsV2IO5FKzRCPBc/l0Kkzql2S6nZ1RAhn3rjmZd7RJyHVxQxAPtJc0uZzgY= X-Received: by 2002:a05:6870:610c:b0:171:d1a1:c5cb with SMTP id s12-20020a056870610c00b00171d1a1c5cbmr212592oae.217.1676860598109; Sun, 19 Feb 2023 18:36:38 -0800 (PST) MIME-Version: 1.0 References: <20230207120843.1580403-1-sunnanyong@huawei.com> <20230217051038-mutt-send-email-mst@kernel.org> In-Reply-To: <20230217051038-mutt-send-email-mst@kernel.org> From: Jason Wang Date: Mon, 20 Feb 2023 10:36:27 +0800 Message-ID: Subject: Re: [PATCH v2] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI To: "Michael S. Tsirkin" 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 17, 2023 at 6:11 PM Michael S. Tsirkin wrote: > > On Fri, Feb 17, 2023 at 01:35:59PM +0800, Jason Wang wrote: > > On Fri, Feb 17, 2023 at 8:15 AM 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.. > > > > Yes, but we probably need a patch for -stable. > > Hmm do we? this looks like it's enabling new platforms is not a bugfix... I think we haven't limited vDPA to any specific arch in the past? Thanks > > > > > > > Also the iommu_group_has_isolated_msi() check is missing on the vdpa > > > path, and it is missing the iommu ownership mechanism. > > > > Ok. > > > > > > > > Also which in-tree VDPA driver that uses the iommu runs on ARM? Please > > > > ifcvf and vp_vpda are two drivers that use platform IOMMU. > > > > Thanks > > > > > don't propose core changes for unmerged drivers. :( > > > > > > Jason > > > >