Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vfio/device: add support enabling/disabling specific IRQ(s) #26

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

minwooim
Copy link
Collaborator

No description provided.

@minwooim minwooim requested a review from birkelund November 19, 2024 02:34
@birkelund
Copy link
Collaborator

birkelund commented Nov 19, 2024

I would be OK with an API breakage here for next major version. Just replace the existing functions with one including a start parameter.

Please add a note in CHANGELOG.md for this.

@minwooim
Copy link
Collaborator Author

I would be OK with an API breakage here for next major version. Just replace the existing functions with one including a start parameter.

vfio_set_irq() can be simply converted to have a new parameter start, but vfio_disable_irq() has been used to disable ALL IRQs. How about rename vfio_disable_irq to vfio_disable_irq_all or something like that? If so, we can make vfio_disable_irq disables with targeting start for count.

Please add a note in CHANGELOG.md for this.

Okay!

@birkelund
Copy link
Collaborator

I would be OK with an API breakage here for next major version. Just replace the existing functions with one including a start parameter.

vfio_set_irq() can be simply converted to have a new parameter start, but vfio_disable_irq() has been used to disable ALL IRQs. How about rename vfio_disable_irq to vfio_disable_irq_all or something like that? If so, we can make vfio_disable_irq disables with targeting start for count.

Sounds good!

This patch added 'start' parameter to 'vfio_set_irq' API to specify
start IRQ number to configure to vfio-pci kernel driver.  This patch
also converted previous 'vfio_disable_irq' to 'vfio_disable_irq_all' to
disable all enabled irqs.  'vfio_disable_irq' has been updated to
disable specific irqs from the given 'start' parameter.

To disable (de-assign) one or more IRQs from vfio-pci kernel driver,
irq_set data -1 should be passed to irq_set->data.  uapi <linux/vfio.h>
says that value -1 with DATA_EVENTFD|ACTION_TRIGGER) will de-assign
interrupts if already assigned.

This patch also fixed de-assign behavior by replacing DATA_NONE to
DATA_EVENTFD with data -1 along with adding a new API to disable
specific interrupts with start and count.

Signed-off-by: Minwoo Im <[email protected]>
@minwooim minwooim force-pushed the for-set-irq-with-start branch from d6d09e1 to 9d015c1 Compare November 19, 2024 09:42
@minwooim
Copy link
Collaborator Author

Updated branch.

@birkelund birkelund merged commit 5debd2e into main Nov 20, 2024
25 checks passed
@birkelund birkelund deleted the for-set-irq-with-start branch November 20, 2024 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants