From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796393671; b=xW9XkDE3vxQ8oWjmtigTCptgxjtIJ11txKGU2mwfKScsLUcEoezRzzn18kclhafX2dMM Akl8rzHMeAJ8sNhaqJTA1ZIWfuGsYfll512CYuc4L4jdKh5uif54PKyag142+uIrBD6W+ WDY7iTSWPLD+dvQ2YGs55cRezfwpgthLFlOOp3a67xf++oUQ9wutuSxu2J7Wvg3SXewK4 FZ/o3o61NNBTSXAcwMA5CEvv0rI0g4h716kjWYGtMJKeLA8yGjEzKmC87lmRZEAOFC8GO Hcrk8eUtGrPY5uWroTmiIYf5B3tJkNM1o+Wa4EIcGbp3scqZ26fwoYPFq2v0SIifoSQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796393671; h=DMARC-Filter:Received:Received:DKIM-Signature:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:From: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=aCkgJTbo1iY+QXD5lL4YsiSWtRsoLU62RreacVfwp9o=; b=YdzTqbzNviFb/7LgTXXOnSTsBfxOzG2jc9QlC/d05H/KReQ7T062RMOa7kaZfHq0nVEr f0KtFJim8owBVVmYWHo01dK+64Ub46tRXecGoN1nQE93782YAk1hiPoi4xaE+zTtI0BSq ugP7UhrrZLdBCy7C0CFQBVFNWKnE6lt8AIroVdst9PVCoMIXQ7AuqoMFIDgjPT1Tgp7Ll Ec/SjIl7iSPS3wnl/GLyEUwvBaZy/Zz8SQveDHisLSuziElhFIIilRTuebn7jZScB5LIP 48VwBYv6cAMEKZb16ZMDdXnW1o6S/4JJsKCz0iesbLqYv8SIlE2z7ZZFUUdYeGtJZyA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=sgnR6RgX; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 587F1606A322 for ; Fri, 4 Dec 2026 14:14:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 587F1606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=sgnR6RgX Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D1A7514BF; Fri, 4 Dec 2026 06:14:26 -0800 (PST) Received: from [10.2.212.23] (e121345-lin.cambridge.arm.com [10.2.212.23]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D7343F86F; Fri, 4 Dec 2026 06:14:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796393669; bh=mZjz6aX9klOl7GQKXXKtz4Zca9HU0flC4I88LVca22I=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=sgnR6RgXbZvLbydFvSXTCvDkhuCHybvTDYosGHrvyfXni+XYXkcy+1QkA/Zj+O+8C TC9R0TVz4Vxa8X4ll4ZE5bzYwyQFWpxgifAzzq/5vpls4KoZeIFsQLBSP2p2zyDCJV 35Sy/W/SWZWrjOLF6eTiC3Y0fhVjkiCbpry1KOzc= Message-ID: Date: Fri, 4 Dec 2026 14:14:25 +0000 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v8 0/6] iommu/riscv: Enable MSI remapping and IOMMU_DMA To: Andrew Jones , linux-riscv@lists.infradead.org, iommu@lists.linux.dev Cc: linux-kernel@vger.kernel.org, tomasz.jeznach@linux.dev, jgg@ziepe.ca, jgg@nvidia.com, joro@8bytes.org, will@kernel.org, pjw@kernel.org, palmer@dabbelt.com, anup@brainfault.org, tglx@kernel.org, kevin.tian@intel.com, fangyu.yu@linux.alibaba.com, nutty.liu@hotmail.com References: <20261204133106.664239-1-andrew.jones@linux.dev> From: Robin Murphy Content-Language: en-GB In-Reply-To: <20261204133106.664239-1-andrew.jones@linux.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 04/12/2026 1:31 pm, Andrew Jones wrote: > This series adds MSI remapping for IMSIC so a device's MSI target gets > translated the same way its DMA does, allowing RISC-V to enable IOMMU_DMA > and paging domains by default. > > The IMSIC MSI target address changes with interrupt affinity, so every > possible target must be mapped before an affinity change can select it > in atomic context. The IMSIC driver prepares an ordered list of targets > with iommu_dma_prepare_msi_list() when allocating an IRQ. DMA-IOMMU maps > the list into one contiguous IOVA range and caches the base in the domain. > The MSI descriptor carries the base IOVA and mapping granule, allowing > IMSIC to compose the target address without allocating memory or looking > up IOMMU state during affinity changes. > > Ordered-list mappings have their own cache, separate from the existing > single-page MSI cache. IOVA allocation, mapping and rollback are shared > between the two paths. > > VFIO and iommufd support from v6[1] is deferred. This series does not > enable VFIO_IOMMU_TYPE1 or introduce an IOMMU_RESV_SW_MSI reservation. > I'll look into Nicolin's MSI-window configuration patches[2] in a > follow-on series and see if I can avoid introducing IOMMU_RESV_SW_MSI > entirely. Without that reservation, the legacy Type1 backend cannot > provide the MSI mappings it needs, so I'll try to support existing Type1 > userspace through iommufd's compatibility interface. That path will need > automatic MSI IOVA allocation, since existing Type1 userspace won't issue > Nicolin's new ioctls. > > LLM-based coding assistants were used during development for code > exploration, patch review, test execution, and drafting and editing > commit messages and this cover letter. I reviewed and finalized all > resulting code and text. Per-patch Assisted-by tags are omitted in > light of ongoing discussions about simplifying coding-assistant > attribution. Acked-by Robin Murphy (FWIW the irqchip patches also look sensible as far as my experience there goes...) > > Thanks, > drew > > [1] https://lore.kernel.org/all/20260925151659.419512-1-andrew.jones@oss.qualcomm.com/ > [2] https://lore.kernel.org/linux-iommu/cover.1760487869.git.nicolinc@nvidia.com/ > > v8: > - Rebased on linux-iommu/next at 052bac986393 > - Added a patch (3/6) to introduce msi_msg_set_addr_iova_offset() in > order to avoid duplicating msi_msg_set_addr() [Jason] > - Addressed Jason's other v7 comments (kzalloc_objs(), 32-bit explanation) > - Added Jason's r-b's > > > Andrew Jones (5): > iommu/dma: Prepare MSI physical address lists > iommu/dma: Introduce iommu_dma_prepare_msi_list() > genirq/msi: Add msi_msg_set_addr_iova_offset() > irqchip/riscv-imsic: Add MSI address list > irqchip/riscv-imsic: Support IOMMU MSI address lists > > Tomasz Jeznach (1): > iommu/dma: Enable IOMMU_DMA for 64-bit RISC-V > > drivers/iommu/Kconfig | 2 +- > drivers/iommu/dma-iommu.c | 77 ++++++++++++++++++++-- > drivers/iommu/dma-iommu.h | 10 +++ > drivers/iommu/iommu.c | 43 ++++++++++++ > drivers/irqchip/Kconfig | 1 + > drivers/irqchip/irq-riscv-imsic-platform.c | 21 ++++-- > drivers/irqchip/irq-riscv-imsic-state.c | 32 +++++++++ > drivers/irqchip/irq-riscv-imsic-state.h | 3 + > include/linux/iommu.h | 9 +++ > include/linux/msi.h | 25 ++++--- > 10 files changed, 202 insertions(+), 21 deletions(-) >