From nobody Thu Apr 16 15:04:25 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 4fxLrp28wgz6ZnrQ for ; Thu, 16 Apr 2026 15:04:26 +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 4fxLrn70wmz4Hhg for ; Thu, 16 Apr 2026 15:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351866; 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=HQzoFw3qr3om+ewTm8KSWbc3Ynso96KLuXhCMjn3oKk=; b=TGASOzd+fMzBbr73eA94z8ZPuswO71uMYwvk0VBGYsgV0rcU2mHW1gU4GgekMlQXQRLGqb 1e5LvOFs+CzAAk7514LvyqyENFApZrhoMdwjOXYfvdERxeYmSAXeErRDCPOo1QhrkCMP0m Zy2gfxSihfMC6kSEoXTx96DjAKIqTNrLoNFkVc9M0YFo5qXvqYhRBR3/U83qetakMGPyIR LSBlrpIcNhyHU9dWdL7c7wTPBk6BQMRCUuTOtNKVFZb+Hf+Uy4NSn9O7itZeluJXcTUQvG DgIOoAicVgQbfSUEt0Z4+chclcz4T9WiKPk9gDKVoOo/nasGmn0WmN02552uag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776351866; a=rsa-sha256; cv=none; b=ZCudKEt8XgYhVlYTlwr8Saj2GNrg+rzvI/k8q50sPF6GHP1fgbQkPTHkJuLcZhHT0ordS2 7iSURnswVotcO7Q61TdcQsUTGT8E1/pWImAnKgrhHzAOHi+5WNtDWzZRWqPBPtHd/ai9AC eNgb9vC1CC9qHuZLsO8v9xdAvvCNcUhVL8XHeQtEGNew0TbZU/Oltk13XogVueNZOM87Bi E/00/A2zsCcF4ZDmsKsfSDvESxEhVXCMP5q6FN5BN4ffis34yKVeUqJh9fY+Lqxqgz9Kos /9GMn1wCRXW+xlT37GVGHxrx519c9A0eYgKQvHpOtH1LFlFA9e0aDfeTUi9v9Q== 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=1776351866; 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=HQzoFw3qr3om+ewTm8KSWbc3Ynso96KLuXhCMjn3oKk=; b=rI51U0lfl6li7Ym2Pf53fUP/6VYz6ebKmgPSj5Xc6ybjmh+kKTcBUoBHXQBNVY/rN25kGA B77caOQEKFLHp7d409RkCBhPgpDoEjJnncqPxC8+0ppzEnhR/hLqLM33xGUOB0ikdy6B9t npQsoECKEQMjOrRkNF7/LPwso3YUPK+56nQS76UxtQWvRVWun+YIvjqoFPKEp9AD8Pb0yY tFns1VrZL0Imd54ujyDIVTQVY+a9H5udrQRlnOPPZb4s4FxNOUO6IWkfLrU2El2ys3cgfv c/9NBidOFEAqFD2AolhvHQK6sL3uRwp6YEx5pzuZcyNE6XHOouP8O3nQAq/DTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxLrn6Qrpz1BxR for ; Thu, 16 Apr 2026 15:04:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e1cf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 15:04:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: da6df572010c - stable/15 - x86: Add stub for Extended Destination ID support 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: da6df572010c423a4fbef76ebc972c83cb409e58 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 15:04:25 +0000 Message-Id: <69e0fa79.1e1cf.75f3894f@gitrepo.freebsd.org> The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=da6df572010c423a4fbef76ebc972c83cb409e58 commit da6df572010c423a4fbef76ebc972c83cb409e58 Author: Colin Percival AuthorDate: 2026-03-16 23:37:04 +0000 Commit: Colin Percival CommitDate: 2026-04-16 15:03:58 +0000 x86: Add stub for Extended Destination ID support Without an IOMMU, the APIC standard only allows 8 bits of Destination ID for MSI messages, limiting us to 256 CPUs. While IOMMUs can allow for more than 256 CPUs to be supported, they are not necessarily desirable in virtualized environments. The Extended Destination ID standard authored by David Woodhouse uses 7 "Reserved" bits for the high bits of a 15-bit Extended Destination ID in order to address this: http://david.woodhou.se/ExtDestId.pdf Add a loader tunable machdep.apic_ext_dest_id to control the use of this feature; the default value (-1) means "autodetect" while 0 and 1 mean disabled and enabled respectively. Code to detect host support in Xen, Hyper-V, KVM, and Bhyve will come in future commits, as will the code to use this setting in msi_map and ioapic_program_intpin. Tested on: EC2 r8i.96xlarge MFC after: 3 weeks Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55890 (cherry picked from commit d9db6d759dfcf4a4559e66e777599bb3fa8ca14c) --- sys/x86/include/apicvar.h | 1 + sys/x86/x86/local_apic.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/sys/x86/include/apicvar.h b/sys/x86/include/apicvar.h index c537d0ee0cdd..e088b3d53547 100644 --- a/sys/x86/include/apicvar.h +++ b/sys/x86/include/apicvar.h @@ -264,6 +264,7 @@ device_t ioapic_get_dev(u_int apic_id); extern int x2apic_mode; extern int lapic_eoi_suppression; +extern int apic_ext_dest_id; #ifdef _SYS_SYSCTL_H_ SYSCTL_DECL(_hw_apic); diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index ed9f985dafd5..cb7b03b313c1 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -2067,6 +2067,17 @@ apic_setup_local(void *dummy __unused) } SYSINIT(apic_setup_local, SI_SUB_CPU, SI_ORDER_SECOND, apic_setup_local, NULL); +/* Are we in a VM which supports the Extended Destination ID standard? */ +int apic_ext_dest_id = -1; +SYSCTL_INT(_machdep, OID_AUTO, apic_ext_dest_id, CTLFLAG_RDTUN, &apic_ext_dest_id, 0, + "Use APIC Extended Destination IDs"); + +/* Detect support for Extended Destination IDs. */ +static void +detect_extended_dest_id(void) +{ +} + /* * Setup the I/O APICs. */ @@ -2078,6 +2089,10 @@ apic_setup_io(void *dummy __unused) if (best_enum == NULL) return; + /* Check hypervisor support for extended destination IDs. */ + if (apic_ext_dest_id == -1) + detect_extended_dest_id(); + /* * Local APIC must be registered before other PICs and pseudo PICs * for proper suspend/resume order.