Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2883537rwd; Wed, 14 Jun 2023 08:27:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4aNXIqh0rABuPpmEMoRbZR57/L02uggU7CdFCYhdVTK25C5GaGzpUo5XCFceSy41nOOElO X-Received: by 2002:a17:902:be0e:b0:1a6:46f2:4365 with SMTP id r14-20020a170902be0e00b001a646f24365mr11415370pls.30.1686756462311; Wed, 14 Jun 2023 08:27:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686756462; cv=none; d=google.com; s=arc-20160816; b=HwBZfDvUq1Rzb1AH4U8nbBgJt8t2LujDhNmwV9vV3FWwKEBqJi9Q/UGlYgtowlRxUR gbcSfvOaIqbtbDrpRb4dSVQZRkKKYh2KW0PEEs+zc618ifVbXui4C7EJCBi/6km+8/Sb O/F6HDEMy3p6x1Wf4cs14wNchud2M3VH05WSkVgnqnedDYoyG9uaB63wIU+XgKPB5Adt 4T/uzCQRdk5WrmyNHeZvn1XL3RdwlkV0ZgakUUQ55SbOR1ijFk+r0ymJlnxRQAhrVlgk fRDQI0UUs6kVsl6xgK/SLK9bf2TUaLs66+p9K1OlVrwhemb86J85hhT0a86zKXXAioFf VKqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XCPI5ZcRcUuga+hwGvL6zbC51EZUbGkp50/wT3gC0jw=; b=OJb8wRdCtu7JiqjHEOnLcUwUSdLbU5DyN7nA7/8x1rgZdK1WYs0lanJzqM/qflEKJ7 I1YCZ2i57+wNTxiohcmbh7raZ13P0hEISC04TFXxZv+OEfwsGl30k6cwHI7di0uzci9g I4luJEjycAeoWUgACkU0fBBlYIlq0VwO+dubY/uFgISd52Tmj2FA8MNuLh6aYaV6V2zE QPi45tS7y78X3GzBhsoxPBTZVL6QC+RzkTY5an6bqGJpo+9OzxDjoHZx6hNI/syUfZ2H capxkvC8BwFSHPYD1SjR2eaJfs6Y2H2UZ7FpkYpgBBberGzjE2sYo640Xpl1CwgoSoNr mBYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=bxe8uVF1; 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 c4-20020a170902b68400b001b3af7e375fsi7057740pls.559.2023.06.14.08.27.30; Wed, 14 Jun 2023 08:27:42 -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=@ziepe.ca header.s=google header.b=bxe8uVF1; 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 S236667AbjFNOqI (ORCPT + 99 others); Wed, 14 Jun 2023 10:46:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231812AbjFNOqD (ORCPT ); Wed, 14 Jun 2023 10:46:03 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59C391981 for ; Wed, 14 Jun 2023 07:46:02 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-62dfc2da0c8so12951486d6.1 for ; Wed, 14 Jun 2023 07:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1686753961; x=1689345961; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=XCPI5ZcRcUuga+hwGvL6zbC51EZUbGkp50/wT3gC0jw=; b=bxe8uVF1FEFSaF8JRbza9nJxP5K4Z2yuCd6J5OgmRschaBVxVJWJfmR+Ixcf6XsCRD VQGIikKxvftgKxlPbwVUcIOeW1ItnaXi0L9T24RrWyFWyUKgAKRwPeOhpH7hFh6F8sut jfeVokjQBWaGawD+ng6KqGLNS2xBnH9Qsjz03TyIdT94ubbeK/TtqLGXGf4t+RIxSQWO 52o0vVvPYfTfR984Gy3/51k9fZpw+606eog4fRYT1dwqqc3HBjtl9YL8GXmCIy0qAkT0 H8izUvIjCjOVtOI+9wUZ1aCs2HTvUtIXN+RsHs0mvBD8QwW+edk74Aq/Rv2f8Vb1W63i QpxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686753961; x=1689345961; 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=XCPI5ZcRcUuga+hwGvL6zbC51EZUbGkp50/wT3gC0jw=; b=C4y3e7FKPOMmo4qAv+KT/7+GhbSBb9LKSFFaqokHo3uG4l71qDFhv84jtAOJVTSzfj hGi2q01OLDTEZ4Hk/s6owpH3wmUgxL+MBR5f1yiozWnZyH0NXLLPD8IoJa0QPlk5UpOL RW4nC+TE+1WWBwUIkWt4UPoabBqHGSjs0IEUFrMr2kx0nbCNJ6nIioBoOhlbdz9rxuzO tlknVmsrhVpw4fDofT4qHh11WP+ppo3TA91or+0DjEzYO9Ua1dDXYm9iEL5YcWhBxQfb dlNFN1VLutEZOvfwxh+NPbKU+5sxx87+oFMOJpKCk1UyODtp6pd0FV5eftQEupOgM0r9 fP2A== X-Gm-Message-State: AC+VfDyTyYnLkoN2Xr5W11s/7jKVKkrSJYtnwZ9VAD6QmdPXL9fldkfU Lc6ScmE7W/eGoN8o2uBUt375a0psVI14GfMVciw= X-Received: by 2002:a05:6214:d0b:b0:5ef:46a9:15d2 with SMTP id 11-20020a0562140d0b00b005ef46a915d2mr16973858qvh.7.1686753961443; Wed, 14 Jun 2023 07:46:01 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-25-194.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.25.194]) by smtp.gmail.com with ESMTPSA id e21-20020a0caa55000000b00626330a39ecsm4785870qvb.9.2023.06.14.07.46.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 07:46:01 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.95) (envelope-from ) id 1q9Rl2-0058qB-9u; Wed, 14 Jun 2023 11:46:00 -0300 Date: Wed, 14 Jun 2023 11:46:00 -0300 From: Jason Gunthorpe To: Anup Patel 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 Subject: Re: [PATCH v4 06/10] irqchip/riscv-imsic: Improve IOMMU DMA support Message-ID: References: <20230613153415.350528-1-apatel@ventanamicro.com> <20230613153415.350528-7-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613153415.350528-7-apatel@ventanamicro.com> 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 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 :( Jason