qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 01/10] cuda: do not use old_mmio accesses


From: Mark Cave-Ayland
Subject: Re: [Qemu-devel] [PATCH 01/10] cuda: do not use old_mmio accesses
Date: Tue, 6 Feb 2018 21:40:00 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 05/02/18 14:17, Laurent Vivier wrote:

On 03/02/2018 11:37, Mark Cave-Ayland wrote:
Signed-off-by: Mark Cave-Ayland <address@hidden>
---
  hw/misc/macio/cuda.c | 40 ++++++++--------------------------------
  1 file changed, 8 insertions(+), 32 deletions(-)

diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c
index 008d8bd4d5..23b7e0f5b0 100644
--- a/hw/misc/macio/cuda.c
+++ b/hw/misc/macio/cuda.c
@@ -275,7 +275,7 @@ static void cuda_delay_set_sr_int(CUDAState *s)
      timer_mod(s->sr_delay_timer, expire);
  }
-static uint32_t cuda_readb(void *opaque, hwaddr addr)
+static uint64_t cuda_read(void *opaque, hwaddr addr, unsigned size)
  {
      CUDAState *s = opaque;
      uint32_t val;
@@ -350,7 +350,7 @@ static uint32_t cuda_readb(void *opaque, hwaddr addr)
      return val;
  }
-static void cuda_writeb(void *opaque, hwaddr addr, uint32_t val)
+static void cuda_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
  {
      CUDAState *s = opaque;
@@ -780,38 +780,14 @@ static void cuda_receive_packet_from_host(CUDAState *s,
      }
  }
-static void cuda_writew (void *opaque, hwaddr addr, uint32_t value)
-{
-}
-
-static void cuda_writel (void *opaque, hwaddr addr, uint32_t value)
-{
-}
-
-static uint32_t cuda_readw (void *opaque, hwaddr addr)
-{
-    return 0;
-}
-
-static uint32_t cuda_readl (void *opaque, hwaddr addr)
-{
-    return 0;
-}
-
  static const MemoryRegionOps cuda_ops = {
-    .old_mmio = {
-        .write = {
-            cuda_writeb,
-            cuda_writew,
-            cuda_writel,
-        },
-        .read = {
-            cuda_readb,
-            cuda_readw,
-            cuda_readl,
-        },
-    },
+    .read = cuda_read,
+    .write = cuda_write,
      .endianness = DEVICE_NATIVE_ENDIAN,

As CUDA Macintoshes are all big-endian, I think you should use
DEVICE_BIG_ENDIAN here, except if you are aware of a little-endian
machine using it in little-endian mode.

Yes that's true, I will give it a test to make sure that everything still works as expected. Any thoughts on the rest of the patchset? I haven't finished porting Ben's PMU patches over to use it, however things are looking fairly good with progress so far.


ATB,

Mark.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]