From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Damien Hedde <damien.hedde@greensocs.com>,
qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Cc: peter.maydell@linaro.org, berrange@redhat.com,
ehabkost@redhat.com, Alexey Kardashevskiy <aik@ozlabs.ru>,
Richard Henderson <richard.henderson@linaro.org>,
cohuck@redhat.com, mark.burton@greensocs.com,
qemu-s390x@nongnu.org, edgari@xilinx.com, pbonzini@redhat.com,
david@gibson.dropbear.id.au
Subject: Re: [PATCH v7 03/11] hw/core: create Resettable QOM interface
Date: Thu, 16 Jan 2020 09:57:45 +0100 [thread overview]
Message-ID: <ddd3f6cf-83e5-7198-fd91-9433ef6df923@redhat.com> (raw)
In-Reply-To: <42e9a018-0070-205b-65ed-1d7a6a1b1ff5@greensocs.com>
On 1/16/20 9:53 AM, Damien Hedde wrote:
> On 1/16/20 2:59 AM, Philippe Mathieu-Daudé wrote:
>> On 1/15/20 1:36 PM, Damien Hedde wrote:
>>> This commit defines an interface allowing multi-phase reset. This aims
>>> to solve a problem of the actual single-phase reset (built in
>>> DeviceClass and BusClass): reset behavior is dependent on the order
>>> in which reset handlers are called. In particular doing external
>>> side-effect (like setting an qemu_irq) is problematic because receiving
>>> object may not be reset yet.
>>>
>>> The Resettable interface divides the reset in 3 well defined phases.
>>> To reset an object tree, all 1st phases are executed then all 2nd then
>>> all 3rd. See the comments in include/hw/resettable.h for a more complete
>>> description. The interface defines 3 phases to let the future
>>> possibility of holding an object into reset for some time.
>>>
>>> The qdev/qbus reset in DeviceClass and BusClass will be modified in
>>> following commits to use this interface. A mechanism is provided
>>> to allow executing a transitional reset handler in place of the 2nd
>>> phase which is executed in children-then-parent order inside a tree.
>>> This will allow to transition devices and buses smoothly while
>>> keeping the exact current qdev/qbus reset behavior for now.
>>>
>>> Documentation will be added in a following commit.
>>>
>>> Signed-off-by: Damien Hedde <damien.hedde@greensocs.com>
>>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>>> ---
>>>
>>> v7 update: un-nest struct ResettablePhases
>>> ---
>>> Makefile.objs | 1 +
>>> include/hw/resettable.h | 211 +++++++++++++++++++++++++++++++++++
>>> hw/core/resettable.c | 238 ++++++++++++++++++++++++++++++++++++++++
>>> hw/core/Makefile.objs | 1 +
>>> hw/core/trace-events | 17 +++
>>> 5 files changed, 468 insertions(+)
>>> create mode 100644 include/hw/resettable.h
>>> create mode 100644 hw/core/resettable.c
>>>
>
>>
>> Something here breaks ./configure --enable-trace-backends=ust:
>>
>> CC trace-ust-all.o
>> In file included from trace-ust-all.h:13,
>> from trace-ust-all.c:13:
>> trace-ust-all.h:35151:1: error: redefinition of
>> ‘__tracepoint_cb_qemu___loader_write_rom’
>> 35151 | TRACEPOINT_EVENT(
>> | ^~~~~~~~~~~~~~~~
>> trace-ust-all.h:31791:1: note: previous definition of
>> ‘__tracepoint_cb_qemu___loader_write_rom’ was here
>> 31791 | TRACEPOINT_EVENT(
>> | ^~~~~~~~~~~~~~~~
>> ...
>> ./trace-ust-all.h:35388:1: error: redefinition of
>> ‘__tp_event_signature___qemu___resettable_transitional_function’
>> 35388 | TRACEPOINT_EVENT(
>> | ^~~~~~~~~~~~~~~~
>> ./trace-ust-all.h:32028:1: note: previous definition of
>> ‘__tp_event_signature___qemu___resettable_transitional_function’ was here
>> 32028 | TRACEPOINT_EVENT(
>> | ^~~~~~~~~~~~~~~~
>> In file included from /usr/include/lttng/tracepoint-event.h:58,
>> from trace-ust-all.h:35401,
>> from trace-ust-all.c:13:
>>
>> Indeed:
>>
>> 32028 TRACEPOINT_EVENT(
>> 32029 qemu,
>> 32030 resettable_transitional_function,
>> 32031 TP_ARGS(void *, obj, const char *, objtype),
>> 32032 TP_FIELDS(
>> 32033 ctf_integer_hex(void *, obj, obj)
>> 32034 ctf_string(objtype, objtype)
>> 32035 )
>> 32036 )
>> 32037
>> ...
>> 35388 TRACEPOINT_EVENT(
>> 35389 qemu,
>> 35390 resettable_transitional_function,
>> 35391 TP_ARGS(void *, obj, const char *, objtype),
>> 35392 TP_FIELDS(
>> 35393 ctf_integer_hex(void *, obj, obj)
>> 35394 ctf_string(objtype, objtype)
>> 35395 )
>> 35396 )
>> 35397
>> 35398 #endif /* TRACE_ALL_GENERATED_UST_H */
>>
>> Ah! I was going to say "no clue what could be wrong, so Cc'ing Stefan"
>> but got it:
>>
>> $ git grep hw/core Makefile.objs
>> Makefile.objs:194:trace-events-subdirs += hw/core
>> Makefile.objs:207:trace-events-subdirs += hw/core
>>
>> We might already have a 'uniq' makefile function to do:
>>
>> trace-events-subdirs = $(call uniq $(trace-events-subdirs))
>>
>> or maybe was it with $filter? I can't find it/remember, too tired.
>
> You can use $sort to remove duplicates in make.
Ah $(sort ...) thanks, I was too tired to remember it =)
>>
>> So the fix is:
>>
>> -- >8 --
>> --- a/Makefile.objs
>> +++ b/Makefile.objs
>> @@ -191,7 +191,6 @@ trace-events-subdirs += migration
>> trace-events-subdirs += net
>> trace-events-subdirs += ui
>> endif
>> -trace-events-subdirs += hw/core
>> trace-events-subdirs += hw/display
>> trace-events-subdirs += qapi
>> trace-events-subdirs += qom
>> ---
>>
>
> I'll remove the duplicate entry.
I prepared a patch to move hw/core, if qemu-trivial merges it first, you
shouldn't need to respin your series.
next prev parent reply other threads:[~2020-01-16 8:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-15 12:36 [PATCH v7 00/11] Multi-phase reset mechanism Damien Hedde
2020-01-15 12:36 ` [PATCH v7 01/11] add device_legacy_reset function to prepare for reset api change Damien Hedde
2020-01-18 6:48 ` Philippe Mathieu-Daudé
2020-01-15 12:36 ` [PATCH v7 02/11] hw/core/qdev: add trace events to help with resettable transition Damien Hedde
2020-01-16 2:04 ` Philippe Mathieu-Daudé
2020-01-15 12:36 ` [PATCH v7 03/11] hw/core: create Resettable QOM interface Damien Hedde
2020-01-16 1:59 ` Philippe Mathieu-Daudé
2020-01-16 2:12 ` Philippe Mathieu-Daudé
2020-01-16 8:53 ` Damien Hedde
2020-01-16 8:57 ` Philippe Mathieu-Daudé [this message]
2020-01-18 6:35 ` Philippe Mathieu-Daudé
2020-01-20 8:50 ` Damien Hedde
2020-01-18 6:42 ` Philippe Mathieu-Daudé
2020-01-20 9:08 ` Damien Hedde
2020-01-20 9:18 ` Philippe Mathieu-Daudé
2020-01-15 12:36 ` [PATCH v7 04/11] hw/core: add Resettable support to BusClass and DeviceClass Damien Hedde
2020-01-16 2:02 ` Philippe Mathieu-Daudé
2020-01-15 12:36 ` [PATCH v7 05/11] hw/core/resettable: add support for changing parent Damien Hedde
2020-01-18 6:45 ` Philippe Mathieu-Daudé
2020-01-15 12:36 ` [PATCH v7 06/11] hw/core/qdev: handle parent bus change regarding resettable Damien Hedde
2020-01-16 2:05 ` Philippe Mathieu-Daudé
2020-01-15 12:36 ` [PATCH v7 07/11] hw/core/qdev: update hotplug reset " Damien Hedde
2020-01-18 6:47 ` Philippe Mathieu-Daudé
2020-01-15 12:36 ` [PATCH v7 08/11] hw/core: deprecate old reset functions and introduce new ones Damien Hedde
2020-01-18 6:47 ` Philippe Mathieu-Daudé
2020-01-15 12:36 ` [PATCH v7 09/11] docs/devel/reset.rst: add doc about Resettable interface Damien Hedde
2020-01-15 12:36 ` [PATCH v7 10/11] vl: replace deprecated qbus_reset_all registration Damien Hedde
2020-01-15 23:44 ` Philippe Mathieu-Daudé
2020-01-16 8:57 ` Damien Hedde
2020-01-15 12:36 ` [PATCH v7 11/11] hw/s390x/ipl: replace deprecated qdev_reset_all registration Damien Hedde
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=ddd3f6cf-83e5-7198-fd91-9433ef6df923@redhat.com \
--to=philmd@redhat.com \
--cc=aik@ozlabs.ru \
--cc=berrange@redhat.com \
--cc=cohuck@redhat.com \
--cc=damien.hedde@greensocs.com \
--cc=david@gibson.dropbear.id.au \
--cc=edgari@xilinx.com \
--cc=ehabkost@redhat.com \
--cc=mark.burton@greensocs.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=stefanha@redhat.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 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).