All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] Use of TARGET_FMT_plx in hw/tpm/trace-events
@ 2019-07-20  6:39 Markus Armbruster
  2019-07-20  9:42 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Armbruster @ 2019-07-20  6:39 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Stefan Berger

Consider hw/tpm/trace-events

    # tpm_crb.c
    tpm_crb_mmio_read(uint64_t addr, unsigned size, uint32_t val) "CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
    tpm_crb_mmio_write(uint64_t addr, unsigned size, uint32_t val) "CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32

Format is TARGET_FMT_plx formats a hwaddr, but the parameter type is
uint64_t.  They happen to be the same.  Is this kosher?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Use of TARGET_FMT_plx in hw/tpm/trace-events
  2019-07-20  6:39 [Qemu-devel] Use of TARGET_FMT_plx in hw/tpm/trace-events Markus Armbruster
@ 2019-07-20  9:42 ` Philippe Mathieu-Daudé
  2019-07-21  7:22   ` Thomas Huth
  2019-07-22 14:43   ` Markus Armbruster
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-07-20  9:42 UTC (permalink / raw)
  To: Markus Armbruster, Stefan Hajnoczi; +Cc: Thomas Huth, qemu-devel, Stefan Berger

On 7/20/19 8:39 AM, Markus Armbruster wrote:
> Consider hw/tpm/trace-events
> 
>     # tpm_crb.c
>     tpm_crb_mmio_read(uint64_t addr, unsigned size, uint32_t val) "CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
>     tpm_crb_mmio_write(uint64_t addr, unsigned size, uint32_t val) "CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
> 
> Format is TARGET_FMT_plx formats a hwaddr, but the parameter type is
> uint64_t.  They happen to be the same.  Is this kosher?
> 

Missed when converting from DPRINTF() to trace-events:
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ec427498;hp=8cb340c613

PRIx64 certainly makes sense here.

Since it is the single use, once updated we can remote this hunk from
scripts/tracetool/format/log_stap.py:

    if macro == "TARGET_FMT_plx":
        return "%016x"

I guess remember a thread with Thomas talking about TARGET_FMT_plx but I
can't find it, maybe I dreamed about it...

The idea was, we poison TARGET_FMT_l[udx] but not TARGET_FMT_plx, we
could, but then we have to fix few formats, once done TARGET_FMT_plx
existence is almost irrelevant.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Use of TARGET_FMT_plx in hw/tpm/trace-events
  2019-07-20  9:42 ` Philippe Mathieu-Daudé
@ 2019-07-21  7:22   ` Thomas Huth
  2019-07-22 14:40     ` Markus Armbruster
  2019-07-22 14:43   ` Markus Armbruster
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Huth @ 2019-07-21  7:22 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, Markus Armbruster, Stefan Hajnoczi
  Cc: qemu-devel, Stefan Berger

On 20/07/2019 11.42, Philippe Mathieu-Daudé wrote:
> On 7/20/19 8:39 AM, Markus Armbruster wrote:
>> Consider hw/tpm/trace-events
>>
>>     # tpm_crb.c
>>     tpm_crb_mmio_read(uint64_t addr, unsigned size, uint32_t val) "CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
>>     tpm_crb_mmio_write(uint64_t addr, unsigned size, uint32_t val) "CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
>>
>> Format is TARGET_FMT_plx formats a hwaddr, but the parameter type is
>> uint64_t.  They happen to be the same.  Is this kosher?
>>
> 
> Missed when converting from DPRINTF() to trace-events:
> https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ec427498;hp=8cb340c613
> 
> PRIx64 certainly makes sense here.
> 
> Since it is the single use, once updated we can remote this hunk from
> scripts/tracetool/format/log_stap.py:
> 
>     if macro == "TARGET_FMT_plx":
>         return "%016x"
> 
> I guess remember a thread with Thomas talking about TARGET_FMT_plx but I
> can't find it, maybe I dreamed about it...

That was:

 https://patchwork.kernel.org/patch/10930327/

... I think we should rename it to HWADDR_PRI0x or so.

 Thomas


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Use of TARGET_FMT_plx in hw/tpm/trace-events
  2019-07-21  7:22   ` Thomas Huth
