flask/label-pci: Allow specifying optional irq label

IRQs can be shared between devices, so using the same label as the PCI
device can create conflicts where the IRQ is labeled with one of the
device labels preventing assignment of the second device to the second
domain.  Add the ability to specify an irq label distinct from the PCI
device, so a shared irq label can be specified.  The policy would then
be written such that the two domains can each use the shared IRQ type in
addition to their labeled PCI device.  That way we can still label most
of the PCI device resources and assign devices in the face of shared
IRQs.

Signed-off-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>
This commit is contained in:
Jason Andryuk authored and Jan Beulich committed 2023-03-14 10:46:00 +01:00
1 parent 402195e56d
commit de819c96c8
2 files changed
+26 -3

No files matched your search

+10 -3
View File
@@ -28,7 +28,7 @@
static void usage (int argCnt, char *argv[])
{
fprintf(stderr, "Usage: %s SBDF label\n", argv[0]);
fprintf(stderr, "Usage: %s SBDF label <irq_label>\n", argv[0]);
exit(1);
}
@@ -39,12 +39,19 @@ int main (int argCnt, char *argv[])
int seg, bus, dev, fn;
uint32_t sbdf;
uint64_t start, end, flags;
char *pirq_label;
char buf[1024];
FILE *f;
if (argCnt != 3)
if (argCnt < 3 || argCnt > 4)
usage(argCnt, argv);
if (argCnt == 4) {
pirq_label = argv[3];
} else {
pirq_label = argv[2];
}
xch = xc_interface_open(0,0,0);
if ( !xch )
{
@@ -107,7 +114,7 @@ int main (int argCnt, char *argv[])
if (fscanf(f, "%" SCNu64, &start) != 1)
start = 0;
if (start) {
ret = xc_flask_add_pirq(xch, start, argv[2]);
ret = xc_flask_add_pirq(xch, start, pirq_label);
if (ret) {
fprintf(stderr, "xc_flask_add_pirq %"PRIu64" failed: %d\n",
start, ret);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.