From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FABD323E for ; Fri, 17 Feb 2023 10:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676628757; 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=7Y7MkPKxQ4b4S+E2uuEcl4fSWKwkp7IBI4B2vVLi24A=; b=ClxYJ0hn4Jr7aQog7ltNWg76fmRK3NOEJcdlPIUCrT/eKgm/RZhIgVxlnDvJ6LPyBg8ntL ksIYg6CX1U9lbF5oc5QZMsjJ9PfeDRQkVpWQTY+LVaHOxx0b1S910LUrvuYiopCwUSLPRp W2bpWxpRBZiHp8Snb9sY+6Cz35DhpcQ= 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.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-489-ARJrOc91MyyyO6Zrk9cW6Q-1; Fri, 17 Feb 2023 05:12:36 -0500 X-MC-Unique: ARJrOc91MyyyO6Zrk9cW6Q-1 Received: by mail-wm1-f72.google.com with SMTP id k2-20020a05600c1c8200b003dd41ad974bso417167wms.3 for ; Fri, 17 Feb 2023 02:12:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=7Y7MkPKxQ4b4S+E2uuEcl4fSWKwkp7IBI4B2vVLi24A=; b=Y74TOfzHHsYAzjk1S39KvjCUPyZ5NRi3tE+HRmtWR6vHECe7cbeuhONEUJvUgStu6+ E3wcCPrsMtDzYtgFwr5BR679qrOKvoDEuWT3s+/Byq5ws9JKAWQboL4vVPEl/XzQqkd7 iGOSK11cpk4zUAdj+FrlbjBW3v6z9p9TbXZeHVr0JQBTlOCDMEZP7v/92jfia50HxpvN JYsr/6zAG+iJIAL9M/asLZZoYDDrtYs9ubz3htUDEmLurIcliNmQsvQCXsI+9l7mZVKM 3YLsd2Rs2qzlm/+v2+SpNrJcbVdwgxoY/LRxc9mlHANsIu/GwdREtG7Dl5xG8IuX3CwB UCvQ== X-Gm-Message-State: AO0yUKWQmEtp+8bc6zrR6xaJq9t3YGIHUV0pPg8bE4cJiOC1AJ+3n/31 725Kke8qiA8EWOFXzV1HNn4PfG60Jyo2/bm5BLsoMIZOHAf0y9/B36XMmR9qpUlaf14ayqFh9vs wZtWUh4WFnRqHsKE= X-Received: by 2002:adf:f40b:0:b0:2c5:5ff8:93e5 with SMTP id g11-20020adff40b000000b002c55ff893e5mr6717183wro.44.1676628755108; Fri, 17 Feb 2023 02:12:35 -0800 (PST) X-Google-Smtp-Source: AK7set9h4wA736ZeMYva3jBcgfzObA1Ee5DxMQNCqSjLJtJ9uB6fqQFZuR5r1/3OYbU7YpGJ6GX0bQ== X-Received: by 2002:adf:f40b:0:b0:2c5:5ff8:93e5 with SMTP id g11-20020adff40b000000b002c55ff893e5mr6717163wro.44.1676628754834; Fri, 17 Feb 2023 02:12:34 -0800 (PST) Received: from redhat.com ([2.52.5.34]) by smtp.gmail.com with ESMTPSA id i3-20020a05600011c300b002c4061a687bsm3720864wrx.31.2023.02.17.02.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 02:12:34 -0800 (PST) Date: Fri, 17 Feb 2023 05:12:29 -0500 From: "Michael S. Tsirkin" To: Jason Gunthorpe Cc: Nanyong Sun , joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, jasowang@redhat.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 Subject: Re: [PATCH v2] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI Message-ID: <20230217051158-mutt-send-email-mst@kernel.org> References: <20230207120843.1580403-1-sunnanyong@huawei.com> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? > Also the iommu_group_has_isolated_msi() check is missing on the vdpa > path, and it is missing the iommu ownership mechanism. > > Also which in-tree VDPA driver that uses the iommu runs on ARM? Please > don't propose core changes for unmerged drivers. :( > > Jason