[kvm-unit-tests GIT PULL 16/16] s390x: mvpg: skip some tests when using TCG

Janosch Frank
2021-03-08T14:34:56Z

From: Claudio Imbrenda <imbrenda@linux.ibm.com>

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>
Link: https://lore.kernel.org/kvm/20210302114107.501837-4-imbrenda@linux.ibm.com/
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
s390x/mvpg.c | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)

diff --git a/s390x/mvpg.c b/s390x/mvpg.c
index 1776ec6e..5743d5b6 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)
@@ -225,20 +226,29 @@ 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;
+ /* Known issue in TCG: CCO flag is not honoured */
+ if (vm_is_tcg()) {
+ report_prefix_push("TCG");
+ report_skip("destination invalid");
+ report_skip("source invalid");
+ report_skip("source and destination invalid");
+ report_prefix_pop();
+ } 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();
--
2.29.2