From: Chen Gang S <gang.chen@sunrus.com.cn>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Riku Voipio <riku.voipio@iki.fi>,
qemu-devel <qemu-devel@nongnu.org>,
Chris Metcalf <cmetcalf@ezchip.com>,
"walt@tilera.com" <walt@tilera.com>,
"rth@twiddle.net" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 1/6 v4] target-tilegx: Firstly add to qemu with minimized features
Date: Sun, 01 Mar 2015 03:19:36 +0800 [thread overview]
Message-ID: <54F214C8.20903@sunrus.com.cn> (raw)
In-Reply-To: <54F0AB3A.9060100@suse.de>
On 2/28/15 01:36, Andreas Färber wrote:
>> +static void tilegx_cpu_class_init(ObjectClass *oc, void *data)
>> > +{
>> > + DeviceClass *dc = DEVICE_CLASS(oc);
>> > + CPUClass *cc = CPU_CLASS(oc);
>> > + TilegxCPUClass *mcc = TILEGX_CPU_CLASS(oc);
>> > +
>> > + mcc->parent_realize = dc->realize;
>> > + dc->realize = tilegx_cpu_realizefn;
>> > +
>> > + mcc->parent_reset = cc->reset;
>> > + cc->reset = tilegx_cpu_reset;
>> > +
>> > + cc->has_work = tilegx_cpu_has_work;
>> > + cc->do_interrupt = tilegx_cpu_do_interrupt;
>> > + cc->cpu_exec_interrupt = tilegx_cpu_exec_interrupt;
>> > + cc->dump_state = NULL;
>> > + cc->set_pc = tilegx_cpu_set_pc;
>> > + cc->gdb_read_register = NULL;
>> > + cc->gdb_write_register = NULL;
> Is this really safe to do? If so, all fields are zero-initialized at
> this point already, so no need to assign NULL or 0.
>
>> > + cc->handle_mmu_fault = tilegx_cpu_handle_mmu_fault;
>> > + dc->vmsd = &vmstate_tilegx_cpu;
>> > + dc->props = tilegx_properties;
>> > + cc->gdb_num_core_regs = 0;
>> > +}
>> > +
When we set gdb_num_core_regs be 0, gdb_read/write_register should not
be called, and they assume the callers always pass valid parameters.
- For alpha, s390 have considered about the invalid parameter.
- arm, i386 and microblaze do not consider about the invalid parameter.
For dump_state, the caller will check whether it is NULL, before use it.
Thanks.
--
Chen Gang
Open, share, and attitude like air, water, and life which God blessed
next prev parent reply other threads:[~2015-02-28 19:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-22 13:31 [Qemu-devel] [PATCH 0/6 v4] tilegx: Can load elf64 tilegx binary successfully for linux-user Chen Gang S
2015-02-22 13:33 ` [Qemu-devel] [PATCH 1/6 v4] target-tilegx: Firstly add to qemu with minimized features Chen Gang S
2015-02-27 17:36 ` Andreas Färber
2015-02-27 21:49 ` Chris Metcalf
2015-02-28 2:10 ` Chen Gang S
2015-02-28 2:09 ` Chris Metcalf
2015-02-28 4:39 ` Chen Gang S
2015-02-28 5:20 ` Chen Gang S
2015-02-28 20:04 ` Chen Gang S
2015-02-28 19:19 ` Chen Gang S [this message]
2015-02-22 13:35 ` [Qemu-devel] [PATCH 3/6 v4] linux-user: tilegx: Add target features support within qemu Chen Gang S
2015-02-22 13:36 ` [Qemu-devel] [PATCH 4/6 v4] linux-user: Support tilegx architecture in syscall Chen Gang S
2015-02-27 17:40 ` Andreas Färber
2015-02-27 23:10 ` Chen Gang S
2015-02-22 13:36 ` [Qemu-devel] [PATCH 5/6 v4] linux-user: Support tilegx architecture in linux-user Chen Gang S
2015-02-22 13:37 ` [Qemu-devel] [PATCH 6/6 v4] linux-user/syscall.c: Switch all macros which are not defined in tilegx Chen Gang S
2015-02-27 18:24 ` Andreas Färber
2015-02-27 23:06 ` Chen Gang S
2015-02-22 18:29 ` [Qemu-devel] [PATCH 0/6 v4] tilegx: Can load elf64 tilegx binary successfully for linux-user Richard Henderson
2015-02-23 1:40 ` Chen Gang S
2015-02-22 22:32 ` Bastian Koppelmann
2015-02-23 1:37 ` Chen Gang S
2015-02-26 23:56 ` Chen Gang S
2015-02-27 0:32 ` Chen Gang S
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=54F214C8.20903@sunrus.com.cn \
--to=gang.chen@sunrus.com.cn \
--cc=afaerber@suse.de \
--cc=cmetcalf@ezchip.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
--cc=rth@twiddle.net \
--cc=walt@tilera.com \
/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.