OSDN Git Service

vfio/platform: read and write support for the device fd
authorAntonios Motakis <a.motakis@virtualopensystems.com>
Mon, 16 Mar 2015 20:08:47 +0000 (14:08 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 16 Mar 2015 20:08:47 +0000 (14:08 -0600)
commit6e3f264560099869f68830cb14b3b3e71e5ac76a
tree2b7ee9a62d4f88fd647b1084bd0f3f3353275df3
parente8909e67cac3ad3868dc86cc6b1445f39c71bf63
vfio/platform: read and write support for the device fd

VFIO returns a file descriptor which we can use to manipulate the memory
regions of the device. Usually, the user will mmap memory regions that are
addressable on page boundaries, however for memory regions where this is
not the case we cannot provide mmap functionality due to security concerns.
For this reason we also allow to use read and write functions to the file
descriptor pointing to the memory regions.

We implement this functionality only for MMIO regions of platform devices;
PIO regions are not being handled at this point.

Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
Signed-off-by: Baptiste Reynal <b.reynal@virtualopensystems.com>
Reviewed-by: Eric Auger <eric.auger@linaro.org>
Tested-by: Eric Auger <eric.auger@linaro.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/platform/vfio_platform_common.c
drivers/vfio/platform/vfio_platform_private.h