Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2276893ybg; Thu, 30 Jul 2020 15:34:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL+XjdpQtipNZUG+h1ZjUEihvOh7z5ZeDcrGEQmsNFoU16h2SD3pk8WVGSa98BQ7WIsQzW X-Received: by 2002:a50:d655:: with SMTP id c21mr1150212edj.49.1596148474898; Thu, 30 Jul 2020 15:34:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596148474; cv=none; d=google.com; s=arc-20160816; b=Qms0y1QS22fORRhuWE81m5E1tfrS2gWirt+bOTEPojDxOiLgK1E7VydTEKLWVhSQuf OjoqXESlEpsU4ltafAEgdviFdIIfUCtrcf35KzLJ3oV4GiYyMgl0EuuJyVKkp0S9VKjz vVfjmq5oNwB+fkW6OxxdPZZkL1kz4Dbk5Eh+eKnfjNKxwuPoFw8xxXxeQ3TzOffjJv8E 13VC1HAlewowDwgAlfaOUI/kNu2dHjZOxSEaOyIIMqZE6NSks5j2IlORDJHHh1kH5sRD qxg2hFH6QHmFLQDZOv6k1rJYXXY027LUcpDU3iXdtXub/mHipa7QNvJ0930qYDFQgTy4 eR4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:dkim-signature; bh=F8V5dJHtdOS7toaRAn2Ry59zBUcx5vitMpMVIJbeVfk=; b=y2o2WmoYZ1lnH2bNz1P4Fdo6bHUjxgj+Ohp0y59ItHdW/c3WviXasbW+ZCEi+nOAZr skOrc6gq9XMskH5Y9E2Zqij4INaDZkyyd3cF6bcdTHEEHbSAHo0AHmy87NPir7cNf8p6 3UQiGgy+AriiuuWREG64Kss8GVff8QRcMK0M289KYEstNTcRQbn0XSczz/EqZTqWbAWR NapQYFjjbbccagQmq/qNn2xsIgfSDIzj8H8wh9dE8/tS5aSDG+Wwx/CZYBX3rCw//Dk6 bBTrxwPyF594MbNbLwjWHFAQZHVLL2uctajDNWjQKYg2NCJ8/B5Y0XXMfGvUNi5lGoWj ZByA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=EAgn+yg3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si3980725edj.156.2020.07.30.15.34.11; Thu, 30 Jul 2020 15:34:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=EAgn+yg3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730024AbgG3Wdu (ORCPT + 99 others); Thu, 30 Jul 2020 18:33:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728607AbgG3Wdu (ORCPT ); Thu, 30 Jul 2020 18:33:50 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B500C061574 for ; Thu, 30 Jul 2020 15:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Sender: Reply-To:Cc:Content-ID:Content-Description; bh=F8V5dJHtdOS7toaRAn2Ry59zBUcx5vitMpMVIJbeVfk=; b=EAgn+yg3QQpl9ZeRYNqax2++tY v9WOHaDz0CaO8A99zlFxGIOayyA+cQVtIkuhn91Dv1ReQzVauCGu+yHnAq3mcynE0AAgO1YgwW2nW HaSvOTyJxY90uSuTZSpaID7Bd7mz8AWGOo4pzxHT269INqcBbULiQRAw1yIyl070I6bzk57iM9o4X 80OaIHdj7ChzLPaFRkxu03RtNE8iKioyHh2+z9RXoEWZSFKkmyrg0jci9+NN4iEPvcnLEF7ErZFAy rjalyyGIo9E7988CtYqd/npRv3hQyr73o1RVHukOWNhi5CPKd629y0HzUGq9so60iK0M1+fiYrNdk VEzfilnQ==; Received: from [2601:1c0:6280:3f0:897c:6038:c71d:ecac] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1H7Q-0006Vz-2W; Thu, 30 Jul 2020 22:33:45 +0000 Subject: Re: [PATCH] Platform lockdown information in SYSFS To: Daniel Gutson , Derek Kiernan , Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mika Westerberg , Arnd Bergmann , Greg Kroah-Hartman , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Richard Hughes , Alex Bazhaniuk References: <20200730214136.5534-1-daniel.gutson@eclypsium.com> From: Randy Dunlap Message-ID: <5bd9d37f-4567-f28b-3932-58bd9de38882@infradead.org> Date: Thu, 30 Jul 2020 15:33:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200730214136.5534-1-daniel.gutson@eclypsium.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Could we get some consistency in the use of "bios" vs. "Bios" vs. "BIOS", please. BIOS is preferred IMO. On 7/30/20 2:41 PM, Daniel Gutson wrote: > > This initial version exports the BIOS Write Enable (bioswe), > BIOS Lock Enable (ble), and the SMM Bios Write Protect (SMM_BWP) > fields of the Bios Control register. The idea is to keep adding more > flags, not only from the BC but also from other registers in following > versions. > > The goal is that the attributes are avilable to fwupd when SecureBoot available > is turned on. > > The patch provides a new misc driver, as proposed in the previous patch, > that provides a registration function for HW Driver devices to register > class_attributes. > In this case, the intel SPI flash chip (intel-spi) registers three > class_attributes corresponding to the fields mentioned above. > > Signed-off-by: Daniel Gutson > --- > .../ABI/stable/sysfs-class-platform-lockdown | 23 +++++++ > MAINTAINERS | 7 +++ > drivers/misc/Kconfig | 9 +++ > drivers/misc/Makefile | 1 + > drivers/misc/platform-lockdown-attrs.c | 57 +++++++++++++++++ > drivers/mtd/spi-nor/controllers/Kconfig | 1 + > .../mtd/spi-nor/controllers/intel-spi-pci.c | 49 +++++++++++++++ > drivers/mtd/spi-nor/controllers/intel-spi.c | 62 +++++++++++++++++++ > .../platform_data/platform-lockdown-attrs.h | 19 ++++++ > 9 files changed, 228 insertions(+) > create mode 100644 Documentation/ABI/stable/sysfs-class-platform-lockdown > create mode 100644 drivers/misc/platform-lockdown-attrs.c > create mode 100644 include/linux/platform_data/platform-lockdown-attrs.h > > diff --git a/Documentation/ABI/stable/sysfs-class-platform-lockdown b/Documentation/ABI/stable/sysfs-class-platform-lockdown > new file mode 100644 > index 000000000000..6034d6cbefac > --- /dev/null > +++ b/Documentation/ABI/stable/sysfs-class-platform-lockdown > @@ -0,0 +1,23 @@ > +What: /sys/class/platform-lockdown/bioswe > +Date: July 2020 > +KernelVersion: 5.8.0 > +Contact: Daniel Gutson > +Description: If the system firmware set BIOS Write Enable. > + 0: writes disabled, 1: writes enabled. > +Users: https://github.com/fwupd/fwupd > + > +What: /sys/class/platform-lockdown/ble > +Date: July 2020 > +KernelVersion: 5.8.0 > +Contact: Daniel Gutson > +Description: If the system firmware set Bios Lock Enable. BIOS > + 0: SMM lock disabled, 1: SMM lock enabled. > +Users: https://github.com/fwupd/fwupd > + > +What: /sys/class/platform-lockdown/smm_bwp > +Date: July 2020 > +KernelVersion: 5.8.0 > +Contact: Daniel Gutson > +Description: If the system firmware set SMM Bios Write Protect. BIOS > + 0: writes disabled unless in SMM, 1: writes enabled. > +Users: https://github.com/fwupd/fwupd cheers. -- ~Randy