qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices
@ 2012-10-25 12:57 Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 01/12] hw/pl050: Use LOG_GUEST_ERROR Peter Maydell
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Another batch of a dozen random ARM devices updated to use
LOG_GUEST_ERROR and LOG_UNIMP rather than hw_error().
[Some hw_error() uses remain in these devices, for cases
which are diagnosing genuine qemu bugs or bad device
property values.]

Since this isn't a particularly urgent cleanup I left
it at a dozen patches to avoid code reviewer fatigue;
More may follow next time I want an easy task :-)

Peter Maydell (12):
  hw/pl050: Use LOG_GUEST_ERROR
  hw/pl061: Use LOG_GUEST_ERROR
  hw/pl080: Use LOG_GUEST_ERROR and LOG_UNIMP
  hw/pl110: Use LOG_GUEST_ERROR rather than hw_error()
  hw/pl190: Use LOG_UNIMP rather than hw_error()
  hw/arm11mpcore: Use LOG_GUEST_ERROR rather than hw_error()
  hw/arm_gic: Use LOG_GUEST_ERROR
  hw/arm_timer: Use LOG_GUEST_ERROR and LOG_UNIMP
  hw/armv7m_nvic: Use LOG_GUEST_ERROR and LOG_UNIMP
  hw/arm_sysctl: Use LOG_GUEST_ERROR
  hw/arm_l2x0: Use LOG_GUEST_ERROR
  hw/versatile_i2c: Use LOG_GUEST_ERROR

 hw/arm11mpcore.c   |    7 +++++--
 hw/arm_gic.c       |   12 ++++++++----
 hw/arm_l2x0.c      |    6 ++++--
 hw/arm_sysctl.c    |    8 ++++++--
 hw/arm_timer.c     |   19 +++++++++++++------
 hw/armv7m_nvic.c   |   31 +++++++++++++++++++------------
 hw/pl050.c         |    6 ++++--
 hw/pl061.c         |    6 ++++--
 hw/pl080.c         |   11 +++++++----
 hw/pl110.c         |    6 ++++--
 hw/pl190.c         |    2 +-
 hw/versatile_i2c.c |    6 ++++--
 12 files changed, 79 insertions(+), 41 deletions(-)

-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 01/12] hw/pl050: Use LOG_GUEST_ERROR
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 02/12] hw/pl061: " Peter Maydell
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR for reporting guest attempts to access invalid register
offsets.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/pl050.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/pl050.c b/hw/pl050.c
index 470572e..47032f1 100644
--- a/hw/pl050.c
+++ b/hw/pl050.c
@@ -95,7 +95,8 @@ static uint64_t pl050_read(void *opaque, hwaddr offset,
     case 4: /* KMIIR */
         return s->pending | 2;
     default:
-        hw_error("pl050_read: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pl050_read: Bad offset %x\n", (int)offset);
         return 0;
     }
 }
@@ -123,7 +124,8 @@ static void pl050_write(void *opaque, hwaddr offset,
         s->clk = value;
         return;
     default:
-        hw_error("pl050_write: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pl050_write: Bad offset %x\n", (int)offset);
     }
 }
 static const MemoryRegionOps pl050_ops = {
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 02/12] hw/pl061: Use LOG_GUEST_ERROR
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 01/12] hw/pl050: Use LOG_GUEST_ERROR Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 03/12] hw/pl080: Use LOG_GUEST_ERROR and LOG_UNIMP Peter Maydell
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR to report guest attempts to access bad register offsets.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/pl061.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/pl061.c b/hw/pl061.c
index 7d182e7..f1ed5ce 100644
--- a/hw/pl061.c
+++ b/hw/pl061.c
@@ -164,7 +164,8 @@ static uint64_t pl061_read(void *opaque, hwaddr offset,
     case 0x528: /* Analog mode select */
         return s->amsel;
     default:
-        hw_error("pl061_read: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pl061_read: Bad offset %x\n", (int)offset);
         return 0;
     }
 }
