From: Like Xu <like.xu@linux.intel.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Eduardo Habkost" <ehabkost@redhat.com>,
"QEMU Trivial" <qemu-trivial@nongnu.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
like.xu@intel.com, "Paolo Bonzini" <pbonzini@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [Qemu-devel] [PATCH 4/9] cpu/topology: add ARM support for smp machine properties
Date: Tue, 2 Apr 2019 13:20:51 +0800 [thread overview]
Message-ID: <ca73da94-df07-ac0e-67a4-8c9b18b7dc20@linux.intel.com> (raw)
In-Reply-To: <CAFEAcA_i9Te5Gs9GWnqH+JvTPFbp80+n2D=VAoC0e2DS7OfSeg@mail.gmail.com>
On 2019/4/2 12:45, Peter Maydell wrote:
> On Tue, 2 Apr 2019 at 09:46, Like Xu <like.xu@linux.intel.com> wrote:
>>
>> On 2019/4/2 7:38, Eduardo Habkost wrote:
>>> On Mon, Apr 01, 2019 at 10:56:30AM +0800, Like Xu wrote:
>>>> On 2019/3/29 17:27, Alex Bennée wrote:
>>> [...]
>>>>>> @@ -1713,6 +1717,9 @@ static void cortex_a9_initfn(Object *obj)
>>>>>> #ifndef CONFIG_USER_ONLY
>>>>>> static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri)
>>>>>> {
>>>>>> + MachineState *ms = MACHINE(qdev_get_machine());
>>>>>
>>>>> How expensive is qdev_get_machine? This could potentially be a
>>>>> performance issue if this register is read a lot.
>>>>
>>>> It may not bother us cause the MachineState object would be feteched from
>>>> qemu QOM at its first requested time and save it as static variable for
>>>> incoming requests.
>>>
>>> We already have a current_machine variable declared in
>>> include/hw/boards.h. We normally avoid using it and use
>>> MACHINE(qdev_get_machine()) instead, but I never understood why.
>>>
>> Which one do you prefer to access smp machine properties?
>
> My suggestion would be that we use qdev_get_machine(). I think
> it would be nice to make the remaining dozen or so uses of
> the global current_machine outside vl.c use qdev_get_machine()
> instead, and then make current_machine local to vl.c instead
> of global.
>
> thanks
> -- PMM
>
>
It looks good to me and I am not sure if this refactoring should be
added in next patch series or as a separate patch.
next prev parent reply other threads:[~2019-04-02 5:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1553849325-44201-1-git-send-email-like.xu@linux.intel.com>
[not found] ` <20190329112152.0c7ad147@redhat.com>
2019-04-04 3:26 ` [Qemu-devel] [PATCH 0/9] refactor cpu topo into machine properties Like Xu
2019-04-08 13:26 ` Igor Mammedov
2019-04-08 13:26 ` Igor Mammedov
2019-04-08 14:38 ` Like Xu
2019-04-08 14:38 ` Like Xu
[not found] ` <1553849325-44201-2-git-send-email-like.xu@linux.intel.com>
2019-04-04 11:37 ` [Qemu-devel] [PATCH 1/9] cpu/topology: add struct CpuTopology to MachineState Igor Mammedov
[not found] ` <1553849325-44201-3-git-send-email-like.xu@linux.intel.com>
2019-04-04 14:25 ` [Qemu-devel] [PATCH 2/9] cpu/topology: add general support for machine properties Igor Mammedov
2019-04-04 16:21 ` Dr. David Alan Gilbert
2019-04-30 7:30 ` Like Xu
2019-04-30 7:30 ` Like Xu
2019-05-02 15:09 ` Igor Mammedov
2019-05-02 15:09 ` Igor Mammedov
2019-05-03 1:08 ` Eduardo Habkost
2019-05-03 1:08 ` Eduardo Habkost
2019-05-03 1:01 ` Eduardo Habkost
2019-05-03 1:01 ` Eduardo Habkost
[not found] ` <1553849325-44201-4-git-send-email-like.xu@linux.intel.com>
2019-04-08 12:54 ` [Qemu-devel] [PATCH 3/9] cpu/topology: add uncommon arch support for smp " Igor Mammedov
2019-04-08 12:54 ` Igor Mammedov
2019-04-16 8:47 ` Like Xu
2019-04-16 8:47 ` Like Xu
2019-04-16 12:00 ` Igor Mammedov
2019-04-16 12:00 ` Igor Mammedov
[not found] ` <1553849325-44201-5-git-send-email-like.xu@linux.intel.com>
[not found] ` <87h8bmuj2d.fsf@zen.linaroharston>
[not found] ` <2546bf3e-2009-5a76-bc63-0ad73d333a78@linux.intel.com>
2019-04-01 23:38 ` [Qemu-devel] [PATCH 4/9] cpu/topology: add ARM " Eduardo Habkost
2019-04-02 2:35 ` Like Xu
2019-04-02 4:45 ` Peter Maydell
2019-04-02 5:20 ` Like Xu [this message]
2019-04-02 5:27 ` Peter Maydell
2019-04-08 13:11 ` Igor Mammedov
2019-04-08 13:11 ` Igor Mammedov
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=ca73da94-df07-ac0e-67a4-8c9b18b7dc20@linux.intel.com \
--to=like.xu@linux.intel.com \
--cc=alex.bennee@linaro.org \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=like.xu@intel.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).