From nobody Thu Apr 16 15:04:27 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fxLrq3QDhz6Zp01 for ; Thu, 16 Apr 2026 15:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxLrq0sGmz4J1v for ; Thu, 16 Apr 2026 15:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jXu592oYP5XhJCy8iZJ1AFzhu+1ZZ8215piFLNe285Q=; b=oUjy7yw4+1XRgPM4s/ETro145wsxU9b0Q130mEQohzwLc9JS3X4h+3HiZydq1p1cx2+TRt r9I2XmZSWNm59sS+VtKE49dTiOF+CldUYIWyBdgrVgTn3ivYSiIRxL8vHjFv7t88q9icpF c5FFn8kyMw5mOlAcsimclTYh2SnlJI+l7xq7beZqrKXvmadLtvf9D/cACXDKpAjH/bxCcQ M4/CtLl2qrQy8gKZhIdjJMcihhDNF2BL2aoL03Fyfj8ct3NYjmSMSfICA8uCLC1M1lKp9q sL62vQcpZaQm62Rm8Sn73gzHWECdow1kigYCYbtDcz9c2oECtwilPy79tk4Uug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776351867; a=rsa-sha256; cv=none; b=cNRTUZC5lazWCnIJGOopQMiQvM2pL0GJc7/B1BotFvHTXTb/KxD82Mz59dAJxPna4O2aS/ M8X6yDP/9eKhtLhnSSlz789g89ZhF8vIfHpejWkWtyLfXyvysbGFfVmnEKLN8aSUXgl944 t/Aofb01OrY6soc/p/U8b2AohUarKHfq1yOO4HMJn6uS7pzYHcWyvpDjkLo0lYtipfE9rI 8PqN/27BE1PMdlJ5ApRi+TQImWfhD5q8Kq0T2RQxaNi0HjYfDGdckZ6Vqa+Rf0dZCQwmiD 7CpxRA5RwpSLhamOGLfq9FcD0I20zebpGZKEUS3132ur1mKYcMVI/rWZSuykRg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jXu592oYP5XhJCy8iZJ1AFzhu+1ZZ8215piFLNe285Q=; b=XmVRotrgN4Uqh4y0GTEV0+qh+lbSRpqLd+cWECKM4mQQMZLaQ1Lk9s5N++QpW3L7sFqxcC D9frg5bCepoRjka07plZ1pUm6NBUFyCeXge2VJGDQuFSFHmojCmofXo4cXNfutz3fyYHu+ zCg2MKebDJTpHFFQ4Rgs7TU+I9Gd4hQyn01BCIHycp7t5+EGlebOv6Nga48RfTI4flsQui KRQtnjA4ZqAK/0X7iSK38zfW+TbwJj6BVu5H75ZZtMqRq+xOGOMTlRrCySaAGgsMt7nzW5 gR0dP77WPLjl28y0wlQKtPWTbNmqqdxDaKKgarUi1Zaib+ycTkxDqnSWfaPlCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxLrq05jqz1BYt for ; Thu, 16 Apr 2026 15:04:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e7d9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 15:04:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: bba179b0aac1 - stable/15 - msi: Support APIC Extended Destination IDs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: bba179b0aac1da000707f0f5d5de8670d0a529a5 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 15:04:27 +0000 Message-Id: <69e0fa7b.1e7d9.454690e2@gitrepo.freebsd.org> The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=bba179b0aac1da000707f0f5d5de8670d0a529a5 commit bba179b0aac1da000707f0f5d5de8670d0a529a5 Author: Colin Percival AuthorDate: 2026-02-22 04:08:59 +0000 Commit: Colin Percival CommitDate: 2026-04-16 15:03:59 +0000 msi: Support APIC Extended Destination IDs If APIC Extended Destination ID support is enabled, use it in MSIs by allowing APIC IDs up to 2^15 - 1 and encoding the high bits into Intel "reserved" bits per the standard. Tested on: EC2 r8i.96xlarge MFC after: 3 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55426 (cherry picked from commit 02f29c1324cf5193c3aec181cb409917b541f7fe) --- sys/x86/x86/msi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/x86/x86/msi.c b/sys/x86/x86/msi.c index 9d5a51f9753c..9ecdfca3e01b 100644 --- a/sys/x86/x86/msi.c +++ b/sys/x86/x86/msi.c @@ -92,6 +92,10 @@ #define INTEL_ADDR(msi) \ (MSI_INTEL_ADDR_BASE | (msi)->msi_cpu << 12 | \ MSI_INTEL_ADDR_RH_OFF | MSI_INTEL_ADDR_DM_PHYSICAL) +#define INTEL_ADDR_EXT(msi) \ + (MSI_INTEL_ADDR_BASE | ((msi)->msi_cpu & 0xff) << 12 | \ + ((msi)->msi_cpu & 0x7f00) >> 3 | \ + MSI_INTEL_ADDR_RH_OFF | MSI_INTEL_ADDR_DM_PHYSICAL) #define INTEL_DATA(msi) \ (MSI_INTEL_DATA_TRGREDG | MSI_INTEL_DATA_DELFIXED | (msi)->msi_vector) @@ -644,13 +648,16 @@ msi_map(int irq, uint64_t *addr, uint32_t *data) mtx_unlock(&msi_lock); error = EOPNOTSUPP; #endif - if (error == EOPNOTSUPP && msi->msi_cpu > 0xff) { + if (error == EOPNOTSUPP && + (msi->msi_cpu > 0x7fff || + (msi->msi_cpu > 0xff && apic_ext_dest_id != 1))) { printf("%s: unsupported destination APIC ID %u\n", __func__, msi->msi_cpu); error = EINVAL; } if (error == EOPNOTSUPP) { - *addr = INTEL_ADDR(msi); + *addr = (apic_ext_dest_id == 1) ? + INTEL_ADDR_EXT(msi) : INTEL_ADDR(msi); *data = INTEL_DATA(msi); error = 0; }