@@ -239,7 +240,8 @@ static void pl061_write(void *opaque, hwaddr offset,
         s->amsel = value & 0xff;
         break;
     default:
-        hw_error("pl061_write: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pl061_write: Bad offset %x\n", (int)offset);
     }
     pl061_update(s);
 }
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 03/12] hw/pl080: Use LOG_GUEST_ERROR and LOG_UNIMP
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 01/12] hw/pl050: Use LOG_GUEST_ERROR Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 02/12] hw/pl061: " Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 13:19   ` malc
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 04/12] hw/pl110: Use LOG_GUEST_ERROR rather than hw_error() Peter Maydell
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR and LOG_UNIMP in preference to hw_error().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/pl080.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/hw/pl080.c b/hw/pl080.c
index 6abe528..26150af 100644
--- a/hw/pl080.c
+++ b/hw/pl080.c
@@ -281,7 +281,8 @@ static uint64_t pl080_read(void *opaque, hwaddr offset,
         return s->sync;
     default:
     bad_offset:
-        hw_error("pl080_read: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pl080_read: Bad offset %x\n", (int)offset);
         return 0;
     }
 }
@@ -327,12 +328,13 @@ static void pl080_write(void *opaque, hwaddr offset,
     case 10: /* SoftLBReq */
     case 11: /* SoftLSReq */
         /* ??? Implement these.  */
-        hw_error("pl080_write: Soft DMA not implemented\n");
+        qemu_log_mask(LOG_UNIMP, "pl080_write: Soft DMA not implemented\n");
         break;
     case 12: /* Configuration */
         s->conf = value;
         if (s->conf & (PL080_CONF_M1 | PL080_CONF_M1)) {
-            hw_error("pl080_write: Big-endian DMA not implemented\n");
+            qemu_log_mask(LOG_UNIMP,
+                          "pl080_write: Big-endian DMA not implemented\n");
         }
         pl080_run(s);
         break;
@@ -341,7 +343,8 @@ static void pl080_write(void *opaque, hwaddr offset,
         break;
     default:
     bad_offset:
-        hw_error("pl080_write: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pl080_write: Bad offset %x\n", (int)offset);
     }
     pl080_update(s);
 }
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 04/12] hw/pl110: Use LOG_GUEST_ERROR rather than hw_error()
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (2 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 03/12] hw/pl080: Use LOG_GUEST_ERROR and LOG_UNIMP Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 05/12] hw/pl190: Use LOG_UNIMP " Peter Maydell
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR to report guest accesses to invalid register
offsets.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/pl110.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/pl110.c b/hw/pl110.c
index 82486b0..d5472f4 100644
--- a/hw/pl110.c
+++ b/hw/pl110.c
@@ -349,7 +349,8 @@ static uint64_t pl110_read(void *opaque, hwaddr offset,
     case 12: /* LCDLPCURR */
         return s->lpbase;
     default:
-        hw_error("pl110_read: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pl110_read: Bad offset %x\n", (int)offset);
         return 0;
     }
 }
@@ -417,7 +418,8 @@ static void pl110_write(void *opaque, hwaddr offset,
         pl110_update(s);
         break;
     default:
-        hw_error("pl110_write: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "pl110_write: Bad offset %x\n", (int)offset);
     }
 }
 
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 05/12] hw/pl190: Use LOG_UNIMP rather than hw_error()
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (3 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 04/12] hw/pl110: Use LOG_GUEST_ERROR rather than hw_error() Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 06/12] hw/arm11mpcore: Use LOG_GUEST_ERROR " Peter Maydell
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_UNIMP to report attempts to use the unimplemented test mode.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/pl190.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/pl190.c b/hw/pl190.c
index 213229b..4019930 100644
--- a/hw/pl190.c
+++ b/hw/pl190.c
@@ -199,7 +199,7 @@ static void pl190_write(void *opaque, hwaddr offset,
         break;
     case 0xc0: /* ITCR */
         if (val) {
-            hw_error("pl190: Test mode not implemented\n");
+            qemu_log_mask(LOG_UNIMP, "pl190: Test mode not implemented\n");
         }
         break;
     default:
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 06/12] hw/arm11mpcore: Use LOG_GUEST_ERROR rather than hw_error()
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (4 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 05/12] hw/pl190: Use LOG_UNIMP " Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 07/12] hw/arm_gic: Use LOG_GUEST_ERROR Peter Maydell
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR to report guest accesses to bad offsets.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm11mpcore.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/hw/arm11mpcore.c b/hw/arm11mpcore.c
index 105f158..640ed20 100644
--- a/hw/arm11mpcore.c
+++ b/hw/arm11mpcore.c
@@ -44,7 +44,9 @@ static uint64_t mpcore_scu_read(void *opaque, hwaddr offset,
     case 0x0c: /* Invalidate all.  */
         return 0;
     default:
-        hw_error("mpcore_priv_read: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "mpcore_priv_read: Bad offset %x\n", (int)offset);
+        return 0;
     }
 }
 
