qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCHv2 01/12] cuda: do not use old_mmio accesses


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCHv2 01/12] cuda: do not use old_mmio accesses
Date: Fri, 9 Feb 2018 17:05:23 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

Hi Mark,

On 02/09/2018 03:51 PM, 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..6631017ca2 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_BIG_ENDIAN,
> +    .valid = {

This change the device behavior, previously 16/32bit access were
ignored, now they are illegal.

Using ".impl" instead also change the behavior, since 16/32bits access
would be processed (as 2x or 4x 8bit access).

A comment "this change is safe because ..." would reassure me ;)

> +        .min_access_size = 1,
> +        .max_access_size = 1,
>      },
> -    .endianness = DEVICE_NATIVE_ENDIAN,
>  };
>  
>  static bool cuda_timer_exist(void *opaque, int version_id)
> 



reply via email to

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