Re: [PATCH v8 3/8] powerpc: detect the trusted boot state of the system
From: Michael Ellerman
Date: Tue Oct 22 2019 - 19:38:44 EST
Nayna Jain <nayna@xxxxxxxxxxxxx> writes:
> diff --git a/arch/powerpc/kernel/secure_boot.c b/arch/powerpc/kernel/secure_boot.c
> index 99bba7915629..9753470ab08a 100644
> --- a/arch/powerpc/kernel/secure_boot.c
> +++ b/arch/powerpc/kernel/secure_boot.c
> @@ -28,3 +39,16 @@ bool is_ppc_secureboot_enabled(void)
> pr_info("Secure boot mode %s\n", enabled ? "enabled" : "disabled");
> return enabled;
> }
> +
> +bool is_ppc_trustedboot_enabled(void)
> +{
> + struct device_node *node;
> + bool enabled = false;
> +
> + node = get_ppc_fw_sb_node();
> + enabled = of_property_read_bool(node, "trusted-enabled");
Also here you need:
of_node_put(node);
> +
> + pr_info("Trusted boot mode %s\n", enabled ? "enabled" : "disabled");
> +
> + return enabled;
> +}
cheers