@@ -61,7 +63,8 @@ static void mpcore_scu_write(void *opaque, hwaddr offset,
         /* This is a no-op as cache is not emulated.  */
         break;
     default:
-        hw_error("mpcore_priv_read: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "mpcore_priv_read: Bad offset %x\n", (int)offset);
     }
 }
 
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 07/12] hw/arm_gic: Use LOG_GUEST_ERROR
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (5 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 06/12] hw/arm11mpcore: Use LOG_GUEST_ERROR " Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 08/12] hw/arm_timer: Use LOG_GUEST_ERROR and LOG_UNIMP Peter Maydell
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR to report guest accesses to bad offsets.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm_gic.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/arm_gic.c b/hw/arm_gic.c
index ce16e83..f9e423f 100644
--- a/hw/arm_gic.c
+++ b/hw/arm_gic.c
@@ -324,7 +324,8 @@ static uint32_t gic_dist_readb(void *opaque, hwaddr offset)
     }
     return res;
 bad_reg:
-    hw_error("gic_dist_readb: Bad offset %x\n", (int)offset);
+    qemu_log_mask(LOG_GUEST_ERROR,
+                  "gic_dist_readb: Bad offset %x\n", (int)offset);
     return 0;
 }
 
@@ -487,7 +488,8 @@ static void gic_dist_writeb(void *opaque, hwaddr offset,
     gic_update(s);
     return;
 bad_reg:
-    hw_error("gic_dist_writeb: Bad offset %x\n", (int)offset);
+    qemu_log_mask(LOG_GUEST_ERROR,
+                  "gic_dist_writeb: Bad offset %x\n", (int)offset);
 }
 
 static void gic_dist_writew(void *opaque, hwaddr offset,
@@ -556,7 +558,8 @@ static uint32_t gic_cpu_read(GICState *s, int cpu, int offset)
     case 0x18: /* Highest Pending Interrupt */
         return s->current_pending[cpu];
     default:
-        hw_error("gic_cpu_read: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "gic_cpu_read: Bad offset %x\n", (int)offset);
         return 0;
     }
 }
@@ -577,7 +580,8 @@ static void gic_cpu_write(GICState *s, int cpu, int offset, uint32_t value)
     case 0x10: /* End Of Interrupt */
         return gic_complete_irq(s, cpu, value & 0x3ff);
     default:
-        hw_error("gic_cpu_write: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "gic_cpu_write: Bad offset %x\n", (int)offset);
         return;
     }
     gic_update(s);
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 08/12] hw/arm_timer: Use LOG_GUEST_ERROR and LOG_UNIMP
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (6 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 07/12] hw/arm_gic: Use LOG_GUEST_ERROR Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 09/12] hw/armv7m_nvic: " Peter Maydell
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR to report guest accesses to bad register
offsets, and LOG_UNIMP for access to the unimplemented
test registers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm_timer.c |   19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/hw/arm_timer.c b/hw/arm_timer.c
index 2e13621..af339d3 100644
--- a/hw/arm_timer.c
+++ b/hw/arm_timer.c
@@ -64,7 +64,8 @@ static uint32_t arm_timer_read(void *opaque, hwaddr offset)
             return 0;
         return s->int_level;
     default:
-        hw_error("%s: Bad offset %x\n", __func__, (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: Bad offset %x\n", __func__, (int)offset);
         return 0;
     }
 }
@@ -131,7 +132,8 @@ static void arm_timer_write(void *opaque, hwaddr offset,
         arm_timer_recalibrate(s, 0);
         break;
     default:
-        hw_error("%s: Bad offset %x\n", __func__, (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: Bad offset %x\n", __func__, (int)offset);
     }
     arm_timer_update(s);
 }
@@ -223,10 +225,14 @@ static uint64_t sp804_read(void *opaque, hwaddr offset,
     /* Integration Test control registers, which we won't support */
     case 0xf00: /* TimerITCR */
     case 0xf04: /* TimerITOP (strictly write only but..) */
+        qemu_log_mask(LOG_UNIMP,
+                      "%s: integration test registers unimplemented\n",
+                      __func__);
         return 0;
     }
 
-    hw_error("%s: Bad offset %x\n", __func__, (int)offset);
+    qemu_log_mask(LOG_GUEST_ERROR,
+                  "%s: Bad offset %x\n", __func__, (int)offset);
     return 0;
 }
 
