From: Baolu Lu <baolu.lu@linux.intel.com>
To: Pe3k <pe3cek@gmail.com>, iommu@lists.linux.dev
Cc: David Woodhouse <dwmw2@infradead.org>,
Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
Damien Le Moal <dlemoal@kernel.org>,
Niklas Cassel <cassel@kernel.org>,
linux-ide@vger.kernel.org
Subject: Re: iommu/vt-d: data corruption, AHCI gets IOVAs inside its RMRR (HP Gen8)
Date: Fri, 27 Nov 2026 13:38:47 +0800 [thread overview]
Message-ID: <3304e166-c2e6-4bda-bc75-46ca73f836e1@linux.intel.com> (raw)
In-Reply-To: <CAGvcwsDdKSZe0reeuT0eQabaSbM6+KAfwFimxiqhvKrjD2nQeg@mail.gmail.com>
On 11/25/26 02:08, Pe3k wrote:
> Hi,
>
> On the HP ProLiant MicroServer Gen8 (Xeon E3-1265L V2, C204, BIOS J06
> 04/04/2019) the AHCI controller is handed IOVAs inside an RMRR that the
> firmware declares for it. With the default translated DMA domain this
> corrupts disk data on every boot under write load. iommu=pt avoids it.
> Seen on two machines of this model, on 6.12.118, 7.3.4 and 7.4-rc4.
>
> Topology
> --------
> 00:1f.0 ISA bridge [8086:1c54] and 00:1f.2 AHCI [8086:1c02] share IOMMU
> group 10 (DMA-FQ), probed in that order. The group's reserved_regions
> include "0xf1f7e000 0xf1f94fff direct". The DMAR RMRRs covering that
> range list 00:1f.2 in their device scope, but not 00:1f.0.
>
> 6.12.118 (default cmdline)
> --------------------------
> Once per boot, ~20 min into sustained writes, 23 errors (21 + 2):
>
> DMAR: ERROR: DMA PTE for vPFN 0xf1f80 already set (to f1f80003 not 167119001)
>
> from AHCI writeback (ata_qc_issue -> iommu_dma_map_sg). Each one is a
> 4 KiB page that reaches the disk with wrong content: mostly zeros, some
> with firmware data from the RMRR. No I/O error is reported.
>
> 7.3.4 and 7.4-rc4 (default cmdline)
> -----------------------------------
> No DMAR errors. Instead 64-84 writes per boot fail before reaching the
> device:
>
> ata2.00: failed command: WRITE FPDMA QUEUED
> ... res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x40 (internal error)
>
> followed by I/O errors and 4-8 MiB of zeros in written files. In one
> 7.3.4 run the machine also took an NMI (iLO: "Unrecoverable System
> Error (NMI)"). An iommu:map trace filtered to the RMRR shows the cause:
>
> map: IOMMU: iova=0x00000000f1f7e000 - 0x00000000f1f7e000
> paddr=0x00000001c94d6000 size=0
> => iommu_map_nosync <= iommu_map_sg <= iommu_dma_map_sg
> <= dma_map_sg_attrs <= ata_qc_issue
>
> With iommu=pt both 6.12 and 7.3.4 run clean.
>
> Suspected cause (not verified in the source)
> --------------------------------------------
> The domain's IOVA reservations seem to come from the device that
> initialises it (00:1f.0, no RMRR). When 00:1f.2 joins the domain, its
> RMRRs are identity-mapped but never reserved in the IOVA allocator.
>
> Reproducer
> ----------
> Fresh boot, ext4 on an AHCI disk, 6 parallel cp of a 10 GiB random
> file, sync, drop_caches, compare hashes. Fails within ~25 minutes.
>
> I can test patches on a spare machine of this model. Full logs, the
> DMAR table and traces are available on request.
>
> I used Claude Code to run the tests, analyse the
> logs and draft this report. The results and logs are from my own
> machines, and I have reviewed the report.
This seems to have been root-caused in this thread:
https://lore.kernel.org/linux-iommu/02b201dd5ea3$02b88430$08298c90$@machelett.com/
A fix patch has also been posted:
https://lkml.iu.edu/2411.1/00575.html
Perhaps you could give that patch a try?
Thanks,
baolu
next prev parent reply other threads:[~2026-11-27 5:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 18:08 iommu/vt-d: data corruption, AHCI gets IOVAs inside its RMRR (HP Gen8) Pe3k
2026-11-24 21:19 ` Niklas Cassel
2026-11-25 10:01 ` Pe3k
2026-11-25 11:00 ` Niklas Cassel
2026-11-25 13:48 ` Pe3k
2026-11-25 15:49 ` Pe3k
2026-11-26 8:48 ` Niklas Cassel
2026-11-27 5:38 ` Baolu Lu [this message]
2026-11-27 10:13 ` Pe3k
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3304e166-c2e6-4bda-bc75-46ca73f836e1@linux.intel.com \
--to=baolu.lu@linux.intel.com \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=dwmw2@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-ide@vger.kernel.org \
--cc=pe3cek@gmail.com \
--cc=robin.murphy@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.