• Anshuman Khandual's avatar
    mm/debug_vm_pgtable/basic: iterate over entire protection_map[] · 2e326c07
    Anshuman Khandual authored
    Currently the basic tests just validate various page table transformations
    after starting with vm_get_page_prot(VM_READ|VM_WRITE|VM_EXEC) protection.
    Instead scan over the entire protection_map[] for better coverage.  It
    also makes sure that all these basic page table tranformations checks hold
    true irrespective of the starting protection value for the page table
    entry.  There is also a slight change in the debug print format for basic
    tests to capture the protection value it is being tested with.  The
    modified output looks something like
    
    [pte_basic_tests          ]: Validating PTE basic ()
    [pte_basic_tests          ]: Validating PTE basic (read)
    [pte_basic_tests          ]: Validating PTE basic (write)
    [pte_basic_tests          ]: Validating PTE basic (read|write)
    [pte_basic_tests          ]: Validating PTE basic (exec)
    [pte_basic_tests          ]: Validating PTE basic (read|exec)
    [pte_basic_tests          ]: Validating PTE basic (write|exec)
    [pte_basic_tests          ]: Validating PTE basic (read|write|exec)
    [pte_basic_tests          ]: Validating PTE basic (shared)
    [pte_basic_tests          ]: Validating PTE basic (read|shared)
    [pte_basic_tests          ]: Validating PTE basic (write|shared)
    [pte_basic_tests          ]: Validating PTE basic (read|write|shared)
    [pte_basic_tests          ]: Validating PTE basic (exec|shared)
    [pte_basic_tests          ]: Validating PTE basic (read|exec|shared)
    [pte_basic_tests          ]: Validating PTE basic (write|exec|shared)
    [pte_basic_tests          ]: Validating PTE basic (read|write|exec|shared)
    
    This adds a missing argument 'struct mm_struct *' in pud_basic_tests()
    test .  This never got exposed before as PUD based THP is available only
    on X86 platform where mm_pmd_folded(mm) call gets macro replaced without
    requiring the mm_struct i.e __is_defined(__PAGETABLE_PMD_FOLDED).
    
    Link: https://lkml.kernel.org/r/1611137241-26220-3-git-send-email-anshuman.khandual@arm.comSigned-off-by: default avatarAnshuman Khandual <anshuman.khandual@arm.com>
    Tested-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> [s390]
    Reviewed-by: default avatarSteven Price <steven.price@arm.com>
    Suggested-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
    Cc: Gerald Schaefer <gerald.schaefer@linux.ibm.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Vineet Gupta <vgupta@synopsys.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    2e326c07
debug_vm_pgtable.c 31.3 KB