@@ -246,7 +252,8 @@ static void sp804_write(void *opaque, hwaddr offset,
     }
 
     /* Technically we could be writing to the Test Registers, but not likely */
-    hw_error("%s: Bad offset %x\n", __func__, (int)offset);
+    qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset %x\n",
+                  __func__, (int)offset);
 }
 
 static const MemoryRegionOps sp804_ops = {
@@ -300,7 +307,7 @@ static uint64_t icp_pit_read(void *opaque, hwaddr offset,
     /* ??? Don't know the PrimeCell ID for this device.  */
     n = offset >> 8;
     if (n > 2) {
-        hw_error("%s: Bad timer %d\n", __func__, n);
+        qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad timer %d\n", __func__, n);
     }
 
     return arm_timer_read(s->timer[n], offset & 0xff);
@@ -314,7 +321,7 @@ static void icp_pit_write(void *opaque, hwaddr offset,
 
     n = offset >> 8;
     if (n > 2) {
-        hw_error("%s: Bad timer %d\n", __func__, n);
+        qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad timer %d\n", __func__, n);
     }
 
     arm_timer_write(s->timer[n], offset & 0xff, value);
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 09/12] hw/armv7m_nvic: Use LOG_GUEST_ERROR and LOG_UNIMP
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (7 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 08/12] hw/arm_timer: Use LOG_GUEST_ERROR and LOG_UNIMP Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 10/12] hw/arm_sysctl: Use LOG_GUEST_ERROR Peter Maydell
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR and LOG_UNIMP rather than hw_error() where
appropriate.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/armv7m_nvic.c |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

diff --git a/hw/armv7m_nvic.c b/hw/armv7m_nvic.c
index 35c1aa6..ebf6282 100644
--- a/hw/armv7m_nvic.c
+++ b/hw/armv7m_nvic.c
@@ -243,7 +243,7 @@ static uint32_t nvic_readl(void *opaque, uint32_t offset)
         return val;
     case 0xd28: /* Configurable Fault Status.  */
         /* TODO: Implement Fault Status.  */
-        hw_error("Not implemented: Configurable Fault Status.");
+        qemu_log_mask(LOG_UNIMP, "Configurable Fault Status unimplemented\n");
         return 0;
     case 0xd2c: /* Hard Fault Status.  */
     case 0xd30: /* Debug Fault Status.  */
@@ -251,7 +251,8 @@ static uint32_t nvic_readl(void *opaque, uint32_t offset)
     case 0xd38: /* Bus Fault Address.  */
     case 0xd3c: /* Aux Fault Status.  */
         /* TODO: Implement fault status registers.  */
-        goto bad_reg;
+        qemu_log_mask(LOG_UNIMP, "Fault status registers unimplemented\n");
+        return 0;
     case 0xd40: /* PFR0.  */
         return 0x00000030;
     case 0xd44: /* PRF1.  */
@@ -280,8 +281,8 @@ static uint32_t nvic_readl(void *opaque, uint32_t offset)
         return 0x01310102;
     /* TODO: Implement debug registers.  */
     default:
-    bad_reg:
-        hw_error("NVIC: Bad read offset 0x%x\n", offset);
+        qemu_log_mask(LOG_GUEST_ERROR, "NVIC: Bad read offset 0x%x\n", offset);
+        return 0;
     }
 }
 
@@ -345,17 +346,18 @@ static void nvic_writel(void *opaque, uint32_t offset, uint32_t value)
     case 0xd0c: /* Application Interrupt/Reset Control.  */
         if ((value >> 16) == 0x05fa) {
             if (value & 2) {
-                hw_error("VECTCLRACTIVE not implemented");
+                qemu_log_mask(LOG_UNIMP, "VECTCLRACTIVE unimplemented\n");
             }
             if (value & 5) {
-                hw_error("System reset");
+                qemu_log_mask(LOG_UNIMP, "AIRCR system reset unimplemented\n");
             }
         }
         break;
     case 0xd10: /* System Control.  */
     case 0xd14: /* Configuration Control.  */
         /* TODO: Implement control registers.  */
