All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed
@ 2020-08-12 19:02 Philippe Mathieu-Daudé
  2020-08-12 19:02 ` [PATCH v2 1/3] hw/misc/unimp: Display value after offset Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-12 19:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Maydell, Richard Henderson,
	Philippe Mathieu-Daudé

This series aims to ease looking at the '-d unimp' output reported
by the UnimplementedDevice.

- read/write accesses are now aligned
- the value format width uses the access size
- the offset (address) uses the size of the memory region it belongs

Series fully reviewed.

Since v1:
- Use DIV_ROUND_UP instead of ROUND_UP (rth)
- Added rth R-b tags

$ git backport-diff -u v1 -r origin/master..
Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/3:[----] [--] 'hw/misc/unimp: Display value after offset'
002/3:[----] [--] 'hw/misc/unimp: Display the value with width of the access size'
003/3:[0002] [FC] 'hw/misc/unimp: Display the offset with width of the region size'

Philippe Mathieu-Daudé (3):
  hw/misc/unimp: Display value after offset
  hw/misc/unimp: Display the value with width of the access size
  hw/misc/unimp: Display the offset with width of the region size

 include/hw/misc/unimp.h |  1 +
 hw/misc/unimp.c         | 14 ++++++++------
 2 files changed, 9 insertions(+), 6 deletions(-)

-- 
2.21.3



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

* [PATCH v2 1/3] hw/misc/unimp: Display value after offset
  2020-08-12 19:02 [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
@ 2020-08-12 19:02 ` Philippe Mathieu-Daudé
  2020-08-12 19:02 ` [PATCH v2 2/3] hw/misc/unimp: Display the value with width of the access size Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-12 19:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Maydell, Richard Henderson,
	Philippe Mathieu-Daudé, Philippe Mathieu-Daudé

To better align the read/write accesses, display the value after
the offset (read accesses only display the offset).

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/misc/unimp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c
index bc4084d344..ee2e536c8b 100644
--- a/hw/misc/unimp.c
+++ b/hw/misc/unimp.c
@@ -22,7 +22,7 @@ static uint64_t unimp_read(void *opaque, hwaddr offset, unsigned size)
 {
     UnimplementedDeviceState *s = UNIMPLEMENTED_DEVICE(opaque);
 
-    qemu_log_mask(LOG_UNIMP, "%s: unimplemented device read "
+    qemu_log_mask(LOG_UNIMP, "%s: unimplemented device read  "
                   "(size %d, offset 0x%" HWADDR_PRIx ")\n",
                   s->name, size, offset);
     return 0;
@@ -34,9 +34,9 @@ static void unimp_write(void *opaque, hwaddr offset,
     UnimplementedDeviceState *s = UNIMPLEMENTED_DEVICE(opaque);
 
     qemu_log_mask(LOG_UNIMP, "%s: unimplemented device write "
-                  "(size %d, value 0x%" PRIx64
-                  ", offset 0x%" HWADDR_PRIx ")\n",
-                  s->name, size, value, offset);
+                  "(size %d, offset 0x%" HWADDR_PRIx
+                  ", value 0x%" PRIx64 ")\n",
+                  s->name, size, offset, value);
 }
 
 static const MemoryRegionOps unimp_ops = {
-- 
2.21.3



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

* [PATCH v2 2/3] hw/misc/unimp: Display the value with width of the access size
  2020-08-12 19:02 [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
  2020-08-12 19:02 ` [PATCH v2 1/3] hw/misc/unimp: Display value after offset Philippe Mathieu-Daudé
