[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-9.1.1 16/32] mac_dbdma: Remove leftover `dma_memory_unmap` calls
From: |
Michael Tokarev |
Subject: |
[Stable-9.1.1 16/32] mac_dbdma: Remove leftover `dma_memory_unmap` calls |
Date: |
Mon, 7 Oct 2024 22:16:33 +0300 |
From: Mattias Nissler <mnissler@rivosinc.com>
These were passing a NULL buffer pointer unconditionally, which happens
to behave in a mostly benign way (except for the chance of an excess
memory region unref and a bounce buffer leak). Per the function comment,
this was never meant to be accepted though, and triggers an assertion
with the "softmmu: Support concurrent bounce buffers" change.
Given that the code in question never sets up any mappings, just remove
the unnecessary dma_memory_unmap calls along with the DBDMA_io struct
fields that are now entirely unused.
Signed-off-by: Mattias Nissler <mnissler@rivosinc.com>
Message-Id: <20240916175708.1829059-1-mnissler@rivosinc.com>
Fixes: be1e343995 ("macio: switch over to new byte-aligned DMA helpers")
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
(cherry picked from commit 2d0a071e625d7234e8c5623b7e7bf445e1bef72c)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/ide/macio.c b/hw/ide/macio.c
index e84bf2c9f6..15dd40138e 100644
--- a/hw/ide/macio.c
+++ b/hw/ide/macio.c
@@ -119,9 +119,6 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int
ret)
return;
done:
- dma_memory_unmap(&address_space_memory, io->dma_mem, io->dma_len,
- io->dir, io->dma_len);
-
if (ret < 0) {
block_acct_failed(blk_get_stats(s->blk), &s->acct);
} else {
@@ -202,9 +199,6 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
return;
done:
- dma_memory_unmap(&address_space_memory, io->dma_mem, io->dma_len,
- io->dir, io->dma_len);
-
if (s->dma_cmd == IDE_DMA_READ || s->dma_cmd == IDE_DMA_WRITE) {
if (ret < 0) {
block_acct_failed(blk_get_stats(s->blk), &s->acct);
diff --git a/include/hw/ppc/mac_dbdma.h b/include/hw/ppc/mac_dbdma.h
index 4a3f644516..c774f6bf84 100644
--- a/include/hw/ppc/mac_dbdma.h
+++ b/include/hw/ppc/mac_dbdma.h
@@ -44,10 +44,6 @@ struct DBDMA_io {
DBDMA_end dma_end;
/* DMA is in progress, don't start another one */
bool processing;
- /* DMA request */
- void *dma_mem;
- dma_addr_t dma_len;
- DMADirection dir;
};
/*
--
2.39.5
- [Stable-9.1.1 07/32] tests/docker: update debian i686 and mipsel images to bookworm, (continued)
- [Stable-9.1.1 07/32] tests/docker: update debian i686 and mipsel images to bookworm, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 08/32] contrib/plugins/Makefile: Add a 'distclean' target, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 06/32] tests/docker: remove debian-armel-cross, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 09/32] hw/audio/virtio-sound: fix heap buffer overflow, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 10/32] hw/intc/arm_gic: fix spurious level triggered interrupts, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 11/32] ui/sdl2: set swap interval explicitly when OpenGL is enabled, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 12/32] gitlab: fix logic for changing docker tag on stable branches, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 13/32] softmmu: Support concurrent bounce buffers, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 14/32] softmmu/physmem: fix memory leak in dirty_memory_extend(), Michael Tokarev, 2024/10/07
- [Stable-9.1.1 15/32] softmmu/physmem.c: Keep transaction attribute in address_space_map(), Michael Tokarev, 2024/10/07
- [Stable-9.1.1 16/32] mac_dbdma: Remove leftover `dma_memory_unmap` calls,
Michael Tokarev <=
- [Stable-9.1.1 17/32] migration/multifd: Fix rb->receivedmap cleanup race, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 18/32] hw/char/stm32l4x5_usart.c: Enable USART ACK bit response, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 19/32] target/arm: Correct ID_AA64ISAR1_EL1 value for neoverse-v1, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 20/32] target/hppa: Fix random 32-bit linux-user crashes, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 26/32] hw/mips/jazz: fix typo in in-built NIC alias, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 25/32] target/ppc: Fix lxvx/stxvx facility check, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 30/32] hw/sd/sdcard: Fix handling of disabled boot partitions, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 21/32] target/ppc: Fix migration of CPUs with TLB_EMB TLB type, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 23/32] hw/loongarch/virt: Add description for virt machine type, Michael Tokarev, 2024/10/07
- [Stable-9.1.1 22/32] migration/multifd: Fix p->iov leak in multifd-uadk.c, Michael Tokarev, 2024/10/07