-        goto bad_reg;
+        qemu_log_mask(LOG_UNIMP, "NVIC: SCR and CCR unimplemented\n");
+        break;
     case 0xd18: case 0xd1c: case 0xd20: /* System Handler Priority.  */
         {
             int irq;
@@ -380,15 +382,17 @@ static void nvic_writel(void *opaque, uint32_t offset, uint32_t value)
     case 0xd34: /* Mem Manage Address.  */
     case 0xd38: /* Bus Fault Address.  */
     case 0xd3c: /* Aux Fault Status.  */
-        goto bad_reg;
+        qemu_log_mask(LOG_UNIMP,
+                      "NVIC: fault status registers unimplemented\n");
+        break;
     case 0xf00: /* Software Triggered Interrupt Register */
         if ((value & 0x1ff) < s->num_irq) {
             gic_set_pending_private(&s->gic, 0, value & 0x1ff);
         }
         break;
     default:
-    bad_reg:
-        hw_error("NVIC: Bad write offset 0x%x\n", offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "NVIC: Bad write offset 0x%x\n", offset);
     }
 }
 
@@ -409,7 +413,9 @@ static uint64_t nvic_sysreg_read(void *opaque, hwaddr addr,
     if (size == 4) {
         return nvic_readl(opaque, offset);
     }
-    hw_error("NVIC: Bad read of size %d at offset 0x%x\n", size, offset);
+    qemu_log_mask(LOG_GUEST_ERROR,
+                  "NVIC: Bad read of size %d at offset 0x%x\n", size, offset);
+    return 0;
 }
 
 static void nvic_sysreg_write(void *opaque, hwaddr addr,
@@ -420,7 +426,8 @@ static void nvic_sysreg_write(void *opaque, hwaddr addr,
         nvic_writel(opaque, offset, value);
         return;
     }
-    hw_error("NVIC: Bad write of size %d at offset 0x%x\n", size, offset);
+    qemu_log_mask(LOG_GUEST_ERROR,
+                  "NVIC: Bad write of size %d at offset 0x%x\n", size, offset);
 }
 
 static const MemoryRegionOps nvic_sysreg_ops = {
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 10/12] hw/arm_sysctl: Use LOG_GUEST_ERROR
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (8 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 09/12] hw/armv7m_nvic: " Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 11/12] hw/arm_l2x0: " Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 12/12] hw/versatile_i2c: " Peter Maydell
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR to report bad guest accesses.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm_sysctl.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c
index 26318e1..58eb982 100644
--- a/hw/arm_sysctl.c
+++ b/hw/arm_sysctl.c
@@ -184,7 +184,9 @@ static uint64_t arm_sysctl_read(void *opaque, hwaddr offset,
         return s->sys_cfgstat;
     default:
     bad_reg:
-        printf ("arm_sysctl_read: Bad register offset 0x%x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "arm_sysctl_read: Bad register offset 0x%x\n",
+                      (int)offset);
         return 0;
     }
 }
