git: 3c03ab02cf31 - main - EC2: Set hw.dmar.enable="1"

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Wed, 25 Nov 2026 02:35:46 UTC
The branch main has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=3c03ab02cf312d4fdf37ce3ff90b901722c4b3cb

commit 3c03ab02cf312d4fdf37ce3ff90b901722c4b3cb
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2026-11-24 23:36:48 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-11-25 02:32:32 +0000

    EC2: Set hw.dmar.enable="1"
    
    Large EC2 "bare metal" instances route interrupts to APIC IDs > 255,
    and unlike the "virtualized" instances, don't support extended APIC
    destination IDs (since that's a hypervisor feature, and bare metal
    instances have no hypervisor).
    
    Enable the IOMMU for interrupt remapping; this unbreaks booting on
    m8i.metal-96xl and variants thereof (e.g. c8in).
    
    MFC after:      1 day
    Sponsored by:   Amazon
    Tested on:      c5n.9xlarge, c6a.24xlarge, c8in.96xlarge, c5.metal,
                    c6in.metal, c6a.metal, c7a.metal-48xl, c7i.metal-24xl,
                    c7i.metal-48xl, c8a.metal-24xl, c8a.metal-48xl,
                    c8i.metal-48xl, c8i.metal-96xl, c8in.metal-48xl,
                    c8in.metal-96xl, m5.metal, m8azn.metal-24xl
---
 release/tools/ec2.conf | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf
index b6dbee3a3cad..642919e9d93d 100644
--- a/release/tools/ec2.conf
+++ b/release/tools/ec2.conf
@@ -86,6 +86,10 @@ ec2_common() {
 	# a kernel panic unless we disable this.
 	echo 'hw.pci.intx_reroute=0' >> ${DESTDIR}/boot/loader.conf
 
+	# Large EC2 instances have APIC IDs > 255; bare metal instances
+	# use the iommu.
+	echo 'hw.dmar.enable="1"' >> ${DESTDIR}/boot/loader.conf
+
 	# Load the kernel module for the Amazon "Elastic Network Adapter"
 	echo 'if_ena_load="YES"' >> ${DESTDIR}/boot/loader.conf