]> git.proxmox.com Git - mirror_edk2.git/commit - OvmfPkg/VirtioBlkDxe/VirtioBlk.c
Ovmfpkg/VirtioBlkDxe: map virtio-blk request and response buffers
authorBrijesh Singh <brijesh.singh@amd.com>
Sun, 27 Aug 2017 22:53:25 +0000 (18:53 -0400)
committerLaszlo Ersek <lersek@redhat.com>
Mon, 28 Aug 2017 09:00:14 +0000 (11:00 +0200)
commit3540f2cef57afc08f18fe4db971f3b0e06b49d63
tree5383621b4f101d34ef3a6933549613ee43cbd83f
parent19165130470f010a427730ea270c154c9dd500df
Ovmfpkg/VirtioBlkDxe: map virtio-blk request and response buffers

When device is behind the IOMMU, driver is require to pass the device
address of virtio request, response and any memory referenced by those
request/response to the bus master.

The patch uses IOMMU-like member functions from VIRTIO_DEVICE_PROTOCOL to
map request and response buffers system physical address to the device
address.

- If the buffer need to be accessed by both the processor and a bus
  master then map with BusMasterCommonBuffer.

- If the buffer need to be accessed for a write operation by a bus master
  then map with BusMasterWrite.

- If the buffer need to be accessed for a read  operation by a bus master
  then map with BusMasterRead.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/VirtioBlkDxe/VirtioBlk.c