@@ -339,7 +341,9 @@ static void arm_sysctl_write(void *opaque, hwaddr offset,
         return;
     default:
     bad_reg:
-        printf ("arm_sysctl_write: Bad register offset 0x%x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "arm_sysctl_write: Bad register offset 0x%x\n",
+                      (int)offset);
         return;
     }
 }
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 11/12] hw/arm_l2x0: Use LOG_GUEST_ERROR
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (9 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 10/12] hw/arm_sysctl: Use LOG_GUEST_ERROR Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 12/12] hw/versatile_i2c: " Peter Maydell
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR to report bad guest accesses.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm_l2x0.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/arm_l2x0.c b/hw/arm_l2x0.c
index 8f5921c..6abf0ee 100644
--- a/hw/arm_l2x0.c
+++ b/hw/arm_l2x0.c
@@ -87,7 +87,8 @@ static uint64_t l2x0_priv_read(void *opaque, hwaddr offset,
     case 0xF80:
         return 0;
     default:
-        fprintf(stderr, "l2x0_priv_read: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "l2x0_priv_read: Bad offset %x\n", (int)offset);
         break;
     }
     return 0;
@@ -128,7 +129,8 @@ static void l2x0_priv_write(void *opaque, hwaddr offset,
     case 0xF80:
         return;
     default:
-        fprintf(stderr, "l2x0_priv_write: Bad offset %x\n", (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "l2x0_priv_write: Bad offset %x\n", (int)offset);
         break;
     }
 }
-- 
1.7.9.5

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

* [Qemu-devel] [PATCH 12/12] hw/versatile_i2c: Use LOG_GUEST_ERROR
  2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
                   ` (10 preceding siblings ...)
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 11/12] hw/arm_l2x0: " Peter Maydell
@ 2012-10-25 12:57 ` Peter Maydell
  11 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 12:57 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches

Use LOG_GUEST_ERROR to report bad guest accesses.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/versatile_i2c.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/versatile_i2c.c b/hw/versatile_i2c.c
index 44e7e40..ad71e9d 100644
--- a/hw/versatile_i2c.c
+++ b/hw/versatile_i2c.c
@@ -40,7 +40,8 @@ static uint64_t versatile_i2c_read(void *opaque, hwaddr offset,
     if (offset == 0) {
         return (s->out & 1) | (s->in << 1);
     } else {
-        hw_error("%s: Bad offset 0x%x\n", __func__, (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: Bad offset 0x%x\n", __func__, (int)offset);
         return -1;
     }
 }
@@ -58,7 +59,8 @@ static void versatile_i2c_write(void *opaque, hwaddr offset,
         s->out &= ~value;
         break;
     default:
-        hw_error("%s: Bad offset 0x%x\n", __func__, (int)offset);
+        qemu_log_mask(LOG_GUEST_ERROR,
+                      "%s: Bad offset 0x%x\n", __func__, (int)offset);
     }
     bitbang_i2c_set(s->bitbang, BITBANG_I2C_SCL, (s->out & 1) != 0);
     s->in = bitbang_i2c_set(s->bitbang, BITBANG_I2C_SDA, (s->out & 2) != 0);
-- 
1.7.9.5

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

* Re: [Qemu-devel] [PATCH 03/12] hw/pl080: Use LOG_GUEST_ERROR and LOG_UNIMP
  2012-10-25 12:57 ` [Qemu-devel] [PATCH 03/12] hw/pl080: Use LOG_GUEST_ERROR and LOG_UNIMP Peter Maydell
@ 2012-10-25 13:19   ` malc
  2012-10-25 13:23     ` Peter Maydell
  0 siblings, 1 reply; 15+ messages in thread
From: malc @ 2012-10-25 13:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches

On Thu, 25 Oct 2012, Peter Maydell wrote:

> Use LOG_GUEST_ERROR and LOG_UNIMP in preference to hw_error().

It's weird that printing something + abort is replaced by just printing
a message and the commit message doesn't really reflect the fact.

[..snip..]

-- 
mailto:av1474@comtv.ru

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

* Re: [Qemu-devel] [PATCH 03/12] hw/pl080: Use LOG_GUEST_ERROR and LOG_UNIMP
  2012-10-25 13:19   ` malc
@ 2012-10-25 13:23     ` Peter Maydell
  0 siblings, 0 replies; 15+ messages in thread
From: Peter Maydell @ 2012-10-25 13:23 UTC (permalink / raw)
  To: malc; +Cc: qemu-devel, patches

On 25 October 2012 14:19, malc <av1474@comtv.ru> wrote:
> On Thu, 25 Oct 2012, Peter Maydell wrote:
>
>> Use LOG_GUEST_ERROR and LOG_UNIMP in preference to hw_error().
>
> It's weird that printing something + abort is replaced by just printing
> a message and the commit message doesn't really reflect the fact.

I assume that the reader knows that hw_error() is fatal;
the point of the series is that these shouldn't be fatal
errors...

-- PMM

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

end of thread, other threads:[~2012-10-25 13:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25 12:57 [Qemu-devel] [PATCH 00/12] use LOG_GUEST_ERROR in more ARM devices Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 01/12] hw/pl050: Use LOG_GUEST_ERROR Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 02/12] hw/pl061: " Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 03/12] hw/pl080: Use LOG_GUEST_ERROR and LOG_UNIMP Peter Maydell
2012-10-25 13:19   ` malc
2012-10-25 13:23     ` Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 04/12] hw/pl110: Use LOG_GUEST_ERROR rather than hw_error() Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 05/12] hw/pl190: Use LOG_UNIMP " Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 06/12] hw/arm11mpcore: Use LOG_GUEST_ERROR " Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 07/12] hw/arm_gic: Use LOG_GUEST_ERROR Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 08/12] hw/arm_timer: Use LOG_GUEST_ERROR and LOG_UNIMP Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 09/12] hw/armv7m_nvic: " Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 10/12] hw/arm_sysctl: Use LOG_GUEST_ERROR Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 11/12] hw/arm_l2x0: " Peter Maydell
2012-10-25 12:57 ` [Qemu-devel] [PATCH 12/12] hw/versatile_i2c: " Peter Maydell

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).