• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • 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-pdp-tables

    Construct PDP tables, where each table has entries that map a 1GB page

    Signature
    (construct-pdp-tables table-number pdpt-base-addr acc) → *

    PML4 tables contain 512 64-bit entries, and in our current setup, each of those 512 entries point to a PDP table. Thus, we need to construct 512 PDP tables. In our current setup, each PDPTE maps a 1GB page.

    Definitions and Theorems

    Function: construct-pdp-tables

    (defun
     construct-pdp-tables
     (table-number pdpt-base-addr acc)
     (declare (type (unsigned-byte 10) table-number)
              (type (unsigned-byte 40)
                    pdpt-base-addr))
     (declare (xargs :guard (alistp acc)))
     (let
      ((__function__ 'construct-pdp-tables))
      (declare (ignorable __function__))
      (cond
         ((not (and (natp table-number)
                    (unsigned-byte-p 22 (* 512 table-number))
                    (unsigned-byte-p 40 (+ 1 pdpt-base-addr))
                    (unsigned-byte-p 10 (+ 1 table-number))
                    (unsigned-byte-p 22 (+ 1 (* 512 table-number)))
                    (unsigned-byte-p 52 (+ 8 (ash pdpt-base-addr 12)))))
          acc)
         ((< table-number 512)
          (b* ((table (construct-pdp-table 0 (ash pdpt-base-addr 12)
                                           (* 512 table-number)
                                           nil))
               (acc (cons table acc)))
              (construct-pdp-tables (+ 1 table-number)
                                    (+ 1 pdpt-base-addr)
                                    acc)))
         (t acc))))

    Theorem: physical-addr-qword-alist-listp-construct-pdp-tables

    (defthm
      physical-addr-qword-alist-listp-construct-pdp-tables
      (implies
           (and (physical-addr-qword-alist-listp acc)
                (unsigned-byte-p 40 pdpt-base-addr))
           (physical-addr-qword-alist-listp
                (construct-pdp-tables table-number pdpt-base-addr acc)))
      :rule-classes (:type-prescription :rewrite))