• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
      • X86isa
        • Program-execution
          • Dynamic-instrumentation
          • Initialize-x86-state
          • Binary-file-load-fn
          • Read-channel-into-memory
          • Setting-up-page-tables
          • Read-channel-into-byte-list
          • Init-zero-page
          • Linux-load
          • Read-file-into-memory
          • Read-file-into-byte-list
          • Init-sys-view
            • Load-elf-sections
            • Chars-to-c-str
            • String-to-c-str
            • Pack-u64
            • Pack-u32
            • Concrete-simulation-examples
            • Gdt-entry
          • Sdm-instruction-set-summary
          • Tlb
          • 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
    • Program-execution

    Init-sys-view

    Switches the model to the system-level view and load our default configuration of 1G page tables.

    Signature
    (init-sys-view paging-base-addr x86) → x86
    Returns
    x86 — Type (x86p x86), given (and (x86p x86) (unsigned-byte-p 52 paging-base-addr)).

    Definitions and Theorems

    Function: init-sys-view

    (defun init-sys-view (paging-base-addr x86)
     (declare (xargs :stobjs (x86)))
     (declare (type (unsigned-byte 52)
                    paging-base-addr))
     (declare (xargs :guard (equal (loghead 12 paging-base-addr)
                                   0)))
     (let ((__function__ 'init-sys-view))
       (declare (ignorable __function__))
       (b*
        ((ctx 'init-sys-view)
         ((when (not (mbt (equal (loghead 12 paging-base-addr)
                                 0))))
          (!!ms-fresh :misaligned-paging-base-address paging-base-addr))
         (paging-base-addr40 (logtail 12 paging-base-addr))
         (x86 (!app-view nil x86))
         (cr0 (n32 (ctri 0 x86)))
         (cr4 (n21 (ctri 4 x86)))
         (x86 (!ctri 0 (!cr0bits->pg 1 cr0) x86))
         (x86 (!ctri 4 (!cr4bits->pae 1 cr4) x86))
         (x86 (!ctri 3
                     (!cr3bits->pdb paging-base-addr40 (ctri 3 x86))
                     x86))
         (efer (n12 (msri 0 x86)))
         (x86 (!msri 0 (!ia32_eferbits->lme 1 efer)
                     x86))
         (x86 (load-qwords-into-physical-memory-list
                   (construct-page-tables paging-base-addr)
                   x86)))
        x86)))

    Theorem: x86p-of-init-sys-view

    (defthm x86p-of-init-sys-view
      (implies (and (x86p x86)
                    (unsigned-byte-p 52 paging-base-addr))
               (b* ((x86 (init-sys-view paging-base-addr x86)))
                 (x86p x86)))
      :rule-classes :rewrite)