qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH qom-cpu 27/59] cpu: Turn cpu_unassigned_access()


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH qom-cpu 27/59] cpu: Turn cpu_unassigned_access() into a CPUState hook
Date: Tue, 11 Jun 2013 00:05:08 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Am 09.06.2013 21:12, schrieb Andreas Färber:
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index a69c09c..814d067 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
[...]
> @@ -383,6 +401,21 @@ void cpu_interrupt(CPUState *cpu, int mask);
>  
>  #endif /* USER_ONLY */
>  
> +#ifndef CONFIG_USER_ONLY
> +
> +static inline void cpu_unassigned_access(CPUState *cpu, hwaddr addr,
> +                                         bool is_write, bool is_exec,
> +                                         int opaque, unsigned size)
> +{
> +    CPUClass *cc = CPU_GET_CLASS(cpu);
> +
> +    if (cc->do_unassigned_access) {
> +        cc->do_unassigned_access(cpu, addr, is_write, is_exec, opaque, size);
> +    }
> +}
> +
> +#endif
> +
>  /**
>   * cpu_reset_interrupt:
>   * @cpu: The CPU to clear the interrupt on.
> diff --git a/memory.c b/memory.c
> index 5cb8f4a..74daf03 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -857,9 +857,8 @@ static uint64_t unassigned_mem_read(void *opaque, hwaddr 
> addr,
>  #ifdef DEBUG_UNASSIGNED
>      printf("Unassigned mem read " TARGET_FMT_plx "\n", addr);
>  #endif
> -#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || 
> defined(TARGET_MICROBLAZE)
> -    cpu_unassigned_access(cpu_single_env, addr, 0, 0, 0, size);
> -#endif
> +    cpu_unassigned_access(ENV_GET_CPU(cpu_single_env), addr, false, false, 0,
> +                          size);
>      return 0;
>  }
>  
> @@ -869,9 +868,8 @@ static void unassigned_mem_write(void *opaque, hwaddr 
> addr,
>  #ifdef DEBUG_UNASSIGNED
>      printf("Unassigned mem write " TARGET_FMT_plx " = 0x%"PRIx64"\n", addr, 
> val);
>  #endif
> -#if defined(TARGET_ALPHA) || defined(TARGET_SPARC) || 
> defined(TARGET_MICROBLAZE)
> -    cpu_unassigned_access(cpu_single_env, addr, 1, 0, 0, size);
> -#endif
> +    cpu_unassigned_access(ENV_GET_CPU(cpu_single_env), addr, true, false, 0,
> +                          size);
>  }
>  
>  static bool unassigned_mem_accepts(void *opaque, hwaddr addr,

Taking a wild guess here, could it be that cpu_single_env is NULL in the
Xen case, and we're tripping over cpu_unassigned_access() trying
CPU_GET_CLASS(ENV_GET_CPU(NULL)) and asserting?

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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