Skip to content

Commit

Permalink
tests: Report pte_mask translation parameter
Browse files Browse the repository at this point in the history
The pte_mask parameter is set to zero for all OS-specific
initialisation, but it is not checked.

Note that this also requires extending the parser in sys-xlat,
because it takes the xlat-*.expect files as input.

Signed-off-by: Petr Tesarik <ptesarik@suse.com>
  • Loading branch information
ptesarik committed Oct 2, 2020
1 parent 04a94fa commit ebd2820
Show file tree
Hide file tree
Showing 55 changed files with 76 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/sys-xlat.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ enum param_index {

/* Page tables */
pgt_root,
pgt_pte_mask,
pgt_pte_format,
pgt_fields,

Expand Down Expand Up @@ -169,6 +170,7 @@ static const kw_pair_t linear_param[] = {

static const kw_pair_t pgt_param[] = {
{"root", pgt_root },
{"pte_mask", pgt_pte_mask },
{"pte_format", pgt_pte_format },
{"fields", pgt_fields },
{NULL}
Expand Down Expand Up @@ -464,6 +466,14 @@ parse_meth_param(const char *spec, addrxlat_meth_t *meth)
res = parse_fulladdr(p, &meth->param.pgt.root);
break;

case pgt_pte_mask:
meth->param.pgt.pte_mask = strtoull(p, (char**)&endp, 0);
if (endp != p && !*endp)
res = TEST_OK;
else
fprintf(stderr, "Invalid number: %s", p);
break;

case pgt_pte_format:
res = parse_pte_format(p, &meth->param.pgt.pf.pte_format);
break;
Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-ia32-pae.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x926000
pte_mask=0x0
pte_format=ia32_pae
fields=12,9,9,2

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-ia32.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x911000
pte_mask=0x0
pte_format=ia32
fields=12,10,10

Expand Down
2 changes: 2 additions & 0 deletions tests/xlat-linux-ppc64-64k.expect
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=ppc64_linux_rpn30
fields=16,12,12,4

@userpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=ppc64_linux_rpn30
fields=16,12,12,4

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-s390x-2l.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KPHYSADDR:0x8b5000
pte_mask=0x0
pte_format=s390x
fields=12,8,11

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-s390x-3l.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KPHYSADDR:0x8b5000
pte_mask=0x0
pte_format=s390x
fields=12,8,11,11

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-s390x-4l.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KPHYSADDR:0x8b5000
pte_mask=0x0
pte_format=s390x
fields=12,8,11,11,11

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-2.6.11-nover.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
2 changes: 2 additions & 0 deletions tests/xlat-linux-x86_64-2.6.11.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand All @@ -11,6 +12,7 @@
@ktext: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-2.6.27-cr3-xen.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x401af000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-2.6.27-nover.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
2 changes: 2 additions & 0 deletions tests/xlat-linux-x86_64-2.6.27.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand All @@ -11,6 +12,7 @@
@ktext: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-2.6.31-cr3.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x2e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-2.6.31-kvaddr.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-2.6.31-nover-reloc.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
2 changes: 2 additions & 0 deletions tests/xlat-linux-x86_64-2.6.31-nover-xen.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand All @@ -26,6 +27,7 @@
@kphys_machphys: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x3abc000
pte_mask=0x0
pte_format=pfn64
fields=12,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-2.6.31-nover.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-2.6.31-reloc.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
2 changes: 2 additions & 0 deletions tests/xlat-linux-x86_64-2.6.31.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand All @@ -11,6 +12,7 @@
@ktext: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-4.13-kaslr.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff92c09000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-4.13-nover.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81c09000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-5l.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff8b40a000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-ktext-128M.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-ktext-130M-nonlinear.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff99e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-ktext-130M.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-ktext-1G.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-ktext-40M.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-ktext-512M.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-ktext-520M.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-ktext-crosspage.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
2 changes: 2 additions & 0 deletions tests/xlat-linux-x86_64-ktext-pgt.expect
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

@ktext: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-linux-x86_64-old-nover.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=KVADDR:0xffffffff81e10000
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
2 changes: 2 additions & 0 deletions tests/xlat-linux-x86_64-old.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand All @@ -11,6 +12,7 @@
@ktext: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-os-ia32-none.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=ia32
fields=12,10,10

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-os-ia32-pae-none.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=ia32_pae
fields=12,9,9,2

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-os-s390x-2l.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x8b5000
pte_mask=0x0
pte_format=s390x
fields=12,8,11

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-os-s390x-3l.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x8b5000
pte_mask=0x0
pte_format=s390x
fields=12,8,11,11

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-os-s390x-4l.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x8b5000
pte_mask=0x0
pte_format=s390x
fields=12,8,11,11,11

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-os-s390x-5l.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=MACHPHYSADDR:0x8b5000
pte_mask=0x0
pte_format=s390x
fields=12,8,11,11,11,11

Expand Down
1 change: 1 addition & 0 deletions tests/xlat-os-x86_64-none.expect
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@rootpgt: PGT
target_as=MACHPHYSADDR
root=NOADDR
pte_mask=0x0
pte_format=x86_64
fields=12,9,9,9,9

Expand Down
Loading

0 comments on commit ebd2820

Please sign in to comment.