• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
        • Running-linux
        • Introduction
        • Asmtest
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • X86isa-state
          • Syscalls
          • Cpuid
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
          • Instructions
          • Register-readers-and-writers
          • X86-modes
          • Segmentation
          • Other-non-deterministic-computations
          • Environment
          • Paging
            • Ia32e-paging
              • Paging-entry-no-page-fault-p
              • Ia32e-la-to-pa-without-tlb-internal
              • Ia32e-la-to-pa-page-directory
              • Ia32e-la-to-pa-page-dir-ptr-table
              • Ia32e-la-to-pa-page-table
              • Ia32e-la-to-pa-pml4-table
              • Ia32e-la-to-pa-without-tlb
              • Ia32e-la-to-pa
              • Same-page
              • Page-fault-exception
              • Page-dir-ptr-table-entry-addr
              • Page-directory-entry-addr
              • Page-table-entry-addr
              • La-to-pa
                • Paging-entry-no-page-fault-p-did-fault?
                • Pml4-table-entry-addr
                • Same-page-offset
                • Page-user-supervisor
                • Page-execute-disable
                • Set-dirty-bit
                • Set-accessed-bit
                • Page-read-write
                • Page-present
                • Page-fault-err-no
                • Accessed-bit
                • Page-size
                • Find-similar-paging-entries-from-page-present-equality-aux
                • Dirty-bit
                • Good-lin-addr-p
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Ia32e-paging

    La-to-pa

    Top-level page translation function

    Signature
    (la-to-pa lin-addr r-w-x x86) → (mv flg p-addr x86)
    Arguments
    r-w-x — Indicates whether this translation is on the behalf of a read, write, or instruction fetch.
    x86 — x86 state.
    Returns
    p-addr — Type (physical-address-p p-addr).
    x86 — Type (x86p x86), given (x86p x86).

    Definitions and Theorems

    Function: la-to-pa$inline

    (defun la-to-pa$inline (lin-addr r-w-x x86)
     (declare (xargs :stobjs (x86)))
     (declare (type (signed-byte 48) lin-addr)
              (type (member :r :w :x) r-w-x))
     (declare (xargs :guard (not (app-view x86))))
     (if (mbt (and (canonical-address-p lin-addr)
                   (not (app-view x86))))
         (ia32e-la-to-pa lin-addr r-w-x x86)
       (mv (list :ia32e-paging-invalid-linear-address-or-not-in-sys-view
                 lin-addr)
           0 x86)))

    Theorem: physical-address-p-of-la-to-pa.p-addr

    (defthm physical-address-p-of-la-to-pa.p-addr
      (b* (((mv ?flg ?p-addr ?x86)
            (la-to-pa$inline lin-addr r-w-x x86)))
        (physical-address-p p-addr))
      :rule-classes :rewrite)

    Theorem: x86p-of-la-to-pa.x86

    (defthm x86p-of-la-to-pa.x86
      (implies (x86p x86)
               (b* (((mv ?flg ?p-addr ?x86)
                     (la-to-pa$inline lin-addr r-w-x x86)))
                 (x86p x86)))
      :rule-classes :rewrite)

    Theorem: n52p-mv-nth-1-la-to-pa

    (defthm n52p-mv-nth-1-la-to-pa
     (unsigned-byte-p 52
                      (mv-nth 1 (la-to-pa lin-addr r-w-x x86)))
     :rule-classes
     (:rewrite
      (:type-prescription
          :corollary (natp (mv-nth 1 (la-to-pa lin-addr r-w-x x86)))
          :hints
          (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp))))
      (:linear
       :corollary (and (<= 0
                           (mv-nth 1 (la-to-pa lin-addr r-w-x x86)))
                       (< (mv-nth 1 (la-to-pa lin-addr r-w-x x86))
                          4503599627370496))
       :hints
       (("Goal"
            :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))

    Theorem: xr-and-la-to-pa

    (defthm xr-and-la-to-pa
      (implies (and (not (equal fld :tlb))
                    (not (equal fld :mem))
                    (not (equal fld :fault)))
               (equal (xr fld index
                          (mv-nth 2 (la-to-pa lin-addr r-w-x x86)))
                      (xr fld index x86))))