arch/powerpc/platforms/powernv/setup.c
Source file repositories/reference/linux-study-clean/arch/powerpc/platforms/powernv/setup.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/platforms/powernv/setup.c- Extension
.c- Size
- 14801 bytes
- Lines
- 589
- Domain
- Architecture Layer
- Bucket
- arch/powerpc
- Inferred role
- Architecture Layer: implementation source
- Status
- source 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 or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpu.hlinux/errno.hlinux/sched.hlinux/kernel.hlinux/tty.hlinux/reboot.hlinux/init.hlinux/console.hlinux/delay.hlinux/irq.hlinux/seq_buf.hlinux/seq_file.hlinux/of.hlinux/of_fdt.hlinux/interrupt.hlinux/bug.hlinux/pci.hlinux/cpufreq.hlinux/memblock.hasm/machdep.hasm/firmware.hasm/xics.hasm/xive.hasm/opal.hasm/kexec.hasm/smp.hasm/tm.hasm/setup.hasm/security_features.hpowernv.h
Detected Declarations
function fw_feature_isfunction init_fw_feat_flagsfunction pnv_setup_security_mitigationsfunction pvr_version_isfunction pnv_check_guarded_coresfunction for_each_node_by_typefunction pnv_setup_archfunction pnv_add_hw_descriptionfunction pnv_initfunction for_each_possible_cpufunction pnv_init_IRQfunction pnv_show_cpuinfofunction pnv_prepare_going_downfunction pnv_restartfunction pnv_power_offfunction pnv_haltfunction pnv_progressfunction pnv_kexec_wait_secondaries_downfunction for_each_online_cpufunction pnv_kexec_cpu_downfunction pnv_memory_block_sizefunction pnv_setup_machdep_opalfunction pnv_probefunction pnv_tm_initfunction pnv_get_proc_freqfunction pnv_machine_check_early
Annotated Snippet
pvr_version_is(PVR_POWER8)) {
security_ftr_clear(SEC_FTR_L1D_FLUSH_ENTRY);
security_ftr_clear(SEC_FTR_L1D_FLUSH_UACCESS);
}
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) && \
(security_ftr_enabled(SEC_FTR_L1D_FLUSH_PR) || \
security_ftr_enabled(SEC_FTR_L1D_FLUSH_HV));
setup_rfi_flush(type, enable);
setup_count_cache_flush();
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
security_ftr_enabled(SEC_FTR_L1D_FLUSH_ENTRY);
setup_entry_flush(enable);
enable = security_ftr_enabled(SEC_FTR_FAVOUR_SECURITY) &&
security_ftr_enabled(SEC_FTR_L1D_FLUSH_UACCESS);
setup_uaccess_flush(enable);
setup_stf_barrier();
}
static void __init pnv_check_guarded_cores(void)
{
struct device_node *dn;
int bad_count = 0;
for_each_node_by_type(dn, "cpu") {
if (of_property_match_string(dn, "status", "bad") >= 0)
bad_count++;
}
if (bad_count) {
printk(" _ _______________\n");
pr_cont(" | | / \\\n");
pr_cont(" | | | WARNING! |\n");
pr_cont(" | | | |\n");
pr_cont(" | | | It looks like |\n");
pr_cont(" |_| | you have %*d |\n", 3, bad_count);
pr_cont(" _ | guarded cores |\n");
pr_cont(" (_) \\_______________/\n");
}
}
static void __init pnv_setup_arch(void)
{
set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT);
pnv_setup_security_mitigations();
/* Initialize SMP */
pnv_smp_init();
/* Setup RTC and NVRAM callbacks */
if (firmware_has_feature(FW_FEATURE_OPAL))
opal_nvram_init();
/* Enable NAP mode */
powersave_nap = 1;
pnv_check_guarded_cores();
/* XXX PMCS */
pnv_rng_init();
}
static void __init pnv_add_hw_description(void)
{
struct device_node *dn;
const char *s;
dn = of_find_node_by_path("/ibm,opal/firmware");
if (!dn)
return;
if (of_property_read_string(dn, "version", &s) == 0 ||
of_property_read_string(dn, "git-id", &s) == 0)
seq_buf_printf(&ppc_hw_desc, "opal:%s ", s);
if (of_property_read_string(dn, "mi-version", &s) == 0)
seq_buf_printf(&ppc_hw_desc, "mi:%s ", s);
of_node_put(dn);
}
static void __init pnv_init(void)
{
pnv_add_hw_description();
Annotation
- Immediate include surface: `linux/cpu.h`, `linux/errno.h`, `linux/sched.h`, `linux/kernel.h`, `linux/tty.h`, `linux/reboot.h`, `linux/init.h`, `linux/console.h`.
- Detected declarations: `function fw_feature_is`, `function init_fw_feat_flags`, `function pnv_setup_security_mitigations`, `function pvr_version_is`, `function pnv_check_guarded_cores`, `function for_each_node_by_type`, `function pnv_setup_arch`, `function pnv_add_hw_description`, `function pnv_init`, `function for_each_possible_cpu`.
- Atlas domain: Architecture Layer / arch/powerpc.
- Implementation status: source 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.