aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-05-26user arbitraty path for control filesThanos Makatos2-19/+20
The parent directories must exist and the last component must be the IOMMU group. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-05-21allow non-root access to UNIX domain socketThanos Makatos1-4/+11
SPDK has a hard time running as non-root. This is a temporary hack. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-05-20allow installation location to be overriddenThanos Makatos1-0/+2
This allows package systems to use /usr (instead of CMake's default /usr/local), which is the typical choice.
2020-05-15use /var/run/muser instead of /dev/vfioThanos Makatos4-3/+4
This avoids problems with cgroups. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-05-14install libvfio libraryThanos Makatos1-0/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-05-13disable building kernel moduleThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-27fix compilationThanos Makatos2-7/+4
Compilation is broken because it required an existing installation of libmuser, including the correct header files fixes it. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-25trap SIGINT in gpio sampleThanos Makatos1-2/+26
This allows system calls to return if a signal is sent (e.g. SIGINT) in order to clean uo properly. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-25use lm_ctx_destroy for cleaning up failed lm_ctx_createThanos Makatos1-7/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-25don't close invalid fds and log error if close failsThanos Makatos2-9/+30
This helps reduce noise and debugging. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-25introduce vfio-over-socket transportThanos Makatos10-93/+1108
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-25save/restore errno in lm_logThanos Makatos1-4/+4
This simplifies callers of lm_log who use errno. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-24provide more information in some error casesThanos Makatos1-3/+10
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-24coding style fixesThanos Makatos1-16/+16
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-24don't use fd for matching DMA region for unmapThanos Makatos3-38/+30
The fd might come from another process so it doesn't make sense, the IOVA range alone is sufficient to determine the DMA region to unmap. Also, don't fail unmapping DMA regions that don't exist. Maybe we should revisit this and ignore the error at the client side? Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-24pack struct pmcsThanos Makatos1-2/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-03-09ignore NULL arg in dma_controller_destroyThanos Makatos1-0/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28log error messages when failing to remove DMAThanos Makatos3-13/+21
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28make remove DMA message consistent to addThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28don't pass negative error code to strerrorThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28don't dup DMA region fdThanos Makatos1-7/+1
fixes #47 Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28code cleanupThanos Makatos1-1/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28add sample to test #47Thanos Makatos2-0/+111
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28keep reference to file backing DMA regionThanos Makatos1-4/+2
This is required for restartable device emulation. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28refactor libmuser_unl_ioctlThanos Makatos1-88/+93
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28print file path for DMA map/unmapThanos Makatos1-9/+37
This should probably only be done for debug builds, and I don't think we need to print the fd. I'm enabling it for now because this is a new feature so it's good to have these messages until we're convinced it works properly. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28improve readability of messages about memory rangesThanos Makatos1-1/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28ignore non-existent DMA regions when unmappingThanos Makatos1-2/+11
The problem of not receiving a DMA unmap looks like it will be solved by having VFIO send us the DMA unmap even if we haven't called vfio_pin_pages, so instead of failing for regions we haven't mapped (e.g. non-shared regions) we simply ignore that operation. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-28use correct fd for DMA unmapThanos Makatos2-4/+11
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25mmap fd instead of grabbing pages when receiving DMA region registrationThanos Makatos3-156/+93
This enables huge pages to work. Also, it avoids requiring having to pin memory. The solution is not 100% correct because since we no longer call vfio_pin_pages, VFIO doesn't send the DMA registration event and we end up getting duplicate regions which we reject (this is because of our internal DMA bookkeeping implementation). We need to work with the community to find a solution. fixes #28 fixes #29 fixes #38 Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25use better flags for allocating device memoryThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25add test to repro issue #29Thanos Makatos2-0/+219
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25gpio sample: print error message when device UUID is missingThanos Makatos1-4/+10
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25remove extraneous new line from muser print statementsThanos Makatos1-5/+5
The muser print macro automatically inserts a new line. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25rename vfio_dma_mapping to muser_dma_mappingThanos Makatos1-19/+31
This is a struct private to muser. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25improve readability of messages about memory rangesThanos Makatos2-13/+17
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25define DEBUG in kmod for debug buildsThanos Makatos1-1/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-05use vmalloc for allocating array of pagesThanos Makatos1-2/+2
Otherwise kmalloc can fail to allocate memory for larger guest VM RAM (>= 3GB). Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-01-29Merge pull request #35 from swapnili/masterswapnili1-6/+16
Fix for #34 issue
2020-01-28muser: protect module unload if mudev is opened by vfioSwapnil Ingle1-1/+9
Grab the module reference if mudev is opened from vfio side. We need to protect module unloads if, 1> mudev is opened by qemu 2> mudev is opened by device emulation Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-01-28muser: Code tidyup and added WARN_ON()Swapnil Ingle1-5/+7
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-01-20explain how to enable VFIO tracing in QEMUThanos Makatos1-0/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-01-13don't take address of packed memberThanos Makatos1-4/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-01-13don't use page offset as address in device mapThanos Makatos1-2/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-12-17don't ignore mmap return value from libmuserThanos Makatos1-1/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-12-17return correct error code on device map failure from user spaceThanos Makatos1-5/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-12-05muser: fix the type of nr_pagesSwapnil Ingle1-3/+4
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-21Merge pull request #20 from swapnili/masterswapnili5-115/+59
General cleanup and fixes
2019-11-21muser.c: Do not destroy DMA_MAP information from libmuser_release()Swapnil Ingle1-46/+34
When the application close(muser_control_dev), do not destroy the DMA_MAP information. Reasons: - Application should be able to connect back to DMA_MAP's. - Qemu(vfio-client) is not aware when the DMA_MAP is destroyed. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-21muser.c: Fix memory leak, free dma_mapSwapnil Ingle1-15/+7
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>