Skip to contentSkip to conversation

Platform integrity information in sysfs (version 9)

PATCH In review Daniel Gutson 1 participant 1 message Sep 30, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Platform integrity information in sysfs (version 9)

This patch exports the BIOS Write Enable (bioswe), BIOS
Lock Enable (biosle), and the SMM BIOS Write Protect (SMM_BIOSWP) fields of the BIOS Control register using the platform-integrity misc kernel module. 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 is turned on.

---
 drivers/mtd/spi-nor/controllers/Kconfig       |  1 +
 .../mtd/spi-nor/controllers/intel-spi-pci.c   | 75 ++++++++++++++-
 .../spi-nor/controllers/intel-spi-platform.c  |  2 +-
 drivers/mtd/spi-nor/controllers/intel-spi.c   | 91 ++++++++++++++++++-
 drivers/mtd/spi-nor/controllers/intel-spi.h   |  9 +-
 5 files changed, 171 insertions(+), 7 deletions(-)
drivers/mtd/spi-nor/controllers/Kconfig +1 -0
index 5c0e0ec2e6d1..e7eaef506fc2 100644
@@ -29,6 +29,7 @@ config SPI_NXP_SPIFI
 
 config SPI_INTEL_SPI
 	tristate
+	depends on PLATFORM_INTEGRITY_DATA
 
 config SPI_INTEL_SPI_PCI
 	tristate "Intel PCH/PCU SPI flash PCI driver (DANGEROUS)"
drivers/mtd/spi-nor/controllers/intel-spi-pci.c +74 -1

98 lines not on this page · raw message

drivers/mtd/spi-nor/controllers/intel-spi-platform.c +1 -1
index f80f1086f928..5b1a9989426a 100644
@@ -23,7 +23,7 @@ static int intel_spi_platform_probe(struct platform_device *pdev)
 		return -EINVAL;
 
 	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ispi = intel_spi_probe(&pdev->dev, mem, info);
+	ispi = intel_spi_probe(&pdev->dev, mem, info, NULL);
 	if (IS_ERR(ispi))
 		return PTR_ERR(ispi);
 
drivers/mtd/spi-nor/controllers/intel-spi.c +88 -3

139 lines not on this page · raw message

drivers/mtd/spi-nor/controllers/intel-spi.h +7 -2
index e2f41b8827bf..5b00df0d4f19 100644
@@ -14,8 +14,13 @@
 struct intel_spi;
 struct resource;
 
-struct intel_spi *intel_spi_probe(struct device *dev,
-	struct resource *mem, const struct intel_spi_boardinfo *info);
+typedef struct device *(*register_platform_integrity_t)(struct device *parent,
+			enum intel_spi_type type);
+
+struct intel_spi *intel_spi_probe(struct device *dev, struct resource *mem,
+				  const struct intel_spi_boardinfo *info,
+				  register_platform_integrity_t register_pi_cb);
+
 int intel_spi_remove(struct intel_spi *ispi);
 
 #endif /* INTEL_SPI_H */
Signature · 1 line
2.25.1