Library mcertikos.invariants.INVLemmaInterrupt

Require Import Coqlib.
Require Import Maps.
Require Import Constant.
Require Import GlobIdent.
Require Import FlatMemory.
Require Import CommonTactic.
Require Import FutureTactic.
Require Import AuxLemma.
Require Import DeviceStateDataType.
Require Import AbstractDataType.

Require Import Values.
Require Import AsmX.
Require Import Integers.
Require Import liblayers.compat.CompatLayers.
Require Import AST.
Require Import AuxStateDataType.
Require Import ObjInterruptManagement.
Require Import Omega.
Require Import XOmega.
Require Import DeviceStateDataType.
Require Import GlobalOracleProp.
Require Import INVLemmaMemory.
Require Import RealParams.

Section INTERRUPT_INV.

  Section INTR_DISABLE.

    Context `{real_params: RealParams}.
    Context `{waittime: WaitTime}.

    Lemma serial_intr_disable_aux_preserves_all:
       n masked d ,
        serial_intr_disable_aux n masked d = ret
        CPU_ID d = CPU_ID
        cid d = cid
        multi_oracle d = multi_oracle
        multi_log d = multi_log
        ti d = ti
        kctxt d = kctxt
        uctxt d = uctxt
        vmcs d = vmcs
        vmx d = vmx
        AC d = AC
        init d = init
        ikern d = ikern
        ihost d = ihost
        pg d = pg
        MM d = MM
        MMSize d = MMSize
        CR3 d = CR3
        nps d = nps
        AT d = AT
        ATC d = ATC
        pperm d = pperm
        ipt d = ipt
        PT d = PT
        ptpool d = ptpool
        HP d = HP
        LAT d = LAT
        idpde d = idpde
        abtcb d = abtcb
        abq d = abq
        cid d = cid
        tcb d = tcb
        tdq d = tdq
        syncchpool d = syncchpool
        uctxt d = uctxt
        ept d = ept
        tf d = tf
        big_oracle d = big_oracle
        big_log d = big_log
        sleeper d = sleeper
        lock d = lock
        smspool d = smspool
        big_log d = big_log
        big_oracle d = big_oracle
        ept d = ept
        vmcs d = vmcs
        vmx d = vmx
        vmxinfo d = vmxinfo .
    Proof.
      intros until n.
      induction n.
      {
        simpl.
        intros.
        inv H.
        repeat (split; [reflexivity|]); try reflexivity.
      }
      {
        simpl.
        intros.
        subdestruct.
        {
          eapply IHn in H.
          simpl in H.
          apply H.
        }
        {
          eapply IHn in H.
          functional inversion Hdestruct1; subst;
          simpl in *; eauto.
        }
        {
          inv H.
          repeat (split; [reflexivity|]); try reflexivity.
        }
      }
    Qed.

    Lemma serial_intr_disable_preserves_all:
       d ,
        serial_intr_disable_spec d = ret
        CPU_ID d = CPU_ID
        cid d = cid
        multi_oracle d = multi_oracle
        multi_log d = multi_log
        ti d = ti
        kctxt d = kctxt
        uctxt d = uctxt
        vmcs d = vmcs
        vmx d = vmx
        AC d = AC
        init d = init
        ikern d = ikern
        ihost d = ihost
        pg d = pg
        MM d = MM
        MMSize d = MMSize
        CR3 d = CR3
        nps d = nps
        AT d = AT
        ATC d = ATC
        pperm d = pperm
        ipt d = ipt
        PT d = PT
        ptpool d = ptpool
        HP d = HP
        LAT d = LAT
        idpde d = idpde
        abtcb d = abtcb
        abq d = abq
        cid d = cid
        tcb d = tcb
        tdq d = tdq
        syncchpool d = syncchpool
        uctxt d = uctxt
        ept d = ept
        tf d = tf
        big_oracle d = big_oracle
        big_log d = big_log
        sleeper d = sleeper
        lock d = lock
        smspool d = smspool
        big_log d = big_log
        big_oracle d = big_oracle
        ept d = ept
        vmcs d = vmcs
        vmx d = vmx
        vmxinfo d = vmxinfo .
    Proof.
      intros.
      functional inversion H; simpl;
      apply (serial_intr_disable_aux_preserves_all INTR_DISABLE_REC_MAX masked (d { in_intr : true}) d0); assumption.
    Qed.

    Lemma serial_intr_disable_aux_rpos_within_range:
       n masked d ,
        serial_intr_disable_aux n masked d = ret
        0 rpos (console d) < 512 →
        0 rpos (console ) < 512.
    Proof.
      intros until n.
      induction n.
      {
        simpl.
        intros.
        inv H.
        eauto.
      }
      {
        simpl.
        intros.
        subdestruct.
        {
          eapply IHn in H.
          eassumption.
          simpl in ×.
          assumption.
        }
        {
          eapply IHn in H; simpl in *; try assumption.
          functional inversion Hdestruct1; subst; simpl in *; eauto.
          apply Z.mod_bound_pos.
          omega.
          omega.
        }
        {
          inv H.
          eauto.
        }
      }
    Qed.

    Open Scope Z_scope.
    Lemma serial_intr_disable_rpos_within_range:
       d ,
        serial_intr_disable_spec d = ret
        0 rpos (console d) < 512 →
        0 rpos (console ) < 512.
    Proof.
      intros.
      functional inversion H; simpl;
      apply (serial_intr_disable_aux_rpos_within_range INTR_DISABLE_REC_MAX masked (d { in_intr : true}) d0); assumption.
    Qed.

    Lemma serial_intr_disable_aux_cons_buf_length_within_range:
       n masked d ,
        serial_intr_disable_aux n masked d = ret
        0 Zlength (cons_buf (console d)) < 512 →
        0 Zlength (cons_buf (console )) < 512.
    Proof.
      intros until n.
      induction n.
      {
        simpl.
        intros.
        inv H.
        eauto.
      }
      {
        simpl.
        intros.
        subdestruct.
        {
          eapply IHn in H; simpl in *; eassumption.
        }
        {
          eapply IHn in H; simpl in *; try eassumption.
          functional inversion Hdestruct1; simpl in *; eauto.
          split. apply Zlength_ge_0. omega.
          split. apply Zlength_ge_0. repeat solve_list. repeat toZ.
          omega.
          generalize _x10. repeat solve_list. intros. omega. omega.
          generalize _x10. repeat solve_list. intros. omega.
        }
        {
          inv H; eauto.
        }
      }
    Qed.

    Lemma serial_intr_disable_cons_buf_length_within_range:
       d ,
        serial_intr_disable_spec d = ret
        0 Zlength (cons_buf (console d)) < 512 →
        0 Zlength (cons_buf (console )) < 512.
    Proof.
      intros.
      functional inversion H; simpl;
      apply (serial_intr_disable_aux_cons_buf_length_within_range INTR_DISABLE_REC_MAX masked (d { in_intr : true}) d0); assumption.
    Qed.

    Lemma serial_intr_disable_aux_cons_buf_tl_length_within_range:
       n masked d x tl,
        serial_intr_disable_aux n masked d = ret
        0 Zlength (cons_buf (console d)) < 512 →
        cons_buf (console ) = x :: tl
        0 Zlength tl < 512.
    Proof.
      intros.
      generalize (serial_intr_disable_aux_cons_buf_length_within_range n masked d H H0).
      rewrite H1. generalize H0. solve_list.
      intros. split. apply Zlength_ge_0. omega.
    Qed.

    Require Import FutureTactic.
    Lemma serial_intr_disable_cr2_injection:
       d m,
        serial_intr_disable_spec d = ret
        val_inject (Mem.flat_inj m) (snd (ti d)) (snd (ti d)) →
        val_inject (Mem.flat_inj m) (snd (ti )) (snd (ti )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_disable_cr2_type:
       d ,
        serial_intr_disable_spec d = ret
        Val.has_type (snd (ti d)) Tint
        Val.has_type (snd (ti )) Tint.
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_disable_kctxt_INJECT:
       d m,
        serial_intr_disable_spec d = ret
        kctxt_inject_neutral (kctxt d) m
        kctxt_inject_neutral (kctxt ) m.
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_disable_uctxt_INJECT:
       d m,
        serial_intr_disable_spec d = ret
        uctxt_inject_neutral (uctxt d) m
        uctxt_inject_neutral (uctxt ) m.
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_disable_VMCS_inject_neutral:
       d m,
        serial_intr_disable_spec d = ret
        VMCSPool_inject_neutral (vmcs d) m
        VMCSPool_inject_neutral (vmcs ) m.
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_disable_VMX_inject_neutral:
       d m,
        serial_intr_disable_spec d = ret
        VMXPool_inject_neutral (vmx d) m
        VMXPool_inject_neutral (vmx ) m.
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_disable_Container_valid:
       d ,
        serial_intr_disable_spec d = ret
        Container_valid (AC d) →
        Container_valid (AC ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_disable_valid_preinit_container:
       d ,
        serial_intr_disable_spec d = ret
        (init d = false
          x : Z, 0 x < num_proccused (ZMap.get x (AC d)) true) →
        (init = false
          x : Z, 0 x < num_proccused (ZMap.get x (AC )) true).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_preserves_ikernhost:
       d ,
        serial_intr_disable_spec d = ret
        ikern d = true ihost d = true
        ikern = true ihost = true.
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_kern:
       d ,
        serial_intr_disable_spec d = ret
        (ikern d = falsepg d = true init d = true) →
        (ikern = falsepg = true init = true).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_mm:
       d ,
        serial_intr_disable_spec d = ret
        (init d = trueMM_valid (MM d) (MMSize d)) →
        (init = trueMM_valid (MM ) (MMSize )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_correct_mm:
       d ,
        serial_intr_disable_spec d = ret
        (init d = trueMM_correct (MM d) (MMSize d)) →
        (init = trueMM_correct (MM ) (MMSize )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_mm_kern:
       d ,
        serial_intr_disable_spec d = ret
        (init d = trueMM_kern (MM d) (MMSize d)) →
        (init = trueMM_kern (MM ) (MMSize )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_mm_size:
       d ,
        serial_intr_disable_spec d = ret
        (init d = true → 0 < MMSize d Int.max_unsigned) →
        (init = true → 0 < MMSize Int.max_unsigned).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_CR4:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueCR3_valid (CR3 d)) →
        (pg = trueCR3_valid (CR3 )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_nps:
       d ,
        serial_intr_disable_spec d = ret
        (init d = true → 262144 nps d 1048576) →
        (init = true → 262144 nps 1048576).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_AT_kern:
       d ,
        serial_intr_disable_spec d = ret
        (init d = trueAT_kern (AT d) (nps d)) →
        (init = trueAT_kern (AT ) (nps )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_AT_usr:
       d ,
        serial_intr_disable_spec d = ret
        (init d = trueAT_usr (AT d) (nps d)) →
        (init = trueAT_usr (AT ) (nps )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pperm:
       d ,
        serial_intr_disable_spec d = ret
        (consistent_ppage (AT d) (pperm d) (nps d)) →
        (consistent_ppage (AT ) (pperm ) (nps )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_init_pperm:
       d ,
        serial_intr_disable_spec d = ret
        (init d = falsepperm d = ZMap.init PGUndef) →
        (init = falsepperm = ZMap.init PGUndef).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

for MPT
    Lemma serial_intr_disable_valid_kern_pt:
       d ,
        serial_intr_disable_spec d = ret
        (ipt d = falsepg d = true init d = true) →
        (ipt = falsepg = true init = true).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_iptt:
       d ,
        serial_intr_disable_spec d = ret
        (ipt d = trueikern d = true) →
        (ipt = trueikern = true).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_iptf:
       d ,
        serial_intr_disable_spec d = ret
        (ikern d = falseipt d = false) →
        (ikern = falseipt = false).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_PMap:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = truePMap_valid (ZMap.get (PT d) (ptpool d))) →
        (pg = truePMap_valid (ZMap.get (PT ) (ptpool ))).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_PMap_kern:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueipt d = truePMap_kern (ZMap.get (PT d) (ptpool d))) →
        (pg = trueipt = truePMap_kern (ZMap.get (PT ) (ptpool ))).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_PT:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = true → 0 PT d < num_proc) →
        (pg = true → 0 PT < num_proc).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_dirty:
       d ,
        serial_intr_disable_spec d = ret
        (dirty_ppage (pperm d) (HP d)) →
        (dirty_ppage (pperm ) (HP )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_uninitialized:
       d ,
        serial_intr_disable_spec d = ret
        (init d = false → ( n i pi pte, ZMap.get i (ZMap.get n (ptpool d)) PDEValid pi pte)) →
        (init = false → ( n i pi pte, ZMap.get i (ZMap.get n (ptpool )) PDEValid pi pte)).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_ihost:
       d ,
        serial_intr_disable_spec d = ret
        (ihost d = falsepg d = true init d = true ikern d = true) →
        (ihost = falsepg = true init = true ikern = true).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_preserves_tf:
       d ,
        serial_intr_disable_spec d = Some
        tf d = tf .
    Proof.
      intros.
      generalize (serial_intr_disable_preserves_all d H); intro.
      destruct H0 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]; try assumption).
    Qed.

    Lemma serial_intr_disable_CPU_ID_within_range:
       d ,
        serial_intr_disable_spec d = Some
        0 CPU_ID d < 8 →
        0 CPU_ID < 8.
    Proof.
      intros.
      generalize (serial_intr_disable_preserves_all d H); intros.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]); try omega.
    Qed.

    Lemma serial_intr_disable_cid_within_range:
       d ,
        serial_intr_disable_spec d = Some
        0 ZMap.get (CPU_ID d) (cid d) < num_proc
        0 ZMap.get (CPU_ID ) (cid ) < num_proc.
    Proof.
      intros.
      generalize (serial_intr_disable_preserves_all d H); intros.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]).
      rewrite <- H1; rewrite <- H2; auto.
    Qed.

    Lemma serial_intr_disable_preserves_valid_multi_oracle_pool:
       d ,
        serial_intr_disable_spec d = Some
        valid_multi_oracle_pool (multi_oracle d) →
        valid_multi_oracle_pool (multi_oracle ).
    Proof.
      intros.
      generalize (serial_intr_disable_preserves_all d H); intro.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]).
      rewrite <- H3; auto.
    Qed.

    Lemma serial_intr_disable_preserves_valid_multi_oracle_pool_H:
       d ,
        serial_intr_disable_spec d = Some
        valid_multi_oracle_pool_H (multi_oracle d) →
        valid_multi_oracle_pool_H (multi_oracle ).
    Proof.
      intros.
      generalize (serial_intr_disable_preserves_all d H); intro.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]).
      rewrite <- H3; auto.
    Qed.

    Lemma serial_intr_disable_preserves_valid_qlock_pool:
       d ,
        serial_intr_disable_spec d = Some
        (init d = truevalid_qlock_pool (multi_log d)) →
        (init = truevalid_qlock_pool (multi_log )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_preserves_valid_hlock_pool:
       d ,
        serial_intr_disable_spec d = Some
        (valid_hlock_pool (multi_log d)) →
        (valid_hlock_pool (multi_log )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_preserves_valid_AT_oracle_pool:
       d , serial_intr_disable_spec d = Some
                   valid_AT_oracle_pool (multi_oracle d) →
                   valid_AT_oracle_pool (multi_oracle ).
    Proof.
      intros; generalize (serial_intr_disable_preserves_all d H); intro.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]).
      rewrite <- H3; auto.
    Qed.

    Lemma serial_intr_disable_preserves_valid_AT_log_pool:
       d , serial_intr_disable_spec d = Some
                   (init d = truevalid_AT_log_pool (multi_log d) (nps d)) →
                   (init = truevalid_AT_log_pool (multi_log ) (nps )).
    Proof.
      intros; generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_nps2:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = true → 262144 nps d 1048576) →
        (pg = true → 262144 nps 1048576).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.


    Lemma serial_intr_disable_valid_ipt_pg:
       d ,
        serial_intr_disable_spec d = ret
        (ipt d = falsepg d = true) →
        (ipt = falsepg = true).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_ihost_pg_ikern:
       d ,
        serial_intr_disable_spec d = ret
        (ihost d = falsepg d = true ikern d = true) →
        (ihost = falsepg = true ikern = true).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.


    Lemma serial_intr_disable_valid_pg_pperm:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = falsepperm d = ZMap.init PGUndef) →
        (pg = falsepperm = ZMap.init PGUndef).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_PMap_valid:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = true
          i : Z, 0 i < num_procPMap_valid (ZMap.get i (ptpool d))) →
        (pg = true
          i : Z, 0 i < num_procPMap_valid (ZMap.get i (ptpool ))).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_ipt_PT:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueipt d = truePT d = 0) →
        (pg = trueipt = truePT = 0).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_PMap_kern:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = truePMap_kern (ZMap.get 0 (ptpool d))) →
        (pg = truePMap_kern (ZMap.get 0 (ptpool ))).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_IDPDE_init:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueIDPDE_init (idpde d)) →
        (pg = trueIDPDE_init (idpde )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_consistent_pmap2:
       d ,
        serial_intr_disable_spec d = ret
        (consistent_pmap (ptpool d) (pperm d) (AT d) (LAT d) (nps d)) →
        (consistent_pmap (ptpool ) (pperm ) (AT ) (LAT ) (nps )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_consistent_pmap_domain2:
       d ,
        serial_intr_disable_spec d = ret
        (consistent_pmap_domain (ptpool d) (pperm d) (LAT d) (nps d)) →
        (consistent_pmap_domain (ptpool ) (pperm ) (LAT ) (nps )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_consistent_lat_domain:
       d ,
        serial_intr_disable_spec d = ret
        (consistent_lat_domain (ptpool d) (LAT d) (nps d)) →
        (consistent_lat_domain (ptpool ) (LAT ) (nps )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_LATable_nil:
       d ,
        serial_intr_disable_spec d = ret
        (LATCTable_nil (LAT d) (AT d)) →
        (LATCTable_nil (LAT ) (AT )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_init:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = init d) →
        (pg = init ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_cused:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = truecused (ZMap.get 0 (AC d)) = true) →
        (pg = truecused (ZMap.get 0 (AC )) = true).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_AbTCBCorrect_range:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueAbTCBCorrect_range (abtcb d)) →
        (pg = trueAbTCBCorrect_range (abtcb )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_AbQCorrect_range:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueAbQCorrect_range (abq d)) →
        (pg = trueAbQCorrect_range (abq )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_NotInQ:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueNotInQ (AC d) (abtcb d)) →
        (pg = trueNotInQ (AC ) (abtcb )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_QCount:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueQCount (abtcb d) (abq d)) →
        (pg = trueQCount (abtcb ) (abq )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_pg_InQ:
       d ,
        serial_intr_disable_spec d = ret
        (pg d = trueInQ (abtcb d) (abq d)) →
        (pg = trueInQ (abtcb ) (abq )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_consistent_ppage_log:
       d ,
        serial_intr_disable_spec d = ret
        consistent_ppage_log (multi_log d) (pperm d) (nps d) →
        consistent_ppage_log (multi_log ) (pperm ) (nps ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Definition PMap_uninitialized (ptp: PMapPool) :=
       n i pi pte,
        ZMap.get i (ZMap.get n ptp) PDEValid pi pte.

    Lemma PMap_uninitialized_undef:
      PMap_uninitialized (ZMap.init (ZMap.init PDEUndef)).
    Proof.
      intros n. intros.
      repeat rewrite ZMap.gi. congruence.
    Qed.

    Lemma serial_intr_disable_valid_init_PMap_uninitialized:
       d ,
        serial_intr_disable_spec d = ret
        (init d = falsePMap_uninitialized (ptpool d)) →
        (init = falsePMap_uninitialized (ptpool )).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_valid_multi_oracle_pool_H1:
       d ,
        serial_intr_disable_spec d = ret
        valid_multi_oracle_pool_H1 (multi_oracle d) →
        valid_multi_oracle_pool_H1 (multi_oracle ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_valid_hlock_pool1:
       d ,
        serial_intr_disable_spec d = ret
        valid_hlock_pool1 (multi_log d) →
        valid_hlock_pool1 (multi_log ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_valid_AT_oracle_pool_H:
       d ,
        serial_intr_disable_spec d = ret
        valid_AT_oracle_pool_H (multi_oracle d) →
        valid_AT_oracle_pool_H (multi_oracle ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_valid_AT_log_pool_H:
       d ,
        serial_intr_disable_spec d = ret
        valid_AT_log_pool_H (multi_log d) →
        valid_AT_log_pool_H (multi_log ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Context`{oracle_ops: MultiOracleOps}.

    Lemma serial_intr_disable_valid_valid_big_oracle:
       d ,
        serial_intr_disable_spec d = ret
        valid_big_oracle (big_oracle d) →
        valid_big_oracle (big_oracle ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_valid_big_log:
       d ,
        serial_intr_disable_spec d = ret
        valid_big_log (big_log d) (CPU_ID d) →
        valid_big_log (big_log ) (CPU_ID ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_disable_valid_valid_lock_pool:
       d ,
        serial_intr_disable_spec d = ret
        valid_lock_pool_B (big_log d) →
        valid_lock_pool_B (big_log ).
    Proof.
      intros. generalize (serial_intr_disable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

  End INTR_DISABLE.

  Section INTR_ENABLE.

    Context `{waittime: WaitTime}.
    Context `{real_params: RealParams}.

    Lemma serial_intr_enable_aux_preserves_all:
       n d ,
        serial_intr_enable_aux n d = ret
        CPU_ID d = CPU_ID
        cid d = cid
        multi_oracle d = multi_oracle
        multi_log d = multi_log
        ti d = ti
        kctxt d = kctxt
        uctxt d = uctxt
        vmcs d = vmcs
        vmx d = vmx
        AC d = AC
        init d = init
        ikern d = ikern
        ihost d = ihost
        pg d = pg
        MM d = MM
        MMSize d = MMSize
        CR3 d = CR3
        nps d = nps
        AT d = AT
        ATC d = ATC
        pperm d = pperm
        ipt d = ipt
        PT d = PT
        ptpool d = ptpool
        HP d = HP
        LAT d = LAT
        idpde d = idpde
        abtcb d = abtcb
        abq d = abq
        cid d = cid
        tcb d = tcb
        tdq d = tdq
        syncchpool d = syncchpool
        uctxt d = uctxt
        ept d = ept
        tf d = tf
        sleeper d = sleeper
        lock d = lock
        smspool d = smspool
        big_log d = big_log
        big_oracle d = big_oracle
        ept d = ept
        vmcs d = vmcs
        vmx d = vmx
        vmxinfo d = vmxinfo .
    Proof.
      intros until n.
      induction n.
      {
        simpl.
        intros.
        inv H.
        repeat (split; [reflexivity|]); try reflexivity.
      }
      {
        simpl.
        intros.
        subdestruct.
        {
          eapply IHn in H.
          functional inversion Hdestruct0; subst;
          simpl in *; eauto.
        }
        {
          inv H.
          repeat (split; [reflexivity|]); try reflexivity.
        }
      }
    Qed.

    Lemma serial_intr_enable_preserves_all:
       d ,
        serial_intr_enable_spec d = ret
        CPU_ID d = CPU_ID
        cid d = cid
        multi_oracle d = multi_oracle
        multi_log d = multi_log
        ti d = ti
        kctxt d = kctxt
        uctxt d = uctxt
        vmcs d = vmcs
        vmx d = vmx
        AC d = AC
        init d = init
        ikern d = ikern
        ihost d = ihost
        pg d = pg
        MM d = MM
        MMSize d = MMSize
        CR3 d = CR3
        nps d = nps
        AT d = AT
        ATC d = ATC
        pperm d = pperm
        ipt d = ipt
        PT d = PT
        ptpool d = ptpool
        HP d = HP
        LAT d = LAT
        idpde d = idpde
        abtcb d = abtcb
        abq d = abq
        cid d = cid
        tcb d = tcb
        tdq d = tdq
        syncchpool d = syncchpool
        uctxt d = uctxt
        ept d = ept
        tf d = tf
        sleeper d = sleeper
        lock d = lock
        smspool d = smspool
        big_log d = big_log
        big_oracle d = big_oracle
        ept d = ept
        vmcs d = vmcs
        vmx d = vmx
        vmxinfo d = vmxinfo .
    Proof.
      intros.
      functional inversion H; simpl;
      apply (serial_intr_enable_aux_preserves_all INTR_ENABLE_REC_MAX (d { in_intr : true}) d0); assumption.
    Qed.

    Lemma serial_intr_enable_aux_rpos_within_range:
       n d ,
        serial_intr_enable_aux n d = ret
        0 rpos (console d) < 512 →
        0 rpos (console ) < 512.
    Proof.
      intros until n.
      induction n.
      {
        simpl.
        intros.
        inv H.
        eauto.
      }
      {
        simpl.
        intros.
        subdestruct.
        {
          eapply IHn in H; simpl in *; try assumption.
          functional inversion Hdestruct0; subst; simpl in *; eauto.
          apply Z.mod_bound_pos.
          omega.
          omega.
        }
        {
          inv H.
          eauto.
        }
      }
    Qed.

    Open Scope Z_scope.
    Lemma serial_intr_enable_rpos_within_range:
       d ,
        serial_intr_enable_spec d = ret
        0 rpos (console d) < 512 →
        0 rpos (console ) < 512.
    Proof.
      intros.
      functional inversion H; simpl;
      apply (serial_intr_enable_aux_rpos_within_range INTR_ENABLE_REC_MAX (d { in_intr : true}) d0); assumption.
    Qed.

    Lemma serial_intr_enable_aux_cons_buf_length_within_range:
       n d ,
        serial_intr_enable_aux n d = ret
        0 Zlength (cons_buf (console d)) < 512 →
        0 Zlength (cons_buf (console )) < 512.
    Proof.
      intros until n.
      induction n.
      {
        simpl.
        intros.
        inv H.
        eauto.
      }
      {
        simpl.
        intros.
        subdestruct.
        {
          eapply IHn in H; simpl in *; try eassumption.
          functional inversion Hdestruct0; simpl in *; eauto.
          split. apply Zlength_ge_0. omega.
          split. apply Zlength_ge_0. repeat solve_list. repeat toZ.
          omega.
          generalize _x10. repeat solve_list. intros. omega. omega.
          generalize _x10. repeat solve_list. intros. omega.
        }
        {
          inv H; eauto.
        }
      }
    Qed.

    Lemma serial_intr_enable_cons_buf_length_within_range:
       d ,
        serial_intr_enable_spec d = ret
        0 Zlength (cons_buf (console d)) < 512 →
        0 Zlength (cons_buf (console )) < 512.
    Proof.
      intros.
      functional inversion H; simpl;
      apply (serial_intr_enable_aux_cons_buf_length_within_range INTR_ENABLE_REC_MAX (d { in_intr : true}) d0); assumption.
    Qed.

    Lemma serial_intr_enable_aux_cons_buf_tl_length_within_range:
       n d x tl,
        serial_intr_enable_aux n d = ret
        0 Zlength (cons_buf (console d)) < 512 →
        cons_buf (console ) = x :: tl
        0 Zlength tl < 512.
    Proof.
      intros.
      generalize (serial_intr_enable_aux_cons_buf_length_within_range n d H H0).
      rewrite H1. generalize H0. solve_list.
      intros. split. apply Zlength_ge_0. omega.
    Qed.

    Require Import FutureTactic.
    Lemma serial_intr_enable_cr2_injection:
       d m,
        serial_intr_enable_spec d = ret
        val_inject (Mem.flat_inj m) (snd (ti d)) (snd (ti d)) →
        val_inject (Mem.flat_inj m) (snd (ti )) (snd (ti )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_enable_cr2_type:
       d ,
        serial_intr_enable_spec d = ret
        Val.has_type (snd (ti d)) Tint
        Val.has_type (snd (ti )) Tint.
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_enable_kctxt_INJECT:
       d m,
        serial_intr_enable_spec d = ret
        kctxt_inject_neutral (kctxt d) m
        kctxt_inject_neutral (kctxt ) m.
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_enable_uctxt_INJECT:
       d m,
        serial_intr_enable_spec d = ret
        uctxt_inject_neutral (uctxt d) m
        uctxt_inject_neutral (uctxt ) m.
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_enable_VMCS_inject_neutral:
       d m,
        serial_intr_enable_spec d = ret
        VMCSPool_inject_neutral (vmcs d) m
        VMCSPool_inject_neutral (vmcs ) m.
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_enable_VMX_inject_neutral:
       d m,
        serial_intr_enable_spec d = ret
        VMXPool_inject_neutral (vmx d) m
        VMXPool_inject_neutral (vmx ) m.
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_enable_Container_valid:
       d ,
        serial_intr_enable_spec d = ret
        Container_valid (AC d) →
        Container_valid (AC ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. assumption.
    Qed.

    Lemma serial_intr_enable_valid_preinit_container:
       d ,
        serial_intr_enable_spec d = ret
        (init d = false
          x : Z, 0 x < num_proccused (ZMap.get x (AC d)) true) →
        (init = false
          x : Z, 0 x < num_proccused (ZMap.get x (AC )) true).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_preserves_ikernhost:
       d ,
        serial_intr_enable_spec d = ret
        ikern d = true ihost d = true
        ikern = true ihost = true.
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_kern:
       d ,
        serial_intr_enable_spec d = ret
        (ikern d = falsepg d = true init d = true) →
        (ikern = falsepg = true init = true).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_mm:
       d ,
        serial_intr_enable_spec d = ret
        (init d = trueMM_valid (MM d) (MMSize d)) →
        (init = trueMM_valid (MM ) (MMSize )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_correct_mm:
       d ,
        serial_intr_enable_spec d = ret
        (init d = trueMM_correct (MM d) (MMSize d)) →
        (init = trueMM_correct (MM ) (MMSize )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_mm_kern:
       d ,
        serial_intr_enable_spec d = ret
        (init d = trueMM_kern (MM d) (MMSize d)) →
        (init = trueMM_kern (MM ) (MMSize )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_mm_size:
       d ,
        serial_intr_enable_spec d = ret
        (init d = true → 0 < MMSize d Int.max_unsigned) →
        (init = true → 0 < MMSize Int.max_unsigned).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_CR4:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueCR3_valid (CR3 d)) →
        (pg = trueCR3_valid (CR3 )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_nps:
       d ,
        serial_intr_enable_spec d = ret
        (init d = true → 262144 nps d 1048576) →
        (init = true → 262144 nps 1048576).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_AT_kern:
       d ,
        serial_intr_enable_spec d = ret
        (init d = trueAT_kern (AT d) (nps d)) →
        (init = trueAT_kern (AT ) (nps )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_AT_usr:
       d ,
        serial_intr_enable_spec d = ret
        (init d = trueAT_usr (AT d) (nps d)) →
        (init = trueAT_usr (AT ) (nps )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pperm:
       d ,
        serial_intr_enable_spec d = ret
        (consistent_ppage (AT d) (pperm d) (nps d)) →
        (consistent_ppage (AT ) (pperm ) (nps )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_init_pperm:
       d ,
        serial_intr_enable_spec d = ret
        (init d = falsepperm d = ZMap.init PGUndef) →
        (init = falsepperm = ZMap.init PGUndef).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

for MPT
    Lemma serial_intr_enable_valid_kern_pt:
       d ,
        serial_intr_enable_spec d = ret
        (ipt d = falsepg d = true init d = true) →
        (ipt = falsepg = true init = true).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_iptt:
       d ,
        serial_intr_enable_spec d = ret
        (ipt d = trueikern d = true) →
        (ipt = trueikern = true).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_iptf:
       d ,
        serial_intr_enable_spec d = ret
        (ikern d = falseipt d = false) →
        (ikern = falseipt = false).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_PMap:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = truePMap_valid (ZMap.get (PT d) (ptpool d))) →
        (pg = truePMap_valid (ZMap.get (PT ) (ptpool ))).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_PMap_kern:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueipt d = truePMap_kern (ZMap.get (PT d) (ptpool d))) →
        (pg = trueipt = truePMap_kern (ZMap.get (PT ) (ptpool ))).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_PT:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = true → 0 PT d < num_proc) →
        (pg = true → 0 PT < num_proc).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_dirty:
       d ,
        serial_intr_enable_spec d = ret
        (dirty_ppage (pperm d) (HP d)) →
        (dirty_ppage (pperm ) (HP )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_uninitialized:
       d ,
        serial_intr_enable_spec d = ret
        (init d = false → ( n i pi pte, ZMap.get i (ZMap.get n (ptpool d)) PDEValid pi pte)) →
        (init = false → ( n i pi pte, ZMap.get i (ZMap.get n (ptpool )) PDEValid pi pte)).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_ihost:
       d ,
        serial_intr_enable_spec d = ret
        (ihost d = falsepg d = true init d = true ikern d = true) →
        (ihost = falsepg = true init = true ikern = true).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_preserves_tf:
       d ,
        serial_intr_enable_spec d = Some
        tf d = tf .
    Proof.
      intros.
      generalize (serial_intr_enable_preserves_all d H); intro.
      destruct H0 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]; try assumption).
    Qed.

    Lemma serial_intr_enable_CPU_ID_within_range:
       d ,
        serial_intr_enable_spec d = Some
        0 CPU_ID d < 8 →
        0 CPU_ID < 8.
    Proof.
      intros.
      generalize (serial_intr_enable_preserves_all d H); intros.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]); try omega.
    Qed.

    Lemma serial_intr_enable_cid_within_range:
       d ,
        serial_intr_enable_spec d = Some
        0 ZMap.get (CPU_ID d) (cid d) < num_proc
        0 ZMap.get (CPU_ID ) (cid ) < num_proc.
    Proof.
      intros.
      generalize (serial_intr_enable_preserves_all d H); intros.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]).
      rewrite <- H1; rewrite <- H2; auto.
    Qed.

    Lemma serial_intr_enable_preserves_valid_multi_oracle_pool:
       d ,
        serial_intr_enable_spec d = Some
        valid_multi_oracle_pool (multi_oracle d) →
        valid_multi_oracle_pool (multi_oracle ).
    Proof.
      intros.
      generalize (serial_intr_enable_preserves_all d H); intro.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]).
      rewrite <- H3; auto.
    Qed.

    Lemma serial_intr_enable_preserves_valid_multi_oracle_pool_H:
       d ,
        serial_intr_enable_spec d = Some
        valid_multi_oracle_pool_H (multi_oracle d) →
        valid_multi_oracle_pool_H (multi_oracle ).
    Proof.
      intros.
      generalize (serial_intr_enable_preserves_all d H); intro.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]).
      rewrite <- H3; auto.
    Qed.

    Lemma serial_intr_enable_preserves_valid_qlock_pool:
       d ,
        serial_intr_enable_spec d = Some
        (init d = truevalid_qlock_pool (multi_log d)) →
        (init = truevalid_qlock_pool (multi_log )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_preserves_valid_hlock_pool:
       d ,
        serial_intr_enable_spec d = Some
        (valid_hlock_pool (multi_log d)) →
        (valid_hlock_pool (multi_log )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_preserves_valid_AT_oracle_pool:
       d , serial_intr_enable_spec d = Some
                   valid_AT_oracle_pool (multi_oracle d) →
                   valid_AT_oracle_pool (multi_oracle ).
    Proof.
      intros; generalize (serial_intr_enable_preserves_all d H); intro.
      destruct H1 as [? Htmp].
      repeat (destruct Htmp as [? Htmp]).
      rewrite <- H3; auto.
    Qed.

    Lemma serial_intr_enable_preserves_valid_AT_log_pool:
       d , serial_intr_enable_spec d = Some
                   (init d = truevalid_AT_log_pool (multi_log d) (nps d)) →
                   (init = truevalid_AT_log_pool (multi_log ) (nps )).
    Proof.
      intros; generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_nps2:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = true → 262144 nps d 1048576) →
        (pg = true → 262144 nps 1048576).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.


    Lemma serial_intr_enable_valid_ipt_pg:
       d ,
        serial_intr_enable_spec d = ret
        (ipt d = falsepg d = true) →
        (ipt = falsepg = true).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_ihost_pg_ikern:
       d ,
        serial_intr_enable_spec d = ret
        (ihost d = falsepg d = true ikern d = true) →
        (ihost = falsepg = true ikern = true).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.


    Lemma serial_intr_enable_valid_pg_pperm:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = falsepperm d = ZMap.init PGUndef) →
        (pg = falsepperm = ZMap.init PGUndef).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_PMap_valid:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = true
          i : Z, 0 i < num_procPMap_valid (ZMap.get i (ptpool d))) →
        (pg = true
          i : Z, 0 i < num_procPMap_valid (ZMap.get i (ptpool ))).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_ipt_PT:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueipt d = truePT d = 0) →
        (pg = trueipt = truePT = 0).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_PMap_kern:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = truePMap_kern (ZMap.get 0 (ptpool d))) →
        (pg = truePMap_kern (ZMap.get 0 (ptpool ))).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_IDPDE_init:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueIDPDE_init (idpde d)) →
        (pg = trueIDPDE_init (idpde )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_consistent_pmap2:
       d ,
        serial_intr_enable_spec d = ret
        (consistent_pmap (ptpool d) (pperm d) (AT d) (LAT d) (nps d)) →
        (consistent_pmap (ptpool ) (pperm ) (AT ) (LAT ) (nps )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_consistent_pmap_domain2:
       d ,
        serial_intr_enable_spec d = ret
        (consistent_pmap_domain (ptpool d) (pperm d) (LAT d) (nps d)) →
        (consistent_pmap_domain (ptpool ) (pperm ) (LAT ) (nps )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_consistent_lat_domain:
       d ,
        serial_intr_enable_spec d = ret
        (consistent_lat_domain (ptpool d) (LAT d) (nps d)) →
        (consistent_lat_domain (ptpool ) (LAT ) (nps )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_LATable_nil:
       d ,
        serial_intr_enable_spec d = ret
        (LATCTable_nil (LAT d) (AT d)) →
        (LATCTable_nil (LAT ) (AT )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_init:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = init d) →
        (pg = init ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_cused:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = truecused (ZMap.get 0 (AC d)) = true) →
        (pg = truecused (ZMap.get 0 (AC )) = true).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_AbTCBCorrect_range:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueAbTCBCorrect_range (abtcb d)) →
        (pg = trueAbTCBCorrect_range (abtcb )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_AbQCorrect_range:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueAbQCorrect_range (abq d)) →
        (pg = trueAbQCorrect_range (abq )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_NotInQ:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueNotInQ (AC d) (abtcb d)) →
        (pg = trueNotInQ (AC ) (abtcb )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_QCount:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueQCount (abtcb d) (abq d)) →
        (pg = trueQCount (abtcb ) (abq )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_pg_InQ:
       d ,
        serial_intr_enable_spec d = ret
        (pg d = trueInQ (abtcb d) (abq d)) →
        (pg = trueInQ (abtcb ) (abq )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_consistent_ppage_log:
       d ,
        serial_intr_enable_spec d = ret
        consistent_ppage_log (multi_log d) (pperm d) (nps d) →
        consistent_ppage_log (multi_log ) (pperm ) (nps ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_init_PMap_uninitialized:
       d ,
        serial_intr_enable_spec d = ret
        (init d = falsePMap_uninitialized (ptpool d)) →
        (init = falsePMap_uninitialized (ptpool )).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_valid_multi_oracle_pool_H1:
       d ,
        serial_intr_enable_spec d = ret
        valid_multi_oracle_pool_H1 (multi_oracle d) →
        valid_multi_oracle_pool_H1 (multi_oracle ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_valid_hlock_pool1:
       d ,
        serial_intr_enable_spec d = ret
        valid_hlock_pool1 (multi_log d) →
        valid_hlock_pool1 (multi_log ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_valid_AT_oracle_pool_H:
       d ,
        serial_intr_enable_spec d = ret
        valid_AT_oracle_pool_H (multi_oracle d) →
        valid_AT_oracle_pool_H (multi_oracle ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_valid_AT_log_pool_H:
       d ,
        serial_intr_enable_spec d = ret
        valid_AT_log_pool_H (multi_log d) →
        valid_AT_log_pool_H (multi_log ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Context`{oracle_ops: MultiOracleOps}.

    Lemma serial_intr_enable_valid_valid_big_oracle:
       d ,
        serial_intr_enable_spec d = ret
        valid_big_oracle (big_oracle d) →
        valid_big_oracle (big_oracle ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_valid_big_log:
       d ,
        serial_intr_enable_spec d = ret
        valid_big_log (big_log d) (CPU_ID d) →
        valid_big_log (big_log ) (CPU_ID ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

    Lemma serial_intr_enable_valid_valid_lock_pool:
       d ,
        serial_intr_enable_spec d = ret
        valid_lock_pool_B (big_log d) →
        valid_lock_pool_B (big_log ).
    Proof.
      intros. generalize (serial_intr_enable_preserves_all d H).
      intros Hpre. blast Hpre. eauto.
    Qed.

  End INTR_ENABLE.

End INTERRUPT_INV.

Ltac rest :=
  match goal with
    | Hs: serial_intr_disable_spec _ = _ |- _
      pose proof (serial_intr_disable_preserves_all _ _ Hs) as Hs´;
        blast Hs´; eauto
    | Hs: serial_intr_enable_spec _ = _ |- _
      pose proof (serial_intr_enable_preserves_all _ _ Hs) as Hs´;
        blast Hs´; eauto
  end.

Create HintDb serial_intr_disable_invariantdb discriminated.

Hint Resolve serial_intr_disable_cr2_injection: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_cr2_type: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_kctxt_INJECT: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_uctxt_INJECT: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_VMCS_inject_neutral: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_VMX_inject_neutral: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_Container_valid: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_preinit_container: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_rpos_within_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_cons_buf_length_within_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_preserves_ikernhost: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_kern: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_mm: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_correct_mm: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_mm_kern: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_mm_size: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_CR4: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_ihost: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_nps: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_AT_kern: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_AT_usr: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pperm: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_init_pperm: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_kern_pt: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_iptt: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_iptf: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_PMap: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_PMap_kern: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_PT: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_dirty: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_uninitialized: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_aux_preserves_all: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_aux_rpos_within_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_aux_cons_buf_length_within_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_aux_cons_buf_tl_length_within_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_preserves_tf: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_CPU_ID_within_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_cid_within_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_preserves_valid_multi_oracle_pool: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_preserves_valid_multi_oracle_pool_H: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_preserves_valid_qlock_pool: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_preserves_valid_hlock_pool: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_preserves_valid_AT_oracle_pool: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_preserves_valid_AT_log_pool: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_nps2: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_ipt_pg: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_ihost_pg_ikern: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_pperm: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_PMap_valid: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_ipt_PT: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_PMap_kern: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_IDPDE_init: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_consistent_pmap2: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_consistent_pmap_domain2: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_consistent_lat_domain: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_LATable_nil: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_init: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_cused: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_AbTCBCorrect_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_AbQCorrect_range: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_NotInQ: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_QCount: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_pg_InQ: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_consistent_ppage_log: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_init_PMap_uninitialized: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_valid_multi_oracle_pool_H1: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_valid_hlock_pool1: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_valid_AT_oracle_pool_H: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_valid_AT_log_pool_H: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_valid_big_oracle: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_valid_big_log: serial_intr_disable_invariantdb.
Hint Resolve serial_intr_disable_valid_valid_lock_pool: serial_intr_disable_invariantdb.

Create HintDb serial_intr_enable_invariantdb discriminated.

Hint Resolve serial_intr_enable_cr2_injection: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_cr2_type: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_kctxt_INJECT: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_uctxt_INJECT: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_VMCS_inject_neutral: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_VMX_inject_neutral: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_Container_valid: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_preinit_container: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_rpos_within_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_cons_buf_length_within_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_preserves_ikernhost: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_kern: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_mm: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_correct_mm: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_mm_kern: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_mm_size: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_CR4: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_ihost: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_nps: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_AT_kern: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_AT_usr: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pperm: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_init_pperm: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_kern_pt: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_iptt: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_iptf: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_PMap: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_PMap_kern: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_PT: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_dirty: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_uninitialized: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_aux_preserves_all: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_aux_rpos_within_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_aux_cons_buf_length_within_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_aux_cons_buf_tl_length_within_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_preserves_tf: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_CPU_ID_within_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_cid_within_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_preserves_valid_multi_oracle_pool: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_preserves_valid_multi_oracle_pool_H: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_preserves_valid_qlock_pool: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_preserves_valid_hlock_pool: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_preserves_valid_AT_oracle_pool: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_preserves_valid_AT_log_pool: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_nps2: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_ipt_pg: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_ihost_pg_ikern: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_pperm: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_PMap_valid: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_ipt_PT: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_PMap_kern: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_IDPDE_init: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_consistent_pmap2: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_consistent_pmap_domain2: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_consistent_lat_domain: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_LATable_nil: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_init: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_cused: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_AbTCBCorrect_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_AbQCorrect_range: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_NotInQ: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_QCount: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_pg_InQ: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_consistent_ppage_log: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_init_PMap_uninitialized: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_valid_multi_oracle_pool_H1: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_valid_hlock_pool1: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_valid_AT_oracle_pool_H: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_valid_AT_log_pool_H: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_valid_big_oracle: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_valid_big_log: serial_intr_enable_invariantdb.
Hint Resolve serial_intr_enable_valid_valid_lock_pool: serial_intr_enable_invariantdb.