diff mbox series

[kvm-unit-tests,v3,3/3] s390x: mvpg: skip some tests when using TCG

Message ID 20210301182830.478145-4-imbrenda@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: mvpg test | expand

Commit Message

Claudio Imbrenda March 1, 2021, 6:28 p.m. UTC
TCG is known to fail these tests, so add an explicit exception to skip them.

Once TCG has been fixed, it will be enough to revert this patch.

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
---
 s390x/mvpg.c | 31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

Comments

Thomas Huth March 2, 2021, 5:59 a.m. UTC | #1
On 01/03/2021 19.28, Claudio Imbrenda wrote:
> TCG is known to fail these tests, so add an explicit exception to skip them.
> 
> Once TCG has been fixed, it will be enough to revert this patch.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
>   s390x/mvpg.c | 31 +++++++++++++++++++------------
>   1 file changed, 19 insertions(+), 12 deletions(-)
> 
> diff --git a/s390x/mvpg.c b/s390x/mvpg.c
> index 792052ad..148095e0 100644
> --- a/s390x/mvpg.c
> +++ b/s390x/mvpg.c
> @@ -20,6 +20,7 @@
>   #include <smp.h>
>   #include <alloc_page.h>
>   #include <bitops.h>
> +#include <vm.h>
>   
>   /* Used to build the appropriate test values for register 0 */
>   #define KFC(x) ((x) << 10)
> @@ -224,20 +225,26 @@ static void test_mmu_prot(void)
>   	report(clear_pgm_int() == PGM_INT_CODE_PROTECTION, "destination read only");
>   	fresh += PAGE_SIZE;
>   
> -	protect_page(fresh, PAGE_ENTRY_I);
> -	cc = mvpg(CCO, fresh, source);
> -	report(cc == 1, "destination invalid");
> -	fresh += PAGE_SIZE;
> +	if (vm_is_tcg()) {
> +		report_skip("destination invalid");
> +		report_skip("source invalid");
> +		report_skip("source and destination invalid");

You could also use report_xfail(vm_is_tcg(), ...) instead. That shows that 
there are still problems without failing CI runs.

Anyway:
Reviewed-by: Thomas Huth <thuth@redhat.com>
Janosch Frank March 2, 2021, 8:22 a.m. UTC | #2
On 3/2/21 6:59 AM, Thomas Huth wrote:
> On 01/03/2021 19.28, Claudio Imbrenda wrote:
>> TCG is known to fail these tests, so add an explicit exception to skip them.
>>
>> Once TCG has been fixed, it will be enough to revert this patch.
>>
>> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
>> ---
>>   s390x/mvpg.c | 31 +++++++++++++++++++------------
>>   1 file changed, 19 insertions(+), 12 deletions(-)
>>
>> diff --git a/s390x/mvpg.c b/s390x/mvpg.c
>> index 792052ad..148095e0 100644
>> --- a/s390x/mvpg.c
>> +++ b/s390x/mvpg.c
>> @@ -20,6 +20,7 @@
>>   #include <smp.h>
>>   #include <alloc_page.h>
>>   #include <bitops.h>
>> +#include <vm.h>
>>   
>>   /* Used to build the appropriate test values for register 0 */
>>   #define KFC(x) ((x) << 10)
>> @@ -224,20 +225,26 @@ static void test_mmu_prot(void)
>>   	report(clear_pgm_int() == PGM_INT_CODE_PROTECTION, "destination read only");
>>   	fresh += PAGE_SIZE;
>>   
>> -	protect_page(fresh, PAGE_ENTRY_I);
>> -	cc = mvpg(CCO, fresh, source);
>> -	report(cc == 1, "destination invalid");
>> -	fresh += PAGE_SIZE;
>> +	if (vm_is_tcg()) {
>> +		report_skip("destination invalid");
>> +		report_skip("source invalid");
>> +		report_skip("source and destination invalid");
> 
> You could also use report_xfail(vm_is_tcg(), ...) instead. That shows that 
> there are still problems without failing CI runs.

If I remember correctly we fail with a PGM so we would also need to add
a expect_pgm_int() call before each test when running under tcg
therefore it's not just a 1:1 replacement in this case.

But yes, I'd also like an indication why we're skipping. A comment and a
TCG prefix for skips should be enough.


> 
> Anyway:
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
diff mbox series

Patch

diff --git a/s390x/mvpg.c b/s390x/mvpg.c
index 792052ad..148095e0 100644
--- a/s390x/mvpg.c
+++ b/s390x/mvpg.c
@@ -20,6 +20,7 @@ 
 #include <smp.h>
 #include <alloc_page.h>
 #include <bitops.h>
+#include <vm.h>
 
 /* Used to build the appropriate test values for register 0 */
 #define KFC(x) ((x) << 10)
@@ -224,20 +225,26 @@  static void test_mmu_prot(void)
 	report(clear_pgm_int() == PGM_INT_CODE_PROTECTION, "destination read only");
 	fresh += PAGE_SIZE;
 
-	protect_page(fresh, PAGE_ENTRY_I);
-	cc = mvpg(CCO, fresh, source);
-	report(cc == 1, "destination invalid");
-	fresh += PAGE_SIZE;
+	if (vm_is_tcg()) {
+		report_skip("destination invalid");
+		report_skip("source invalid");
+		report_skip("source and destination invalid");
+	} else {
+		protect_page(fresh, PAGE_ENTRY_I);
+		cc = mvpg(CCO, fresh, source);
+		report(cc == 1, "destination invalid");
+		fresh += PAGE_SIZE;
 
-	protect_page(source, PAGE_ENTRY_I);
-	cc = mvpg(CCO, fresh, source);
-	report(cc == 2, "source invalid");
-	fresh += PAGE_SIZE;
+		protect_page(source, PAGE_ENTRY_I);
+		cc = mvpg(CCO, fresh, source);
+		report(cc == 2, "source invalid");
+		fresh += PAGE_SIZE;
 
-	protect_page(fresh, PAGE_ENTRY_I);
-	cc = mvpg(CCO, fresh, source);
-	report(cc == 2, "source and destination invalid");
-	fresh += PAGE_SIZE;
+		protect_page(fresh, PAGE_ENTRY_I);
+		cc = mvpg(CCO, fresh, source);
+		report(cc == 2, "source and destination invalid");
+		fresh += PAGE_SIZE;
+	}
 
 	unprotect_page(source, PAGE_ENTRY_I);
 	report_prefix_pop();