[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/15] hw/scsi/vmw_pvscsi: Remove assertion for kick after reset
From: |
Paolo Bonzini |
Subject: |
[PULL 01/15] hw/scsi/vmw_pvscsi: Remove assertion for kick after reset |
Date: |
Thu, 2 Apr 2020 15:06:26 -0400 |
From: Elazar Leibovich <address@hidden>
When running Ubuntu 3.13.0-65-generic guest, QEMU sometimes crashes
during guest ACPI reset. It crashes on assert(s->rings_info_valid)
in pvscsi_process_io().
Analyzing the crash revealed that it happens when userspace issues
a sync during a reboot syscall.
Below are backtraces we gathered from the guests.
Guest backtrace when issuing PVSCSI_CMD_ADAPTER_RESET:
pci_device_shutdown
device_shutdown
init_pid_ns
init_pid_ns
kernel_power_off
SYSC_reboot
Guest backtrace when issuing PVSCSI_REG_OFFSET_KICK_RW_IO:
scsi_done
scsi_dispatch_cmd
blk_add_timer
scsi_request_fn
elv_rb_add
__blk_run_queue
queue_unplugged
blk_flush_plug_list
blk_finish_plug
ext4_writepages
set_next_entity
do_writepages
__filemap_fdatawrite_range
filemap_write_and_wait_range
ext4_sync_file
ext4_sync_file
do_fsync
sys_fsync
Since QEMU pvscsi should imitate VMware pvscsi device emulation,
we decided to imitate VMware's behavior in this case.
To check VMware behavior, we wrote a kernel module that issues
a reset to the pvscsi device and then issues a kick. We ran it on
VMware ESXi 6.5 and it seems that it simply ignores the kick.
Hence, we decided to ignore the kick as well.
Signed-off-by: Elazar Leibovich <address@hidden>
Signed-off-by: Liran Alon <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/scsi/vmw_pvscsi.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index c91352cf46..ec5bf9ea34 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -719,7 +719,10 @@ pvscsi_process_io(PVSCSIState *s)
PVSCSIRingReqDesc descr;
hwaddr next_descr_pa;
- assert(s->rings_info_valid);
+ if (!s->rings_info_valid) {
+ return;
+ }
+
while ((next_descr_pa = pvscsi_ring_pop_req_descr(&s->rings)) != 0) {
/* Only read after production index verification */
--
2.18.2
- [PULL 00/15] Misc patches for 5.0-rc2, Paolo Bonzini, 2020/04/02
- [PULL 02/15] hw/isa/superio: Correct the license text, Paolo Bonzini, 2020/04/02
- [PULL 01/15] hw/scsi/vmw_pvscsi: Remove assertion for kick after reset,
Paolo Bonzini <=
- [PULL 03/15] virtio-iommu: depend on PCI, Paolo Bonzini, 2020/04/02
- [PULL 04/15] softmmu: fix crash with invalid -M memory-backend=, Paolo Bonzini, 2020/04/02
- [PULL 06/15] util/bufferiszero: assign length_to_accel value for each accelerator case, Paolo Bonzini, 2020/04/02
- [PULL 07/15] util/bufferiszero: improve avx2 accelerator, Paolo Bonzini, 2020/04/02
- [PULL 08/15] vl: fix broken IPA range for ARM -M virt with KVM enabled, Paolo Bonzini, 2020/04/02
- [PULL 11/15] target/i386: do not set unsupported VMX secondary execution controls, Paolo Bonzini, 2020/04/02
- [PULL 12/15] migration: fix cleanup_bh leak on resume, Paolo Bonzini, 2020/04/02
- [PULL 09/15] i386: hvf: Reset IRQ inhibition after moving RIP, Paolo Bonzini, 2020/04/02
- [PULL 14/15] object-add: don't create return value if failed, Paolo Bonzini, 2020/04/02
- [PULL 05/15] MAINTAINERS: Add an entry for the HVF accelerator, Paolo Bonzini, 2020/04/02