arch/powerpc/platforms/pseries/lpar.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/pseries/lpar.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/pseries/lpar.c- Extension
.c- Size
- 51654 bytes
- Lines
- 2032
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: operation-table or driver-model contract
- Status
- pattern 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.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/dma-mapping.hlinux/console.hlinux/export.hlinux/jump_label.hlinux/delay.hlinux/seq_file.hlinux/stop_machine.hlinux/spinlock.hlinux/cpuhotplug.hlinux/workqueue.hlinux/proc_fs.hlinux/pgtable.hlinux/debugfs.hasm/processor.hasm/mmu.hasm/page.hasm/setup.hasm/mmu_context.hasm/iommu.hasm/tlb.hasm/cputable.hasm/papr-sysparm.hasm/udbg.hasm/smp.hasm/trace.hasm/firmware.hasm/plpar_wrappers.hasm/kexec.hasm/fadump.hasm/dtl.hasm/vphn.h
Detected Declarations
struct dtl_workerstruct vcpu_dispatch_datastruct hpt_resize_statefunction alloc_dtl_buffersfunction for_each_possible_cpufunction register_dtl_bufferfunction free_dtl_buffersfunction for_each_possible_cpufunction init_cpu_associativityfunction destroy_cpu_associativityfunction cpu_relative_dispatch_distancefunction cpu_home_node_dispatch_distancefunction update_vcpu_disp_statfunction process_dtl_bufferfunction dtl_worker_onlinefunction dtl_worker_offlinefunction set_global_dtl_maskfunction reset_global_dtl_maskfunction dtl_worker_enablefunction dtl_worker_disablefunction vcpudispatch_stats_writefunction for_each_possible_cpufunction vcpudispatch_stats_displayfunction for_each_online_cpufunction vcpudispatch_stats_openfunction vcpudispatch_stats_freq_writefunction vcpudispatch_stats_freq_displayfunction vcpudispatch_stats_freq_openfunction vcpudispatch_stats_procfs_initfunction pseries_paravirt_steal_clockfunction vpa_initfunction pseries_lpar_register_process_tablefunction pSeries_lpar_hpte_insertfunction pSeries_lpar_hpte_removefunction manual_hpte_clear_allfunction hcall_hpte_clear_allfunction pseries_hpte_clear_allfunction pSeries_lpar_hpte_updateppfunction __pSeries_lpar_hpte_findfunction pSeries_lpar_hpte_findfunction pSeries_lpar_hpte_updateboltedppfunction pSeries_lpar_hpte_invalidatefunction is_supported_hlbkrmfunction call_block_removefunction hugepage_block_invalidatefunction hugepage_bulk_invalidatefunction __pSeries_lpar_hugepage_invalidatefunction pSeries_lpar_hugepage_invalidate
Annotated Snippet
static const struct file_operations vpa_fops = {
.open = simple_open,
.read = vpa_file_read,
.llseek = default_llseek,
};
static int __init vpa_debugfs_init(void)
{
char name[16];
long i;
struct dentry *vpa_dir;
if (!firmware_has_feature(FW_FEATURE_SPLPAR))
return 0;
vpa_dir = debugfs_create_dir("vpa", arch_debugfs_dir);
/* set up the per-cpu vpa file*/
for_each_possible_cpu(i) {
sprintf(name, "cpu-%ld", i);
debugfs_create_file(name, 0400, vpa_dir, (void *)i, &vpa_fops);
}
return 0;
}
machine_arch_initcall(pseries, vpa_debugfs_init);
#endif /* CONFIG_DEBUG_FS */
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/dma-mapping.h`, `linux/console.h`, `linux/export.h`, `linux/jump_label.h`, `linux/delay.h`, `linux/seq_file.h`, `linux/stop_machine.h`.
- Detected declarations: `struct dtl_worker`, `struct vcpu_dispatch_data`, `struct hpt_resize_state`, `function alloc_dtl_buffers`, `function for_each_possible_cpu`, `function register_dtl_buffer`, `function free_dtl_buffers`, `function for_each_possible_cpu`, `function init_cpu_associativity`, `function destroy_cpu_associativity`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.