Merge pull request #1303 from davidharrishmc/dev

Fixed MMU tests with reserved A/D bits on non leaf PTEs
This commit is contained in:
Jordan Carlin 2025-02-27 06:24:48 -08:00 committed by GitHub
commit de928b9015
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 140 additions and 141 deletions

View file

@ -85,17 +85,17 @@ finished:
.align 16
# Page table situated at 0x80010000
pagetable:
.8byte 0x200044C1
.8byte 0x300044C1 # point to invalid region of physical memory
.8byte 0x20004401
.8byte 0x30004401 # point to invalid region of physical memory
.align 12
.8byte 0x00000040200048C1
.8byte 0x00000000200048C1
.8byte 0x00000000200048C1
.8byte 0x0000004020004801
.8byte 0x0000000020004801
.8byte 0x0000000020004801
.align 12
.8byte 0x0000000020004CC1
.8byte 0x0000000020004C01
.align 12
#80000000

View file

@ -29,7 +29,6 @@
#include "WALLY-init-lib.h"
# run-elf.bash find this in project description
main:
# Page table root address at 0x80010000
li t5, 0x9000000000080010
@ -64,12 +63,12 @@ finished:
.align 16
# Page table situated at 0x80010000
pagetable:
.8byte 0x200044C1
.8byte 0x20004401
.align 12
.8byte 0x00000000200048C1
.8byte 0x00000000200048C1
.8byte 0x00000000200048C1
.8byte 0x0000000020004801
.8byte 0x0000000020004801
.8byte 0x0000000020004801
.align 12 // megapages starting at 8000 0000 going to 8480 0000 (32*2 MiB beyond that)
@ -154,7 +153,7 @@ pagetable:
.8byte 0x20F000CF
.8byte 0x20F800CF
.8byte 0x20004CC1
.8byte 0x20004C01
// Kilopage entry, for addresses from 8400, 0000 to 841F, FFFF
// point to ...

View file

@ -138,56 +138,56 @@ ipf:
.align 16
# root Page table situated at 0x80010000
pagetable:
.8byte 0x200044C1 // old page table was 200040 which just pointed to itself! wrong
.8byte 0x20004401 // old page table was 200040 which just pointed to itself! wrong
# next page table at 0x80011000
.align 12
.8byte 0x0000000000000000 # gigapage at 0x00000000
.8byte 0x00000000200058C1 # gigapage at 0x40000000 used for non-NAPOT with PPN bit 3 set
.8byte 0x00000000200048C1 # gigapage at 0x80000000 used for testing NAPOT huge pages
.8byte 0x00000000200050C1 # gigapage at 0xC0000000 mapped to ill-formed NAPOT with wrong PPN
.8byte 0x0000000020005801 # gigapage at 0x40000000 used for non-NAPOT with PPN bit 3 set
.8byte 0x0000000020004801 # gigapage at 0x80000000 used for testing NAPOT huge pages
.8byte 0x0000000020005001 # gigapage at 0xC0000000 mapped to ill-formed NAPOT with wrong PPN
# Next page table at 0x80012000 for gigapage at 0x80000000
.align 12
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
.8byte 0x0000000020004C01
# Leaf page table at 0x80013000 with NAPOT pages
.align 12
@ -262,44 +262,44 @@ pagetable:
# Next page table at 0x80014000: mega-sized, pointing to malformed NAPOT for gigapage at 0xC9000000
.align 12
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x00000000200054C1
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
.8byte 0x0000000020005401
# Leaf page table at 0x80015000 with malformed NAPOT pages (wrong PPN) starting at 0xC0000000
.align 12
@ -352,43 +352,43 @@ pagetable:
# Next page table at 0x80016000: mega-sized, pointing to properly formed PTE with 1 in PPN bit 3 for gigapage at 0x40000000
.align 12
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005CC1
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
.8byte 0x0000000020005C01
# Leaf page table at 0x80017000 with properly formed PTE with bit 4 of PPN set but no NAPOT
.align 12

View file