@ 2020-08-12 19:02 ` Philippe Mathieu-Daudé
  2020-08-12 19:02 ` [PATCH v2 3/3] hw/misc/unimp: Display the offset with width of the region size Philippe Mathieu-Daudé
  2020-08-22 20:02 ` [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
  3 siblings, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-12 19:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Maydell, Richard Henderson,
	Philippe Mathieu-Daudé, Philippe Mathieu-Daudé

To quickly notice the access size, display the value with the
width of the access (i.e. 16-bit access is displayed 0x0000,
while 8-bit access 0x00).

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/misc/unimp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c
index ee2e536c8b..b4b318db1c 100644
--- a/hw/misc/unimp.c
+++ b/hw/misc/unimp.c
@@ -35,8 +35,8 @@ static void unimp_write(void *opaque, hwaddr offset,
 
     qemu_log_mask(LOG_UNIMP, "%s: unimplemented device write "
                   "(size %d, offset 0x%" HWADDR_PRIx
-                  ", value 0x%" PRIx64 ")\n",
-                  s->name, size, offset, value);
+                  ", value 0x%0*" PRIx64 ")\n",
+                  s->name, size, offset, size << 1, value);
 }
 
 static const MemoryRegionOps unimp_ops = {
-- 
2.21.3



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

* [PATCH v2 3/3] hw/misc/unimp: Display the offset with width of the region size
  2020-08-12 19:02 [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
  2020-08-12 19:02 ` [PATCH v2 1/3] hw/misc/unimp: Display value after offset Philippe Mathieu-Daudé
  2020-08-12 19:02 ` [PATCH v2 2/3] hw/misc/unimp: Display the value with width of the access size Philippe Mathieu-Daudé
@ 2020-08-12 19:02 ` Philippe Mathieu-Daudé
  2020-08-22 20:02 ` [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
  3 siblings, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-12 19:02 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Peter Maydell, Richard Henderson,
	Philippe Mathieu-Daudé, Philippe Mathieu-Daudé

To have a better idea of how big is the region where the offset
belongs, display the value with the width of the region size
(i.e. a region of 0x1000 bytes uses 0x000 format).

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Since v1: Use DIV_ROUND_UP (rth)
---
 include/hw/misc/unimp.h |  1 +
 hw/misc/unimp.c         | 10 ++++++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h
index 4c1d13c9bf..c63968a2cd 100644
--- a/include/hw/misc/unimp.h
+++ b/include/hw/misc/unimp.h
@@ -20,6 +20,7 @@
 typedef struct {
     SysBusDevice parent_obj;
     MemoryRegion iomem;
+    unsigned offset_fmt_width;
     char *name;
     uint64_t size;
 } UnimplementedDeviceState;
diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c
index b4b318db1c..6cfc5727f0 100644
--- a/hw/misc/unimp.c
+++ b/hw/misc/unimp.c
@@ -23,8 +23,8 @@ static uint64_t unimp_read(void *opaque, hwaddr offset, unsigned size)
     UnimplementedDeviceState *s = UNIMPLEMENTED_DEVICE(opaque);
 
     qemu_log_mask(LOG_UNIMP, "%s: unimplemented device read  "
-                  "(size %d, offset 0x%" HWADDR_PRIx ")\n",
-                  s->name, size, offset);
+                  "(size %d, offset 0x%0*" HWADDR_PRIx ")\n",
+                  s->name, size, s->offset_fmt_width, offset);
     return 0;
 }
 
@@ -34,9 +34,9 @@ static void unimp_write(void *opaque, hwaddr offset,
     UnimplementedDeviceState *s = UNIMPLEMENTED_DEVICE(opaque);
 
     qemu_log_mask(LOG_UNIMP, "%s: unimplemented device write "
-                  "(size %d, offset 0x%" HWADDR_PRIx
+                  "(size %d, offset 0x%0*" HWADDR_PRIx
                   ", value 0x%0*" PRIx64 ")\n",
-                  s->name, size, offset, size << 1, value);
+                  s->name, size, s->offset_fmt_width, offset, size << 1, value);
 }
 
 static const MemoryRegionOps unimp_ops = {
@@ -63,6 +63,8 @@ static void unimp_realize(DeviceState *dev, Error **errp)
         return;
     }
 
+    s->offset_fmt_width = DIV_ROUND_UP(64 - clz64(s->size - 1), 4);
+
     memory_region_init_io(&s->iomem, OBJECT(s), &unimp_ops, s,
                           s->name, s->size);
     sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem);
-- 
2.21.3



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

* Re: [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed
  2020-08-12 19:02 [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2020-08-12 19:02 ` [PATCH v2 3/3] hw/misc/unimp: Display the offset with width of the region size Philippe Mathieu-Daudé
@ 2020-08-22 20:02 ` Philippe Mathieu-Daudé
  2020-08-24 15:01   ` Peter Maydell
  3 siblings, 1 reply; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-22 20:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Peter Maydell, Richard Henderson

On 8/12/20 9:02 PM, Philippe Mathieu-Daudé wrote:
> This series aims to ease looking at the '-d unimp' output reported
> by the UnimplementedDevice.
> 
> - read/write accesses are now aligned
> - the value format width uses the access size
> - the offset (address) uses the size of the memory region it belongs
> 
> Series fully reviewed.

ping?


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

