diff mbox

[1/5] target/sh4: log unauthorized accesses using qemu_log_mask

Message ID 20170516224721.13832-2-aurelien@aurel32.net (mailing list archive)
State New, archived
Headers show

Commit Message

Aurelien Jarno May 16, 2017, 10:47 p.m. UTC
qemu_log_mask() is preferred over fprintf() for logging errors.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target/sh4/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé May 17, 2017, 1:01 a.m. UTC | #1
On 05/16/2017 07:47 PM, Aurelien Jarno wrote:
> qemu_log_mask() is preferred over fprintf() for logging errors.
>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

> ---
>  target/sh4/helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target/sh4/helper.c b/target/sh4/helper.c
> index 8f8ce81401..4c024f9529 100644
> --- a/target/sh4/helper.c
> +++ b/target/sh4/helper.c
> @@ -420,7 +420,7 @@ static int get_physical_address(CPUSH4State * env, target_ulong * physical,
>          if (!(env->sr & (1u << SR_MD))
>  	    && (address < 0xe0000000 || address >= 0xe4000000)) {
>  	    /* Unauthorized access in user mode (only store queues are available) */
> -	    fprintf(stderr, "Unauthorized access\n");
> +            qemu_log_mask(LOG_GUEST_ERROR, "Unauthorized access\n");
>  	    if (rw == 0)
>  		return MMU_DADDR_ERROR_READ;
>  	    else if (rw == 1)
>
Richard Henderson May 24, 2017, 10:51 p.m. UTC | #2
On 05/16/2017 03:47 PM, Aurelien Jarno wrote:
> qemu_log_mask() is preferred over fprintf() for logging errors.
> 
> Signed-off-by: Aurelien Jarno<aurelien@aurel32.net>
> ---
>   target/sh4/helper.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <rth@twiddle.net>


r~
diff mbox

Patch

diff --git a/target/sh4/helper.c b/target/sh4/helper.c
index 8f8ce81401..4c024f9529 100644
--- a/target/sh4/helper.c
+++ b/target/sh4/helper.c
@@ -420,7 +420,7 @@  static int get_physical_address(CPUSH4State * env, target_ulong * physical,
         if (!(env->sr & (1u << SR_MD))
 	    && (address < 0xe0000000 || address >= 0xe4000000)) {
 	    /* Unauthorized access in user mode (only store queues are available) */
-	    fprintf(stderr, "Unauthorized access\n");
+            qemu_log_mask(LOG_GUEST_ERROR, "Unauthorized access\n");
 	    if (rw == 0)
 		return MMU_DADDR_ERROR_READ;
 	    else if (rw == 1)