• 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
        • Introduction
        • X86isa-build-instructions
        • Publications
        • Contributors
        • Machine
          • Syscalls
          • Cpuid
          • X86isa-state
          • Linear-memory
          • Rflag-specifications
          • Characterizing-undefined-behavior
          • Top-level-memory
          • App-view
          • X86-decoder
          • Physical-memory
          • Decoding-and-spec-utils
            • Effective-address-computations
            • Read-operands-and-write-results
            • Instruction-pointer-operations
            • Select-operand-size
            • Stack-pointer-operations
            • Select-segment-register
            • Prefix-modrm-sib-decoding
            • Select-address-size
            • Check-instruction-length
            • Error-objects
            • Rip-guard-okp
              • Sib-decoding
            • Instructions
            • X86-modes
            • Segmentation
            • Register-readers-and-writers
            • Other-non-deterministic-computations
            • Environment
            • Paging
          • Implemented-opcodes
          • Proof-utilities
          • To-do
          • Concrete-simulation-examples
          • Model-validation
          • Utils
          • Debugging-code-proofs
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Decoding-and-spec-utils

    Rip-guard-okp

    Size constraints on a memory address of some instruction byte

    Signature
    (rip-guard-okp proc-mode rip) → *

    This function specifies the maximum size of a memory address that points to some instruction byte in a certain mode of operation. We usually use this function to specify the guard on start-rip or temp-rip --- that way, we can put in suitable type declarations in our specification functions.

    This function doesn't really specify whether a memory address that points to some instruction byte is valid or not --- that notion is much more complicated; see canonical-address-p, ea-to-la, and instruction-pointer-operations for details.

    Definitions and Theorems

    Function: rip-guard-okp

    (defun rip-guard-okp (proc-mode rip)
           (declare (type (integer 0 4) proc-mode)
                    (type (signed-byte 48) rip))
           (let ((__function__ 'rip-guard-okp))
                (declare (ignorable __function__))
                (if (equal proc-mode 0)
                    (signed-byte-p 48 rip)
                    (unsigned-byte-p 32 rip))))

    Theorem: rip-guard-okp-equiv-for-non-64-bit-modes

    (defthm rip-guard-okp-equiv-for-non-64-bit-modes
            (implies (and (rip-guard-okp proc-mode-1 rip)
                          (not (equal proc-mode-1 0))
                          (not (equal proc-mode-2 0)))
                     (rip-guard-okp proc-mode-2 rip)))

    Theorem: rip-guard-okp-for-64-bit-modep

    (defthm rip-guard-okp-for-64-bit-modep
            (equal (rip-guard-okp 0 rip)
                   (signed-byte-p 48 rip)))

    Theorem: rip-guard-okp-for-compatibility-mode

    (defthm rip-guard-okp-for-compatibility-mode
            (equal (rip-guard-okp 1 rip)
                   (unsigned-byte-p 32 rip)))