arch/powerpc/kernel/setup_64.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/setup_64.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/setup_64.c- Extension
.c- Size
- 25420 bytes
- Lines
- 929
- 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/export.hlinux/string.hlinux/sched.hlinux/init.hlinux/kernel.hlinux/reboot.hlinux/delay.hlinux/initrd.hlinux/seq_file.hlinux/ioport.hlinux/console.hlinux/utsname.hlinux/tty.hlinux/root_dev.hlinux/notifier.hlinux/cpu.hlinux/unistd.hlinux/serial.hlinux/serial_8250.hlinux/memblock.hlinux/pci.hlinux/lockdep.hlinux/memory.hlinux/nmi.hlinux/pgtable.hlinux/of.hlinux/of_fdt.hasm/asm-prototypes.hasm/kvm_guest.hasm/io.hasm/kdump.hasm/processor.h
Detected Declarations
function setup_tlb_core_datafunction for_each_possible_cpufunction check_smt_enabledfunction early_smt_enabledfunction fixup_boot_pacafunction configure_exceptionsfunction cpu_ready_for_interruptsfunction suspendfunction record_spr_defaultsfunction probefunction early_setup_secondaryfunction panic_smp_self_stopfunction use_spinloopfunction smp_release_cpusfunction init_cache_infofunction parse_cache_infofunction initialize_cache_infofunction exceptionfunction alloc_stackfunction irqstack_early_initfunction exc_lvl_early_initfunction for_each_possible_cpufunction emergency_stack_initfunction for_each_possible_cpufunction pcpu_cpu_distancefunction pcpu_cpu_to_nodefunction setup_per_cpu_areasfunction memory_block_size_bytesfunction hw_nmi_get_sample_periodfunction disable_hardlockup_detectorexport ppc64_cachesexport __per_cpu_offsetexport ppc_pci_io
Annotated Snippet
if (dn) {
smt_option = of_get_property(dn, "ibm,smt-enabled",
NULL);
if (smt_option) {
if (!strcmp(smt_option, "on"))
smt_enabled_at_boot = threads_per_core;
else if (!strcmp(smt_option, "off"))
smt_enabled_at_boot = 0;
}
of_node_put(dn);
}
}
}
/* Look for smt-enabled= cmdline option */
static int __init early_smt_enabled(char *p)
{
smt_enabled_cmdline = p;
return 0;
}
early_param("smt-enabled", early_smt_enabled);
#endif /* CONFIG_SMP */
/** Fix up paca fields required for the boot cpu */
static void __init fixup_boot_paca(struct paca_struct *boot_paca)
{
/* The boot cpu is started */
boot_paca->cpu_start = 1;
#ifdef CONFIG_PPC_BOOK3S_64
/*
* Give the early boot machine check stack somewhere to use, use
* half of the init stack. This is a bit hacky but there should not be
* deep stack usage in early init so shouldn't overflow it or overwrite
* things.
*/
boot_paca->mc_emergency_sp = (void *)&init_thread_union +
(THREAD_SIZE/2);
#endif
/* Allow percpu accesses to work until we setup percpu data */
boot_paca->data_offset = 0;
/* Mark interrupts soft and hard disabled in PACA */
boot_paca->irq_soft_mask = IRQS_DISABLED;
boot_paca->irq_happened = PACA_IRQ_HARD_DIS;
WARN_ON(mfmsr() & MSR_EE);
}
static void __init configure_exceptions(void)
{
/*
* Setup the trampolines from the lowmem exception vectors
* to the kdump kernel when not using a relocatable kernel.
*/
setup_kdump_trampoline();
/* Under a PAPR hypervisor, we need hypercalls */
if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
/*
* - PR KVM does not support AIL mode interrupts in the host
* while a PR guest is running.
*
* - SCV system call interrupt vectors are only implemented for
* AIL mode interrupts.
*
* - On pseries, AIL mode can only be enabled and disabled
* system-wide so when a PR VM is created on a pseries host,
* all CPUs of the host are set to AIL=0 mode.
*
* - Therefore host CPUs must not execute scv while a PR VM
* exists.
*
* - SCV support can not be disabled dynamically because the
* feature is advertised to host userspace. Disabling the
* facility and emulating it would be possible but is not
* implemented.
*
* - So SCV support is blanket disabled if PR KVM could possibly
* run. That is, PR support compiled in, booting on pseries
* with hash MMU.
*/
if (IS_ENABLED(CONFIG_KVM_BOOK3S_PR_POSSIBLE) && !radix_enabled()) {
init_task.thread.fscr &= ~FSCR_SCV;
cur_cpu_spec->cpu_user_features2 &= ~PPC_FEATURE2_SCV;
}
/* Enable AIL if possible */
if (!pseries_enable_reloc_on_exc()) {
init_task.thread.fscr &= ~FSCR_SCV;
Annotation
- Immediate include surface: `linux/export.h`, `linux/string.h`, `linux/sched.h`, `linux/init.h`, `linux/kernel.h`, `linux/reboot.h`, `linux/delay.h`, `linux/initrd.h`.
- Detected declarations: `function setup_tlb_core_data`, `function for_each_possible_cpu`, `function check_smt_enabled`, `function early_smt_enabled`, `function fixup_boot_paca`, `function configure_exceptions`, `function cpu_ready_for_interrupts`, `function suspend`, `function record_spr_defaults`, `function probe`.
- 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.