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>
|
|
And print file path when it fails to mmap.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Run unit tests with -fsanitize-address too.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
|
|
We were forgetting to close vfu_ctx->fd, add a tran callback for this. While
we're there, clean up the tran callbacks somewhat.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
|
|
These aren't interesting, but it lets us run ASAN.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
|
|
Define the full-size capability as defined in the specification.
Previously, we were defining the structure as in the form used by PCI Express
Integrated Endpoints. It's reasonable to assume, however, that a vfio-user
device is a normal PCI Express Endpoint connected over a Link.
We'll go further, and define the whole structure, including the slot registers
at the end that are usually only used for Ports.
The presumption here is that it can't hurt to use the larger size: the only way
a client could care is if it presumed the next capability was at a particular
offset from this one, and we must hope nothing is that silly.
This also corrects a buffer overflow: cap_size() in fact disagreed with the
original size of our struct pxcap (found via clang's address sanitizer).
Signed-off-by: John Levon <john.levon@nutanix.com
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
We need to initialize .client_max_fds to get the fd array allocated properly in
process_request().
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
|
|
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
CI: run client/server through Valgrind
And fail the test if Valgrind discovers any errors.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
run client/server sample in CI
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
SPDK would like to statically link in libvfio-user, and it builds against a
staged installation directory, so always install the static library too.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Migration now takes a non-trivial amount of time, plus running the
sample through Valgrind will inherently be slower.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
This is simply to make debugging easier.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
The interrupt might be delivered too soon, when e.g. the client is
waiting for a response for a message it previously sent. This isn't 100%
bulletproof.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Not that useful, apart from running it through Valgrind in CI.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
The number of migration iterations would depend on whether or how many
times the fake guest thread would touch BAR1.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
When the device is set to stop-and-copy state it must stop operating, which means that if it has been previously programmed to triggers it should refrain from doing so.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
The fake guest thread unconditionally performs the first iteration, so
there's no need to give it time to do stuff.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Handling data_offset and data_size internally is wrong: we can't simply
assume that the migration data should be appending to the migration
region, devices might have their own requirements.
This also requires a way for the device to return the data_offset, we
do this by making the prepare_data callback applicable in resume state.
Also, allow migration read/write callabcks to return errors.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
* add fake guest thread in migration sample
This patch adds a thread that pretends to be the guest VM (while the
client itself is the VMM) in the live migration sample. Our goal is to
have the fake guest modifying device state while live migration is
ongoing and when live migration has finished the device state should be
correct in the destination server.
Currently this doesn't work because the server blindly applies device
state when resuming, which is wrong because some device state must be
applied to specific offsets. To fix this we have to include the offset
and length (along with BAR1 data) in the migration stream.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
In VFIO, pending_bytes can be re-read and each time it's read the device
can return a new value (even higher than the previous one). Rather than
exposing the vfio-user device implementation to such complicated
semantics, we cache pending_bytes and handle repeated calls to it
ourselves. Even if pending_bytes does change in the device, the client
will either way read it as a part of the current migration iteration.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
We don't need data_size, it only complicates things.
We don't use migr_data at all.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
(#254)
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Plus migration states array fixes and unit tests.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
prepared (#257)
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
This makes it easier to tell where we change the migration iteration state. In
the future we might also perform additional validations.
|
|
This patch adds a simplistic pre-copy phase in the live migration
sample. The end goal is have a separate thread in the client to
modify device state while the device is in the pre-copy phase. This will
be done in later patches.
BAR1 is saved during the pre-copy phase and BAR0 is saved during the
stop-and-copy phase. This is purely for convenience. There are quite a
few assumptions and FIXMEs, even in the client code. We plan to address
them in future patches.
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
This makes debugging a little bit easier.
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>
|
|
vfio_migr_state_transition_is_valid for clarity (#260)
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: John Levon <john.levon@nutanix.com>
Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
|
|
A newer GCC caught that in test_dma_controller_add_region_no_fd(), we were not
allocating enough stack space for the region at the end of the dma_controller_t.
Also add Fedora Rawhide to github CI for this.
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
* Misc fixes for DMA_MAP region prot
1. Validate prot passed in vfu_addr_to_sg()
2. Let user know region prot via vfu_unmap_dma_cb_t
Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
|
|
reword explanation of how dirty bitmaps are returned for clarity
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
|