arch/powerpc/kvm/book3s_hv_nestedv2.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kvm/book3s_hv_nestedv2.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kvm/book3s_hv_nestedv2.c- Extension
.c- Size
- 28423 bytes
- Lines
- 1073
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/blk-mq.hlinux/console.hlinux/gfp_types.hlinux/signal.hlinux/kernel.hlinux/kvm_host.hlinux/pgtable.hasm/kvm_ppc.hasm/kvm_book3s.hasm/hvcall.hasm/pgalloc.hasm/reg.hasm/plpar_wrappers.hasm/guest-state-buffer.htrace_hv.h
Detected Declarations
function gs_msg_ops_kvmhv_nestedv2_config_get_sizefunction gs_msg_ops_kvmhv_nestedv2_config_fill_infofunction gs_msg_ops_kvmhv_nestedv2_config_refresh_infofunction gs_msg_ops_vcpu_get_sizefunction gs_msg_ops_vcpu_fill_infofunction kvmppc_gsm_for_eachfunction gs_msg_ops_vcpu_refresh_infofunction kvmppc_gsp_for_eachfunction kvmhv_nestedv2_host_createfunction __kvmhv_nestedv2_mark_dirtyfunction __kvmhv_nestedv2_cached_reloadfunction kvmhv_nestedv2_flush_vcpufunction kvmhv_nestedv2_set_ptbl_entryfunction kvmhv_nestedv2_set_vpafunction kvmhv_nestedv2_parse_outputfunction kvmhv_nestedv2_host_freefunction __kvmhv_nestedv2_reload_ptregsfunction __kvmhv_nestedv2_mark_dirty_ptregsfunction kvmhv_nestedv2_vcpu_createfunction kvmhv_nestedv2_vcpu_freeexport __kvmhv_is_nestedv2export __kvmhv_nestedv2_mark_dirtyexport __kvmhv_nestedv2_cached_reloadexport kvmhv_nestedv2_flush_vcpuexport kvmhv_nestedv2_set_ptbl_entryexport kvmhv_nestedv2_set_vpaexport kvmhv_nestedv2_parse_outputexport __kvmhv_nestedv2_reload_ptregsexport __kvmhv_nestedv2_mark_dirty_ptregsexport kvmhv_nestedv2_vcpu_createexport kvmhv_nestedv2_vcpu_free
Annotated Snippet
switch (iden) {
case KVMPPC_GSID_HOST_STATE_SIZE:
case KVMPPC_GSID_RUN_OUTPUT_MIN_SIZE:
case KVMPPC_GSID_PARTITION_TABLE:
case KVMPPC_GSID_PROCESS_TABLE:
case KVMPPC_GSID_RUN_INPUT:
case KVMPPC_GSID_RUN_OUTPUT:
/* Host wide counters */
case KVMPPC_GSID_L0_GUEST_HEAP:
case KVMPPC_GSID_L0_GUEST_HEAP_MAX:
case KVMPPC_GSID_L0_GUEST_PGTABLE_SIZE:
case KVMPPC_GSID_L0_GUEST_PGTABLE_SIZE_MAX:
case KVMPPC_GSID_L0_GUEST_PGTABLE_RECLAIM:
break;
default:
size += kvmppc_gse_total_size(kvmppc_gsid_size(iden));
}
}
return size;
}
static int gs_msg_ops_vcpu_fill_info(struct kvmppc_gs_buff *gsb,
struct kvmppc_gs_msg *gsm)
{
struct kvm_vcpu *vcpu;
vector128 v;
int rc, i;
u16 iden;
u32 arch_compat = 0;
vcpu = gsm->data;
kvmppc_gsm_for_each(gsm, iden)
{
rc = 0;
if ((gsm->flags & KVMPPC_GS_FLAGS_WIDE) !=
(kvmppc_gsid_flags(iden) & KVMPPC_GS_FLAGS_WIDE))
continue;
switch (iden) {
case KVMPPC_GSID_DSCR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dscr);
break;
case KVMPPC_GSID_MMCRA:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.mmcra);
break;
case KVMPPC_GSID_HFSCR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hfscr);
break;
case KVMPPC_GSID_PURR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.purr);
break;
case KVMPPC_GSID_SPURR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.spurr);
break;
case KVMPPC_GSID_AMR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.amr);
break;
case KVMPPC_GSID_UAMOR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.uamor);
break;
case KVMPPC_GSID_SIAR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.siar);
break;
case KVMPPC_GSID_SDAR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.sdar);
break;
case KVMPPC_GSID_IAMR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.iamr);
break;
case KVMPPC_GSID_DAWR0:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dawr0);
break;
case KVMPPC_GSID_DAWR1:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dawr1);
break;
case KVMPPC_GSID_DAWRX0:
rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.dawrx0);
break;
case KVMPPC_GSID_DAWRX1:
rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.dawrx1);
break;
case KVMPPC_GSID_DEXCR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dexcr);
break;
case KVMPPC_GSID_HASHKEYR:
rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashkeyr);
break;
case KVMPPC_GSID_HASHPKEYR:
Annotation
- Immediate include surface: `linux/blk-mq.h`, `linux/console.h`, `linux/gfp_types.h`, `linux/signal.h`, `linux/kernel.h`, `linux/kvm_host.h`, `linux/pgtable.h`, `asm/kvm_ppc.h`.
- Detected declarations: `function gs_msg_ops_kvmhv_nestedv2_config_get_size`, `function gs_msg_ops_kvmhv_nestedv2_config_fill_info`, `function gs_msg_ops_kvmhv_nestedv2_config_refresh_info`, `function gs_msg_ops_vcpu_get_size`, `function gs_msg_ops_vcpu_fill_info`, `function kvmppc_gsm_for_each`, `function gs_msg_ops_vcpu_refresh_info`, `function kvmppc_gsp_for_each`, `function kvmhv_nestedv2_host_create`, `function __kvmhv_nestedv2_mark_dirty`.
- 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.