All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"David Hildenbrand" <david@redhat.com>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	qemu-s390x@nongnu.org, qemu-arm@nongnu.org,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Richard Henderson" <rth@twiddle.net>
Subject: [PATCH 2/6] hw/dma/rc4030: Use DMA address space to do DMA accesses
Date: Sun, 31 May 2020 19:54:21 +0200	[thread overview]
Message-ID: <20200531175425.10329-3-f4bug@amsat.org> (raw)
In-Reply-To: <20200531175425.10329-1-f4bug@amsat.org>

The DMA device should not use the CPU address space
to do its operation, but its own address space.
Replace cpu_physical_memory_write() by dma_memory_read()
since we already have the DMA address space available.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/dma/rc4030.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/dma/rc4030.c b/hw/dma/rc4030.c
index eefbabd758..c39fe2bb69 100644
--- a/hw/dma/rc4030.c
+++ b/hw/dma/rc4030.c
@@ -24,6 +24,7 @@
 
 #include "qemu/osdep.h"
 #include "qemu/units.h"
+#include "sysemu/dma.h"
 #include "hw/irq.h"
 #include "hw/mips/mips.h"
 #include "hw/sysbus.h"
@@ -301,7 +302,7 @@ static void rc4030_write(void *opaque, hwaddr addr, uint64_t data,
         if (s->cache_ltag == 0x80000001 && s->cache_bmask == 0xf0f0f0f) {
             hwaddr dest = s->cache_ptag & ~0x1;
             dest += (s->cache_maint & 0x3) << 3;
-            cpu_physical_memory_write(dest, &val, 4);
+            dma_memory_read(&s->dma_as, dest, &val, 4);
         }
         break;
     /* Remote Speed Registers */
-- 
2.21.3



  parent reply	other threads:[~2020-05-31 17:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-31 17:54 [PATCH 0/6] exec/memory: Rework some address and access size limits Philippe Mathieu-Daudé
2020-05-31 17:54 ` [PATCH 1/6] target/s390x/mmu_helper: Use address_space_rw() in place Philippe Mathieu-Daudé
2020-06-02  7:11   ` David Hildenbrand
2020-05-31 17:54 ` Philippe Mathieu-Daudé [this message]
2020-05-31 17:54 ` [PATCH 3/6] hw/sd/allwinner-sdhost: Do DMA accesses via DMA address space Philippe Mathieu-Daudé
2020-05-31 19:31   ` Philippe Mathieu-Daudé
2020-05-31 17:54 ` [PATCH 4/6] exec/cpu-common: Do not restrict CPU to 32-bit memory access maximum Philippe Mathieu-Daudé
2020-05-31 19:41   ` Peter Maydell
2020-06-01  7:30     ` Philippe Mathieu-Daudé
2020-05-31 17:54 ` [PATCH 5/6] exec: Restrict 32-bit CPUs to 32-bit address space Philippe Mathieu-Daudé
2020-05-31 19:09   ` Peter Maydell
2020-06-01  8:09     ` Philippe Mathieu-Daudé
2020-06-01 10:45       ` Peter Maydell
2020-06-02  0:01       ` Richard Henderson
2020-05-31 17:54 ` [RFC PATCH 6/6] memory: Use CPU register size as default access_size_max Philippe Mathieu-Daudé
2020-05-31 19:14   ` Peter Maydell
2020-06-01  8:13     ` Philippe Mathieu-Daudé
2020-05-31 18:31 ` [PATCH 0/6] exec/memory: Rework some address and access size limits no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200531175425.10329-3-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=b.galvani@gmail.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=hpoussin@reactos.org \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.