Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp854559lqh; Thu, 28 Mar 2024 20:58:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxgIB9q0RdnUl3sldNXO2UVhCcAT0wPTlOPivE2pQ1GTmUi1yJrOWKRKqpBayRVb937uN7wwzRVB61YdLCZcvZTHiE0rvp4v9v/BufeA== X-Google-Smtp-Source: AGHT+IFM1s1mcFrtrcxK7rP6o9EyG8NBxMRlie0qWIwsW02qLib+GLo35o3xPIXSzLlwTkFABOVi X-Received: by 2002:a17:90b:291:b0:29d:dd9c:baaf with SMTP id az17-20020a17090b029100b0029ddd9cbaafmr6101336pjb.14.1711684689294; Thu, 28 Mar 2024 20:58:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711684689; cv=pass; d=google.com; s=arc-20160816; b=JuoKMacvOiG2s2wzwxbnq+P22mskIX2VyFoEQTYRd8Oi+7KdQxWdxrtU7k/1NcWAwp tBdOxo8PHyN683+b1tWM3HXukUVEDeAvlf1XkBh+u37cLlFsv7TnWRddf2u1rqnMyB/y S7tiEg5AXQhQGDnQthEGfQDEZzuTEk7t1fKQuEiIWovRjC0zBycm3mWgZVyWNU8AiCm2 6mbFEgVYqGbHk1zk+o1ThH6XH/h5FOECckqyDrVW1za01EBJzGF0GQaXBb5iIUdMwEY+ 6IaQ/aZwZnkdvNJLmFVOsLTStj4zESGtlbV3CddLNc26nw/M8nQLMWPgqJxDtqt9bMwd JO4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=LJdVzIjhdB6S/DcfelzDKPP9Yk+5ga0skvUpr5ygfQM=; fh=Cld2Cc9BbsvkHPpuyLVe0F8AGQB1XrdhJSX2YuEMfHA=; b=sdiBLtENG71gd61wIHKL06U1gafD4mjRBNI24C8XRFi8ALhqDREZ24n0Or4VUw/pVp fHzymWiAzFOWocRuoR/TpDAXvMquju+0N7kBLs/6g0whWz2iU7e/g8oWt3Dl93+iGOzs oAfIOJDOkAgunsWIVjlyXb6p0ToC5y8YVJyB6BBr9zlIXpPr9dIpkDfcte70U8/WOVCV ja2nxKgH3VDxP+TWxXy/cu35qYHmVMDbCNXoCunY6ttLLKLMmb45gracKFqX5xKq+KO+ vEPZeBR4H9BfVowWpuv5RAoKjs0Au9xunij8SEuY5HKFyZx6GmXRYqQQxJ8JE30dHRcX XmGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gyGiD1Wy; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-124098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bx11-20020a17090af48b00b0029ac787c384si2881485pjb.123.2024.03.28.20.58.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 20:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-124098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gyGiD1Wy; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-124098-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-124098-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 31CDEB224F6 for ; Fri, 29 Mar 2024 03:56:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 555CC3A27B; Fri, 29 Mar 2024 03:56:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gyGiD1Wy" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 0A4BA2E821 for ; Fri, 29 Mar 2024 03:56:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711684569; cv=none; b=govpa6lrMddnbGUEFCUNpDjeGx/clqpVqOqHTp0l110g0g5vDjH0OpN/q8nNsrbVBLmKGGhnYMbfJHJFFFYV1PymCgXdJUcPIL0tz5Tqtiav3eNxGFBLHRiXXbQZDR4E44nP+EUahPWLSDOW/L5jrF4S7DvjkitaQqf+kBfd7BE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711684569; c=relaxed/simple; bh=LJdVzIjhdB6S/DcfelzDKPP9Yk+5ga0skvUpr5ygfQM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fZjQ4qyqcI9szq1ZaNZDLAWZEw9tYxvLGaJrFujtMcc4Sg4Bl2dWh9wfhmkbfZ7n2diq/cEW8qI0NZyw7makpyrnEJnfK2DhYP/mzEn7TVPqNQo8whvRx8aGlHjNNNgUCvLw8X2AJm6jVe8H8nLrb8+ydrIDTtCEWEX7+A6Umrc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=gyGiD1Wy; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711684566; 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=LJdVzIjhdB6S/DcfelzDKPP9Yk+5ga0skvUpr5ygfQM=; b=gyGiD1Wyt+1Jhi83kuzdCNeLA3KxmqJ6x+wJBZW3eahEfRuahfIEzaDFnCPrGqTeCp71QT 3VCLYRE5BmjaoJKw4pS0ME+helrX6ZlWXWrNCV5f8mjBN0eb7XcmbBzcOnOb3AefSR0We9 O6fy+fdU3Tulx1KyCcX2S3WgouojH6M= Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-34-iVQytZqvORavyDAuQi8e9g-1; Thu, 28 Mar 2024 23:56:04 -0400 X-MC-Unique: iVQytZqvORavyDAuQi8e9g-1 Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-1e0ae06181eso18924355ad.0 for ; Thu, 28 Mar 2024 20:56:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711684563; x=1712289363; h=content-transfer-encoding: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=LJdVzIjhdB6S/DcfelzDKPP9Yk+5ga0skvUpr5ygfQM=; b=f9k5+Vyop1UGCgm1ClCmTMyYQNIvrxvb1NKDhtlwpuCzzJoHtNeHVLL2W5DsiGO+4B sk2L48vqxxDY7FFMbPUOW6zMF/GUfOhORGlltyCLnmQ6+v1FmUY2ARQ0Lc4f3UjtygWY gnNR0+s/VjvcFKBR+6eY/6YMETs2yCSlCmjJaKrnEGUy/fcIn4hgH7WeL8Ejptan8Mgn DjJmJh/fpp35Mnwc15Soe9K8lwruMls/4ip0Hn6S+jojK6helzXTHY5lT3ZD6LzrEDKn yRPQX5wly0h5tBQnuVR30UDwM78pfTEvgv+tAhY/vClbXAKRCxyY5Xv7m+jrenVpLHTM lq3w== X-Forwarded-Encrypted: i=1; AJvYcCXtOS/zkAa5PCao80TgwQkAtkNJdzd6kDee9PGvaouGX2elDPB1URWalouY0zr0ccaid4Me3aGEmd0oxYkfsbnTpzGE9Oj/sAW78TT8 X-Gm-Message-State: AOJu0YzM944Dkq+IlAe8JZIKbpNH52ibio9pisF2lbEzEUJGB9vqf/93 RRxSOQQbNad2ijlEPgC5SsPp6uSoDD7/ia1HOBFc7fM2KPEqr8XvUjPkuZQXi3dYd3d3lKYGH6Q hPY12qXQ5utlC9PUQPR2/kocTmpcVobKk7LsEl36o5jNRVstUeWNcoBlol87R+5T7yscl2Dj7RG iNHNAjp9XwLmbOTgxjqHIMZMphZZlvIxJNXna8iT2gQJdG X-Received: by 2002:a17:90a:d515:b0:2a0:8d17:948d with SMTP id t21-20020a17090ad51500b002a08d17948dmr1838132pju.1.1711684562670; Thu, 28 Mar 2024 20:56:02 -0700 (PDT) X-Received: by 2002:a17:90a:d515:b0:2a0:8d17:948d with SMTP id t21-20020a17090ad51500b002a08d17948dmr1838120pju.1.1711684562345; Thu, 28 Mar 2024 20:56:02 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240320101912.28210-1-w_angrong@163.com> <20240321025920-mutt-send-email-mst@kernel.org> In-Reply-To: From: Jason Wang Date: Fri, 29 Mar 2024 11:55:50 +0800 Message-ID: Subject: Re: [PATCH v3] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI To: "Michael S. Tsirkin" Cc: Wang Rong , kvm@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Cindy Lu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 27, 2024 at 5:08=E2=80=AFPM Jason Wang wr= ote: > > On Thu, Mar 21, 2024 at 3:00=E2=80=AFPM Michael S. Tsirkin wrote: > > > > On Wed, Mar 20, 2024 at 06:19:12PM +0800, Wang Rong 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. > > > > > > Change log > > > ---------- > > > > > > v1->v2: > > > - add resv iotlb to avoid overlap mapping. > > > v2->v3: > > > - there is no need to export the iommu symbol anymore. > > > > > > Signed-off-by: Rong Wang > > > > There's in interest to keep extending vhost iotlb - > > we should just switch over to iommufd which supports > > this already. > > IOMMUFD is good but VFIO supports this before IOMMUFD. This patch > makes vDPA run without a backporting of full IOMMUFD in the production > environment. I think it's worth. > > If you worry about the extension, we can just use the vhost iotlb > existing facility to do this. > > Thanks Btw, Wang Rong, It looks that Cindy does have the bandwidth in working for IOMMUFD support. Do you have the will to do that? Thanks