aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-05-23libvfio-user.h: sync VFIO_DEVICE_STATE_XXXX definitions with upstream (#690)Jag Raman10-92/+110
Rename VFIO_DEVICE_STATE_XXXX defines as VFIO_DEVICE_STATE_V1_XXXX. Upstream renamed these variable to be of the XXXX_V1_XXXX format and switched an enum for VFIO_DEVICE_STATE_XXXX. Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Reviewed-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-05-17tests: add checks to confirm test environment (#688)Jag Raman2-3/+8
test-lspci.sh: some test platforms don't include the lspci command, as such skip this test if lspci is not found test-linkage.sh: specify the source and build root paths of the subproject instead of the root paths of the master project Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-05-16add a slack invite link (#685)John Levon1-1/+2
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-05-16add a diagram to README.md (#686)John Levon3-0/+3
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-05-13samples/client.c: fix implicit casting of const char pointers (#682)Jag Raman2-2/+3
samples/client.c implicitly casts const char * to char * in a couple of places - as such discards the const qualifier. QEMU complains about this as it builds with -Werror=discarded-qualifiers This patch declares irq_to_str as an array of const char pointers. It also casts a "migrate_to() -> _argv" member explicitly Also adds '-Wwrite-strings' build flag to catch similar issues in the future Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-05-13fix fedora CI (#683)John Levon1-1/+1
Presumably Fedora 36 came out, as our docker label moved, and we can no longer install. Change the docker label to fedora:35 to fix. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2022-05-12re-instate -Werror (#681)John Levon1-0/+4
This got lost in the translation to meson; add -Werror for debug builds. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2022-05-12run scan-build in CI (#680)John Levon6-27/+40
Yet another static analyzer pass, this one is used by SPDK, and as it did detect some minor issues, it's worth running. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-05-12build PR runs in release mode (#669)John Levon2-12/+12
Instead of "plain", which doesn't specify any optimization, use "release", which both turns off -DDEBUG and enables -O3. Switch the default build to "debug" - we can't use optimization if we want to run valgrind, as there are apparent CPython bugs that trip up valgrind in that case. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2022-05-12add an ubuntu-latest PR run (#668)John Levon3-0/+15
Without this, we didn't detect the openssl-3.0 build breakage. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-05-09build: delete CMake build rulesDaniel P. Berrangé6-325/+1
Now that Meson is functional, support for building with CMake is removed so that there is only one build system to maintain. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09build: switch Makefile over to use mesonDaniel P. Berrangé1-120/+11
This cuts out most of the current Makefile, leaving a simplified set of targets that are a shim to the various meson commands. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09docs: rewrite to refer to meson commands instead of cmakeDaniel P. Berrangé2-17/+67
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09github: switch workflows over to using mesonDaniel P. Berrangé3-29/+16
This switch the pull request and coverity workflows over to use Meson instead of cmake. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09github: add 'coverity.sh' script to replicate 'coverity' make targetDaniel P. Berrangé1-0/+35
Most of 'Makefile' will go away, but the 'coverity' target has a set of commands that are used to run a Coverity code check from GitHub workflows, or manually by maintainers. Putting this sequence of commands in a shell script removes the dep on 'make'. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09github: add 'pull_request.sh' script to replicate 'prepush' make targetDaniel P. Berrangé1-0/+39
Most of 'Makefile' will go away, but the 'prepush' target has a set of commands that are used to run a full build and test check from GitHub workflows, or manually by contributors. Putting this sequence of commands in a shell script removes the dep on 'make'. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09build: introduce Meson build file rulesDaniel P. Berrangé9-0/+422
The Meson build system used by many other virt projects (QEMU, libvirt and others) is easier to understand & maintain rules for than cmake, guiding towards best practice. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09test: pass in location of libvfio-user.so libraryDaniel P. Berrangé1-0/+2
The test currently hardwires a location based on where cmake creates binaries. Pass in an explicit location via LIBVFIO_SO_DIR env variable, to override this hardwired default. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09test: optionally pass in 'client' and 'server' pathDaniel P. Berrangé1-2/+8
Rather than assuming the location of the client and server binaries, allowing passing in explicit paths. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09test: optionally pass in 'lspci' pathDaniel P. Berrangé1-1/+5
Rather than assuming the location of the lspci binary, allowing passing in an explicit path. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09docs: drop mention of libssl-dev package for testingDaniel P. Berrangé1-1/+2
Use of libssl-dev was dropped in commit bc44bd1a246dc95b91faae30defafc3c259f5c4d Author: John Levon <john.levon@nutanix.com> Date: Mon May 9 09:58:02 2022 +0100 drop usage of MD5_*() (#667) Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-09drop usage of MD5_*() (#667)John Levon6-57/+508
These functions from openssl are deprecated, and hence break builds with openssl 3.0, which now has a compiler warning for them. We only use them to check buffer contents; replace them with CRC code from DPDK instead, and entirely drop use of openssl. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-04-28test library linkage (#665)John Levon2-0/+56
Add a cheesy test for identifying functions in the public header that are not exported. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-04-28lib: export dma_sg_size symbol in library (#664)Daniel Berrangé3-1/+11
The dma_sg_size() method is listed in libvfio-user.h but the symbol is marked private in the ELF library. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-04-21fix a small coverity complaint (#663)John Levon1-6/+0
The complaint was: 259 if (ret != 0) { >>> CID 392380: Possible Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "free(tp);". 260 free(tp); 261 return ERROR_INT(ret); 262 } Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2022-04-21support AFL++ fuzzing (#623)John Levon18-348/+1064
To support fuzzing with AFL++, add a "pipe" transport that reads from stdin and outputs to stdout: this is the most convenient way of doing fuzzing. Add some docs on how to run a fuzzing session. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-04-19use struct iovec for grouping buffer and length (#658)Thanos Makatos5-131/+125
This make it tidier and easier to pass to function the buffer and length, instead of passing the whole msg. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-04-19add compile_commands.json generation (#661)John Levon1-0/+3
For use by LSP, generate a compile_commands.json file. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2022-04-06document live migration for SPDK (#659)Thanos Makatos1-0/+54
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-03-24use --exit-on-first-error=yes with valgrind (#655)John Levon2-1/+2
Catch valgrind issues earlier with less noise. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-03-24retire ubuntu-18 CI (#656)John Levon2-13/+0
This OS version's valgrind lacks --exit-on-first-error, so let's stop trying to build in it. We still have centos 7 as "old Linux". Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-03-07check for allowed operations in quiesce state (#647)Thanos Makatos4-0/+60
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-03-02improve region access debugging (#653)John Levon3-60/+49
Many region accesses of interest are of normal register sizes; sniff the region access size, and report the read/written value if possible. Clean up dump_buffer() now, as it's not of much use. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-02-25clarify when logging when device changes migration state (#649)Thanos Makatos1-1/+6
This makes reading logs easier. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-02-24additional logging around dirty pages (#650)Thanos Makatos2-0/+30
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-02-24clarify some semantics of migration callbacks (#651)Thanos Makatos1-3/+20
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-02-24fix typo (#648)Thanos Makatos1-1/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-02-18test/py: simplify errno handling (#645)John Levon15-109/+102
We explicitly identify the quiesce EBUSY case for msg(), letting us simplify the handling of expected errno. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2022-02-14test/py: don't stop logging twice (#644)John Levon1-5/+0
We were accidentally calling VFIO_USER_DIRTY_PAGES twice. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-02-04ignore writes to RO MSI-X registers (#642)Thanos Makatos4-42/+104
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2022-01-25fix a small typo in docs (#638)John Levon1-1/+1
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2022-01-17small get_request_header() cleanup (#637)John Levon1-9/+2
LGTM.com reports "Comparison is always true because ret <= -1.", and it's indeed correct (but harmless). Clean this up. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-12-22fix coverity issues (#636)John Levon3-0/+6
Fix three remaining low priority coverity issues; they do not represent bugs. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-12-09allow DMA funcs to be called in quiesced state (#635)Thanos Makatos5-18/+204
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-12-02test more region access validation code (#634)John Levon1-1/+25
Add a little more coverage of our validation, and correct a small typo. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-12-01refactor process_request() (#633)John Levon2-177/+200
Instead of process_request() having a dual role, split into get_request() and handle_request(). Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-12-01add SPDK instructions (#632)Thanos Makatos2-21/+66
And move them to separate file. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-11-30introduce device quiesce callback (#609)Thanos Makatos35-419/+1380
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Leon <john.levon@nutanix.com>
2021-11-24verify region is mapped before acquiring dirty bitmap (#627)John Levon4-47/+73
DMA regions not mapped by the server are not dirty tracked (the client must track changes via handling VFIO_USER_DMA_WRITE), but we weren't correctly enforcing this, which could segfault when ->dirty_bitmap was NULL. Found via AFL++. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-11-24check ->argsz for VFIO_USER_DIRTY_PAGES (#628)John Levon2-5/+24
We weren't checking for a too-large ->argsz for this command. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>