panic: size 22400, No vmcore KDB: debugger backends: ddb KDB: current backend: ddb ---<>--- Copyright (c) 1992-2022 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 14.0-CURRENT #4 main-n255677-71fe907dfb03c-dirty: Wed May 18 12:07:30 CEST 2022 pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO amd64 FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. VT(vga): resolution 640x480 CPU: Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz (3500.17-MHz K8-class CPU) Origin="GenuineIntel" Id=0x306f2 Family=0x6 Model=0x3f Stepping=2 Features=0xbfebfbff Features2=0x7ffefbff AMD Features=0x2c100800 AMD Features2=0x21 Structured Extended Features=0x37ab XSAVE Features=0x1 VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr TSC: P-state invariant, performance statistics real memory = 34359738368 (32768 MB) avail memory = 33176645632 (31639 MB) Event timer "LAPIC" quality 600 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 12 CPUs FreeBSD/SMP: 1 package(s) x 6 core(s) x 2 hardware threads random: registering fast source Intel Secure Key RNG random: fast provider: "Intel Secure Key RNG" random: unblocking device. ioapic0 irqs 0-23 ioapic1 irqs 24-47 Launching APs: 1 5 10 11 2 6 3 7 4 8 9 random: entropy device external interface kbd1 at kbdmux0 vtvga0: smbios0: at iomem 0xf0560-0xf057e smbios0: Version: 2.8, BCD Revision: 2.7 aesni0: acpi0: acpi0: Power Button (fixed) cpu0: on acpi0 dmar0: iomem 0xfbffc000-0xfbffcfff on acpi0 atrtc0: port 0x70-0x71,0x74-0x77 irq 8 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s Event timer "RTC" frequency 32768 Hz quality 0 attimer0: port 0x40-0x43,0x50-0x53 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 Event timer "HPET" frequency 14318180 Hz quality 350 Event timer "HPET1" frequency 14318180 Hz quality 340 Event timer "HPET2" frequency 14318180 Hz quality 340 Event timer "HPET3" frequency 14318180 Hz quality 340 Event timer "HPET4" frequency 14318180 Hz quality 340 Event timer "HPET5" frequency 14318180 Hz quality 340 Event timer "HPET6" frequency 14318180 Hz quality 340 Event timer "HPET7" frequency 14318180 Hz quality 340 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <24-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 pcib0: on acpi0 pci0: on pcib0 pci0: at device 11.1 (no driver attached) pci0: at device 11.2 (no driver attached) pci0: at device 16.1 (no driver attached) pci0: at device 16.6 (no driver attached) pci0: at device 18.1 (no driver attached) acpi_syscontainer0: on acpi0 acpi_syscontainer1: on acpi0 acpi_syscontainer2: on acpi0 acpi_syscontainer3: on acpi0 apei0: on acpi0 pcib1: port 0xcf8-0xcff on acpi0 pci1: on pcib1 pcib2: irq 26 at device 1.0 on pci1 pci2: on pcib2 pcib3: irq 32 at device 2.0 on pci1 pci3: on pcib3 pci3: at device 0.0 (no driver attached) pci3: at device 0.1 (no driver attached) pcib4: irq 40 at device 3.0 on pci1 pci4: on pcib4 pci1: at device 17.0 (no driver attached) ahci0: port 0xf110-0xf117,0xf100-0xf103,0xf0f0-0xf0f7,0xf0e0-0xf0e3,0xf020-0xf03f mem 0xfb438000-0xfb4387ff irq 16 at device 17.4 on pci1 unknown: dmar0 pci0:0:20:0 rid a0 domain 0 mgaw 48 agaw 48 re-mapped unknown: dmar0 pci0:0:26:0 rid d0 domain 1 mgaw 48 agaw 48 re-mapped unknown: dmar0 pci0:0:29:0 rid e8 domain 2 mgaw 48 agaw 48 re-mapped ahci0: dmar0 pci0:0:17:4 rid 8c domain 3 mgaw 48 agaw 48 re-mapped ahci0: AHCI v1.30 with 4 6Gbps ports, Port Multiplier not supported ahcich0: at channel 0 on ahci0 panic: size 22400 cpuid = 10 time = 1 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xffffffff82364590 vpanic() at vpanic+0x17f/frame 0xffffffff823645e0 panic() at panic+0x43/frame 0xffffffff82364640 iommu_gas_map() at iommu_gas_map+0x230/frame 0xffffffff823646d0 iommu_bus_dmamap_load_something() at iommu_bus_dmamap_load_something+0x10f/frame 0xffffffff82364780 iommu_bus_dmamap_load_buffer() at iommu_bus_dmamap_load_buffer+0x1c5/frame 0xffffffff82364820 bus_dmamap_load() at bus_dmamap_load+0x86/frame 0xffffffff823648a0 ahci_ch_attach() at ahci_ch_attach+0x4ec/frame 0xffffffff82364950 device_attach() at device_attach+0x3c1/frame 0xffffffff82364990 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff823649c0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff823649e0 ahci_attach() at ahci_attach+0x8d7/frame 0xffffffff82364a30 ahci_pci_attach() at ahci_pci_attach+0xa3b/frame 0xffffffff82364aa0 device_attach() at device_attach+0x3c1/frame 0xffffffff82364ae0 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff82364b10 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff82364b30 pci_attach() at pci_attach+0xe0/frame 0xffffffff82364b70 acpi_pci_attach() at acpi_pci_attach+0x19/frame 0xffffffff82364bc0 device_attach() at device_attach+0x3c1/frame 0xffffffff82364c00 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff82364c30 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff82364c50 acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x42d/frame 0xffffffff82364cb0 device_attach() at device_attach+0x3c1/frame 0xffffffff82364cf0 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff82364d20 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff82364d40 acpi_probe_children() at acpi_probe_children+0x207/frame 0xffffffff82364da0 acpi_attach() at acpi_attach+0x9a6/frame 0xffffffff82364e30 device_attach() at device_attach+0x3c1/frame 0xffffffff82364e70 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff82364ea0 bus_generic_attach() at bus_generic_attach+0x18/frame 0xffffffff82364ec0 device_attach() at device_attach+0x3c1/frame 0xffffffff82364f00 device_probe_and_attach() at device_probe_and_attach+0x70/frame 0xffffffff82364f30 bus_generic_new_pass() at bus_generic_new_pass+0xed/frame 0xffffffff82364f60 bus_set_pass() at bus_set_pass+0x46/frame 0xffffffff82364f90 configure() at configure+0x9/frame 0xffffffff82364fa0 mi_startup() at mi_startup+0x20f/frame 0xffffffff82364ff0 btext() at btext+0x22 KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped at kdb_enter+0x32: movq $0,0x12793c3(%rip) db> x/s version version: FreeBSD 14.0-CURRENT #4 main-n255677-71fe907dfb03c-dirty: Wed May 18 12:07:30 CEST 2022\012 pho@mercat1.netperf.freebsd.org:/usr/src/sys/amd64/compile/PHO\012 db> diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c index 99d47f0b6ede8..70d903b70818b 100644 --- a/sys/dev/iommu/busdma_iommu.c +++ b/sys/dev/iommu/busdma_iommu.c @@ -584,7 +584,7 @@ iommu_bus_dmamap_load_something1(struct bus_dma_tag_iommu *tag, } buflen1 = buflen > tag->common.maxsegsz ? tag->common.maxsegsz : buflen; - size = round_page(offset + buflen1); + size = buflen1; /* * (Too) optimistically allow split if there are more @@ -600,24 +600,7 @@ iommu_bus_dmamap_load_something1(struct bus_dma_tag_iommu *tag, gas_flags, ma + idx, &entry); if (error != 0) break; - if ((gas_flags & IOMMU_MF_CANSPLIT) != 0) { - KASSERT(size >= entry->end - entry->start, - ("split increased entry size %jx %jx %jx", - (uintmax_t)size, (uintmax_t)entry->start, - (uintmax_t)entry->end)); - size = entry->end - entry->start; - if (buflen1 > size) - buflen1 = size; - } else { - KASSERT(entry->end - entry->start == size, - ("no split allowed %jx %jx %jx", - (uintmax_t)size, (uintmax_t)entry->start, - (uintmax_t)entry->end)); - } - if (offset + buflen1 > size) - buflen1 = size - offset; - if (buflen1 > tag->common.maxsegsz) - buflen1 = tag->common.maxsegsz; + buflen1 = entry->end - entry->start; KASSERT(vm_addr_align_ok(entry->start + offset, tag->common.alignment), Test scenario: boot w/ hw.dmar.enable=1