From: Jason Wang <jasowang@redhat.com>
To: mst@redhat.com, jasowang@redhat.com
Cc: peterz@infradead.org, maz@kernel.org, keirf@google.com,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, tglx@linutronix.de
Subject: [PATCH 0/3] rework on the IRQ hardening of virtio
Date: Thu, 24 Mar 2022 16:40:01 +0800 [thread overview]
Message-ID: <20220324084004.14349-1-jasowang@redhat.com> (raw)
Hi All:
This is a rework on the IRQ hardening for virtio which is done
previously by the following commits are reverted:
9e35276a5344 ("virtio_pci: harden MSI-X interrupts")
080cd7c3ac87 ("virtio-pci: harden INTX interrupts")
The reason is that it depends on the IRQF_NO_AUTOEN which may conflict
with the assumption of the affinity managed IRQ that is used by some
virtio drivers. And what's more, it is only done for virtio-pci but
not other transports.
In this rework, I try to implement a general virtio solution which
borrows the idea of the INTX hardening by introducing a boolean for
virtqueue callback enabling and toggle it in virtio_device_ready()
and virtio_reset_device(). Then vring_interrupt() can simply check and
return early if the driver is not ready.
To unbreak legacy setups that may generate IRQ before DRIVER_OK, a
module parameter is introduced to disable the hardening by
default. The features can then be turned on the setups that the
hardening is needed (e.g the confidential computing and other cases).
Please review.
Thanks
Jason Wang (2):
virtio: use virtio_reset_device() when possible
virtio: harden vring IRQ
Stefano Garzarella (1):
virtio: use virtio_device_ready() in virtio_device_restore()
drivers/virtio/virtio.c | 28 ++++++++++++++++++++++++----
drivers/virtio/virtio_ring.c | 9 ++++++++-
include/linux/virtio.h | 4 ++++
include/linux/virtio_config.h | 25 +++++++++++++++++++++++++
4 files changed, 61 insertions(+), 5 deletions(-)
--
2.25.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
next reply other threads:[~2022-03-24 8:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 8:40 Jason Wang [this message]
2022-03-24 8:40 ` [PATCH 1/3] virtio: use virtio_device_ready() in virtio_device_restore() Jason Wang
2022-03-24 10:48 ` Michael S. Tsirkin
2022-03-24 11:03 ` Stefano Garzarella
2022-03-24 11:07 ` Michael S. Tsirkin
2022-03-24 11:31 ` Stefano Garzarella
2022-03-25 3:05 ` Jason Wang
2022-03-30 5:22 ` Michael S. Tsirkin
2022-03-24 8:40 ` [PATCH 2/3] virtio: use virtio_reset_device() when possible Jason Wang
2022-03-24 11:04 ` Stefano Garzarella
2022-03-24 8:40 ` [PATCH 3/3] virtio: harden vring IRQ Jason Wang
2022-03-24 11:03 ` Michael S. Tsirkin
2022-03-25 3:04 ` Jason Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220324084004.14349-1-jasowang@redhat.com \
--to=jasowang@redhat.com \
--cc=keirf@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=mst@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).