From patchwork Fri Feb 4 07:22:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 12734856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2AE07C433EF for ; Fri, 4 Feb 2022 07:24:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JemC1eaBQzmzCxj8IucsqVA+LUw0HUbiOzQqMSjUB6E=; b=dhn6eDzVPIqewr 1qcB9fK82dGz+D5Mj7PZpEtBjSAxY9DwvCqCZQrI+hW5w5yB/kW6eXjdVUefAbP432fofRyBs0dPz iLjFf/TtCEjV0yjXCmKldDOJPt3VEug/RMFZhGmA36PQQRE72K6Tq982Zq70sIojpmZyjkdINNNH3 V1vRfFY/y0reJN4G1p4+Tiq7hyrwfqhR5LbbBfyg7jaIWgB0uGtQm69PqN0eIAuPLb1IxV1FRXrRJ 1UErqt58z+dHZc6rcV1DUE54WlXDBIdpcpWYbO1PbJx9kph1W7wmtry46JmfLIXwGEssvMcDxXWai 0KMKKROZD0spwVnbVk+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFsvg-003dQf-OI; Fri, 04 Feb 2022 07:22:48 +0000 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nFsvd-003dQ2-2S for linux-arm-kernel@lists.infradead.org; Fri, 04 Feb 2022 07:22:46 +0000 Received: by mail-pg1-x531.google.com with SMTP id j10so4350583pgc.6 for ; Thu, 03 Feb 2022 23:22:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zLaU+OooQpjOGfOPUlBT8gq0wmyxboLR+0UWXHSx00U=; b=JZHFB3AS8z11YYHqeTrTOxHnhsrXrL5s9NE9aKmi+f6IzzmqBBRtFi5yJPIrRk20Is LaVz3sE7CJjQ2OuiI89/O7eHlMpBNNQ44S78rhBoJDmCqlY5iVXJF58Y+9TXiP0LZNB9 43ou8WMQxOYRDxVCTFPTboQ2g8ygsuI9OQ8ckRZKBXfe3qd8lvxPqOr6FZFP24dDN8cv Zt3Ye0QaGpXCv7bHmWMzkZzdj1S+ob7T59AWuraGkxbpqB5OPcKwOqRPOW4enHa1B5E3 qG7PgwM1vdhL71BxI5/E//RL0pGUGoErCBEZNOpuaI7cU2uMMvIu+RfP+xNoEgUDttv+ U/ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=zLaU+OooQpjOGfOPUlBT8gq0wmyxboLR+0UWXHSx00U=; b=vSFeO4J8V5wBsakid7gLDenqld0YPyK8OKcZFkoJQAL+Fgi1jnfhpCF9uw0JtqCdFP t5FtZqrs7MnwsllrfFxuNZlb6HfrZ3INbAVDdRxgteCbscj1E0/y8ZOd79xxirzotbTz vC9Ni4sVWGB+1hGxpVWzCeuqfAAbDD1p6GAzvBN53fcHeWKufWBQlREPsi7CsxtcQwIT Mph4V1CKV4aCouty93Zlr4wKuZx7Z9M+KVC1qwdWz6cpp1QC4493xlp3PjoQFD0/rHfa 1l8CFpV3hsbW9JhSC0nGGUVNimfx8hmyRi2H0Ysqe/ftvJZUGKoZxv8pF9EZljMbqMtb ybdg== X-Gm-Message-State: AOAM530HQcVhZ8qCb4xrM1J+wSJK9IXx4I5PNlX+SYzq3CcLtP/nOQkg dSNns45eRcx2uxVlxTPg2At0KcgmQU0= X-Google-Smtp-Source: ABdhPJzgRaKNLRRcC5aRsfCldfqd3VmQV2yiZP9dmKE8/HvnW8TNcg+LXnnK0y9HCRkFUnE9LpEXjA== X-Received: by 2002:a05:6a00:24d6:: with SMTP id d22mr1729342pfv.36.1643959362831; Thu, 03 Feb 2022 23:22:42 -0800 (PST) Received: from voyager.lan ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id t14sm11665328pjd.6.2022.02.03.23.22.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 23:22:42 -0800 (PST) From: Joel Stanley To: Arnd Bergmann , Andrew Jeffery , Greg Kroah-Hartman , "Rafael J . Wysocki" , Robin Murphy Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org Subject: [PATCH v3 0/3] firmware: Add boot information to sysfs Date: Fri, 4 Feb 2022 17:52:31 +1030 Message-Id: <20220204072234.304543-1-joel@jms.id.au> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220203_232245_137556_8859AA72 X-CRM114-Status: GOOD ( 13.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org v3 resolves Greg's review for the bootinfo header and macros, and drops uart_boot as it's unlikely to be common across platforms. v2 reworks the series to put the sysfs properties in the core, and optionally show them with the is_visible() callback. This is the second iteration of this idea. The first used socinfo custom attribute groups, but Arnd suggested we make this something standardised under /sys/firmware instead: http://lore.kernel.org/all/CAK8P3a3MRf0aGt1drkgsuZyBbeoy+S7Ha18SBM01q+3f33oL+Q@mail.gmail.com Some ARM systems have a firmware that provides a hardware root of trust. It's useful for the system to know how this root of trust has been configured, so provide a standardised interface that expose this information to userspace. This is implemented as a sysfs attribute group registration in the driver core, with platforms populating values obtained from firmware at kernel boot time. Patch 2 provides a user of the properties on an ARM system. Patch 3 is new in v2 and is an example of populating bootinfo with the EFI secure boot status. Joel Stanley (3): firmware: Add boot information to sysfs ARM: aspeed: Add secure boot controller support x86/setup: Populate bootinfo with secure boot status .../ABI/testing/sysfs-firmware-bootinfo | 37 +++++++++ arch/x86/kernel/setup.c | 6 ++ drivers/base/firmware.c | 80 +++++++++++++++++++ drivers/soc/aspeed/aspeed-socinfo.c | 44 +++++++++- include/linux/firmware_bootinfo.h | 48 +++++++++++ 5 files changed, 214 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/testing/sysfs-firmware-bootinfo create mode 100644 include/linux/firmware_bootinfo.h