All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target/arm: Add missing entries to excnames[] for log strings
@ 2017-04-06 13:45 Peter Maydell
  2017-04-06 16:34 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
  2017-04-10  8:45 ` Edgar E. Iglesias
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2017-04-06 13:45 UTC (permalink / raw)
  To: qemu-arm, qemu-devel; +Cc: patches

Recent changes have added new EXCP_ values to ARM but forgot
to update the excnames[] array which is used to provide
human-readable strings when printing information about the
exception for debug logging. Add the missing entries, and
add a comment to the list of #defines to help avoid the mistake
being repeated in future.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 target/arm/cpu.h       | 1 +
 target/arm/internals.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index a8aabce..e6f05e2 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -58,6 +58,7 @@
 #define EXCP_SEMIHOST       16   /* semihosting call */
 #define EXCP_NOCP           17   /* v7M NOCP UsageFault */
 #define EXCP_INVSTATE       18   /* v7M INVSTATE UsageFault */
+/* NB: new EXCP_ defines should be added to the excnames[] array too */
 
 #define ARMV7M_EXCP_RESET   1
 #define ARMV7M_EXCP_NMI     2
diff --git a/target/arm/internals.h b/target/arm/internals.h
index f742a41..97ca034 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -70,6 +70,8 @@ static const char * const excnames[] = {
     [EXCP_VIRQ] = "Virtual IRQ",
     [EXCP_VFIQ] = "Virtual FIQ",
     [EXCP_SEMIHOST] = "Semihosting call",
+    [EXCP_NOCP] = "v7M NOCP UsageFault",
+    [EXCP_INVSTATE] = "v7M INVSTATE UsageFault",
 };
 
 /* Scale factor for generic timers, ie number of ns per tick.
-- 
2.7.4

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

* Re: [Qemu-devel] [Qemu-arm] [PATCH] target/arm: Add missing entries to excnames[] for log strings
  2017-04-06 13:45 [Qemu-devel] [PATCH] target/arm: Add missing entries to excnames[] for log strings Peter Maydell
@ 2017-04-06 16:34 ` Philippe Mathieu-Daudé
  2017-04-06 16:39   ` Peter Maydell
  2017-04-10  8:45 ` Edgar E. Iglesias
  1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-04-06 16:34 UTC (permalink / raw)
  To: Peter Maydell, qemu-arm, qemu-devel; +Cc: patches

Hi Peter,

excnames[] is only used in arm_log_exception(), can we move it there?

anyway:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

On 04/06/2017 10:45 AM, Peter Maydell wrote:
> Recent changes have added new EXCP_ values to ARM but forgot
> to update the excnames[] array which is used to provide
> human-readable strings when printing information about the
> exception for debug logging. Add the missing entries, and
> add a comment to the list of #defines to help avoid the mistake
> being repeated in future.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target/arm/cpu.h       | 1 +
>  target/arm/internals.h | 2 ++
>  2 files changed, 3 insertions(+)
>
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index a8aabce..e6f05e2 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -58,6 +58,7 @@
>  #define EXCP_SEMIHOST       16   /* semihosting call */
>  #define EXCP_NOCP           17   /* v7M NOCP UsageFault */
>  #define EXCP_INVSTATE       18   /* v7M INVSTATE UsageFault */
> +/* NB: new EXCP_ defines should be added to the excnames[] array too */
>
>  #define ARMV7M_EXCP_RESET   1
>  #define ARMV7M_EXCP_NMI     2
> diff --git a/target/arm/internals.h b/target/arm/internals.h
> index f742a41..97ca034 100644
> --- a/target/arm/internals.h
> +++ b/target/arm/internals.h
> @@ -70,6 +70,8 @@ static const char * const excnames[] = {
>      [EXCP_VIRQ] = "Virtual IRQ",
>      [EXCP_VFIQ] = "Virtual FIQ",
>      [EXCP_SEMIHOST] = "Semihosting call",
> +    [EXCP_NOCP] = "v7M NOCP UsageFault",
> +    [EXCP_INVSTATE] = "v7M INVSTATE UsageFault",
>  };
>
>  /* Scale factor for generic timers, ie number of ns per tick.
>

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

* Re: [Qemu-devel] [Qemu-arm] [PATCH] target/arm: Add missing entries to excnames[] for log strings
  2017-04-06 16:34 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
@ 2017-04-06 16:39   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2017-04-06 16:39 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: qemu-arm, QEMU Developers, patches

On 6 April 2017 at 17:34, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Hi Peter,
>
> excnames[] is only used in arm_log_exception(), can we move it there?

Seems like a good idea. I think this is historic, we used to use
it in separate functions in different files for the 32-bit and
64-bit exception entry code, but those got unified a little while back.

I'll do that as a separate patch, though.

thanks
-- PMM

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

* Re: [Qemu-devel] [Qemu-arm] [PATCH] target/arm: Add missing entries to excnames[] for log strings
  2017-04-06 13:45 [Qemu-devel] [PATCH] target/arm: Add missing entries to excnames[] for log strings Peter Maydell
  2017-04-06 16:34 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
@ 2017-04-10  8:45 ` Edgar E. Iglesias
  1 sibling, 0 replies; 4+ messages in thread
From: Edgar E. Iglesias @ 2017-04-10  8:45 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-arm, qemu-devel, patches

On Thu, Apr 06, 2017 at 02:45:40PM +0100, Peter Maydell wrote:
> Recent changes have added new EXCP_ values to ARM but forgot
> to update the excnames[] array which is used to provide
> human-readable strings when printing information about the
> exception for debug logging. Add the missing entries, and
> add a comment to the list of #defines to help avoid the mistake
> being repeated in future.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


> ---
>  target/arm/cpu.h       | 1 +
>  target/arm/internals.h | 2 ++
>  2 files changed, 3 insertions(+)
> 
> diff --git a/target/arm/cpu.h b/target/arm/cpu.h
> index a8aabce..e6f05e2 100644
> --- a/target/arm/cpu.h
> +++ b/target/arm/cpu.h
> @@ -58,6 +58,7 @@
>  #define EXCP_SEMIHOST       16   /* semihosting call */
>  #define EXCP_NOCP           17   /* v7M NOCP UsageFault */
>  #define EXCP_INVSTATE       18   /* v7M INVSTATE UsageFault */
> +/* NB: new EXCP_ defines should be added to the excnames[] array too */
>  
>  #define ARMV7M_EXCP_RESET   1
>  #define ARMV7M_EXCP_NMI     2
> diff --git a/target/arm/internals.h b/target/arm/internals.h
> index f742a41..97ca034 100644
> --- a/target/arm/internals.h
> +++ b/target/arm/internals.h
> @@ -70,6 +70,8 @@ static const char * const excnames[] = {
>      [EXCP_VIRQ] = "Virtual IRQ",
>      [EXCP_VFIQ] = "Virtual FIQ",
>      [EXCP_SEMIHOST] = "Semihosting call",
> +    [EXCP_NOCP] = "v7M NOCP UsageFault",
> +    [EXCP_INVSTATE] = "v7M INVSTATE UsageFault",
>  };
>  
>  /* Scale factor for generic timers, ie number of ns per tick.
> -- 
> 2.7.4
> 
> 

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

end of thread, other threads:[~2017-04-10  8:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 13:45 [Qemu-devel] [PATCH] target/arm: Add missing entries to excnames[] for log strings Peter Maydell
2017-04-06 16:34 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2017-04-06 16:39   ` Peter Maydell
2017-04-10  8:45 ` Edgar E. Iglesias

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.