arch/powerpc/kernel/secure_boot.c
Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/secure_boot.c
File Facts
- System
- Linux kernel
- Corpus path
arch/powerpc/kernel/secure_boot.c- Extension
.c- Size
- 1584 bytes
- Lines
- 76
- 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/types.hlinux/of.hlinux/secure_boot.hlinux/string_choices.hasm/secure_boot.h
Detected Declarations
function Copyrightfunction is_ppc_secureboot_enabledfunction arch_get_securebootfunction is_ppc_trustedboot_enabled
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2019 IBM Corporation
* Author: Nayna Jain
*/
#include <linux/types.h>
#include <linux/of.h>
#include <linux/secure_boot.h>
#include <linux/string_choices.h>
#include <asm/secure_boot.h>
static struct device_node *get_ppc_fw_sb_node(void)
{
static const struct of_device_id ids[] = {
{ .compatible = "ibm,secureboot", },
{ .compatible = "ibm,secureboot-v1", },
{ .compatible = "ibm,secureboot-v2", },
{},
};
return of_find_matching_node(NULL, ids);
}
bool is_ppc_secureboot_enabled(void)
{
struct device_node *node;
bool enabled = false;
u32 secureboot;
node = get_ppc_fw_sb_node();
enabled = of_property_read_bool(node, "os-secureboot-enforcing");
of_node_put(node);
if (enabled)
goto out;
node = of_find_node_by_path("/");
if (!of_property_read_u32(node, "ibm,secure-boot", &secureboot))
enabled = (secureboot > 1);
of_node_put(node);
out:
pr_info("Secure boot mode %s\n", str_enabled_disabled(enabled));
return enabled;
}
bool arch_get_secureboot(void)
{
return is_ppc_secureboot_enabled();
}
bool is_ppc_trustedboot_enabled(void)
{
struct device_node *node;
bool enabled = false;
u32 trustedboot;
node = get_ppc_fw_sb_node();
enabled = of_property_read_bool(node, "trusted-enabled");
of_node_put(node);
if (enabled)
goto out;
node = of_find_node_by_path("/");
if (!of_property_read_u32(node, "ibm,trusted-boot", &trustedboot))
enabled = (trustedboot > 0);
of_node_put(node);
out:
pr_info("Trusted boot mode %s\n", str_enabled_disabled(enabled));
return enabled;
}
Annotation
- Immediate include surface: `linux/types.h`, `linux/of.h`, `linux/secure_boot.h`, `linux/string_choices.h`, `asm/secure_boot.h`.
- Detected declarations: `function Copyright`, `function is_ppc_secureboot_enabled`, `function arch_get_secureboot`, `function is_ppc_trustedboot_enabled`.
- 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.