@ 2019-07-22 14:40     ` Markus Armbruster
  0 siblings, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2019-07-22 14:40 UTC (permalink / raw)
  To: Thomas Huth
  Cc: Philippe Mathieu-Daudé, qemu-devel, Stefan Hajnoczi, Stefan Berger

Thomas Huth <thuth@redhat.com> writes:

> On 20/07/2019 11.42, Philippe Mathieu-Daudé wrote:
>> On 7/20/19 8:39 AM, Markus Armbruster wrote:
>>> Consider hw/tpm/trace-events
>>>
>>>     # tpm_crb.c
>>>     tpm_crb_mmio_read(uint64_t addr, unsigned size, uint32_t val) "CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
>>>     tpm_crb_mmio_write(uint64_t addr, unsigned size, uint32_t val) "CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
>>>
>>> Format is TARGET_FMT_plx formats a hwaddr, but the parameter type is
>>> uint64_t.  They happen to be the same.  Is this kosher?
>>>
>> 
>> Missed when converting from DPRINTF() to trace-events:
>> https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ec427498;hp=8cb340c613
>> 
>> PRIx64 certainly makes sense here.
>> 
>> Since it is the single use, once updated we can remote this hunk from
>> scripts/tracetool/format/log_stap.py:
>> 
>>     if macro == "TARGET_FMT_plx":
>>         return "%016x"
>> 
>> I guess remember a thread with Thomas talking about TARGET_FMT_plx but I
>> can't find it, maybe I dreamed about it...
>
> That was:
>
>  https://patchwork.kernel.org/patch/10930327/
>
> ... I think we should rename it to HWADDR_PRI0x or so.

I'd expect "PRI" macros to expand into just a format specifier.
"%016" PRIx64 is a full conversion specification.  Something like
HWADDR_FMT0x would work for me.

"Use HWADDR_PRIx and slowly kill TARGET_FMT_plx" (suggested in the
thread you linked) would also work for me.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] Use of TARGET_FMT_plx in hw/tpm/trace-events
  2019-07-20  9:42 ` Philippe Mathieu-Daudé
  2019-07-21  7:22   ` Thomas Huth
@ 2019-07-22 14:43   ` Markus Armbruster
  1 sibling, 0 replies; 5+ messages in thread
From: Markus Armbruster @ 2019-07-22 14:43 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Thomas Huth, qemu-devel, Stefan Hajnoczi, Stefan Berger

Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> On 7/20/19 8:39 AM, Markus Armbruster wrote:
>> Consider hw/tpm/trace-events
>> 
>>     # tpm_crb.c
>>     tpm_crb_mmio_read(uint64_t addr, unsigned size, uint32_t val) "CRB read 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
>>     tpm_crb_mmio_write(uint64_t addr, unsigned size, uint32_t val) "CRB write 0x" TARGET_FMT_plx " len:%u val: 0x%" PRIx32
>> 
>> Format is TARGET_FMT_plx formats a hwaddr, but the parameter type is
>> uint64_t.  They happen to be the same.  Is this kosher?
>> 
>
> Missed when converting from DPRINTF() to trace-events:
> https://git.qemu.org/?p=qemu.git;a=commitdiff;h=ec427498;hp=8cb340c613
>
> PRIx64 certainly makes sense here.
>
> Since it is the single use, once updated we can remote this hunk from
> scripts/tracetool/format/log_stap.py:
>
>     if macro == "TARGET_FMT_plx":
>         return "%016x"

Good point, thanks!

[...]


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-22 14:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-20  6:39 [Qemu-devel] Use of TARGET_FMT_plx in hw/tpm/trace-events Markus Armbruster
2019-07-20  9:42 ` Philippe Mathieu-Daudé
2019-07-21  7:22   ` Thomas Huth
2019-07-22 14:40     ` Markus Armbruster
2019-07-22 14:43   ` Markus Armbruster

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.