diff mbox

[kvm-unit-tests] ] powerpc: display alignment exception in verbose mode only

Message ID 1459350381-23387-1-git-send-email-lvivier@redhat.com
State Accepted
Headers show

Commit Message

Laurent Vivier March 30, 2016, 3:06 p.m. UTC
In the emulator test, the illegal exception is displayed
only in verbose mode, do the same thing for the alignment
exception.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 powerpc/emulator.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Thomas Huth March 30, 2016, 3:07 p.m. UTC | #1
On 30.03.2016 17:06, Laurent Vivier wrote:
> In the emulator test, the illegal exception is displayed
> only in verbose mode, do the same thing for the alignment
> exception.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  powerpc/emulator.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/powerpc/emulator.c b/powerpc/emulator.c
> index ef27f15..3696d83 100644
> --- a/powerpc/emulator.c
> +++ b/powerpc/emulator.c
> @@ -35,8 +35,10 @@ static void alignment_handler(struct pt_regs *regs, void *opaque)
>  {
>  	int *data = opaque;
>  
> -	printf("Detected alignment exception 0x%016lx: %08x\n",
> -	       regs->nip, *(uint32_t*)regs->nip);
> +	if (verbose) {
> +		printf("Detected alignment exception 0x%016lx: %08x\n",
> +		       regs->nip, *(uint32_t*)regs->nip);
> +	}
>  
>  	*data = 1;
>  

Reviewed-by: Thomas Huth <thuth@redhat.com>

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Paolo Bonzini March 30, 2016, 4:12 p.m. UTC | #2
On 30/03/2016 17:06, Laurent Vivier wrote:
> In the emulator test, the illegal exception is displayed
> only in verbose mode, do the same thing for the alignment
> exception.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  powerpc/emulator.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/powerpc/emulator.c b/powerpc/emulator.c
> index ef27f15..3696d83 100644
> --- a/powerpc/emulator.c
> +++ b/powerpc/emulator.c
> @@ -35,8 +35,10 @@ static void alignment_handler(struct pt_regs *regs, void *opaque)
>  {
>  	int *data = opaque;
>  
> -	printf("Detected alignment exception 0x%016lx: %08x\n",
> -	       regs->nip, *(uint32_t*)regs->nip);
> +	if (verbose) {
> +		printf("Detected alignment exception 0x%016lx: %08x\n",
> +		       regs->nip, *(uint32_t*)regs->nip);
> +	}
>  
>  	*data = 1;
>  
> 

Thanks, applying soon.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/powerpc/emulator.c b/powerpc/emulator.c
index ef27f15..3696d83 100644
--- a/powerpc/emulator.c
+++ b/powerpc/emulator.c
@@ -35,8 +35,10 @@  static void alignment_handler(struct pt_regs *regs, void *opaque)
 {
 	int *data = opaque;
 
-	printf("Detected alignment exception 0x%016lx: %08x\n",
-	       regs->nip, *(uint32_t*)regs->nip);
+	if (verbose) {
+		printf("Detected alignment exception 0x%016lx: %08x\n",
+		       regs->nip, *(uint32_t*)regs->nip);
+	}
 
 	*data = 1;