From nobody Thu Apr 16 15:12:21 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 4fxM1x4fxdz6Zq6T for ; Thu, 16 Apr 2026 15:12:21 +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 4fxM1x0lz9z4NCq for ; Thu, 16 Apr 2026 15:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776352341; 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=kzL+6XjkkUz8nLw7c+4Hk51dAgGDV5HRs0d2opq1wRI=; b=qml3ORd8gllvESeWWLnmipTb0o7KbQxZhm5zRBhFE06cQG8q0zO7RuZmWZZTD7BkWWnHJ0 m7GkgZwYPIJfooOVDAzPqa19D+7U55TkjA3odhE9q7wor0rN/1hozwIQc/B8BUQ8FmxWwR kJK4wIaM4hotBTCasEha25rnz9n1dhS00hQ3SxpCQWB1wazgh035tz+iaNBeQ+SqDIBPMf zpu6C+vLQudu2hxxj7ACV0CgFwv4xpTxNWqcnG3o91uHgNGBrfbizT7dKqygCVYVOiWTb4 leMJhX4JXooVUWDiVKWGDxI8iTKM01V1sSBd2i0HvkXAg/sFhhcGuRWvRSI38Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776352341; a=rsa-sha256; cv=none; b=TZPTR+8ypShE6FGPDAPYe4eFH68YrSk5+opzWhhUnwvQYYXcPKHbTNWksWwEQS/ondJOaT +FezJeGDXxeG991YUnmAD80TJj+RfvUrsLo3iqeEZAIehoDKJAYSdGljyNJQjNKGthuXsi iEK26HLqy99cB1RQG/pz8Jn1R2n8Ir8baTmsk3kYZa1pmQJppIj0PPyp3WHJBGCS1O7vCj JpRQDpHfnwpDo4RF+o2axM+DbDhMi+5Ziec3oK+1ZUg076f0mtv3IipVWNYwAQ9IZZ70bv V5pG9KxgWvHqNuT6JsodfWbOnWCF8QNe2SZT9hvTfMfGJz/9rTt15Yaikoagug== 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=1776352341; 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=kzL+6XjkkUz8nLw7c+4Hk51dAgGDV5HRs0d2opq1wRI=; b=lUuBsahNxBaxAj0XIHzR/H6flwze7BpXY/4jmNNBsOAwwmQAbrCSBx7d8q/66PRT8Kwt30 e/NlFACQ9JhlKLep26ZsXGfZfZYOXWLEqvXmN4JA/Nva1R8ilYugW1FJgWnEYDnKaTUx2o Dul+c0VJzrcqP7PZL6ZSDPzqlTVVLfGS43gub70RPu4Jgv17SrKeorrHwjYctOFXBNV5KL BUUe4f5sManKySW0wLBOVPH5taoVnGzcwm5g4j55dx/aOkstezaLEysVo0nSjEkj8i58su W7Q1QEZMmLq6CG3ElILbLA3QEsqXxRMhHH6FA8srD+nthqsW/NZ0M/OXou/KsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxM1x0Cydz1C4w for ; Thu, 16 Apr 2026 15:12:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1efc3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 15:12:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 3007e4a7dd49 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 3007e4a7dd495151df4ef87792f51572cbb52c6b Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 15:12:21 +0000 Message-Id: <69e0fc55.1efc3.520afc5a@gitrepo.freebsd.org> The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3007e4a7dd495151df4ef87792f51572cbb52c6b commit 3007e4a7dd495151df4ef87792f51572cbb52c6b Author: Colin Percival AuthorDate: 2026-02-22 04:08:59 +0000 Commit: Colin Percival CommitDate: 2026-04-16 15:11:54 +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; }