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

cpu/percpu: store safe references to HV doorbell page and SVSM VMSA #387

Merged
merged 5 commits into from
Jun 25, 2024

Commits on Jun 19, 2024

  1. cpu/percpu: store a safe reference to the HV doorbell page

    Mutable references to the HV doorbell page are never given, as its
    data is fully atomic. Thus, there is no need to use raw pointers.
    
    Since we need a pointer to the location of the safe reference itself
    in the PerCpu for #HV servicing, use a OnceCell, which gives out
    references to the inner T under the assumption that the type can only
    be set once, which suits our use. With a &T (in this case a &&'static
    HVDoorbell), we can obtain a pointer to the inner value.
    
    Signed-off-by: Carlos López <[email protected]>
    00xc committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    ddc2be5 View commit details
    Browse the repository at this point in the history
  2. cpu/percpu: add some documentation

    Document some parts of the PerCpu that might not be straightforward to
    understand.
    
    Signed-off-by: Carlos López <[email protected]>
    00xc committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    45bc262 View commit details
    Browse the repository at this point in the history
  3. cpu/percpu: merge SVSM VMSA initialization steps into one

    There is no need for the several steps of SVSM VMSA initialization to
    be split up, and they only make for a more awkward initialization.
    Thus, merge them into a single PerCpu method.
    
    Signed-off-by: Carlos López <[email protected]>
    00xc committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    4358859 View commit details
    Browse the repository at this point in the history
  4. cpu/smp: clean up error handling in start_cpu()

    start_cpu() had several calls to expect() on various error conditions.
    Clean up the function by returning the error and letting the caller
    panic with the specific error.
    
    Signed-off-by: Carlos López <[email protected]>
    00xc committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    8461fc5 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2024

  1. cpu/percpu: store an immutable reference to the SVSM VMSA

    The SVSM VMSA only needs to me mutated during initialization. Thus
    simply encapsulate that step in a PerCpu method and store an
    immutable reference to the VMSA, avoiding the possibility of mutably
    aliasing it.
    
    This obsoletes the VmsaRef type.
    
    Signed-off-by: Carlos López <[email protected]>
    00xc committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    54d62da View commit details
    Browse the repository at this point in the history