DGP isolation lifecycle and authorization implementation. More...
import std;import arch.s390x.mmu.types;import zxfoundation.base.config;import zxfoundation.sched.policy;import zxfoundation.sync.lockable;import zxfoundation.dgp.domain.types;import zxfoundation.dgp.memory_contract;import lib.error;import zxfoundation.dgp.isolation.types;import zxfoundation.base.typestate;import zxfoundation.base.types;Data Structures | |
| class | zxfoundation::dgp::isolation::detail::storage_key_lock_guard |
Enumerations | |
| enum class | zxfoundation::dgp::isolation::lifecycle_state |
| Unified lifecycle states for ALL typestate-tracked resources. More... | |
Functions | |
| auto | zxfoundation::dgp::isolation::activate_domain (lifecycle_state &state, arch::s390x::mmu::typed_asce< arch::s390x::mmu::dat_level::region_1 > asce, u64 root_phys, u8 storage_key) noexcept -> std::expected< void, lib::kernel_error > |
| Activate a sealed DGP isolation domain. | |
| auto | zxfoundation::dgp::isolation::detail::allocate_storage_key (u8 requested) noexcept -> std::expected< u8, lib::kernel_error > |
| auto | zxfoundation::dgp::isolation::begin_portal_teardown (lifecycle_state &state, std::atomic< u16 > &revocation_epoch) noexcept -> std::expected< void, lib::kernel_error > |
| Record that a portal authority is leaving the active DGP set. | |
| auto | zxfoundation::dgp::isolation::begin_portal_teardown (lifecycle_state &state, u16 &revocation_epoch) noexcept -> std::expected< void, lib::kernel_error > |
| auto | zxfoundation::dgp::isolation::begin_storage_key_revocation (lifecycle_state &state, skey_revocation_state &storage_key_state, std::atomic< u16 > &revocation_epoch) noexcept -> std::expected< void, lib::kernel_error > |
| Begin revocation of the storage-key authority attached to a DGP domain. | |
| auto | zxfoundation::dgp::isolation::begin_storage_key_revocation (lifecycle_state &state, skey_revocation_state &storage_key_state, u16 &revocation_epoch) noexcept -> std::expected< void, lib::kernel_error > |
| auto | zxfoundation::dgp::isolation::bind_asce_root (isolation_domain_state &state, lifecycle_state current_ls, arch::s390x::mmu::typed_asce< arch::s390x::mmu::dat_level::region_1 > asce, u64 root_phys) noexcept -> std::expected< void, lib::kernel_error > |
| Attach committed DAT root state to a DGP isolation domain. | |
| auto | zxfoundation::dgp::isolation::complete_storage_key_revocation (lifecycle_state &state, u8 &storage_key, u32 &storage_key_generation, skey_revocation_state &storage_key_state) noexcept -> std::expected< void, lib::kernel_error > |
| Complete storage-key revocation after required translation invalidation is done. | |
| auto | zxfoundation::dgp::isolation::create_domain (u32 domain_id, const isolation_policy &policy) noexcept -> std::expected< isolation_domain_state, lib::kernel_error > |
| Create initial DGP isolation state for a domain. | |
| auto | zxfoundation::dgp::isolation::destroy_domain (lifecycle_state &state, u8 &storage_key, u32 &storage_key_generation, skey_revocation_state &storage_key_state, std::atomic< u16 > &revocation_epoch) noexcept -> std::expected< void, lib::kernel_error > |
| Destroy DGP isolation state for a domain. | |
| auto | zxfoundation::dgp::isolation::destroy_domain (lifecycle_state &state, u8 &storage_key, u32 &storage_key_generation, skey_revocation_state &storage_key_state, u16 &revocation_epoch) noexcept -> std::expected< void, lib::kernel_error > |
| auto | zxfoundation::dgp::isolation::detail::generic_invalid_arg () noexcept -> lib::kernel_error |
| auto | zxfoundation::dgp::isolation::init () noexcept -> void |
| Initialize the DGP isolation clean core. | |
| auto | zxfoundation::dgp::isolation::detail::mask_is_valid (zxfoundation::sched::sched_mask mask, u32 limit) noexcept -> bool |
| auto | zxfoundation::dgp::isolation::detail::memory_out_of_memory () noexcept -> lib::kernel_error |
| auto | zxfoundation::dgp::isolation::detail::release_storage_key (u8 key) noexcept -> u32 |
| auto | zxfoundation::dgp::isolation::revoke_domain_rights (zxfoundation::dgp::domain::domain &d, dgp::isolation::isolation_rights drop_mask) noexcept -> std::expected< void, lib::kernel_error > |
| Lazy revocation of DGP rights on a domain. | |
| auto | zxfoundation::dgp::isolation::detail::storage_key_generation (u8 key) noexcept -> u32 |
| auto | zxfoundation::dgp::isolation::validate_gate_entry (u32 caller_domain_id, u32 gate_id, dgp::isolation::isolation_rights requested) noexcept -> std::expected< void, lib::kernel_error > |
| Validate entry into a DGP gate chokepoint (structural validation only). | |
| auto | zxfoundation::dgp::isolation::validate_portal (u32 source_domain_id, u32 target_domain_id, u64 va_start, u64 va_end, dgp::isolation::isolation_rights requested) noexcept -> std::expected< void, lib::kernel_error > |
| Validate creation or use of a DGP portal. | |
| auto | zxfoundation::dgp::isolation::validate_scheduler_admission (const lifecycle_state state, u64 root_phys, u64 asce_raw) noexcept -> std::expected< void, lib::kernel_error > |
| Validate that a DGP domain may be admitted to a CPU run queue. | |
| auto | zxfoundation::dgp::isolation::validate_scheduler_policy (const lifecycle_state state, const zxfoundation::sched::sched_policy &policy, bool has_rt_authority) noexcept -> std::expected< zxfoundation::sched::sched_admission_result, lib::kernel_error > |
| Validate a scheduler policy against DGP authority and basic safety invariants. | |
Variables | |
| static std::atomic< bool > | zxfoundation::dgp::isolation::detail::g_isolation_initialized {false} |
| static u32 | zxfoundation::dgp::isolation::detail::g_storage_key_generation [STORAGE_KEY_COUNT] {} |
| static std::atomic< u32 > | zxfoundation::dgp::isolation::detail::g_storage_key_lock {0U} |
| static bool | zxfoundation::dgp::isolation::detail::g_storage_key_used [STORAGE_KEY_COUNT] {} |
DGP isolation lifecycle and authorization implementation.
SPDX-License-Identifier: Apache-2.0
|
strong |
Unified lifecycle states for ALL typestate-tracked resources.
Every SCOMS-managed object, every folio, and every slab cache uses exactly these states. No subsystem may define its own.
|
nodiscardexportnoexcept |
Activate a sealed DGP isolation domain.
| [in] | state | Isolation state to activate. |
| [in] | asce | Typed region-first ASCE constructed from the committed DAT root. |
| [in] | root_phys | Physical address of the committed region-first root table. |
| [in] | storage_key | The domain's hardware storage key. |
| [in] | state | Isolation state to activate. |
| [in] | asce | Typed region-first ASCE constructed from the committed DAT root. |
| [in] | root_phys | Physical address of the committed region-first root table. |
| [in] | storage_key | The domain's hardware storage key. |
|
nodiscardexportnoexcept |
Record that a portal authority is leaving the active DGP set.
| [in,out] | state | Isolation state for the source domain that held the portal. |
| [in,out] | revocation_epoch | Revocation epoch counter. |
| [in,out] | state | Isolation state for the source domain that held the portal. |
| [in,out] | revocation_epoch | Revocation epoch counter. |
|
nodiscardexportnoexcept |
Begin revocation of the storage-key authority attached to a DGP domain.
| [in,out] | state | Isolation state whose key is entering the draining phase. |
| [in,out] | state | Isolation state whose key is entering the draining phase. |
|
nodiscardexportnoexcept |
Attach committed DAT root state to a DGP isolation domain.
| [in] | state | Isolation state to update. |
| [in] | current_ls | Current lifecycle state (from ko.state) — must be sealed. |
| [in] | asce | Typed region-first ASCE constructed from the committed DAT root. |
| [in] | root_phys | Physical address of the committed region-first root table. |
| [in] | state | Isolation state to update. |
| [in] | current_ls | Current lifecycle state (from ko.state) — must be sealed. |
| [in] | asce | Typed region-first ASCE constructed from the committed DAT root. |
| [in] | root_phys | Physical address of the committed region-first root table. |
|
nodiscardexportnoexcept |
Complete storage-key revocation after required translation invalidation is done.
| [in] | state | Isolation state whose storage key can be returned to DGP policy. |
| [in,out] | storage_key | The domain's hardware storage key. |
| [in,out] | storage_key_generation | Storage key generation counter. |
| [in,out] | storage_key_state | Storage key revocation state. |
| [in] | state | Isolation state whose storage key can be returned to DGP policy. |
| [in,out] | storage_key | The domain's hardware storage key. |
| [in,out] | storage_key_generation | Storage key generation counter. |
| [in,out] | storage_key_state | Storage key revocation state. |
|
nodiscardexportnoexcept |
Create initial DGP isolation state for a domain.
| [in] | domain_id | Domain identifier assigned by the caller. |
| [in] | policy | Hardware-first isolation policy for the domain. |
| [in] | domain_id | Domain identifier assigned by the caller. |
| [in] | policy | Hardware-first isolation policy for the domain. |
|
nodiscardexportnoexcept |
Destroy DGP isolation state for a domain.
| [in] | state | Domain lifecycle state. |
| [in,out] | storage_key | The domain's hardware storage key. |
| [in,out] | storage_key_generation | Storage key generation counter. |
| [in,out] | storage_key_state | Storage key revocation state. |
| [in,out] | revocation_epoch | Revocation epoch counter. |
| [in] | state | Domain lifecycle state. |
| [in,out] | storage_key | The domain's hardware storage key. |
| [in,out] | storage_key_generation | Storage key generation counter. |
| [in,out] | storage_key_state | Storage key revocation state. |
| [in,out] | revocation_epoch | Revocation epoch counter. |
|
exportnoexcept |
Initialize the DGP isolation clean core.
|
exportnoexcept |
Lazy revocation of DGP rights on a domain.
| [in] | d | Target domain. Must be non-null and active. |
| [in] | drop_mask | Bits to clear from granted_rights. Bits not currently set have no effect. |
d is not active.| [in] | d | Target domain. Must be non-null and active. |
| [in] | drop_mask | Bits to clear from granted_rights. |
d is not active.
|
nodiscardexportnoexcept |
Validate entry into a DGP gate chokepoint (structural validation only).
| [in] | caller_domain_id | Domain requesting entry. |
| [in] | gate_id | Gate identifier being entered. |
| [in] | requested | Rights required by the gate operation. |
|
nodiscardexportnoexcept |
Validate creation or use of a DGP portal.
| [in] | source_domain_id | Domain that will hold the portal authority. |
| [in] | target_domain_id | Domain whose address space is exposed through the portal. |
| [in] | va_start | First target virtual address exposed through the portal. |
| [in] | va_end | Exclusive end of the target virtual range. |
| [in] | requested | Rights requested for the portal mapping. |
| [in] | source_domain_id | Domain that will hold the portal authority. |
| [in] | target_domain_id | Domain whose address space is exposed through the portal. |
| [in] | va_start | First target virtual address exposed through the portal. |
| [in] | va_end | Exclusive end of the target virtual range. |
| [in] | requested | Rights requested for the portal mapping. |
|
nodiscardexportnoexcept |
Validate that a DGP domain may be admitted to a CPU run queue.
| [in] | state | Isolation state associated with the candidate domain. |
| [in] | root_phys | Physical address of the region-first root table. |
| [in] | asce_raw | Raw ASCE value. |
| [in] | state | Isolation state associated with the candidate domain. |
| [in] | root_phys | Physical address of the region-first root table. |
| [in] | asce_raw | Raw ASCE value. |
|
nodiscardexportnoexcept |
Validate a scheduler policy against DGP authority and basic safety invariants.
| [in] | state | Domain isolation state requesting scheduler admission. |
| [in] | policy | Requested scheduler policy. |
| [in] | has_rt_authority | True when the caller holds the domain's RT/admin capability authority. |
| [in] | state | Domain isolation state requesting scheduler admission. |
| [in] | policy | Requested scheduler policy. |
| [in] | has_rt_authority | True when the caller holds the domain's RT/admin capability authority. |