qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] target-moxie: set do_interrupt to a target-spec


From: 黄敦荣
Subject: Re: [Qemu-devel] [PATCH] target-moxie: set do_interrupt to a target-specific helper function
Date: Sun, 31 Mar 2013 21:43:32 +0800

Hi Anthony, thanks for your reply.

Below is the backtrace from core dump file, it may help. 

$ moxie-softmmu/qemu-system-moxie  -M moxiesim
Segmentation fault (core dumped)
$ gdb moxie-softmmu/qemu-system-moxie core
GNU gdb (Gentoo) 7.4.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.gentoo.org/>...
Reading symbols from /home/mathslinux/Develop/QEMU/qemu/moxie-softmmu/qemu-system-moxie...done.

warning: core file may not match specified executable file.
[New LWP 1016]
[New LWP 1015]

warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `moxie-softmmu/qemu-system-moxie -M moxiesim'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007fc256f31691 in cpu_moxie_exec (env=0x7fc2589c5ee0) at /home/mathslinux/Develop/QEMU/qemu/cpu-exec.c:278
#2  0x00007fc256f34833 in tcg_cpu_exec (env=0x7fc2589c5ee0) at /home/mathslinux/Develop/QEMU/qemu/cpus.c:1117
#3  0x00007fc256f3496a in tcg_exec_all () at /home/mathslinux/Develop/QEMU/qemu/cpus.c:1150
#4  0x00007fc256f33c60 in qemu_tcg_cpu_thread_fn (arg=0x7fc2589c5dd0) at /home/mathslinux/Develop/QEMU/qemu/cpus.c:843
#5  0x00007fc2533f1ea7 in start_thread () from /lib64/libpthread.so.0
#6  0x00007fc24f6fa06d in clone () from /lib64/libc.so.6
(gdb) l cpu-exec.c:278
273                    cc->do_interrupt(cpu);
274 #endif
275                    ret = env->exception_index;
276                    break;
277 #else
278                    cc->do_interrupt(cpu);
279                    env->exception_index = -1;
280 #endif
281                }
282            }


On Sun, Mar 31, 2013 at 8:33 PM, Anthony Green <address@hidden> wrote:
Hi Dunrong,

  I can't reproduce the segfault, but your patch still looks right to
me.  Thanks!

Signed-of-by: Anthony Green <address@hidden>

AG


On Sat, Mar 30, 2013 at 9:35 PM, Dunrong Huang <address@hidden> wrote:
> The value of "do_interrupt" member of CPUClass shoule be set to a
> target-specific function, or it will lead to a segfault like below:
>
> $ moxie-softmmu/qemu-system-moxie -M moxiesim
> Segmentation fault
>
> Cc: Anthony Green <address@hidden>
> Cc: Blue Swirl <address@hidden>
> Cc: Andreas Färber <address@hidden>
> Signed-off-by: Dunrong Huang <address@hidden>
> ---
>  target-moxie/cpu.c    | 1 +
>  target-moxie/cpu.h    | 2 +-
>  target-moxie/helper.c | 7 +++++--
>  3 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/target-moxie/cpu.c b/target-moxie/cpu.c
> index c17d3f0..c0855f0 100644
> --- a/target-moxie/cpu.c
> +++ b/target-moxie/cpu.c
> @@ -98,6 +98,7 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data)
>      cc->class_by_name = moxie_cpu_class_by_name;
>
>      dc->vmsd = &vmstate_moxie_cpu;
> +    cc->do_interrupt = moxie_cpu_do_interrupt;
>  }
>
>  static void moxielite_initfn(Object *obj)
> diff --git a/target-moxie/cpu.h b/target-moxie/cpu.h
> index b96236f..988729a 100644
> --- a/target-moxie/cpu.h
> +++ b/target-moxie/cpu.h
> @@ -117,7 +117,7 @@ static inline MoxieCPU *moxie_env_get_cpu(CPUMoxieState *env)
>
>  MoxieCPU *cpu_moxie_init(const char *cpu_model);
>  int cpu_moxie_exec(CPUMoxieState *s);
> -void do_interrupt(CPUMoxieState *env);
> +void moxie_cpu_do_interrupt(CPUState *cs);
>  void moxie_translate_init(void);
>  int cpu_moxie_signal_handler(int host_signum, void *pinfo,
>                               void *puc);
> diff --git a/target-moxie/helper.c b/target-moxie/helper.c
> index 8604ce8..6e0ac2a 100644
> --- a/target-moxie/helper.c
> +++ b/target-moxie/helper.c
> @@ -102,7 +102,7 @@ void helper_debug(CPUMoxieState *env)
>
>  #if defined(CONFIG_USER_ONLY)
>
> -void do_interrupt(CPUState *env)
> +void moxie_cpu_do_interrupt(CPUState *env)
>  {
>      env->exception_index = -1;
>  }
> @@ -147,8 +147,11 @@ int cpu_moxie_handle_mmu_fault(CPUMoxieState *env, target_ulong address,
>  }
>
>
> -void do_interrupt(CPUMoxieState *env)
> +void moxie_cpu_do_interrupt(CPUState *cs)
>  {
> +    MoxieCPU *cpu = MOXIE_CPU(cs);
> +    CPUMoxieState *env = &cpu->env;
> +
>      switch (env->exception_index) {
>      case MOXIE_EX_BREAK:
>          break;
> --
> 1.8.1.5
>




--

Best Regards,

黄敦荣
Linux
Developer
北京云端时代科技有限公司
电 话:+86 10 62415355-620
传 真:+86 10 62415355-609
手 机:+86 18618450559
地址: 北京市海淀区中关村南4街18号紫金数码园3号楼1层(100190)
云基地: 北京亦庄经济技术开发区北工大软件园(100176)

北京云端时代科技有限公司邮件法律声明:

本邮件所有信息及附件内容版权、知识产权归我公司所有,未经事先书面许可,禁止复制、转载、传播、储存。

CLOUD TIMES EMAIL NOTICE:

The information and any attachments contained in this email is all copyright and intellectual property of our company reserved. Without prior written permission of any copy, reproduce, propagation or storage will be prohibited.


reply via email to

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