Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3028805rwd; Wed, 14 Jun 2023 10:12:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ73TfUdu/P9NDcdg1SgZytBZMm1IxcK3R+G28U73zjQBjKLpknmkZZx9g1IIrOBUAf5fm6Z X-Received: by 2002:aa7:cf88:0:b0:514:8d9a:386 with SMTP id z8-20020aa7cf88000000b005148d9a0386mr9471863edx.30.1686762730487; Wed, 14 Jun 2023 10:12:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686762730; cv=none; d=google.com; s=arc-20160816; b=df0tW38ITinqNR7nzoNPrsHOt3j4KxTj1wp27P7ADGDeOpWxGlEMyniqkUaTaFGCDX C3ZcQHGkeLpMfigyT19xuh6EYVcUdbWbSI2ecneCNTj5Rsfv7mvHe8ioO49ihpOKCAuo yfjmEpWzep86hctoouE5w3IsY1KYDiDwKDID0oEYZQWl+1D1QAWoiuvxMqbdBQO58Ozh H3jtZwZE2Ch4ln+qhSFEGbVd5zW9wJIq4v4+17i/jueFtLlUXv82xoUO4j3RXDttZs0j XuMf+cWphmtBILEbiWQ9dtLdBEca50ROUJjUWe6u16y7h2P6Swdf3csp5ydm6Qrg4RRj dQxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gqZ5IpvvmpQbJ1zzadm9lsilhVlagwH9wED8wa6qKyk=; b=0lpFfmE5QoyS365f4FY7j3Zr/8GEsrJa9CeDJGkhXU8rtlaywiBb5kqYdXXmOsf5av Gw/Sa9hMM5DGrM6NQyiAc+qiQ1BVdg7M1974BHI79PePJY4TcKPiNkoy2qTxJ/2Hh1ps hnO+X+WHw86/1u85sosJDxRudB4+3jPP4jqRhfqxJmFFD8ub0bYq7ZRYuqlMsKHiGP9K +623XUZ29NdFaT9RAA43CnfjcNB9xTkPgDjLL6ER0OuZmS6C/Sg7W3g8Z6Z0OKPH7EIv PDdA3RGFyobQTTBPDUyt1l79zUY4ZxWcgMNnz1p+uYWCzHlqylUd/itWdWZV/FUDTUVL Q40w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=XOfu1eYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f3-20020a056402160300b0050bf72fadebsi5308499edv.280.2023.06.14.10.11.44; Wed, 14 Jun 2023 10:12:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=XOfu1eYF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232902AbjFNQSK (ORCPT + 99 others); Wed, 14 Jun 2023 12:18:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232934AbjFNQSI (ORCPT ); Wed, 14 Jun 2023 12:18:08 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7D4D119 for ; Wed, 14 Jun 2023 09:18:06 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-43b2fb0afa6so1044831137.1 for ; Wed, 14 Jun 2023 09:18:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1686759486; x=1689351486; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gqZ5IpvvmpQbJ1zzadm9lsilhVlagwH9wED8wa6qKyk=; b=XOfu1eYFWRpySp+RiCt0aA1jZbJR83Le9ctjs32cZySjS+GuH51iRYEtWpVlMPTqW9 U5gItI0/rvhDWXWBSa0SMZNqwdysynD6LhqX84SvnNkBk+zWvV8ArIMnrYWTWVyqDojM GtdYN+TehUP1b9mwBeN1snu5Rk6tHA0eq6V1W4DblADlIddcAJllqCWZaW34CZUeoP5S TTglt7Hz5thFncRnDsOg0zxzAcyov99SLxk0pbhPTP4R5jh19C1aNmE1wcx93UxEx6fJ 7K37K/Da6eQVnx2tYotE/7pD43Rj1+5vBMOVTKvvPIr20KNj1FRJUOceFPeUhutwO5X7 qovA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686759486; x=1689351486; 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=gqZ5IpvvmpQbJ1zzadm9lsilhVlagwH9wED8wa6qKyk=; b=A/ExxQ6vdh7FByPJRr6Rq/Ecxr7KZs1DeudbWaEQJRolmkQabxwLWQKT5CZ2s+NPCB 6l5GOkIl/N5kSgkCiCflE6YKTwNj25yM+PHPJ5uuzyJ3geUVPkDUwFCDDth7p0rskLIt 02Oasj98B8+2u8QFMiffXK5nJD7vKw75/C2dXMfVah0XppSalHXvuipIGJHDdM5GywFR jsnI2K6jR1Zhx+zvo+eJLYADPrBuHQz7SvGvFurnQ1zPcUYMT5GlsOoIVfhYgaxMeYbM /vLEcUurQtxtkSKL8OZLl2xz2LlfNzUXJfe2lZ4jxQsAxiPc6wrMzxJtMs2wviF4meh+ sPKw== X-Gm-Message-State: AC+VfDyozaswnrDQ4MdJ8MgRatOlcMnXea2cNb2sjQB5o57y05D6C5AX GoalpsNlmAqTALuRUB7Sv4pEL51DLymI9ezMKcHTog== X-Received: by 2002:a67:d088:0:b0:43b:2f4d:2467 with SMTP id s8-20020a67d088000000b0043b2f4d2467mr7412759vsi.29.1686759485808; Wed, 14 Jun 2023 09:18:05 -0700 (PDT) MIME-Version: 1.0 References: <20230613153415.350528-1-apatel@ventanamicro.com> <20230613153415.350528-7-apatel@ventanamicro.com> In-Reply-To: From: Anup Patel Date: Wed, 14 Jun 2023 21:47:53 +0530 Message-ID: Subject: Re: [PATCH v4 06/10] irqchip/riscv-imsic: Improve IOMMU DMA support To: Jason Gunthorpe Cc: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Robin Murphy , Joerg Roedel , Will Deacon , Frank Rowand , Atish Patra , Andrew Jones , Conor Dooley , Saravana Kannan , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, iommu@lists.linux.dev, Vincent Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 14, 2023 at 8:16=E2=80=AFPM Jason Gunthorpe wrot= e: > > On Tue, Jun 13, 2023 at 09:04:11PM +0530, Anup Patel wrote: > > We have a separate RISC-V IMSIC MSI address for each CPU so changing > > MSI (or IRQ) affinity results in re-programming of MSI address in > > the PCIe (or platform) device. > > > > Currently, the iommu_dma_prepare_msi() is called only once at the > > time of IRQ allocation so IOMMU DMA domain will only have mapping > > for one MSI page. This means iommu_dma_compose_msi_msg() called > > by imsic_irq_compose_msi_msg() will always use the same MSI page > > irrespective to target CPU MSI address. In other words, changing > > MSI (or IRQ) affinity for device using IOMMU DMA domain will not > > work. > > You didn't answer my question from last time - there seems to be no > iommu driver here so why are you messing with iommu_dma_prepare_msi()? > > This path is only for platforms that have IOMMU drivers that translate > the MSI window. You should add this code to link the interrupt > controller to the iommu driver when you introduce the iommu driver, > not in this series? > > And, as I said before, I'd like to NOT see new users of > iommu_dma_prepare_msi() since it is a very problematic API. > > This hacking of it here is not making it better :( I misunderstood your previous comments. We can certainly deal with this later when the IOMMU driver is available for RISC-V. I will drop this patch in the next revision. Regards, Anup