From: Joel Stanley <joel@jms.id.au>
To: Arnd Bergmann <arnd@arndb.de>, Andrew Jeffery <andrew@aj.id.au>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Robin Murphy <robin.murphy@arm.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org
Subject: [PATCH v3 3/3] x86/setup: Populate bootinfo with secure boot status
Date: Fri, 4 Feb 2022 17:52:34 +1030 [thread overview]
Message-ID: <20220204072234.304543-4-joel@jms.id.au> (raw)
In-Reply-To: <20220204072234.304543-1-joel@jms.id.au>
bootinfo indicates to userspace that firmware is configured to boot with
secure boot.
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
v2: new
v3: no change
---
arch/x86/kernel/setup.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index f7a132eb794d..b805b758478f 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -23,6 +23,7 @@
#include <linux/usb/xhci-dbgp.h>
#include <linux/static_call.h>
#include <linux/swiotlb.h>
+#include <linux/firmware_bootinfo.h>
#include <uapi/linux/mount.h>
@@ -1100,17 +1101,22 @@ void __init setup_arch(char **cmdline_p)
setup_log_buf(1);
if (efi_enabled(EFI_BOOT)) {
+ struct bootinfo bootinfo = {};
+
switch (boot_params.secure_boot) {
case efi_secureboot_mode_disabled:
pr_info("Secure boot disabled\n");
+ BOOTINFO_SET(bootinfo, secure_boot, false);
break;
case efi_secureboot_mode_enabled:
pr_info("Secure boot enabled\n");
+ BOOTINFO_SET(bootinfo, secure_boot, true);
break;
default:
pr_info("Secure boot could not be determined\n");
break;
}
+ firmware_bootinfo_init(&bootinfo);
}
reserve_initrd();
--
2.34.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-02-04 7:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-04 7:22 [PATCH v3 0/3] firmware: Add boot information to sysfs Joel Stanley
2022-02-04 7:22 ` [PATCH v3 1/3] " Joel Stanley
2022-04-22 6:46 ` Greg Kroah-Hartman
2022-04-22 9:05 ` Arnd Bergmann
2022-04-22 12:26 ` Greg Kroah-Hartman
2022-02-04 7:22 ` [PATCH v3 2/3] ARM: aspeed: Add secure boot controller support Joel Stanley
2022-02-04 7:22 ` Joel Stanley [this message]
2022-04-22 6:48 ` [PATCH v3 0/3] firmware: Add boot information to sysfs Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220204072234.304543-4-joel@jms.id.au \
--to=joel@jms.id.au \
--cc=andrew@aj.id.au \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robin.murphy@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).