]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
um: virtio_uml: Fix broken device handling in time-travel
authorJohannes Berg <johannes.berg@intel.com>
Tue, 17 May 2022 20:52:50 +0000 (22:52 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 16 Sep 2022 08:53:33 +0000 (10:53 +0200)
commit3346ed7c1f53a11efb4a21b2385121d2c3a3972b
treebc9b99bef3b3f39bf759e047efa6ca8f7e6bcb27
parent904070cff688c1f798a8f5e7e2a08b196ec17940
um: virtio_uml: Fix broken device handling in time-travel

BugLink: https://bugs.launchpad.net/bugs/1988479
[ Upstream commit af9fb41ed315ce95f659f0b10b4d59a71975381d ]

If a device implementation crashes, virtio_uml will mark it
as dead by calling virtio_break_device() and scheduling the
work that will remove it.

This still seems like the right thing to do, but it's done
directly while reading the message, and if time-travel is
used, this is in the time-travel handler, outside of the
normal Linux machinery. Therefore, we cannot acquire locks
or do normal "linux-y" things because e.g. lockdep will be
confused about the context.

Move handling this situation out of the read function and
into the actual IRQ handler and response handling instead,
so that in the case of time-travel we don't call it in the
wrong context.

Chances are the system will still crash immediately, since
the device implementation crashing may also cause the time-
travel controller to go down, but at least all of that now
happens without strange warnings from lockdep.

Fixes: c8177aba37ca ("um: time-travel: rework interrupt handling in ext mode")
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/um/drivers/virtio_uml.c