aboutsummaryrefslogtreecommitdiff
path: root/kmod
AgeCommit message (Collapse)AuthorFilesLines
2020-11-13remove kmod related filesThanos Makatos1-1867/+0
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-11Merge branch 'vfio-user'Thanos Makatos2-125/+0
2020-11-11drop the kernel moduleThanos Makatos3-2060/+0
vfio-user is on track to be accepted upstream, so we shouldn't need muser.ko. This patch removes it since keeping it in the source is a maintanance burden. The last version is stashed in https://github.com/nutanix/muser/tree/kmod. If there is a valid use case we can reconsider reinstating it. fixes #67 Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-08-12muser.ko: Update for Linux 5.8Felipe Franciosi1-3/+3
This fixes vfio.diff to apply cleanly on Linux 5.8 and renames vm_insert_pages to _vm_insert_pages because an upstream function of the same name has been added to the kernel since. Future work will include replacing our version of vm_insert_pages with the upstream and redo all necessary testing. We also update travis to use v5.8. Signed-off-by: Felipe Franciosi <felipe@nutanix.com> Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-03-25introduce vfio-over-socket transportThanos Makatos2-32/+95
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-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-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 Makatos1-3/+10
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-02-25mmap fd instead of grabbing pages when receiving DMA region registrationThanos Makatos2-147/+80
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-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 Makatos1-2/+2
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-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-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-05muser: fix the type of nr_pagesSwapnil Ingle1-3/+4
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
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>
2019-11-06Merge pull request #8 from swapnili/masterswapnili1-27/+25
Fix the return values type
2019-11-06muser, libmuser: Do not abuse muser_cmd.mmap.response to return errSwapnil Ingle1-10/+7
muser_cmd.mmap.response is unsigned and should not be used to return errors, instead use muser_cmd.err Also fixed the code path to use valid errno values. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-06muser.c: Fix the return values of the functionsSwapnil Ingle1-20/+21
1> Use errno for the failures 2> Use signed types for the returned variables Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-05remove obsolete comment, this is fixed by the IOMMU patchThanos Makatos1-2/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-11-05rename obsolete 'PCI server' with libmuserThanos Makatos1-3/+3
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-11-05fix compilation for 4.19.67Thanos Makatos1-8/+25
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-11-05don't print page type when failing to add pageThanos Makatos1-2/+2
page_has_type() seems to be an internal function and it's not critically usefull anyway Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-11-04muser.c: code cleanup and coding style fixupsSwapnil Ingle1-49/+49
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-04muser.h: remove unused variable struct muser_cmd_rw.bufSwapnil Ingle1-1/+0
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-04muser.h: fix the ioctl definationSwapnil Ingle1-1/+1
_IOW means userland is writing and kernel is reading _IOR means userland is reading and kernel is writing MUSER_DEV_CMD_WAIT should be _IOR as userland waits to read cmd from kernel. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2019-11-02Fix various format issuesFelipe Franciosi2-3/+2
Remove various spurious whitespaces and empty lines. Some other alignment issues, too. Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
2019-10-03Minor alignment fixesFelipe Franciosi1-7/+6
2019-10-02Log mmap_dev at debug levelFelipe Franciosi1-3/+3
2019-09-27ignore VFIO_IRQ_SET_DATA_NONEThanos Makatos1-0/+1
Need to explain why. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27return number of bytes actually provided by libmuserThanos Makatos1-5/+17
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27log message in kernel when reading from libmuser failsThanos Makatos1-1/+6
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27log message when not able to handle IRQ setThanos Makatos1-0/+15
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add more debug messages in muser.koThanos Makatos1-2/+13
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27fix typo in commentThanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27make function muser_read staticThanos Makatos1-2/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add TODOThanos Makatos1-0/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-27add FIXME regarding enabling DEBUG in kernel moduleThanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2019-09-05Minor style fixesFelipe Franciosi1-27/+16
2019-09-05Clarifications around mucmd_mmapFelipe Franciosi2-24/+17
2019-09-05muser, libmuser: make libmuser_{read,write} consistentSwapnil Ingle1-17/+1
Currently muser/libmuser_write() expects mucmd as buffer, while muser/libmuser_read() expects data buffer. We arleady have the mucmd in mudev->pending, so make muser/libmuser_write() to take data buffer instead of mucmd. This way libmuser_{read,write} are consistent and we do not use mucmd sent by user. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>