Skip to content

xen: privcmd: Add ioeventfd and fix irqfd support

Viresh Kumar lkml xen-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 4 repliesIn review
  2. v32 patches 2 repliesSuperseded
  3. v22 patches 1 replySuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches10 repliesSuperseded

Changes in v4 from the cover letter

- Use __u64 for indirect pointers in an ioctl command's arguments.
- Use u64_to_user_ptr() in kernel driver to access the same.
- Use _IOW() macro instead of the internal one: _IOC().

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4xen: Make struct privcmd_irqfd's layout architecture independentdrivers/xen/privcmd.c include/uapi/xen/privcmd.h+2 -21 reply
2/4xen: irqfd: Use _IOW instead of the internal _IOC() macroinclude/uapi/xen/privcmd.h+1 -11 reply
3/4xen: evtchn: Allow shared registration of IRQ handersdrivers/xen/events/events_base.c drivers/xen/evtchn.c+3 -21 reply
4/4xen: privcmd: Add support for ioeventfddrivers/xen/Kconfig drivers/xen/privcmd.c include/uapi/xen/privcmd.h +1 more+476 -61 reply

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchJuergen Gross
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH V4 0/4] xen: privcmd: Add ioeventfd and fix irqfd support

Hello,

Now that irqfd support (backend to guest interrupt) is already merged, this series solves the other part of the problem, i.e. ioeventfd (guest to backend interrupt).

More details inside the commits.

Arnd reported few issues with the ioctl macro usage and argument's layout, fixed them for irqfd too, which was added recently.

--
Viresh

V3->V4:
- Use __u64 for indirect pointers in an ioctl command's arguments.
- Use u64_to_user_ptr() in kernel driver to access the same.
- Use _IOW() macro instead of the internal one: _IOC().

V2->V3:
- Remove explicit barriers and depend on spin lock instead to take care of it.
- Move check for empty ioeventfds list to privcmd_ioeventfd_deassign(), which could earlier call ioreq_free() even when the list wasn't empty and so we returned without printing a warning in v1 earlier. V2 implemented it incorrectly.

V1->V2:
- Increment irq_info refcnt only for valid info.
- Use u64 type for addr.
- Add comments for use of barriers.
- Use spin lock instead of mutex as we need to use them in irq handler.
- Add a warning when kioreq is getting freed and ioeventfds list isn't empty.
- Use struct_size().
- Validate number of vcpus as well.

Viresh Kumar (4):
xen: Make struct privcmd_irqfd's layout architecture independent
xen: irqfd: Use _IOW instead of the internal _IOC() macro
xen: evtchn: Allow shared registration of IRQ handers
xen: privcmd: Add support for ioeventfd

 drivers/xen/Kconfig               |   8 +-
 drivers/xen/events/events_base.c  |   3 +-
 drivers/xen/evtchn.c              |   2 +-
 drivers/xen/privcmd.c             | 407 +++++++++++++++++++++++++++++-
 include/uapi/xen/privcmd.h        |  22 +-
 include/xen/interface/hvm/ioreq.h |  51 ++++
 6 files changed, 482 insertions(+), 11 deletions(-)
 create mode 100644 include/xen/interface/hvm/ioreq.h
Signature · 1 line
2.31.1.272.g89b43f80a514