diff options
| author | Abhin Parekadan Jose <abhinjoses@gmail.com> | 2026-08-02 17:40:59 +0000 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2026-09-04 17:06:03 -0400 |
| commit | 1b3779dd63edfb45777efb31d99a9029cb011bf3 (patch) | |
| tree | dfbfca6aa9b1b75bbf09fdb6e43059ac8f3c5155 /scripts/Makefile.thinlto | |
| parent | b138982c3bb93a7299b7287a399a8c33bdc3f5f5 (diff) | |
| download | linux-next-1b3779dd63edfb45777efb31d99a9029cb011bf3.tar.gz linux-next-1b3779dd63edfb45777efb31d99a9029cb011bf3.zip | |
virtio_pci_modern: avoid infinite loop in vp_reset() on invalid status
vp_reset() polls device_status in a tight loop, waiting for it to read
back as 0 after the reset write. device_status is read via MMIO from
the common configuration structure, which requires the PCI_COMMAND
Memory Space Enable bit to be set. If that bit is cleared while the
device is bound -- e.g. by writing 0x0000 to PCI_COMMAND (config space
offset 4) -- the MMIO read no longer reaches the device and returns
the bus's synthesized all-ones response instead. Since that value can
never legitimately clear to 0, the loop spins forever and hangs the
caller.
Use VIRTIO_STATUS_ERROR() to recognize such values and bail out of the
poll loop instead of looping indefinitely.
Signed-off-by: Abhin Parekadan Jose <abhinjoses@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260802174059.4082-3-abhinjoses@gmail.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
