Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform: extend the way pages are identified for validation/invalidation #461

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Commits on Sep 23, 2024

  1. platform: permit page validation by physical or by virtual address

    In general, page validation should be performed by physical address,
    which is required on certain platforms; platforms that require
    validation by virtual address can create a temporary virtual mapping to
    describe the physical page being validated.  However, in certain
    contexts (like stage2), temporary mapping is not possible, and the pages
    to be validate already have virtual mapping, so a mechanism to validate
    by virtual address is retained solely for use in those limited cases
    where a virtual mapping already exists in such a restricted context.
    
    Signed-off-by: Jon Lange <[email protected]>
    msft-jlange committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    52c6067 View commit details
    Browse the repository at this point in the history
  2. efer: require the unconditional use of EFER.NXE

    All processors that support virtualization also support NX.  Therefore,
    there is no reason to detect NX via CPUID, and EFER.NXE can be enabled
    very early in boot, unconditionally, for simplicity in managing page
    tables.
    
    Signed-off-by: Jon Lange <[email protected]>
    msft-jlange committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    33716a6 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2024

  1. mm/pagetable: use self map to implement virt_to_phys

    It is possible to insert a reference to the current page table into the
    page table itself, creating a recursive "self-map".  This permits access
    to any PTE in the address space by taking advantage of the hierarchical
    property of page tables, using the CPU's own page table walker to obtain
    the PTE contents.  This change inserts a self-map entry into every page
    table, and reimplements `virt_to_phys()` to use the self map so that it
    is possible to translate any VA to a PA without requiring either the VA
    or the PA to be within the bounds of any known address range.
    
    Signed-off-by: Jon Lange <[email protected]>
    msft-jlange committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    be5c477 View commit details
    Browse the repository at this point in the history
  2. platform: add virt_to_phys checks for debugging

    Some platforms will require translation from virtual to physical address
    in order to perform page validation by virtual address.  Therefore, on
    other platforms, force a call to `virt_to_phys()` in debug builds to
    increas the number of test environments that can detect possible
    translation failures to add in debugging.
    
    Signed-off-by: Jon Lange <[email protected]>
    msft-jlange committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    c73c9fb View commit details
    Browse the repository at this point in the history