Update the |X86ISA|::|SMEP| field of a tlb-key bit structure.
Function:
(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:
(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:
(defthm !tlb-key->smep$inline-of-bfix-smep (equal (!tlb-key->smep$inline (bfix smep) x) (!tlb-key->smep$inline smep x)))
Theorem:
(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:
(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:
(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:
(defthm !tlb-key->smep-is-tlb-key (equal (!tlb-key->smep smep x) (change-tlb-key x :smep smep)))
Theorem:
(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:
(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)))