git: c3f47d8040a8 - releng/15.2 - EC2: Set hw.dmar.enable="1"

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Fri, 27 Nov 2026 00:00:18 UTC
The branch releng/15.2 has been updated by cperciva:

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

commit c3f47d8040a81d1476865bc6c1b0ca9ae4d14f9e
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2026-11-24 23:36:48 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2026-11-26 23:59:27 +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).
    
    Approved by:    re (cperciva)
    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
    
    (cherry picked from commit 3c03ab02cf312d4fdf37ce3ff90b901722c4b3cb)
    (cherry picked from commit 927b349ff141b936adfe9ffd1eb10bea72f0307c)
---
 release/tools/ec2.conf | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf
index dc1818219816..a242ec5202e1 100644
--- a/release/tools/ec2.conf
+++ b/release/tools/ec2.conf
@@ -82,6 +82,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