From: Vasant Hegde <vasant.hegde@amd.com>
To: Akshay Jindal <Akshay.Jindal@amd.com>, iommu@lists.linux.dev
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>,
Robin Murphy <robin.murphy@arm.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] iommu/amd: Skip non-IVMD entries when parsing IVRS memory definitions
Date: Mon, 2 Nov 2026 21:31:54 +0530 [thread overview]
Message-ID: <92c85732-9274-4bc1-83e4-0d3aa9941494@amd.com> (raw)
In-Reply-To: <20261018074549.1493086-1-Akshay.Jindal@amd.com>
On 10/18/2026 1:15 PM, Akshay Jindal wrote:
> init_memory_definitions() walks every top-level subtable including the
> IVHD blocks (type 0x10/0x11/0x40) in the IVRS ACPI table. It interprets
> each one as a 'struct ivmd_header', solely on m->flags, without first
> checking that the subtable's type actually is one of the IVMD types
> (ACPI_IVMD_TYPE, ACPI_IVMD_TYPE_ALL, ACPI_IVMD_TYPE_RANGE).
>
> if (m->flags & (IVMD_FLAG_UNITY_MAP | IVMD_FLAG_EXCL_RANGE))
> init_unity_map_range(m, table);
>
> IVMD_FLAG_UNITY_MAP (0x01) occupies the same bit position as the IVHD
> flags field's HtTunEn bit. Unlike real hardware, QEMU's AMD IOMMU
> emulation sets HtTunEn unconditionally (flags=0xD1 for type 0x10,
> 0x11 for type 0x11), so every QEMU-emitted IVHD block is misidentified
> as a unity-map/exclusion-range IVMD entry, which subsequently results
> in the creation of a bogus pci segment. Eg:
>
> AMD-Vi: PCI segment : 0x4000, last bdf : 0x0000
>
> Fix by checking the subtable's type before treating it as IVMD.
>
> Fixes: be2a022c0dd0 ("x86, AMD IOMMU: add functions to parse IOMMU memory mapping requirements for devices")
> Cc: stable@vger.kernel.org
> Signed-off-by: Akshay Jindal <Akshay.Jindal@amd.com>
Thanks. Queued for rc.
-Vasant
prev parent reply other threads:[~2026-11-02 16:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 7:45 Akshay Jindal
2026-11-02 16:01 ` Vasant Hegde [this message]
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=92c85732-9274-4bc1-83e4-0d3aa9941494@amd.com \
--to=vasant.hegde@amd.com \
--cc=Akshay.Jindal@amd.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=stable@vger.kernel.org \
--cc=suravee.suthikulpanit@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®