arch/arm64/kernel/kaslr.c
Source file repositories/reference/linux-study-clean/arch/arm64/kernel/kaslr.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm64/kernel/kaslr.c- Extension
.c- Size
- 958 bytes
- Lines
- 42
- Domain
- Architecture Layer
- Bucket
- arch/arm64
- 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.
Dependency Surface
linux/cache.hlinux/init.hlinux/printk.hasm/cpufeature.hasm/memory.h
Detected Declarations
function kaslr_initfunction parse_nokaslr
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (C) 2016 Linaro Ltd <ard.biesheuvel@linaro.org>
*/
#include <linux/cache.h>
#include <linux/init.h>
#include <linux/printk.h>
#include <asm/cpufeature.h>
#include <asm/memory.h>
bool __ro_after_init __kaslr_is_enabled = false;
void __init kaslr_init(void)
{
if (kaslr_disabled_cmdline()) {
pr_info("KASLR disabled on command line\n");
return;
}
/*
* The KASLR offset modulo MIN_KIMG_ALIGN is taken from the physical
* placement of the image rather than from the seed, so a displacement
* of less than MIN_KIMG_ALIGN means that no seed was provided.
*/
if (kaslr_offset() < MIN_KIMG_ALIGN) {
pr_warn("KASLR disabled due to lack of seed\n");
return;
}
pr_info("KASLR enabled\n");
__kaslr_is_enabled = true;
}
static int __init parse_nokaslr(char *unused)
{
/* nokaslr param handling is done by early cpufeature code */
return 0;
}
early_param("nokaslr", parse_nokaslr);
Annotation
- Immediate include surface: `linux/cache.h`, `linux/init.h`, `linux/printk.h`, `asm/cpufeature.h`, `asm/memory.h`.
- Detected declarations: `function kaslr_init`, `function parse_nokaslr`.
- Atlas domain: Architecture Layer / arch/arm64.
- 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.