* Re: [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed
  2020-08-22 20:02 ` [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
@ 2020-08-24 15:01   ` Peter Maydell
  2020-08-26  9:54     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Maydell @ 2020-08-24 15:01 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: QEMU Trivial, Richard Henderson, QEMU Developers

On Sat, 22 Aug 2020 at 21:02, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> On 8/12/20 9:02 PM, Philippe Mathieu-Daudé wrote:
> > This series aims to ease looking at the '-d unimp' output reported
> > by the UnimplementedDevice.
> >
> > - read/write accesses are now aligned
> > - the value format width uses the access size
> > - the offset (address) uses the size of the memory region it belongs
> >
> > Series fully reviewed.
>
> ping?

What tree were you expecting these to go in via? Probably worth
being specific about who you're pinging in this kind of case ;-)

-- PMM


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

* Re: [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed
  2020-08-24 15:01   ` Peter Maydell
@ 2020-08-26  9:54     ` Philippe Mathieu-Daudé
  2020-08-26  9:56       ` Philippe Mathieu-Daudé
  2020-08-27 12:58       ` Peter Maydell
  0 siblings, 2 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-26  9:54 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Trivial, Richard Henderson, qemu-devel@nongnu.org Developers

[-- Attachment #1: Type: text/plain, Size: 918 bytes --]

Hi Peter,

Le lun. 24 août 2020 17:01, Peter Maydell <peter.maydell@linaro.org> a
écrit :

> On Sat, 22 Aug 2020 at 21:02, Philippe Mathieu-Daudé <f4bug@amsat.org>
> wrote:
> >
> > On 8/12/20 9:02 PM, Philippe Mathieu-Daudé wrote:
> > > This series aims to ease looking at the '-d unimp' output reported
> > > by the UnimplementedDevice.
> > >
> > > - read/write accesses are now aligned
> > > - the value format width uses the access size
> > > - the offset (address) uses the size of the memory region it belongs
> > >
> > > Series fully reviewed.
> >
> > ping?
>
> What tree were you expecting these to go in via? Probably worth
> being specific about who you're pinging in this kind of case ;-)
>

Ok understood for the next time. In this case you are listed as maintainer
:) Maybe you can Ack the series and then I'll ask to merge it via the
trivial or misc trees.


> -- PMM
>

[-- Attachment #2: Type: text/html, Size: 1609 bytes --]

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

* Re: [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed
  2020-08-26  9:54     ` Philippe Mathieu-Daudé
@ 2020-08-26  9:56       ` Philippe Mathieu-Daudé
  2020-08-27 12:58       ` Peter Maydell
  1 sibling, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-08-26  9:56 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Trivial, Richard Henderson, qemu-devel@nongnu.org Developers

[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]

Le mer. 26 août 2020 11:54, Philippe Mathieu-Daudé <f4bug@amsat.org> a
écrit :

> Hi Peter,
>
> Le lun. 24 août 2020 17:01, Peter Maydell <peter.maydell@linaro.org> a
> écrit :
>
>> On Sat, 22 Aug 2020 at 21:02, Philippe Mathieu-Daudé <f4bug@amsat.org>
>> wrote:
>> >
>> > On 8/12/20 9:02 PM, Philippe Mathieu-Daudé wrote:
>> > > This series aims to ease looking at the '-d unimp' output reported
>> > > by the UnimplementedDevice.
>> > >
>> > > - read/write accesses are now aligned
>> > > - the value format width uses the access size
>> > > - the offset (address) uses the size of the memory region it belongs
>> > >
>> > > Series fully reviewed.
>> >
>> > ping?
>>
>> What tree were you expecting these to go in via? Probably worth
>> being specific about who you're pinging in this kind of case ;-)
>>
>
> Ok understood for the next time. In this case you are listed as maintainer
> :) Maybe you can Ack the series and then I'll ask to merge it via the
> trivial or misc trees.
>

I just realized qemu-trivial was correctly cc'ed.


>
>> -- PMM
>>
>

[-- Attachment #2: Type: text/html, Size: 2320 bytes --]

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

* Re: [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed
  2020-08-26  9:54     ` Philippe Mathieu-Daudé
  2020-08-26  9:56       ` Philippe Mathieu-Daudé
@ 2020-08-27 12:58       ` Peter Maydell
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Maydell @ 2020-08-27 12:58 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: QEMU Trivial, Richard Henderson, qemu-devel@nongnu.org Developers

On Wed, 26 Aug 2020 at 10:55, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> What tree were you expecting these to go in via? Probably worth
>> being specific about who you're pinging in this kind of case ;-)
>
>
> Ok understood for the next time. In this case you are listed as
> maintainer :)

Oh, so I am, I had forgotten that :-)

Anyway, I'll take it via the arm tree. My point was really just
that if you're asking for something to be done it's useful to
specify who you're asking if it's not completely obvious, because
otherwise everybody's liable to assume somebody else will be
dealing with it...

thanks
-- PMM


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

end of thread, other threads:[~2020-08-27 12:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-12 19:02 [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
2020-08-12 19:02 ` [PATCH v2 1/3] hw/misc/unimp: Display value after offset Philippe Mathieu-Daudé
2020-08-12 19:02 ` [PATCH v2 2/3] hw/misc/unimp: Display the value with width of the access size Philippe Mathieu-Daudé
2020-08-12 19:02 ` [PATCH v2 3/3] hw/misc/unimp: Display the offset with width of the region size Philippe Mathieu-Daudé
2020-08-22 20:02 ` [PATCH v2 0/3] hw/misc/unimp: Improve how offset/value are displayed Philippe Mathieu-Daudé
2020-08-24 15:01   ` Peter Maydell
2020-08-26  9:54     ` Philippe Mathieu-Daudé
2020-08-26  9:56       ` Philippe Mathieu-Daudé
2020-08-27 12:58       ` Peter Maydell

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.