• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
        • Sdm-instruction-set-summary
        • Tlb
          • Tlb-key
            • !tlb-key->implicit-supervisor-access
            • Tlb-key-fast
            • Tlb-key-p
            • !tlb-key->r-w-x
            • !tlb-key->vpn
            • !tlb-key->smep
              • !tlb-key->smap
              • !tlb-key->cpl
              • !tlb-key->nxe
              • Tlb-key->implicit-supervisor-access
              • !tlb-key->wp
              • !tlb-key->ac
              • Tlb-key->vpn
              • Tlb-key->smep
              • Tlb-key->smap
              • Tlb-key->r-w-x
              • Tlb-key->cpl
              • Tlb-key-fix
              • Tlb-key->wp
              • Tlb-key->nxe
              • Tlb-key->ac
              • Good-tlb-key-p
            • Tlbp
            • Tlb-entryp
          • Running-linux
          • Introduction
          • Asmtest
          • X86isa-build-instructions
          • Publications
          • Contributors
          • Machine
          • Implemented-opcodes
          • To-do
          • Proof-utilities
          • Peripherals
          • Model-validation
          • Modelcalls
          • Concrete-simulation-examples
          • Utils
          • Debugging-code-proofs
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Tlb-key

    !tlb-key->smep

    Update the |X86ISA|::|SMEP| field of a tlb-key bit structure.

    Signature
    (!tlb-key->smep smep x) → new-x
    Arguments
    smep — Guard (bitp smep).
    x — Guard (tlb-key-p x).
    Returns
    new-x — Type (tlb-key-p new-x).

    Definitions and Theorems

    Function: !tlb-key->smep$inline

    (defun !tlb-key->smep$inline (smep x)
      (declare (xargs :guard (and (bitp smep) (tlb-key-p x))))
      (mbe :logic
           (b* ((smep (mbe :logic (bfix smep) :exec smep))
                (x (tlb-key-fix x)))
             (part-install smep x :width 1 :low 1))
           :exec (the (unsigned-byte 46)
                      (logior (the (unsigned-byte 46)
                                   (logand (the (unsigned-byte 46) x)
                                           (the (signed-byte 3) -3)))
                              (the (unsigned-byte 2)
                                   (ash (the (unsigned-byte 1) smep)
                                        1))))))

    Theorem: tlb-key-p-of-!tlb-key->smep

    (defthm tlb-key-p-of-!tlb-key->smep
      (b* ((new-x (!tlb-key->smep$inline smep x)))
        (tlb-key-p new-x))
      :rule-classes :rewrite)

    Theorem: !tlb-key->smep$inline-of-bfix-smep

    (defthm !tlb-key->smep$inline-of-bfix-smep
      (equal (!tlb-key->smep$inline (bfix smep) x)
             (!tlb-key->smep$inline smep x)))

    Theorem: !tlb-key->smep$inline-bit-equiv-congruence-on-smep

    (defthm !tlb-key->smep$inline-bit-equiv-congruence-on-smep
      (implies (bit-equiv smep smep-equiv)
               (equal (!tlb-key->smep$inline smep x)
                      (!tlb-key->smep$inline smep-equiv x)))
      :rule-classes :congruence)

    Theorem: !tlb-key->smep$inline-of-tlb-key-fix-x

    (defthm !tlb-key->smep$inline-of-tlb-key-fix-x
      (equal (!tlb-key->smep$inline smep (tlb-key-fix x))
             (!tlb-key->smep$inline smep x)))

    Theorem: !tlb-key->smep$inline-tlb-key-equiv-congruence-on-x

    (defthm !tlb-key->smep$inline-tlb-key-equiv-congruence-on-x
      (implies (tlb-key-equiv x x-equiv)
               (equal (!tlb-key->smep$inline smep x)
                      (!tlb-key->smep$inline smep x-equiv)))
      :rule-classes :congruence)

    Theorem: !tlb-key->smep-is-tlb-key

    (defthm !tlb-key->smep-is-tlb-key
      (equal (!tlb-key->smep smep x)
             (change-tlb-key x :smep smep)))

    Theorem: tlb-key->smep-of-!tlb-key->smep

    (defthm tlb-key->smep-of-!tlb-key->smep
      (b* ((?new-x (!tlb-key->smep$inline smep x)))
        (equal (tlb-key->smep new-x)
               (bfix smep))))

    Theorem: !tlb-key->smep-equiv-under-mask

    (defthm !tlb-key->smep-equiv-under-mask
      (b* ((?new-x (!tlb-key->smep$inline smep x)))
        (tlb-key-equiv-under-mask new-x x -3)))