From nobody Sat Mar 28 05:56:29 2026 X-Original-To: dev-commits-src-all@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 4fjRbL2Q7Dz6XbP2 for ; Sat, 28 Mar 2026 05:56:30 +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 4fjRbK6sCZz3qHQ for ; Sat, 28 Mar 2026 05:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1774677390; 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=Nz5iP7TEbDqbu6+mzGloO0Bo2cDxw1jiEPjaidLmhOs=; b=XpyY96Z35ItWP7KAg0H/xNjuCEUg7g6sR4EvJWCi7ON6G/0L5hqPf/HUUPJb0dhnE+gvB4 Dz83JrTqtPHAEScE+nf5YtlRUV2wl6xTkRAdrvsWnLqwJPqMC0nyBsY1FFNoPiarBCqmJY E1imSNblxG1OYsC7TfFeci19d+MQ6JLRV44SMnZTU1lX9QzFDVHq7j+YQemcgP9neE9sf+ o/srxrzUHxwiFXxTnKiHpdpJ3xwHeCK6IA+M5bOC11EslcZ1j7329CYl/Y0StVrPw6u1qg e7Jb/lMAw3wlE3MnnRdQMaxSbqWzdQYDsko6gDpbFfft7d7ifhu/Ci6JZX0IMg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1774677390; a=rsa-sha256; cv=none; b=bS1VbrMCpNiIkHt9Idcz+7e+a1GXrtkhaBTHSTqNtTokgONGOcsEciC/QEsA1meRJ7xJlf oTZ7GrQQEv8PdW3efZynrSdtP8DaKrUK/sA2w65+ykiRaldsD/xPoJ+57w0LujRBH8URVZ WaK5WB0slKn6gSJSodVIhfpqhCW/Xezr3Av0OruMCZDjAG/5dSVL3bQd+vm9+WL/qkmcbl j/UJXZkZlvddOcej4DOUzZ3IazoqisLGLPolWHjjIcKXKoQx8wRgVRURkvvC62e0DiSrIt OZppVT6U4M7c9KqhGFoZ3ndudGcy5/2KD6hx1Kd5x5tw1Bz/BtVMbBuCIFHtlg== 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=1774677390; 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=Nz5iP7TEbDqbu6+mzGloO0Bo2cDxw1jiEPjaidLmhOs=; b=vx/0fPJsnkD718y0eSjO/RYNXpfgPmRObIJgX/FPzGzRn8ZgyRvg5POm6Wc0E3Tw8r39o9 BIQIUm8t80RVUBenMT83OputQ0g6mxfVPef0zDc7ZHGTovdZPNdkMplqZl4kuammej9oTB cxb1IwU2d9zavXrGpyW75YEjGkYdlhZVjnBoIS3bJXlXbKyLLYivS1qLFezyiK1d/adFNO rqNQLwnoS3Bg5CVvLFYO2sT2Pkb+15B864Z/jOfH1NFOAm2BhLqQTf/qFINBfsN/okVL3U dPtCxVDzE4yE/g0UYpbMkDws080nerlMtWiE7VTdto9u47blZAGRJ0ggsFHN0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fjRbK6Qd9z1BmP for ; Sat, 28 Mar 2026 05:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 405e6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 28 Mar 2026 05:56:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 02f29c1324cf - main - msi: Support APIC Extended Destination IDs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 02f29c1324cf5193c3aec181cb409917b541f7fe Auto-Submitted: auto-generated Date: Sat, 28 Mar 2026 05:56:29 +0000 Message-Id: <69c76d8d.405e6.c752a31@gitrepo.freebsd.org> The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=02f29c1324cf5193c3aec181cb409917b541f7fe commit 02f29c1324cf5193c3aec181cb409917b541f7fe Author: Colin Percival AuthorDate: 2026-02-22 04:08:59 +0000 Commit: Colin Percival CommitDate: 2026-03-28 05:54:17 +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 --- 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 b38247bf6e45..9d5409015de7 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) @@ -652,13 +656,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; }