diff mbox

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

Message ID 20170529193016.6888-2-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno May 29, 2017, 7:30 p.m. UTC
qemu_log_mask() is preferred over fprintf() for logging errors.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target/sh4/helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Hajnoczi May 30, 2017, 9:52 a.m. UTC | #1
On Mon, May 29, 2017 at 09:30:12PM +0200, Aurelien Jarno wrote:
> qemu_log_mask() is preferred over fprintf() for logging errors.
> 
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Reviewed-by: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  target/sh4/helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I don't see a pull request cover letter but your git repo is up-to-date
and the pull-target-sh4-20170529 tag is signed correctly.  Therefore I
have merged this pull request.

Thanks, applied to my staging tree:
https://github.com/stefanha/qemu/commits/staging

Stefan
Stefan Hajnoczi May 30, 2017, 10:18 a.m. UTC | #2
On Mon, May 29, 2017 at 09:30:12PM +0200, Aurelien Jarno wrote:
> qemu_log_mask() is preferred over fprintf() for logging errors.
> 
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Reviewed-by: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> ---
>  target/sh4/helper.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Had to drop this series due to a merge conflict.  Please see my reply
regarding qemu_system_reset_request() with info on how to fix it.

Thanks,
Stefan
Aurelien Jarno May 30, 2017, 11:12 a.m. UTC | #3
On 2017-05-30 10:52, Stefan Hajnoczi wrote:
> On Mon, May 29, 2017 at 09:30:12PM +0200, Aurelien Jarno wrote:
> > qemu_log_mask() is preferred over fprintf() for logging errors.
> > 
> > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > Reviewed-by: Richard Henderson <rth@twiddle.net>
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
> >  target/sh4/helper.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> I don't see a pull request cover letter but your git repo is up-to-date
> and the pull-target-sh4-20170529 tag is signed correctly.  Therefore I
> have merged this pull request.

Indeed, I send it to your email, but failed to send it to the mailing
list. Sorry about that. I'll try to do better in the next pull request.
Aurelien Jarno May 30, 2017, 11:12 a.m. UTC | #4
On 2017-05-30 11:18, Stefan Hajnoczi wrote:
> On Mon, May 29, 2017 at 09:30:12PM +0200, Aurelien Jarno wrote:
> > qemu_log_mask() is preferred over fprintf() for logging errors.
> > 
> > Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> > Reviewed-by: Richard Henderson <rth@twiddle.net>
> > Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
> > ---
> >  target/sh4/helper.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Had to drop this series due to a merge conflict.  Please see my reply
> regarding qemu_system_reset_request() with info on how to fix it.

Ok, I'll do that tonight.
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)