hw/i386/amd_iommu: Fix IOMMU event log encoding errors
authorWei Huang <wei.huang2@amd.com>
Fri, 22 Apr 2022 05:51:46 +0000 (00:51 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 16 May 2022 20:15:40 +0000 (16:15 -0400)
commit18aa91cddd8caa14aae094f9b59c0381959cb320
tree9a4a41dd9c47b99521a73d3bb7cbfbae84656242
parentc300bbe8d2a84003775c2ebb2b2885b80b1d9c32
hw/i386/amd_iommu: Fix IOMMU event log encoding errors

Coverity issues several UNINIT warnings against amd_iommu.c [1]. This
patch fixes them by clearing evt before encoding. On top of it, this
patch changes the event log size to 16 bytes per IOMMU specification,
and fixes the event log entry format in amdvi_encode_event().

[1] CID 1487116/1487200/1487190/1487232/1487115/1487258

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Wei Huang <wei.huang2@amd.com>
Message-Id: <20220422055146.3312226-1-wei.huang2@amd.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/amd_iommu.c