Skip to contentSkip to conversation

hw/intc/arm_gicv3_its: Add missing newlines to process_mapc() logging

PATCH In review Peter Maydell 3 participants 5 messages Mar 22, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/intc/arm_gicv3_its: Add missing newlines to process_mapc() logging

In commit 84d43d2e82da we rearranged the logging of errors in process_mapc(), and inadvertently dropped the trailing newlines from the log messages. Restore them.

Fixes 84d43d2e82da ("hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field")
---
 hw/intc/arm_gicv3_its.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/intc/arm_gicv3_its.c +2 -2
index b96b874afdf..d9c741f5fdd 100644
@@ -524,12 +524,12 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t *cmdpkt)
     trace_gicv3_its_cmd_mapc(icid, cte.rdbase, cte.valid);
 
     if (icid >= s->ct.num_entries) {
-        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 0x%d", icid);
+        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 0x%d\n", icid);
         return CMD_CONTINUE;
     }
     if (cte.valid && cte.rdbase >= s->gicv3->num_cpu) {
         qemu_log_mask(LOG_GUEST_ERROR,
-                      "ITS MAPC: invalid RDBASE %u ", cte.rdbase);
+                      "ITS MAPC: invalid RDBASE %u\n", cte.rdbase);
         return CMD_CONTINUE;
     }
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Peter Maydell

In commit 84d43d2e82da we rearranged the logging of errors in process_mapc(), and inadvertently dropped the trailing newlines from the log messages. Restore them.

Fixes 84d43d2e82da ("hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field")
---
  hw/intc/arm_gicv3_its.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/intc/arm_gicv3_its.c +0 -0
index b96b874afdf..d9c741f5fdd 100644

hw/intc/arm_gicv3_its.c static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t *cmdpkt) · line 527

Quoted 5 lines
hw/intc/arm_gicv3_its.c +1 -1
@@ -524,12 +524,12 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t *cmdpkt)
      trace_gicv3_its_cmd_mapc(icid, cte.rdbase, cte.valid);
 
      if (icid >= s->ct.num_entries) {
-        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 0x%d", icid);
+        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 0x%d\n", icid);

(pre-existing: "%u" format, since icid is uint32_t)

Quoted 9 lines
hw/intc/arm_gicv3_its.c +1 -1
          return CMD_CONTINUE;
      }
      if (cte.valid && cte.rdbase >= s->gicv3->num_cpu) {
          qemu_log_mask(LOG_GUEST_ERROR,
-                      "ITS MAPC: invalid RDBASE %u ", cte.rdbase);
+                      "ITS MAPC: invalid RDBASE %u\n", cte.rdbase);
          return CMD_CONTINUE;
      }
 
#2 lore raw
Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Peter Maydell

In commit 84d43d2e82da we rearranged the logging of errors in process_mapc(), and inadvertently dropped the trailing newlines from the log messages. Restore them.

Fixes 84d43d2e82da ("hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field")

---
  hw/intc/arm_gicv3_its.c | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 12 lines

hw/intc/arm_gicv3_its.c static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t · line 527

Quoted 10 lines
hw/intc/arm_gicv3_its.c +1 -1
index b96b874afdf..d9c741f5fdd 100644
@@ -524,12 +524,12 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t 
 *cmdpkt)
       trace_gicv3_its_cmd_mapc(icid, cte.rdbase, cte.valid);
       if (icid >= s->ct.num_entries) {
-        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 0x%d", icid);
+        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 0x%d\n", icid);

(pre-existing: "%u" format, since icid is uint32_t)

Worse than that: 0x%d is going to be *very* misleading. Should fix to 0x%x right away.

r~

#3 lore raw
Quoted 27 lines · Richard Henderson
Quoted 11 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Peter Maydell

In commit 84d43d2e82da we rearranged the logging of errors in process_mapc(), and inadvertently dropped the trailing newlines from the log messages. Restore them.

Fixes 84d43d2e82da ("hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field")

---
  hw/intc/arm_gicv3_its.c | 4 ++--

  1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 14 lines

hw/intc/arm_gicv3_its.c static ItsCmdResult process_mapc(GICv3ITSState · line 529

Quoted 12 lines
hw/intc/arm_gicv3_its.c +1 -1
index b96b874afdf..d9c741f5fdd 100644
@@ -524,12 +524,12 @@ static ItsCmdResult process_mapc(GICv3ITSState 
 *s, const uint64_t *cmdpkt)
       trace_gicv3_its_cmd_mapc(icid, cte.rdbase, cte.valid);
       if (icid >= s->ct.num_entries) {
-        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 
 0x%d", icid);
+        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 
 0x%d\n", icid);

(pre-existing: "%u" format, since icid is uint32_t)

Quoted 2 lines

Worse than that: 0x%d is going to be *very* misleading. Should fix to 0x%x right away.

Triple review is helpful :)

Reviewed-by on v1 1/1
#4 lore raw
In reply to Peter Maydell
Quoted 16 lines · Peter Maydell

In commit 84d43d2e82da we rearranged the logging of errors in process_mapc(), and inadvertently dropped the trailing newlines from the log messages. Restore them.

Fixes 84d43d2e82da ("hw/intc/arm_gicv3_its: In MAPC with V=0, don't check rdbase field")
---
  hw/intc/arm_gicv3_its.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/intc/arm_gicv3_its.c +0 -0
index b96b874afdf..d9c741f5fdd 100644
@@ -524,12 +524,12 @@ static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t *cmdpkt)
      trace_gicv3_its_cmd_mapc(icid, cte.rdbase, cte.valid);

hw/intc/arm_gicv3_its.c static ItsCmdResult process_mapc(GICv3ITSState *s, const uint64_t *cmdpkt) · line 532

Quoted 10 lines
hw/intc/arm_gicv3_its.c +2 -2
 
      if (icid >= s->ct.num_entries) {
-        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 0x%d", icid);
+        qemu_log_mask(LOG_GUEST_ERROR, "ITS MAPC: invalid ICID 0x%d\n", icid);
          return CMD_CONTINUE;
      }
      if (cte.valid && cte.rdbase >= s->gicv3->num_cpu) {
          qemu_log_mask(LOG_GUEST_ERROR,
-                      "ITS MAPC: invalid RDBASE %u ", cte.rdbase);
+                      "ITS MAPC: invalid RDBASE %u\n", cte.rdbase);

Should fix %d as well, broken with the same patch, 84d43d2e82d.

With that,

r~