@ -330,17 +330,17 @@ fixsatptraphandler:
.align 16
# root Page table situated at 0x80010000
pagetable:
.8byte 0x200044C1 # VA 0x00000000-0x7F_FFFFFFFF: PTE at 0x80011000 C1 dirty, accessed, valid
.8byte 0x20004401 # VA 0x00000000-0x7F_FFFFFFFF: PTE at 0x80011000 01 valid
.8byte 0x00000000000010CF # misaligned terapage at 0x80_00000000
.8byte 0x00000000000000CF # access fault terapage at 0x100_00000000
.8byte 0x40000000200044C1 # Bad PBMT at VA 0x180_0000000
.8byte 0x4000000020004401 # Bad PBMT at VA 0x180_0000000
# next page table at 0x80011000
.align 12
.8byte 0x00000000000010CF # misaligned gigapage at 0x00000000
.8byte 0x00000000200058C1 # PTE for pages at 0x40000000 pointing to 0x80150000
.8byte 0x00000000200048C1 # gigapage at 0x80000000 pointing to 0x80120000
.8byte 0x00000000000000C1 # gigapage at VA 0xC0000000 causes access fault
.8byte 0x0000000020005801 # PTE for pages at 0x40000000 pointing to 0x80150000
.8byte 0x0000000020004801 # gigapage at 0x80000000 pointing to 0x80120000
.8byte 0x0000000000000001 # gigapage at VA 0xC0000000 causes access fault
.8byte 0x0
.8byte 0x0
.8byte 0x0
@ -351,16 +351,16 @@ SpecialPage:
# Next page table at 0x80012000 for gigapage at 0x80000000
.align 12
.8byte 0x0000000020004CC1 # for VA starting at 80000000 (pointer to NAPOT 64 KiB pages Page table at 80013000)
.8byte 0x0000000020004C01 # for VA starting at 80000000 (pointer to NAPOT 64 KiB pages Page table at 80013000)
.8byte 0x0000000020014CCF # for VA starting at 80200000 (misaligned megapage)
.8byte 0x00000000200050C1 # for VA starting at 80400000 (bad PBMT pages page table at 0x80014000)
.8byte 0x4000000020004CC1 # for VA starting at 80600000 (bad entry: nonleaf PTE can't have PBMT != 0)
.8byte 0x00000000200054C1 # for VA starting at 80800000 (testing rwx permissiosn with cbom/cboz . page table at 0x80015000)
.8byte 0x0000000020004CC1 # for VA starting at 80A00000 (pointer to NAPOT 64 KiB pages like at 80000000. page table at 0x80013000)
.8byte 0x0000000020005001 # for VA starting at 80400000 (bad PBMT pages page table at 0x80014000)
.8byte 0x4000000020004C01 # for VA starting at 80600000 (bad entry: nonleaf PTE can't have PBMT != 0)
.8byte 0x0000000020005401 # for VA starting at 80800000 (testing rwx permissiosn with cbom/cboz . page table at 0x80015000)
.8byte 0x0000000020004C01 # for VA starting at 80A00000 (pointer to NAPOT 64 KiB pages like at 80000000. page table at 0x80013000)
.8byte 0x0F00000020004CCF # for VA starting at 80C00000 (bad reserved field in bits 60:54)
.8byte 0x000000002000000F # for VA starting at 80E00000 (megapage not dirty or accessed)
.8byte 0x0000000000004CC1 # for VA starting at 81000000 (nonleaf pointing to unimplemented memory causes access fault)
.8byte 0x4000000020004CC1 # for VA starting at 81200000 (nonleaf with PBMT nonzero causes page fault)
.8byte 0x0000000000004C01 # for VA starting at 81000000 (nonleaf pointing to unimplemented memory causes access fault)
.8byte 0x4000000020004C01 # for VA starting at 81200000 (nonleaf with PBMT nonzero causes page fault)
.8byte 0x00000000000000CF # for VA starting at 81400000 (megapage with access fault)
.8byte 0x0000000020004CC1
.8byte 0x0000000020004CC1