In the future, this will probably be moved into its own driver, probably
called `intelvtdd` or `intelvfiod`. This is because `acpid` already
provides an interface to read from ACPI tables, which `pcid` has used
for quite long (when that scheme was provided by the kernel). AMD
implements IOMMU as a PCI function, so letting these be separate drivers
would certainly be beneficial.
The same thing might apply for HPET or MADT, which are the only ACPI
tables still parsed in the kernel.
This change adds a structopt commandline interface to the pcid tool.
This add some help for the arguments that pcid takes.
Signed-off-by: Wren Turkal <wt@penguintechs.org>
When working in an IDE like vscode, it uses rust infrastructure to
check the code, which results in "target" folders in the base of
the crates I am working on. For example, if I am working on pcid
code, I get a "target" folder in the pcid folder. This change
causes git to ignore all those target directories.
Signed-off-by: Wren Turkal <wt@penguintechs.org>
The pcid capability parsing code has an assertion that checks for dword
alignment. Unfortunately, the check was previously checking for
alignment to qwords. This fixes that.
I found this issue by using qemu to emulate adding different pci
devices. I managed to come across a device that had a capability
aligned on dword, but not qword. That exposed the bug.
Signed-off-by: Wren Turkal <wt@penguintechs.org>
Previously, the PCI bus scan was skipping bus 0xFF. Now it does not.
I used a match expression to make sure that all cases are accounted for.
I also changed the PCI dev scan and PCI func scan to use a match
expression in a similar way to make sure all cases are account. While
this is functionally the same as before, the match expression will not
allow unhandled cases and should be easier to read and make it harder
to introduce bugs.
Signed-off-by: Wren Turkal <wt@penguintechs.org>