• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
          • Dynamic-instrumentation
          • Initialize-x86-state
          • Binary-file-load-fn
          • Setting-up-page-tables
            • Construct-pml4-table
              • Construct-pdp-table
              • Load-qwords-into-physical-memory-list
              • Construct-pdp-tables
              • Load-qwords-into-physical-memory
              • Construct-page-tables
              • Physical-addr-qword-alistp
              • Add-pml4-entry
              • Add-pdp-entry
              • Physical-addr-qword-alist-listp
            • Init-sys-view
            • Load-elf-sections
            • Concrete-simulation-examples
          • Introduction
          • X86isa-build-instructions
          • Publications
          • Contributors
          • Machine
          • Implemented-opcodes
          • Proof-utilities
          • To-do
          • Concrete-simulation-examples
          • Model-validation
          • Utils
          • Debugging-code-proofs
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Setting-up-page-tables

    Construct-pml4-table

    Construct a PML4 table, one entry at a time, each of which references a Page-Directory-Pointer Table

    Signature
    (construct-pml4-table entry-number entry-addr pdpt-base-addr acc) 
      → 
    *

    A PML4 table comprises 512 64-bit entries.

    Definitions and Theorems

    Function: construct-pml4-table

    (defun
     construct-pml4-table
     (entry-number entry-addr pdpt-base-addr acc)
     (declare (type (unsigned-byte 10) entry-number)
              (type (unsigned-byte 52) entry-addr)
              (type (unsigned-byte 40)
                    pdpt-base-addr))
     (declare (xargs :guard (physical-addr-qword-alistp acc)))
     (let
      ((__function__ 'construct-pml4-table))
      (declare (ignorable __function__))
      (cond
           ((or (not (integerp entry-number))
                (< entry-number 0)
                (not (unsigned-byte-p 40 (1+ pdpt-base-addr)))
                (not (unsigned-byte-p 10 (1+ entry-number)))
                (not (unsigned-byte-p 52 (+ 8 entry-addr))))
            acc)
           ((< entry-number 512)
            (construct-pml4-table (+ 1 entry-number)
                                  (+ 8 entry-addr)
                                  (+ 1 pdpt-base-addr)
                                  (acons entry-addr
                                         (add-pml4-entry pdpt-base-addr)
                                         acc)))
           (t acc))))

    Theorem: true-listp-construct-pml4-table

    (defthm
     true-listp-construct-pml4-table
     (implies
      (true-listp acc)
      (true-listp (construct-pml4-table entry-number
                                        entry-addr pdpt-base-addr acc)))
     :rule-classes :type-prescription)

    Theorem: consp-construct-pml4-table-helper

    (defthm
     consp-construct-pml4-table-helper
     (implies
      (and (unsigned-byte-p 40 (+ 1 pdpt-base-addr))
           (unsigned-byte-p 52 (+ 8 entry-addr)))
      (consp (construct-pml4-table 511 entry-addr pdpt-base-addr acc))))

    Theorem: consp-construct-pml4-table

    (defthm
      consp-construct-pml4-table
      (implies
           (and (unsigned-byte-p 10 entry-number)
                (< entry-number 512)
                (unsigned-byte-p 40 (1+ pdpt-base-addr))
                (unsigned-byte-p 10 (1+ entry-number))
                (unsigned-byte-p 52 (+ 8 entry-addr)))
           (consp (construct-pml4-table entry-number
                                        entry-addr pdpt-base-addr acc)))
      :rule-classes (:type-prescription :rewrite))

    Theorem: physical-addr-qword-alistp-construct-pml4-table-helper

    (defthm
     physical-addr-qword-alistp-construct-pml4-table-helper
     (implies
        (and (natp entry-addr)
             (unsigned-byte-p 40 pdpt-base-addr)
             (physical-addr-qword-alistp acc))
        (physical-addr-qword-alistp
             (construct-pml4-table 511 entry-addr pdpt-base-addr acc))))

    Theorem: physical-addr-qword-alistp-construct-pml4-table

    (defthm
        physical-addr-qword-alistp-construct-pml4-table
        (implies
             (and (unsigned-byte-p 40 pdpt-base-addr)
                  (unsigned-byte-p 52 entry-addr)
                  (physical-addr-qword-alistp acc))
             (physical-addr-qword-alistp
                  (construct-pml4-table entry-number
                                        entry-addr pdpt-base-addr acc)))
        :rule-classes :type-prescription)