kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests
@ 2019-09-20  7:50 Janosch Frank
  2019-09-20  7:55 ` Christian Borntraeger
  2019-09-20  8:10 ` David Hildenbrand
  0 siblings, 2 replies; 6+ messages in thread
From: Janosch Frank @ 2019-09-20  7:50 UTC (permalink / raw)
  To: kvm; +Cc: linux-s390, david, thuth

Alignment and selectors test order is not specified and so, if you
have an unaligned address and invalid selectors it's up to the
hypervisor to decide which error is presented.

Let's add valid selectors to the unalignmnet test and add selector
tests.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
 s390x/stsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/s390x/stsi.c b/s390x/stsi.c
index 7232cb0..c5bd0a2 100644
--- a/s390x/stsi.c
+++ b/s390x/stsi.c
@@ -35,7 +35,7 @@ static void test_specs(void)
 
 	report_prefix_push("unaligned");
 	expect_pgm_int();
-	stsi(pagebuf + 42, 1, 0, 0);
+	stsi(pagebuf + 42, 1, 1, 1);
 	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
 	report_prefix_pop();
 
@@ -71,6 +71,8 @@ static inline unsigned long stsi_get_fc(void *addr)
 static void test_fc(void)
 {
 	report("invalid fc",  stsi(pagebuf, 7, 0, 0) == 3);
+	report("invalid selector 1", stsi(pagebuf, 1, 0, 1) == 3);
+	report("invalid selector 2", stsi(pagebuf, 1, 1, 0) == 3);
 	report("query fc >= 2",  stsi_get_fc(pagebuf) >= 2);
 }
 
-- 
2.17.2


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

