arch/powerpc/kvm/guest-state-buffer.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kvm/guest-state-buffer.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kvm/guest-state-buffer.c- Extension
.c- Size
- 15045 bytes
- Lines
- 661
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/hvcall.hlinux/log2.hasm/pgalloc.hasm/guest-state-buffer.h
Detected Declarations
function kvmppc_gsb_newfunction kvmppc_gsb_freefunction kvmppc_gsb_putfunction kvmppc_gsid_classfunction kvmppc_gsid_typefunction kvmppc_gsid_flagsfunction kvmppc_gsid_sizefunction kvmppc_gsid_maskfunction __kvmppc_gse_putfunction kvmppc_gse_parsefunction kvmppc_gsb_for_each_elemfunction kvmppc_gse_flatten_idenfunction kvmppc_gse_unflatten_idenfunction kvmppc_gsp_insertfunction kvmppc_gsp_lookupfunction kvmppc_gsbm_setfunction kvmppc_gsbm_clearfunction kvmppc_gsbm_testfunction kvmppc_gsbm_nextfunction kvmppc_gsm_initfunction kvmppc_gsm_newfunction kvmppc_gsm_sizefunction kvmppc_gsm_freefunction kvmppc_gsm_fill_infofunction kvmppc_gsm_refresh_infofunction kvmppc_gsb_sendfunction kvmppc_gsb_recvexport kvmppc_gsb_newexport kvmppc_gsb_freeexport kvmppc_gsb_putexport kvmppc_gsid_flagsexport kvmppc_gsid_sizeexport kvmppc_gsid_maskexport __kvmppc_gse_putexport kvmppc_gse_parseexport kvmppc_gsp_insertexport kvmppc_gsp_lookupexport kvmppc_gsbm_setexport kvmppc_gsbm_clearexport kvmppc_gsbm_testexport kvmppc_gsbm_nextexport kvmppc_gsm_initexport kvmppc_gsm_newexport kvmppc_gsm_sizeexport kvmppc_gsm_freeexport kvmppc_gsm_fill_infoexport kvmppc_gsm_refresh_infoexport kvmppc_gsb_send
Annotated Snippet
switch (iden) {
case KVMPPC_GSID_L0_GUEST_HEAP:
fallthrough;
case KVMPPC_GSID_L0_GUEST_HEAP_MAX:
fallthrough;
case KVMPPC_GSID_L0_GUEST_PGTABLE_SIZE:
fallthrough;
case KVMPPC_GSID_L0_GUEST_PGTABLE_SIZE_MAX:
fallthrough;
case KVMPPC_GSID_L0_GUEST_PGTABLE_RECLAIM:
type = KVMPPC_GSE_BE64;
break;
}
break;
case KVMPPC_GS_CLASS_GUESTWIDE:
switch (iden) {
case KVMPPC_GSID_HOST_STATE_SIZE:
case KVMPPC_GSID_RUN_OUTPUT_MIN_SIZE:
case KVMPPC_GSID_TB_OFFSET:
type = KVMPPC_GSE_BE64;
break;
case KVMPPC_GSID_PARTITION_TABLE:
type = KVMPPC_GSE_PARTITION_TABLE;
break;
case KVMPPC_GSID_PROCESS_TABLE:
type = KVMPPC_GSE_PROCESS_TABLE;
break;
case KVMPPC_GSID_LOGICAL_PVR:
type = KVMPPC_GSE_BE32;
break;
}
break;
case KVMPPC_GS_CLASS_META:
switch (iden) {
case KVMPPC_GSID_RUN_INPUT:
case KVMPPC_GSID_RUN_OUTPUT:
type = KVMPPC_GSE_BUFFER;
break;
case KVMPPC_GSID_VPA:
type = KVMPPC_GSE_BE64;
break;
}
break;
case KVMPPC_GS_CLASS_DWORD_REG:
type = KVMPPC_GSE_BE64;
break;
case KVMPPC_GS_CLASS_WORD_REG:
type = KVMPPC_GSE_BE32;
break;
case KVMPPC_GS_CLASS_VECTOR:
type = KVMPPC_GSE_VEC128;
break;
case KVMPPC_GS_CLASS_INTR:
switch (iden) {
case KVMPPC_GSID_HDAR:
case KVMPPC_GSID_ASDR:
case KVMPPC_GSID_HEIR:
type = KVMPPC_GSE_BE64;
break;
case KVMPPC_GSID_HDSISR:
type = KVMPPC_GSE_BE32;
break;
}
break;
}
return type;
}
/**
* kvmppc_gsid_flags() - the flags for a guest state ID
* @iden: guest state ID
*
* Returns any flags for the guest state ID.
*/
unsigned long kvmppc_gsid_flags(u16 iden)
{
unsigned long flags = 0;
switch (kvmppc_gsid_class(iden)) {
case KVMPPC_GS_CLASS_GUESTWIDE:
flags = KVMPPC_GS_FLAGS_WIDE;
break;
case KVMPPC_GS_CLASS_HOSTWIDE:
flags = KVMPPC_GS_FLAGS_HOST_WIDE;
break;
case KVMPPC_GS_CLASS_META:
case KVMPPC_GS_CLASS_DWORD_REG:
case KVMPPC_GS_CLASS_WORD_REG:
case KVMPPC_GS_CLASS_VECTOR:
Annotation
- Immediate include surface: `asm/hvcall.h`, `linux/log2.h`, `asm/pgalloc.h`, `asm/guest-state-buffer.h`.
- Detected declarations: `function kvmppc_gsb_new`, `function kvmppc_gsb_free`, `function kvmppc_gsb_put`, `function kvmppc_gsid_class`, `function kvmppc_gsid_type`, `function kvmppc_gsid_flags`, `function kvmppc_gsid_size`, `function kvmppc_gsid_mask`, `function __kvmppc_gse_put`, `function kvmppc_gse_parse`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.