Domain/strand context setup and user-mode first-entry trampolines. More...
import lib.cstring;import arch.s390x.cpu.psw;import arch.s390x.cpu.ctlreg;import std;import arch.s390x.cpu.processor;import arch.s390x.cpu.lowcore;import arch.s390x.sched.types;import zxfoundation.sys.syschk.core;import zxfoundation.dgp.isolation;import zxfoundation.base.types;import arch.s390x.cpu.aste;import zxfoundation.dgp.isolation.types;import zxfoundation.dgp.domain.types;Data Structures | |
| struct | zxfoundation::sched::strandctx::domain |
| The domain struct — the central entity of the DGP kernel. More... | |
| struct | zxfoundation::sched::strandctx::strand |
| Strand — the DGP kernel's unit of schedulable execution. More... | |
| struct | zxfoundation::sched::strandctx::detail::user_regs |
| User-mode register save area for strand entry/exit. More... | |
| struct | zxfoundation::sched::strandctx::user_regs |
| User-mode register save area for strand entry/exit. More... | |
Functions | |
| auto | zxfoundation::sched::strandctx::domain_enter_user (domain *d) noexcept -> void |
| Overload taking domain* for backward compatibility. | |
| auto | zxfoundation::sched::strandctx::domain_enter_user (strand *s) noexcept -> void |
| Enter user mode for a domain. | |
| from_global (nomangle) | |
| auto | zxfoundation::sched::strandctx::detail::normalize_user_psw (user_regs &uregs, const domain *owner) noexcept -> void |
| Apply the canonical user-PSW normalization. | |
| auto | zxfoundation::sched::strandctx::setup_primary_strand_context (domain *d, strand_entry_fn entry, void *arg) noexcept -> void |
| Convenience wrapper — kernel-thread first-switch for the primary strand of a domain. | |
| auto | zxfoundation::sched::strandctx::setup_primary_strand_context_user (domain *d) noexcept -> void |
| Convenience wrapper — user-process first-switch for the primary strand of a domain. | |
| auto | zxfoundation::sched::strandctx::setup_strand_context_kernel_thread (strand *s, strand_entry_fn entry, void *arg) noexcept -> void |
| Set up the initial kernel stack frame for a strand so that the. | |
| auto | zxfoundation::sched::strandctx::setup_strand_context_user (strand *s, const user_regs *uregs, const domain *owner) noexcept -> void |
Set up the initial kernel stack frame for a strand whose first context switch performs an LPSWE into user mode. | |
| auto | zxfoundation::sched::strandctx::detail::stage_user_ars_vrs_fpc (strand *s, const user_regs *uregs) noexcept -> void |
| Stage the user_regs AR/FPC/VR state. | |
Variables | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::FRAME_ARS_OFF = 0 |
| AR bank within __switch_to_asm save area. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::FRAME_FPC_OFF = 64 |
| FPC within save area. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::FRAME_VRS_HI_SIZE = 256 |
| v16-v31. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::FRAME_VRS_LO_SIZE = 256 |
| v0-v15 (16 * 16 bytes). | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::FRAME_VRS_OFF = 72 |
| VR bank within save area. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::SF_GPRS = 48 |
| callee-saved GPR save region start (in __switch_to_asm post-pop frame). | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::SWITCH_FRAME_SIZE = 640 |
| __switch_to_asm save area. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::TRAMPOLINE_FRAME_SIZE = 160 |
| domain_trampoline's own frame. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_ARS_OFF = UREGS_PSW_ADDR_OFF + 8U |
| +0x90. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_ARS_SIZE = 16U * 4U |
| 64 bytes. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_FPC_OFF = UREGS_ARS_OFF + UREGS_ARS_SIZE |
| +0xD0. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_GPRS_OFF = 0 |
| gprs[16] start. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_GPRS_SIZE = 16U * 8U |
| 128 bytes. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_PSW_ADDR_OFF = UREGS_PSW_MASK_OFF + 8U |
| +0x88. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_PSW_MASK_OFF = UREGS_GPRS_OFF + UREGS_GPRS_SIZE |
| +0x80. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_VRS_OFF = UREGS_FPC_OFF + 8U |
| +0xD8. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::UREGS_VRS_SIZE = 32U * 16U |
| 512 bytes. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::USER_GPRS_OFF = 0x90 |
| user GPRs start within the user return frame. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::USER_PSW_OFF = 0x110 |
| user PSW (mask+addr, 16B) within the user return frame. | |
| static constexpr u64 | zxfoundation::sched::strandctx::detail::USER_RETURN_FRAME_SIZE = 0x120 |
Domain/strand context setup and user-mode first-entry trampolines.
SPDX-License-Identifier: Apache-2.0
|
exportnoexcept |
Overload taking domain* for backward compatibility.
Overload taking domain* for backward compatibility.
|
exportnoexcept |
Enter user mode for a domain.
Enter user mode for a domain at runtime.
| s | Strand with valid body->uregs; domain accessed via s->owner. |
|
noexcept |
Assembly stub: load ARs/VRs/FPC from user_regs, then jump to ret_to_user.
| [in] | %r2 | frame_base — kernel stack slot with 16 user GPRs + PSW. |
| [in] | %r3 | user_regs* — AR/VR/FPC snapshot to restore before LPSWE. |
Assembly kernel-thread first-entry trampoline.
Unified first-context-switch dispatcher (kernel-thread or user-process).
Low-level context switch: (strand* prev, strand* next) -> domain* (prev->owner).
|
noexcept |
Apply the canonical user-PSW normalization.
| [in,out] | uregs | Mutable user_regs candidate PSW. |
| [in] | owner | The owning domain (may be nullptr in tests); its storage_key is blended into PSW bits 52..55. |
|
exportnoexcept |
Set up the initial kernel stack frame for a strand so that the.
| s | Target strand with valid kstack_top |
| entry | Non-null kernel entry function |
| arg | Opaque argument passed to entry in r2 |
|
exportnoexcept |
Set up the initial kernel stack frame for a strand whose first context switch performs an LPSWE into user mode.
| s | Target strand with valid kstack_top and body->uregs already populated |
| uregs | Pointer to the user_regs snapshot |
| owner | The owning domain, used for ASC normalization and DGP isolation validation. |