* Re: [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests
  2019-09-20  7:50 [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests Janosch Frank
@ 2019-09-20  7:55 ` Christian Borntraeger
  2019-09-20  8:10 ` David Hildenbrand
  1 sibling, 0 replies; 6+ messages in thread
From: Christian Borntraeger @ 2019-09-20  7:55 UTC (permalink / raw)
  To: Janosch Frank, kvm; +Cc: linux-s390, david, thuth



On 20.09.19 09:50, Janosch Frank wrote:
> Alignment and selectors test order is not specified and so, if you
> have an unaligned address and invalid selectors it's up to the
> hypervisor to decide which error is presented.
> 
> Let's add valid selectors to the unalignmnet test and add selector
> tests.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>

> ---
>  s390x/stsi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/s390x/stsi.c b/s390x/stsi.c
> index 7232cb0..c5bd0a2 100644
> --- a/s390x/stsi.c
> +++ b/s390x/stsi.c
> @@ -35,7 +35,7 @@ static void test_specs(void)
>  
>  	report_prefix_push("unaligned");
>  	expect_pgm_int();
> -	stsi(pagebuf + 42, 1, 0, 0);
> +	stsi(pagebuf + 42, 1, 1, 1);
>  	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
>  	report_prefix_pop();
>  
> @@ -71,6 +71,8 @@ static inline unsigned long stsi_get_fc(void *addr)
>  static void test_fc(void)
>  {
>  	report("invalid fc",  stsi(pagebuf, 7, 0, 0) == 3);
> +	report("invalid selector 1", stsi(pagebuf, 1, 0, 1) == 3);
> +	report("invalid selector 2", stsi(pagebuf, 1, 1, 0) == 3);
>  	report("query fc >= 2",  stsi_get_fc(pagebuf) >= 2);
>  }
>  
> 


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

* Re: [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests
  2019-09-20  7:50 [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests Janosch Frank
  2019-09-20  7:55 ` Christian Borntraeger
@ 2019-09-20  8:10 ` David Hildenbrand
  2019-09-23  8:10   ` Thomas Huth
  1 sibling, 1 reply; 6+ messages in thread
From: David Hildenbrand @ 2019-09-20  8:10 UTC (permalink / raw)
  To: Janosch Frank, kvm; +Cc: linux-s390, thuth

On 20.09.19 09:50, Janosch Frank wrote:
> Alignment and selectors test order is not specified and so, if you
> have an unaligned address and invalid selectors it's up to the
> hypervisor to decide which error is presented.
> 
> Let's add valid selectors to the unalignmnet test and add selector
> tests.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  s390x/stsi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/s390x/stsi.c b/s390x/stsi.c
> index 7232cb0..c5bd0a2 100644
> --- a/s390x/stsi.c
> +++ b/s390x/stsi.c
> @@ -35,7 +35,7 @@ static void test_specs(void)
>  
>  	report_prefix_push("unaligned");
>  	expect_pgm_int();
> -	stsi(pagebuf + 42, 1, 0, 0);
> +	stsi(pagebuf + 42, 1, 1, 1);
>  	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
>  	report_prefix_pop();
>  
> @@ -71,6 +71,8 @@ static inline unsigned long stsi_get_fc(void *addr)
>  static void test_fc(void)
>  {
>  	report("invalid fc",  stsi(pagebuf, 7, 0, 0) == 3);
> +	report("invalid selector 1", stsi(pagebuf, 1, 0, 1) == 3);
> +	report("invalid selector 2", stsi(pagebuf, 1, 1, 0) == 3);
>  	report("query fc >= 2",  stsi_get_fc(pagebuf) >= 2);
>  }
>  
> 

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

-- 

Thanks,

David / dhildenb

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

* Re: [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests
  2019-09-20  8:10 ` David Hildenbrand
@ 2019-09-23  8:10   ` Thomas Huth
  2019-09-23  9:48     ` Janosch Frank
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Huth @ 2019-09-23  8:10 UTC (permalink / raw)
  To: David Hildenbrand, Janosch Frank, kvm; +Cc: linux-s390

On 20/09/2019 10.10, David Hildenbrand wrote:
> On 20.09.19 09:50, Janosch Frank wrote:
>> Alignment and selectors test order is not specified and so, if you
>> have an unaligned address and invalid selectors it's up to the
>> hypervisor to decide which error is presented.
>>
>> Let's add valid selectors to the unalignmnet test and add selector
>> tests.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>  s390x/stsi.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/s390x/stsi.c b/s390x/stsi.c
>> index 7232cb0..c5bd0a2 100644
>> --- a/s390x/stsi.c
>> +++ b/s390x/stsi.c
>> @@ -35,7 +35,7 @@ static void test_specs(void)
>>  
>>  	report_prefix_push("unaligned");
>>  	expect_pgm_int();
>> -	stsi(pagebuf + 42, 1, 0, 0);
>> +	stsi(pagebuf + 42, 1, 1, 1);
>>  	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
>>  	report_prefix_pop();
>>  
>> @@ -71,6 +71,8 @@ static inline unsigned long stsi_get_fc(void *addr)
>>  static void test_fc(void)
>>  {
>>  	report("invalid fc",  stsi(pagebuf, 7, 0, 0) == 3);

While you're at it, wouldn't it be better to use "(pagebuf, 7, 1, 1)" here?

 Thomas


>> +	report("invalid selector 1", stsi(pagebuf, 1, 0, 1) == 3);
>> +	report("invalid selector 2", stsi(pagebuf, 1, 1, 0) == 3);
>>  	report("query fc >= 2",  stsi_get_fc(pagebuf) >= 2);
>>  }
>>  
>>
> 
> Acked-by: David Hildenbrand <david@redhat.com>
> 


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

* Re: [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests
  2019-09-23  8:10   ` Thomas Huth
@ 2019-09-23  9:48     ` Janosch Frank
  2019-09-23  9:59       ` Thomas Huth
  0 siblings, 1 reply; 6+ messages in thread
From: Janosch Frank @ 2019-09-23  9:48 UTC (permalink / raw)
  To: Thomas Huth, David Hildenbrand, kvm; +Cc: linux-s390


[-- Attachment #1.1: Type: text/plain, Size: 1701 bytes --]

On 9/23/19 10:10 AM, Thomas Huth wrote:
> On 20/09/2019 10.10, David Hildenbrand wrote:
>> On 20.09.19 09:50, Janosch Frank wrote:
>>> Alignment and selectors test order is not specified and so, if you
>>> have an unaligned address and invalid selectors it's up to the
>>> hypervisor to decide which error is presented.
>>>
>>> Let's add valid selectors to the unaligned test and add selector
>>> tests.
>>>
>>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>>> ---
>>>  s390x/stsi.c | 4 +++-
>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/s390x/stsi.c b/s390x/stsi.c
>>> index 7232cb0..c5bd0a2 100644
>>> --- a/s390x/stsi.c
>>> +++ b/s390x/stsi.c
>>> @@ -35,7 +35,7 @@ static void test_specs(void)
>>>  
>>>  	report_prefix_push("unaligned");
>>>  	expect_pgm_int();
>>> -	stsi(pagebuf + 42, 1, 0, 0);
>>> +	stsi(pagebuf + 42, 1, 1, 1);
>>>  	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
>>>  	report_prefix_pop();
>>>  
>>> @@ -71,6 +71,8 @@ static inline unsigned long stsi_get_fc(void *addr)
>>>  static void test_fc(void)
>>>  {
>>>  	report("invalid fc",  stsi(pagebuf, 7, 0, 0) == 3);
> 
> While you're at it, wouldn't it be better to use "(pagebuf, 7, 1, 1)" here?

The selectors depend on the command, so they need to be checked after
the command. I don't think it would make much sense to change the zeroes
here.

> 
>  Thomas
> 
> 
>>> +	report("invalid selector 1", stsi(pagebuf, 1, 0, 1) == 3);
>>> +	report("invalid selector 2", stsi(pagebuf, 1, 1, 0) == 3);
>>>  	report("query fc >= 2",  stsi_get_fc(pagebuf) >= 2);
>>>  }
>>>  
>>>
>>
>> Acked-by: David Hildenbrand <david@redhat.com>
>>
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests
  2019-09-23  9:48     ` Janosch Frank
@ 2019-09-23  9:59       ` Thomas Huth
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2019-09-23  9:59 UTC (permalink / raw)
  To: Janosch Frank, David Hildenbrand, kvm; +Cc: linux-s390


[-- Attachment #1.1: Type: text/plain, Size: 1523 bytes --]

On 23/09/2019 11.48, Janosch Frank wrote:
> On 9/23/19 10:10 AM, Thomas Huth wrote:
>> On 20/09/2019 10.10, David Hildenbrand wrote:
>>> On 20.09.19 09:50, Janosch Frank wrote:
>>>> Alignment and selectors test order is not specified and so, if you
>>>> have an unaligned address and invalid selectors it's up to the
>>>> hypervisor to decide which error is presented.
>>>>
>>>> Let's add valid selectors to the unaligned test and add selector
>>>> tests.
>>>>
>>>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>>>> ---
>>>>  s390x/stsi.c | 4 +++-
>>>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/s390x/stsi.c b/s390x/stsi.c
>>>> index 7232cb0..c5bd0a2 100644
>>>> --- a/s390x/stsi.c
>>>> +++ b/s390x/stsi.c
>>>> @@ -35,7 +35,7 @@ static void test_specs(void)
>>>>  
>>>>  	report_prefix_push("unaligned");
>>>>  	expect_pgm_int();
>>>> -	stsi(pagebuf + 42, 1, 0, 0);
>>>> +	stsi(pagebuf + 42, 1, 1, 1);
>>>>  	check_pgm_int_code(PGM_INT_CODE_SPECIFICATION);
>>>>  	report_prefix_pop();
>>>>  
>>>> @@ -71,6 +71,8 @@ static inline unsigned long stsi_get_fc(void *addr)
>>>>  static void test_fc(void)
>>>>  {
>>>>  	report("invalid fc",  stsi(pagebuf, 7, 0, 0) == 3);
>>
>> While you're at it, wouldn't it be better to use "(pagebuf, 7, 1, 1)" here?
> 
> The selectors depend on the command, so they need to be checked after
> the command. I don't think it would make much sense to change the zeroes
> here.

OK, fair. Patche queued.

 Thomas


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2019-09-23 10:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20  7:50 [kvm-unit-tests PATCH] s390x: Fix stsi unaligned test and add selector tests Janosch Frank
2019-09-20  7:55 ` Christian Borntraeger
2019-09-20  8:10 ` David Hildenbrand
2019-09-23  8:10   ` Thomas Huth
2019-09-23  9:48     ` Janosch Frank
2019-09-23  9:59       ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).