audk/OvmfPkg/IoMmuDxe
Gerd Hoffmann a52044a9e6 OvmfPkg/IoMmuDxe: add locking to IoMmuAllocateBounceBuffer
Searching for an unused bounce buffer in mReservedMemBitmap and
reserving the buffer by flipping the bit is a critical section
which must not be interrupted.  Raise the TPL level to ensure
that.

Without this fix it can happen that IoMmuDxe hands out the same
bounce buffer twice, causing trouble down the road.  Seen happening
in practice with VirtioNetDxe setting up the network interface (and
calling into IoMmuDxe from a polling timer callback) in parallel with
Boot Manager doing some disk I/O.  An ASSERT() in VirtioNet caught
the buffer inconsistency.

Full story with lots of details and discussions is available here:
https://bugzilla.redhat.com/show_bug.cgi?id=2211060

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2023-07-19 17:36:31 +00:00
..
CcIoMmu.c OvmfPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
CcIoMmu.h OvmfPkg/IoMmuDxe: Rename AmdSevIoMmu to CcIoMmu 2022-12-18 02:14:31 +00:00
IoMmuBuffer.c OvmfPkg/IoMmuDxe: add locking to IoMmuAllocateBounceBuffer 2023-07-19 17:36:31 +00:00
IoMmuDxe.c OvmfPkg/IoMmuDxe: Rename AmdSevIoMmu to CcIoMmu 2022-12-18 02:14:31 +00:00
IoMmuDxe.inf OvmfPkg/IoMmuDxe: Rename AmdSevIoMmu to CcIoMmu 2022-12-18 02:14:31 +00:00
IoMmuInternal.h OvmfPkg/IoMmuDxe: Reserve shared memory region for DMA operation 2022-12-18 02:14:31 +00:00