virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
  • [parent not found: <20221128021005.232105-4-lizetao1@huawei.com>]
  • * Re: [PATCH 0/4] Fix probe failed when modprobe modules
           [not found] <20221128021005.232105-1-lizetao1@huawei.com>
           [not found] ` <20221128021005.232105-3-lizetao1@huawei.com>
           [not found] ` <20221128021005.232105-4-lizetao1@huawei.com>
    @ 2022-11-28 10:14 ` Michael S. Tsirkin
      2022-11-29  3:37   ` Jason Wang
      2023-01-27 11:11   ` Michael S. Tsirkin
           [not found] ` <20221129160615.3343036-1-lizetao1@huawei.com>
      3 siblings, 2 replies; 9+ messages in thread
    From: Michael S. Tsirkin @ 2022-11-28 10:14 UTC (permalink / raw)
      To: Li Zetao
      Cc: axboe, rusty, ericvh, netdev, linux_oss, linux-kernel, davem,
    	linux-block, v9fs-developer, edumazet, stefanha, kuba, pbonzini,
    	pabeni, virtualization
    
    On Mon, Nov 28, 2022 at 10:10:01AM +0800, Li Zetao wrote:
    > This patchset fixes similar issue, the root cause of the
    > problem is that the virtqueues are not stopped on error
    > handling path.
    
    I've been thinking about this.
    Almost all drivers are affected.
    
    The reason really is that it used to be the right thing to do:
    On legacy pci del_vqs writes 0
    into vq index and this resets the device as a side effect
    (we actually do this multiple times, what e.g. writes of MSI vector
     after the 1st reset do I have no idea).
    
    mmio ccw and modern pci don't.
    
    Given this has been with us for a while I am inlined to look for
    a global solution rather than tweaking each driver.
    
    Given many drivers are supposed to work on legacy too, we know del_vqs
    includes a reset for many of them. So I think I see a better way to do
    this:
    
    Add virtio_reset_device_and_del_vqs()
    
    and convert all drivers to that.
    
    When doing this, we also need to/can fix a related problem (and related
    to the hardening that Jason Wang was looking into):
    virtio_reset_device is inherently racy: vq interrupts could
    be in flight when we do reset. We need to prevent handlers from firing in
    the window between reset and freeing the irq, so we should first
    free irqs and only then start changing the state by e.g.
    device reset.
    
    
    Quite a lot of core work here. Jason are you still looking into
    hardening?
    
    
    
    > Li Zetao (4):
    >   9p: Fix probe failed when modprobe 9pnet_virtio
    >   virtio-mem: Fix probe failed when modprobe virtio_mem
    >   virtio-input: Fix probe failed when modprobe virtio_input
    >   virtio-blk: Fix probe failed when modprobe virtio_blk
    > 
    >  drivers/block/virtio_blk.c    | 1 +
    >  drivers/virtio/virtio_input.c | 1 +
    >  drivers/virtio/virtio_mem.c   | 1 +
    >  net/9p/trans_virtio.c         | 1 +
    >  4 files changed, 4 insertions(+)
    > 
    > -- 
    > 2.25.1
    
    _______________________________________________
    Virtualization mailing list
    Virtualization@lists.linux-foundation.org
    https://lists.linuxfoundation.org/mailman/listinfo/virtualization
    
    ^ permalink raw reply	[flat|nested] 9+ messages in thread
  • [parent not found: <20221129160615.3343036-1-lizetao1@huawei.com>]

  • end of thread, other threads:[~2023-01-29  5:50 UTC | newest]
    
    Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <20221128021005.232105-1-lizetao1@huawei.com>
         [not found] ` <20221128021005.232105-3-lizetao1@huawei.com>
    2022-11-28  8:22   ` [PATCH 2/4] virtio-mem: Fix probe failed when modprobe virtio_mem David Hildenbrand
         [not found] ` <20221128021005.232105-4-lizetao1@huawei.com>
    2022-11-28  9:29   ` [PATCH 3/4] virtio-input: Fix probe failed when modprobe virtio_input Michael S. Tsirkin
    2022-11-28 10:14 ` [PATCH 0/4] Fix probe failed when modprobe modules Michael S. Tsirkin
    2022-11-29  3:37   ` Jason Wang
    2022-12-19 10:15     ` Michael S. Tsirkin
    2022-12-20  6:44       ` Jason Wang
    2023-01-27 11:11   ` Michael S. Tsirkin
    2023-01-29  5:50     ` Jason Wang
         [not found] ` <20221129160615.3343036-1-lizetao1@huawei.com>
    2022-11-29 17:08   ` [PATCH v2 0/5] " Jens Axboe
    

    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).