From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org,
Alejandro Jimenez <alejandro.j.jimenez@oracle.com>,
Sairaj Kodilkar <sarunkod@amd.com>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] hw/i386/amd_iommu: Mask address when calculating large PTE page size
Date: Tue, 17 Nov 2026 07:08:15 -0500 [thread overview]
Message-ID: <20261117070754-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAFEAcA_osj+ewemYAt1A+8LA+LuDcJXqvyLfdQS68C_TLq5qjA@mail.gmail.com>
On Tue, Nov 17, 2026 at 11:40:27AM +0000, Peter Maydell wrote:
> On Thu, 5 Nov 2026 at 10:58, Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > The amd_iommu handling of the "large PTE page size" (where Next Level
> > bits are 0b111) case is not correct. We calculate the page size
> > using the address in the descriptor (as per table 14 of the spec),
> > but we don't explicitly pick out the Page Address field, instead
> > passing the whole PTE word to cto64(). This means that a PTE which
> > incorrectly sets all the reserved high bits can cause cto64() to
> > return 63 or 64, and we will try to shift by an out of range amount,
> > which is undefined behaviour.
> >
> > Mask the PTE with AMDVI_DEV_PT_ROOT_MASK to get the page address
> > (matching how we do it to get the address for the next page table
> > level in NEXT_PTE_ADDR).
> >
> > Cc: qemu-stable@nongnu.org
> > Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3618
> > Reported-by: huntr bubble <https://gitlab.com/bubblehuntr>
> > Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> > ---
>
> As this is a small fix that's been reviewed and not yet picked
> up, I'll take it through target-arm.next. I have a small set
> of "oops I forgot about that" patches that I'm planning to
> send today.
>
> thanks
> -- PMM
yea have a small set too.
Sure, take this.
Acked-by: Michael S. Tsirkin <mst@redhat.com>
prev parent reply other threads:[~2026-11-17 12:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 10:58 [PATCH] hw/i386/amd_iommu: Mask address when calculating large PTE page size Peter Maydell
2026-11-06 1:29 ` Alejandro Jimenez
2026-11-06 4:25 ` Sairaj Kodilkar
2026-11-17 11:40 ` Peter Maydell
2026-11-17 12:08 ` Michael S. Tsirkin [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=20261117070754-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=alejandro.j.jimenez@oracle.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sarunkod@amd.com \
/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.