add patches to fix regression with LSI SCSI controller
The patch 0008-memory-prevent-dma-reentracy-issues.patch introduced a regression for the LSI SCSI controller leading to boot failures [0], because, in its current form, it relies on reentrancy for a particular ram_io region. [0]: https://forum.proxmox.com/threads/123843 Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
3c4f941ac7
commit
ffda59f626
38
debian/patches/extra/0021-memory-Allow-disabling-re-entrancy-checking-per-MR.patch
vendored
Normal file
38
debian/patches/extra/0021-memory-Allow-disabling-re-entrancy-checking-per-MR.patch
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Mon, 13 Mar 2023 04:24:16 -0400
|
||||
Subject: [PATCH] memory: Allow disabling re-entrancy checking per-MR
|
||||
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
---
|
||||
include/exec/memory.h | 3 +++
|
||||
softmmu/memory.c | 2 +-
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/exec/memory.h b/include/exec/memory.h
|
||||
index 91f8a2395a..d7268d9f39 100644
|
||||
--- a/include/exec/memory.h
|
||||
+++ b/include/exec/memory.h
|
||||
@@ -765,6 +765,9 @@ struct MemoryRegion {
|
||||
unsigned ioeventfd_nb;
|
||||
MemoryRegionIoeventfd *ioeventfds;
|
||||
RamDiscardManager *rdm; /* Only for RAM */
|
||||
+
|
||||
+ /* For devices designed to perform re-entrant IO into their own IO MRs */
|
||||
+ bool disable_reentrancy_guard;
|
||||
};
|
||||
|
||||
struct IOMMUMemoryRegion {
|
||||
diff --git a/softmmu/memory.c b/softmmu/memory.c
|
||||
index 7dcb3347aa..2b46714191 100644
|
||||
--- a/softmmu/memory.c
|
||||
+++ b/softmmu/memory.c
|
||||
@@ -544,7 +544,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr,
|
||||
}
|
||||
|
||||
/* Do not allow more than one simultanous access to a device's IO Regions */
|
||||
- if (mr->owner &&
|
||||
+ if (mr->owner && !mr->disable_reentrancy_guard &&
|
||||
!mr->ram_device && !mr->ram && !mr->rom_device && !mr->readonly) {
|
||||
dev = (DeviceState *) object_dynamic_cast(mr->owner, TYPE_DEVICE);
|
||||
if (dev) {
|
33
debian/patches/extra/0022-lsi53c895a-disable-reentrancy-detection-for-script-R.patch
vendored
Normal file
33
debian/patches/extra/0022-lsi53c895a-disable-reentrancy-detection-for-script-R.patch
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Bulekov <alxndr@bu.edu>
|
||||
Date: Mon, 13 Mar 2023 04:24:17 -0400
|
||||
Subject: [PATCH] lsi53c895a: disable reentrancy detection for script RAM
|
||||
|
||||
As the code is designed to use the memory APIs to access the script ram,
|
||||
disable reentrancy checks for the pseudo-RAM ram_io MemoryRegion.
|
||||
|
||||
In the future, ram_io may be converted from an IO to a proper RAM MemoryRegion.
|
||||
|
||||
Reported-by: Fiona Ebner <f.ebner@proxmox.com>
|
||||
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
|
||||
---
|
||||
hw/scsi/lsi53c895a.c | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
|
||||
index 50979640c3..894b9311ac 100644
|
||||
--- a/hw/scsi/lsi53c895a.c
|
||||
+++ b/hw/scsi/lsi53c895a.c
|
||||
@@ -2302,6 +2302,12 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp)
|
||||
memory_region_init_io(&s->io_io, OBJECT(s), &lsi_io_ops, s,
|
||||
"lsi-io", 256);
|
||||
|
||||
+ /*
|
||||
+ * Since we use the address-space API to interact with ram_io, disable the
|
||||
+ * re-entrancy guard.
|
||||
+ */
|
||||
+ s->ram_io.disable_reentrancy_guard = true;
|
||||
+
|
||||
address_space_init(&s->pci_io_as, pci_address_space_io(dev), "lsi-pci-io");
|
||||
qdev_init_gpio_out(d, &s->ext_irq, 1);
|
||||
|
2
debian/patches/series
vendored
2
debian/patches/series
vendored
@ -18,6 +18,8 @@ extra/0017-vhost-avoid-a-potential-use-of-an-uninitialized-vari.patch
|
||||
extra/0018-chardev-char-socket-set-s-listener-NULL-in-char_sock.patch
|
||||
extra/0019-intel-iommu-fail-MAP-notifier-without-caching-mode.patch
|
||||
extra/0020-intel-iommu-fail-DEVIOTLB_UNMAP-without-dt-mode.patch
|
||||
extra/0021-memory-Allow-disabling-re-entrancy-checking-per-MR.patch
|
||||
extra/0022-lsi53c895a-disable-reentrancy-detection-for-script-R.patch
|
||||
bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch
|
||||
bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch
|
||||
bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch
|
||||
|
Loading…
Reference in New Issue
Block a user