[kvm-unit-tests,v2,3/7] s390x: Add cpu id to interrupt error prints
diff mbox series

Message ID 20200116120513.2244-4-frankja@linux.ibm.com
State New
Headers show
Series
  • s390x: smp: Improve smp code and reset checks
Related show

Commit Message

Janosch Frank Jan. 16, 2020, 12:05 p.m. UTC
It's good to know which cpu broke the test.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 lib/s390x/interrupt.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

David Hildenbrand Jan. 16, 2020, 12:17 p.m. UTC | #1
On 16.01.20 13:05, Janosch Frank wrote:
> It's good to know which cpu broke the test.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  lib/s390x/interrupt.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c
> index 05f30be..773752a 100644
> --- a/lib/s390x/interrupt.c
> +++ b/lib/s390x/interrupt.c
> @@ -107,8 +107,8 @@ static void fixup_pgm_int(void)
>  void handle_pgm_int(void)
>  {
>  	if (!pgm_int_expected)
> -		report_abort("Unexpected program interrupt: %d at %#lx, ilen %d\n",
> -			     lc->pgm_int_code, lc->pgm_old_psw.addr,
> +		report_abort("Unexpected program interrupt: %d on cpu %d at %#lx, ilen %d\n",
> +			     lc->pgm_int_code, stap(), lc->pgm_old_psw.addr,
>  			     lc->pgm_int_id);

nit: "cpu: %d"

>  
>  	pgm_int_expected = false;
> @@ -119,8 +119,8 @@ void handle_ext_int(void)
>  {
>  	if (!ext_int_expected &&
>  	    lc->ext_int_code != EXT_IRQ_SERVICE_SIG) {
> -		report_abort("Unexpected external call interrupt (code %#x): at %#lx",
> -			     lc->ext_int_code, lc->ext_old_psw.addr);
> +		report_abort("Unexpected external call interrupt (code %#x): on cpu %d at %#lx",
> +			     stap(), lc->ext_int_code, lc->ext_old_psw.addr);

nit: "(code %#x) on cpu: %d" ...

Same comment for the ones below

Reviewed-by: David Hildenbrand <david@redhat.com>

>  		return;
>  	}
>  
> @@ -137,18 +137,18 @@ void handle_ext_int(void)
>  
>  void handle_mcck_int(void)
>  {
> -	report_abort("Unexpected machine check interrupt: at %#lx",
> -		     lc->mcck_old_psw.addr);
> +	report_abort("Unexpected machine check interrupt: on cpu %d at %#lx",
> +		     stap(), lc->mcck_old_psw.addr);
>  }
>  
>  void handle_io_int(void)
>  {
> -	report_abort("Unexpected io interrupt: at %#lx",
> -		     lc->io_old_psw.addr);
> +	report_abort("Unexpected io interrupt: on cpu %d at %#lx",
> +		     stap(), lc->io_old_psw.addr);
>  }
>  
>  void handle_svc_int(void)
>  {
> -	report_abort("Unexpected supervisor call interrupt: at %#lx",
> -		     lc->svc_old_psw.addr);
> +	report_abort("Unexpected supervisor call interrupt: on cpu %d at %#lx",
> +		     stap(), lc->svc_old_psw.addr);
>  }
>
Janosch Frank Jan. 16, 2020, 1:04 p.m. UTC | #2
On 1/16/20 1:17 PM, David Hildenbrand wrote:
> On 16.01.20 13:05, Janosch Frank wrote:
>> It's good to know which cpu broke the test.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>  lib/s390x/interrupt.c | 20 ++++++++++----------
>>  1 file changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c
>> index 05f30be..773752a 100644
>> --- a/lib/s390x/interrupt.c
>> +++ b/lib/s390x/interrupt.c
>> @@ -107,8 +107,8 @@ static void fixup_pgm_int(void)
>>  void handle_pgm_int(void)
>>  {
>>  	if (!pgm_int_expected)
>> -		report_abort("Unexpected program interrupt: %d at %#lx, ilen %d\n",
>> -			     lc->pgm_int_code, lc->pgm_old_psw.addr,
>> +		report_abort("Unexpected program interrupt: %d on cpu %d at %#lx, ilen %d\n",
>> +			     lc->pgm_int_code, stap(), lc->pgm_old_psw.addr,
>>  			     lc->pgm_int_id);
> 
> nit: "cpu: %d"
> 
>>  
>>  	pgm_int_expected = false;
>> @@ -119,8 +119,8 @@ void handle_ext_int(void)
>>  {
>>  	if (!ext_int_expected &&
>>  	    lc->ext_int_code != EXT_IRQ_SERVICE_SIG) {
>> -		report_abort("Unexpected external call interrupt (code %#x): at %#lx",
>> -			     lc->ext_int_code, lc->ext_old_psw.addr);
>> +		report_abort("Unexpected external call interrupt (code %#x): on cpu %d at %#lx",
>> +			     stap(), lc->ext_int_code, lc->ext_old_psw.addr);
> 
> nit: "(code %#x) on cpu: %d" ...

So, should I move the old : or add a second one?

> 
> Same comment for the ones below
> 
> Reviewed-by: David Hildenbrand <david@redhat.com>
> 
>>  		return;
>>  	}
>>  
>> @@ -137,18 +137,18 @@ void handle_ext_int(void)
>>  
>>  void handle_mcck_int(void)
>>  {
>> -	report_abort("Unexpected machine check interrupt: at %#lx",
>> -		     lc->mcck_old_psw.addr);
>> +	report_abort("Unexpected machine check interrupt: on cpu %d at %#lx",
>> +		     stap(), lc->mcck_old_psw.addr);
>>  }
>>  
>>  void handle_io_int(void)
>>  {
>> -	report_abort("Unexpected io interrupt: at %#lx",
>> -		     lc->io_old_psw.addr);
>> +	report_abort("Unexpected io interrupt: on cpu %d at %#lx",
>> +		     stap(), lc->io_old_psw.addr);
>>  }
>>  
>>  void handle_svc_int(void)
>>  {
>> -	report_abort("Unexpected supervisor call interrupt: at %#lx",
>> -		     lc->svc_old_psw.addr);
>> +	report_abort("Unexpected supervisor call interrupt: on cpu %d at %#lx",
>> +		     stap(), lc->svc_old_psw.addr);
>>  }
>>
>
David Hildenbrand Jan. 16, 2020, 1:19 p.m. UTC | #3
On 16.01.20 14:04, Janosch Frank wrote:
> On 1/16/20 1:17 PM, David Hildenbrand wrote:
>> On 16.01.20 13:05, Janosch Frank wrote:
>>> It's good to know which cpu broke the test.
>>>
>>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>>> ---
>>>  lib/s390x/interrupt.c | 20 ++++++++++----------
>>>  1 file changed, 10 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c
>>> index 05f30be..773752a 100644
>>> --- a/lib/s390x/interrupt.c
>>> +++ b/lib/s390x/interrupt.c
>>> @@ -107,8 +107,8 @@ static void fixup_pgm_int(void)
>>>  void handle_pgm_int(void)
>>>  {
>>>  	if (!pgm_int_expected)
>>> -		report_abort("Unexpected program interrupt: %d at %#lx, ilen %d\n",
>>> -			     lc->pgm_int_code, lc->pgm_old_psw.addr,
>>> +		report_abort("Unexpected program interrupt: %d on cpu %d at %#lx, ilen %d\n",
>>> +			     lc->pgm_int_code, stap(), lc->pgm_old_psw.addr,
>>>  			     lc->pgm_int_id);
>>
>> nit: "cpu: %d"
>>
>>>  
>>>  	pgm_int_expected = false;
>>> @@ -119,8 +119,8 @@ void handle_ext_int(void)
>>>  {
>>>  	if (!ext_int_expected &&
>>>  	    lc->ext_int_code != EXT_IRQ_SERVICE_SIG) {
>>> -		report_abort("Unexpected external call interrupt (code %#x): at %#lx",
>>> -			     lc->ext_int_code, lc->ext_old_psw.addr);
>>> +		report_abort("Unexpected external call interrupt (code %#x): on cpu %d at %#lx",
>>> +			     stap(), lc->ext_int_code, lc->ext_old_psw.addr);
>>
>> nit: "(code %#x) on cpu: %d" ...
> 
> So, should I move the old : or add a second one?

No strong feelings, whatever you prefer. (you can also keep it
unchanged, it's just a test error output after all)
Cornelia Huck Jan. 16, 2020, 1:59 p.m. UTC | #4
On Thu, 16 Jan 2020 07:05:09 -0500
Janosch Frank <frankja@linux.ibm.com> wrote:

> It's good to know which cpu broke the test.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  lib/s390x/interrupt.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)

With whatever formatting tweaks you choose:

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Janosch Frank Jan. 16, 2020, 2:11 p.m. UTC | #5
On 1/16/20 2:59 PM, Cornelia Huck wrote:
> On Thu, 16 Jan 2020 07:05:09 -0500
> Janosch Frank <frankja@linux.ibm.com> wrote:
> 
>> It's good to know which cpu broke the test.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>  lib/s390x/interrupt.c | 20 ++++++++++----------
>>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> With whatever formatting tweaks you choose:
> 
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>

Thanks!


I think I might just stick with the old formatting.

Patch
diff mbox series

diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c
index 05f30be..773752a 100644
--- a/lib/s390x/interrupt.c
+++ b/lib/s390x/interrupt.c
@@ -107,8 +107,8 @@  static void fixup_pgm_int(void)
 void handle_pgm_int(void)
 {
 	if (!pgm_int_expected)
-		report_abort("Unexpected program interrupt: %d at %#lx, ilen %d\n",
-			     lc->pgm_int_code, lc->pgm_old_psw.addr,
+		report_abort("Unexpected program interrupt: %d on cpu %d at %#lx, ilen %d\n",
+			     lc->pgm_int_code, stap(), lc->pgm_old_psw.addr,
 			     lc->pgm_int_id);
 
 	pgm_int_expected = false;
@@ -119,8 +119,8 @@  void handle_ext_int(void)
 {
 	if (!ext_int_expected &&
 	    lc->ext_int_code != EXT_IRQ_SERVICE_SIG) {
-		report_abort("Unexpected external call interrupt (code %#x): at %#lx",
-			     lc->ext_int_code, lc->ext_old_psw.addr);
+		report_abort("Unexpected external call interrupt (code %#x): on cpu %d at %#lx",
+			     stap(), lc->ext_int_code, lc->ext_old_psw.addr);
 		return;
 	}
 
@@ -137,18 +137,18 @@  void handle_ext_int(void)
 
 void handle_mcck_int(void)
 {
-	report_abort("Unexpected machine check interrupt: at %#lx",
-		     lc->mcck_old_psw.addr);
+	report_abort("Unexpected machine check interrupt: on cpu %d at %#lx",
+		     stap(), lc->mcck_old_psw.addr);
 }
 
 void handle_io_int(void)
 {
-	report_abort("Unexpected io interrupt: at %#lx",
-		     lc->io_old_psw.addr);
+	report_abort("Unexpected io interrupt: on cpu %d at %#lx",
+		     stap(), lc->io_old_psw.addr);
 }
 
 void handle_svc_int(void)
 {
-	report_abort("Unexpected supervisor call interrupt: at %#lx",
-		     lc->svc_old_psw.addr);
+	report_abort("Unexpected supervisor call interrupt: on cpu %d at %#lx",
+		     stap(), lc->svc_old_psw.addr);
 }