]> git.ipfire.org Git - thirdparty/qemu.git/commit
amd_iommu: Fix truncation of oldval in amdvi_writeq
authorEthan Milon <ethan.milon@eviden.com>
Tue, 17 Jun 2025 15:04:27 +0000 (15:04 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 17 Jul 2025 03:57:23 +0000 (06:57 +0300)
commit787a817cd5691802d9ad69aa1bd969df615b47a9
tree9482bf3c0d34f18a6cc20513f5e207e303cea01b
parentfc1ad5124f5407437d0720fc51db6d88013add1a
amd_iommu: Fix truncation of oldval in amdvi_writeq

The variable `oldval` was incorrectly declared as a 32-bit `uint32_t`.
This could lead to truncation and incorrect behavior where the upper
read-only 32 bits are significant.

Fix the type of `oldval` to match the return type of `ldq_le_p()`.

Cc: qemu-stable@nongnu.org
Fixes: d29a09ca6842 ("hw/i386: Introduce AMD IOMMU")
Signed-off-by: Ethan Milon <ethan.milon@eviden.com>
Message-Id: <20250617150427.20585-9-alejandro.j.jimenez@oracle.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 5788929e05e18ed5f76dc8ade4210f022c9ba5a1)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/i386/amd_iommu.c