From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 CA7F8415B66 for ; Thu, 20 Aug 2026 21:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787262128; cv=none; b=VBcl9+A0pE6Enyt/pwZHpC899QvPn8t3ukWlPXxdSAoI9uL/k5hRVypw8f1rB2bbWas7f/dmHSikq+pTbefhCB8VKYIuZO2oSGsN+itzyVdGhfihHqYzNOJ0FPQdTVQrd+pXQqVkOsoQuEpL7pgZI2d1s0cOkGoPb/t+NR5tElE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787262128; c=relaxed/simple; bh=yRSrMfOIOY8yc+H0kITYB7yCLVZjoqzSM1JBHxbzG64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cejVDDErmy0SwIz/zEfN+39b1qhHcx9odyzEcw5HRxu1hWvDdtI3GbOUoUWt9Czqs0Rr2wy9FBazLF4mSyDfhSY8FO8dfviPId7Zd5SF2plAEx/Cf7+CReQl0xxYh9fvyMua042y1ePZhwnVvgmvP2JRm4mO0fWIyQ3xVhboS8I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FLf9ktyS; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ccVgfDRd; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FLf9ktyS"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ccVgfDRd" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67KK7ZhP4012746 for ; Thu, 20 Aug 2026 21:42:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=95f+Fzhwpw4 3Z8OjjMrn3wgehO1wG/e14m5ANO8Aj4c=; b=FLf9ktySq3FvX1wSCCh3uhuAKql wHiTd35nqMOeX85pmsSALXS+CfoOZnXf1kSmRzqcX51c5J1ErUQlaNIg1BJySSfI VIKPpmvdmXBeiyq9vFqGBbGFMFMOFTytf6z5KATw3r4OGtyAI1vAXfxszG71YNma QcgRy2n874KHdFRn7LY91vQ/+gF0PwgL4qI+XF8EBMB11TFn9ubWWGLPXJkYcQFZ z1omRYU1etmBXidPfWairMSJhXdyiKIEDsKjRMam/b285IvIZDQyfk3wFUyXjzwg d4vgr51pecxSMFJDI2OWcuYHslujsZQBHVBdTQBWl9cMnL0JL+EXM2G9odw== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g5x29kecx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 20 Aug 2026 21:42:06 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-92e63df032bso163189885a.0 for ; Thu, 20 Aug 2026 14:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1787262125; x=1787866925; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=95f+Fzhwpw43Z8OjjMrn3wgehO1wG/e14m5ANO8Aj4c=; b=ccVgfDRdZPW10/F/jAIyyaRG6RISklYYnQTjAK7Ou/YQMhbEBmwwk64dKFZHrFv1XM 5a5xbcNK7+RWQZ6AlNbAtmnruNCBTfTSeow11NyX0FKsSCDk7QBME0AU4vcqFMQO5+f4 MlMcV/S1i9jAPE4TkffEtUL0vI5K25ypdjeDRwQr0QISTg4TGaviztCGQT/ODK2nN+dj z3kSxCNk+pCweytGdMWCR9qwl/rI3/NPPHZ+G9aOdKFgYIycdVwdqq7P7h8QAl20ZyRc Yq5+QzqMNQMN4Z461yq3dYu/PBJbqxZktW38miTA+oWnrD+mGjp5LmV4cgNqA9Pf7vdQ moQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787262125; x=1787866925; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=95f+Fzhwpw43Z8OjjMrn3wgehO1wG/e14m5ANO8Aj4c=; b=cqVxKg1GgZ0vslPm9uxLY6JxV5uo0QelyWBlfv2LJ3nYDyiXGljXN6H/WTDHyUAcQ9 FwB5Hsrk45d/i3uKY2PNH9kU49zMz15DnfdziglKdD2YDtNaYwSDLjlQvXDSJUBEe+1/ KPgn37RhrXVdZ4yTWDHwCP/krcofAYN8Mc7qJWn7oXCNBsRXOUnWqHUPk12KTHAmQIHA bWJY+AeML6fDBGxPdJL1Z9e6bStGVqOMt0Iu9WfHRw7KpIdrxNjfCXPaah5ikYUYWnxt yzGxYN7FctR3uo9lsusm8O2tWtJgclRKxac6htLsczKpgJPmgNRtG8josyaYGzBSESU8 knFg== X-Gm-Message-State: AOJu0Yy+67M8GzS9YcxUlUgsfFhs4KxsqcLlFS5K7WRtacLmUrFkf3kn ub88915PTjb5a7vHNs07sJdelICGa3fFQbvG7Bc2Sag31pvJs/ulhWN2BXN9IyF4Q6oYGAIoWN4 gHJtg+cDWUxiVtCvGv1wpihnEIlbgQpiCUr2R77yXuqxdsjun78KtysbLWGxe4IZPH6A= X-Gm-Gg: AR+sD13l8LN1jcbkZVVRY/4t2y+EjddkCykqbr1l/cMDdXuZ4GYagNBSquf8pPXMKh6 d5aWA4mBVni4mjo8KPuwsI6W2QFsrg/7Jv/HQ5m7D8xA9aXg8eI/WqkKDzTuXSJiHAPzrLkU6FA 32749k6Zq4Qucb5YjnsmGxvcEDPQYR3aG76O7OF16bg1ksteEGzhJPcpCrIW3564+VnD5xIk0Qb ibiTpnQf2NDm6RDmow+OHJhOUI9nKqixlL80jm09Q6Nhnp3/6f6cqEpaIZts4oL4ixvcw7qVbEX vFZ4OSegsc/RSLmNy4xt66qOCp2pjhTGEcoBO5cNVvb56MikBEJ4nxU2uzOUe7xgWD3bAwTxoO2 KnBDgRmpR X-Received: by 2002:a05:620a:a19a:20b0:936:af34:468e with SMTP id af79cd13be357-9372835a96bmr757318885a.4.1787262125147; Thu, 20 Aug 2026 14:42:05 -0700 (PDT) X-Received: by 2002:a05:620a:a19a:20b0:936:af34:468e with SMTP id af79cd13be357-9372835a96bmr757314485a.4.1787262124719; Thu, 20 Aug 2026 14:42:04 -0700 (PDT) Received: from localhost ([193.165.40.195]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-482b1441b0fsm14831889f8f.4.2026.08.20.14.42.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 14:42:04 -0700 (PDT) From: Andrew Jones To: linux-riscv@lists.infradead.org, iommu@lists.linux.dev Cc: linux-kernel@vger.kernel.org, tomasz.jeznach@linux.dev, tjeznach@rivosinc.com, jgg@ziepe.ca, jgg@nvidia.com, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, pjw@kernel.org, palmer@dabbelt.com, anup@brainfault.org, tglx@kernel.org, kevin.tian@intel.com, fangyu.yu@linux.alibaba.com, Nutty Liu Subject: [PATCH v4 06/21] genirq/msi: Provide DOMAIN_BUS_MSI_REMAP Date: Thu, 20 Aug 2026 23:41:35 +0200 Message-ID: <20260820214150.545737-7-andrew.jones@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260820214150.545737-1-andrew.jones@oss.qualcomm.com> References: <20260820214150.545737-1-andrew.jones@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: Bf4b8zd34OQ_HLKyWU3B6X_7dzhVyZ6K X-Authority-Analysis: v=2.4 cv=V8BNF+ni c=1 sm=1 tr=0 ts=6a8774ae cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=CzrpMg+lqiTzknPDBj2tlw==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=69EAbJreAAAA:8 a=cHhBG6FuOey2j-0mYlgA:9 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODIwMDE2MiBTYWx0ZWRfX1IX2ZEbRluki P65758ye9w05LrmV+iANA4xkBda51e8VfqHmjvuHqvkxHfVvWpBKUwKBYI9w0Fc6S/QJIf9zucG BlHfUHOfh1a+OV9Og5bMYT9OP9ZpfwZFKe0A1asMkkVm7yMzIAx76k4HlXUIbOw2Pr+TDOYZ7K8 joShcdJ1F5mYmAMsZaLklXNCORVUnKLrAD0vJBmVsSq4tKyGIm9XSE6noRG4zIDHU6fCWf29aH2 SQ7stUSVmNTzf7DzOqtv85gIUw6LvrFZ9MmawODKn0sYLtyzabPS/0cLKtSpm1PmNkWKV9mzlz2 Ri+CEUOhcwXJrRl7Qo423qbsrv+nv++SSfCc4oEWr7zhEYUwUa6JtTCuDvKuOeiMG7O5XxGt1py draJ/YFrT2R4Ni2O4HbbsKZQ5YNC89qHUeOuDMCbYEDnFGNy5ZH3x17t1wTbhzwzq1b59kyiKFw /zBX5TjxTcb4TtdTg5Q== X-Proofpoint-Spam-Info: AW1haW4tMjYwODIwMDE2MiBTYWx0ZWRfX/z3n1y5wSSda kl9gcBka+BEdHrpML2jpcKOMlgdYfChBm8JnTxrJM+9kDqE6yyzsZ+vHd4ed16TPZL1RqmxOwnA XuO20Ymr++PP5tGwztOM8X4aD1w6AIg= X-Proofpoint-GUID: Bf4b8zd34OQ_HLKyWU3B6X_7dzhVyZ6K X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-20_02,2026-08-20_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 clxscore=1015 bulkscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 spamscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608200162 Add a bus token for MSI domains that remap interrupts, needed by the upcoming RISC-V IOMMU interrupt-remapping domain to distinguish itself from NEXUS domains. The token is generic because remapping itself is the only property that needs to be conveyed -- there is nothing RISC-V-specific about it. Such a domain implements init_dev_msi_info() via msi_parent_init_dev_msi_info(), which leaves 'domain' pointing at the NEXUS domain while 'real_parent' points at the remap domain itself. Accept that combination in msi_lib_init_dev_msi_info(); no other msi-lib changes are needed. Signed-off-by: Andrew Jones Reviewed-by: Nutty Liu --- drivers/irqchip/irq-msi-lib.c | 8 ++++---- include/linux/irqdomain_defs.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-msi-lib.c b/drivers/irqchip/irq-msi-lib.c index 45e0ed3134ce..9027dfbab15e 100644 --- a/drivers/irqchip/irq-msi-lib.c +++ b/drivers/irqchip/irq-msi-lib.c @@ -36,14 +36,14 @@ bool msi_lib_init_dev_msi_info(struct device *dev, struct irq_domain *domain, return false; /* - * MSI parent domain specific settings. For now there is only the - * root parent domain, e.g. NEXUS, acting as a MSI parent, but it is - * possible to stack MSI parents. See x86 vector -> irq remapping + * MSI parent domain specific settings. There may be only the root + * parent domain, e.g. NEXUS, acting as a MSI parent, or there may + * be stacked MSI parents, typically used for remapping. */ if (domain->bus_token == pops->bus_select_token) { if (WARN_ON_ONCE(domain != real_parent)) return false; - } else { + } else if (real_parent->bus_token != DOMAIN_BUS_MSI_REMAP) { WARN_ON_ONCE(1); return false; } diff --git a/include/linux/irqdomain_defs.h b/include/linux/irqdomain_defs.h index 3a03bdfeeee9..954cf585b3c4 100644 --- a/include/linux/irqdomain_defs.h +++ b/include/linux/irqdomain_defs.h @@ -26,6 +26,7 @@ enum irq_domain_bus_token { DOMAIN_BUS_AMDVI, DOMAIN_BUS_DEVICE_MSI, DOMAIN_BUS_WIRED_TO_MSI, + DOMAIN_BUS_MSI_REMAP, }; #endif /* _LINUX_IRQDOMAIN_DEFS_H */ -- 2.43.0