aboutsummaryrefslogtreecommitdiff
path: root/lib/pci.c
AgeCommit message (Collapse)AuthorFilesLines
2022-03-02improve region access debugging (#653)John Levon1-5/+0
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>
2021-07-29change verbosity of some PCI config space accesses (#584)Thanos Makatos1-18/+18
There's nothing special about most of these accesses so we shouldn't create unnecessary noise in the logs. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-07-12ignore writes to some RO registers in PCI config space (#576)Thanos Makatos1-4/+12
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-06-22disable EROM (#572)Thanos Makatos1-0/+2
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-06-22PCI: handle cache line register (#573)Thanos Makatos1-0/+5
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-06-22split writes to PCI header (#569)Thanos Makatos1-20/+61
Multiple registers can be written in one go so we need to split the write. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-05-28hide non-ABI symbols (#538)John Levon1-4/+4
Default to hidden visibility to remove non-public symbols from API users (and improve performance a little). Every public function gets an EXPORT annotation. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-04-15remove vfu_get_region_info() (#444)John Levon1-4/+3
This is only used internally, and not really useful. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-04-13pci: use ERROR_INT() (#430)John Levon1-11/+10
Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-04-13dma: use ERROR_INT()John Levon1-0/+1
The first in a series excising the use of the "return -errno" idiom. This is a non-standard usage, and in userspace, we have "errno" for delivering side-band error values. As there have been multiple bugs from not using standard error return methods like -1+errno or NULL+errno, let's do that. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-04-07clean up newlines in logs (#423)John Levon1-26/+26
vfu_log() and err() should not take newlines. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-04-07mark vfu_log() with format attribute (#426)John Levon1-2/+2
Fix up all resulting fallout. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-02-22don't use wrong buf offset for responding with PCI caps (#355)Thanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Signed-off-by: John Levon <john.levon@nutanix.com>
2021-02-10API error return converged to one func (#325)swapnili1-4/+4
* API error return converged to one func Use ERROR_INT() or ERROR_PTR() to return errors from API's. This way if we want to change the behaviour later, we will just need to update these funcitons. Also fixed some error return cases and comments. Reviewed-by: John Levon <john.levon@nutanix.com>
2021-01-20re-work API for adding capabilities (#200)John Levon1-89/+94
Allow to add capabilities individually, including extended capabilities, and those to be handled via the region callback. As a side effect, rework config space accesses to handle reads that straddle capabilities and non-standard areas and use callbacks as needed. 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>
2021-01-07re-work access handling (#220)John Levon1-60/+88
Various cleanups and fixes to handling of region accesses, including: - there should be no reason for us to split accesses into 1/2/4/8 byte accesses: in general, the client will have already be doing that, and if not, there's no particular reason we should be the ones to split up such larger accesses. - use a callback for PCI config space reads and writes if one is provided (needs more work for capabilities) 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>
2021-01-04re-work PCI config setup API (#198)John Levon1-19/+38
Split up vfu_pci_setup_config_hdr(): individual "helpers" like vfu_pci_set_id() are much simpler to use than making the user specify the values in header-formatted structs; and this way if we want to add additional helpers, we won't need to modify the existing functions. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-01-04move PCI-specific code to pci.c (#219)John Levon1-25/+118
It's still pretty entangled, but move the bulk of the non-cap PCI code over to pci.c. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-02rename VFU_REG_FLAG_* (#145)John Levon1-1/+1
We renamed other code to be "REGION" instead of "REG" so it's less ambiguous. Do the same for VFU_REG_FLAG_*. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-12-02use log level defines from syslogThanos Makatos1-26/+26
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27rename to libvfio-user (#128)John Levon1-0/+332
The muser name no longer reflects the implementation, and will just serve to confuse. Bite the bullet now, and rename ourselves to reflect the actual implementation. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>