Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Very few capabilities are handled, and implementation isn't great.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
If the user wanted non-blocking operation, don't block on the socket
waiting for requests. Instead, use MSG_DONTWAIT to attempt to get the
next request and return.
The other operations all remain as blocking calls because they
are not expected to ever need to wait.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
|
|
This is both for consistency and because the socket transport
is going to need some place to cache things to handle partial
sends and receives.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
This patch introduces a new device callback that is called when a DMA region
is removed. The device must provide this callback and when the callback returns
all references to the DMA regions must have been removed. This new functionality
is necessary since a DMA region can be removed at any time, so the device must
be given a chance to drop all references and perform the necessary cleanup.
This patch also stores lm_ctx_t inside dma_controller_t so that we don't have
to pass lm_ctx_t when calling dma_XXX functions.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Using lm_ctx_poll() simply polls for work and returns instead
of blocking. It is only valid when used on an lm_ctx created
with LM_FLAG_ATTACH_NB.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
|
|
This makes it unsafe to take pointers to addresses within
this data structure, and lots of the code does that.
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
|
|
This is useful when using another log function from the log function callback.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
When PCI_COMMAND interrupt disable bit set to 1, it means
disable the pin-based INTx interrupt.
For NVMe controller, it will use INTx first, and then switch
to MSIX, the interrupt vector 0 is both valid for INTx and
MSIX, so here we remove the check when posting an interrupt,
just check the interrupt fd is valid or not.
Signed-off-by: Changpeng Liu <changpeng.liu@intel.com>
(cherry picked from commit 8ab7ca7d04365a7c39cd12ea45f8b9f7fa0afd47)
|
|
This is required for using multiple controllers in SPDK.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
|
|
|
|
The parent directories must exist and the last component must be the
IOMMU group.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
SPDK has a hard time running as non-root. This is a temporary hack.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
This allows package systems to use /usr (instead of CMake's default
/usr/local), which is the typical choice.
|
|
This avoids problems with cgroups.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
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>
|
|
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>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
This helps reduce noise and debugging.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
This simplifies callers of lm_log who use errno.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
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>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
fixes #47
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
This is required for restartable device emulation.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
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>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
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>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|