Skip to contentSkip to conversation

firmware: coreboot: Support for System Management Interrupt (SMI) handling in coreboot payload (MM payload concept)

PATCH Superseded Michal Gorlas 3 participants 15 messages Jun 12, 2025 – Jun 17, 2025 ChromeOS EC subdrivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover firmware: coreboot: Support for System Management Interrupt (SMI) handling in coreboot payload (MM payload concept)

Hi,

This patchset adds support for MM payload when Linux is used as coreboot's payload. The main idea is to delegate higher-level SMM functions to the payload, limiting the coreboot's System Management Mode (SMM) related responsibilities to the minimum of basic SMM setup [1]. This is done by loading a blob with SMI handler to the shared buffer, from which it is copied to SMRAM [2].

The MM payload is still in a Proof of Concept stage, and we are still working on getting the patches needed for coreboot upstreamed, but I would appreciate any feedback that you may have.

Thanks,
Michal

[1]: https://github.com/9elements/LinuxBootSMM/wiki/Proposed-design#current-design-approach---mm-payload
[2]: https://github.com/9elements/LinuxBootSMM/wiki/Proof-of-Concept-(PoC)

Michal Gorlas (3):
firmware: coreboot: support for parsing SMM related informations from
coreboot tables
firmware: coreboot: loader for Linux-owned SMI handler
firmware: coreboot: Linux-owned SMI handler to be loaded by coreboot

 drivers/firmware/google/Kconfig               |  12 +
 drivers/firmware/google/Makefile              |  12 +
 drivers/firmware/google/coreboot_table.h      |  34 +-
 drivers/firmware/google/mm_blob.S             |  20 +
 drivers/firmware/google/mm_handler/Makefile   |  51 ++
 .../firmware/google/mm_handler/handler.lds.S  |  46 ++
 .../firmware/google/mm_handler/mm_handler.S   | 510 ++++++++++++++++++
 .../firmware/google/mm_handler/mm_handler.h   |  21 +
 .../firmware/google/mm_handler/mm_header.S    |  19 +
 drivers/firmware/google/mm_info.c             |  63 +++
 drivers/firmware/google/mm_loader.c           | 186 +++++++
 drivers/firmware/google/mm_payload.h          |  58 ++
 12 files changed, 1020 insertions(+), 12 deletions(-)
 create mode 100644 drivers/firmware/google/mm_blob.S
 create mode 100644 drivers/firmware/google/mm_handler/Makefile
 create mode 100644 drivers/firmware/google/mm_handler/handler.lds.S
 create mode 100644 drivers/firmware/google/mm_handler/mm_handler.S
 create mode 100644 drivers/firmware/google/mm_handler/mm_handler.h
 create mode 100644 drivers/firmware/google/mm_handler/mm_header.S
 create mode 100644 drivers/firmware/google/mm_info.c
 create mode 100644 drivers/firmware/google/mm_loader.c
 create mode 100644 drivers/firmware/google/mm_payload.h
Signature · 1 line
2.49.0
#1 lore raw

PATCH 1/3 firmware: coreboot: support for parsing SMM related informations from coreboot tables

coreboot exposes (S)MM related data in the coreboot table. Extends existing interface, with structure corresponding to (S)MM data, and adds parser. Parser exposes this data to the modules executed later.

---
 drivers/firmware/google/Kconfig          | 12 +++++
 drivers/firmware/google/Makefile         |  3 ++
 drivers/firmware/google/coreboot_table.h | 34 ++++++++-----
 drivers/firmware/google/mm_info.c        | 63 ++++++++++++++++++++++++
 drivers/firmware/google/mm_payload.h     | 58 ++++++++++++++++++++++
 5 files changed, 158 insertions(+), 12 deletions(-)
 create mode 100644 drivers/firmware/google/mm_info.c
 create mode 100644 drivers/firmware/google/mm_payload.h
drivers/firmware/google/Kconfig +12 -0
index 41b78f5cb735..5d918c076f25 100644
@@ -81,4 +81,16 @@ config GOOGLE_VPD
 	  This option enables the kernel to expose the content of Google VPD
 	  under /sys/firmware/vpd.
 
+config COREBOOT_PAYLOAD_MM
+	tristate "SMI handling in Linux (LinuxBootSMM)"
+	depends on GOOGLE_COREBOOT_TABLE
+	help
+	  Enables support for SMI handling by Linux-owned code.
+	  coreboot reserves region for payload-owned SMI handler, the Linux
+	  driver prepares its SMI handler outside of SMRAM, and lets coreboot
+	  know where the handler is placed by issuing an SMI. On this SMI, the
+	  handler is being placed in SMRAM and all supported SMIs from that point
+	  on are handled by Linux-owned SMI handler.
+	  If in doubt, say N.
+
 endif # GOOGLE_FIRMWARE
drivers/firmware/google/Makefile +3 -0
index 8151e323cc43..d2a690e8379d 100644
@@ -12,3 +12,6 @@ obj-$(CONFIG_GOOGLE_CBMEM)		+= cbmem.o
 
 vpd-sysfs-y := vpd.o vpd_decode.o
 obj-$(CONFIG_GOOGLE_VPD)		+= vpd-sysfs.o
+
+# LinuxBootSMM related.
+obj-$(CONFIG_COREBOOT_PAYLOAD_MM)		+= mm_info.o
drivers/firmware/google/coreboot_table.h +22 -12
index bb6f0f7299b4..e0b087933c5a 100644
@@ -41,7 +41,6 @@ struct lb_cbmem_ref {
 };
 
 #define LB_TAG_CBMEM_ENTRY 0x31
-
 /* Corresponds to LB_TAG_CBMEM_ENTRY */
 struct lb_cbmem_entry {
 	u32 tag;
@@ -52,6 +51,16 @@ struct lb_cbmem_entry {
 	u32 id;
 };
 
+/* Corresponds to LB_TAG_PLD_MM_INTERFACE_INFO */
+#define LB_TAG_PLD_MM_INTERFACE_INFO 0x3b
+struct lb_pld_mm_interface_info {
+	u32 tag;
+	u32 size;
+	u8 revision;
+	u8 requires_long_mode_call;
+	u8 register_mm_entry_command;
+};
+
 /* Describes framebuffer setup by coreboot */
 struct lb_framebuffer {
 	u32 tag;
@@ -61,15 +70,15 @@ struct lb_framebuffer {
 	u32 x_resolution;
 	u32 y_resolution;
 	u32 bytes_per_line;
-	u8  bits_per_pixel;
-	u8  red_mask_pos;
-	u8  red_mask_size;
-	u8  green_mask_pos;
-	u8  green_mask_size;
-	u8  blue_mask_pos;
-	u8  blue_mask_size;
-	u8  reserved_mask_pos;
-	u8  reserved_mask_size;
+	u8 bits_per_pixel;
+	u8 red_mask_pos;
+	u8 red_mask_size;
+	u8 green_mask_pos;
+	u8 green_mask_size;
+	u8 blue_mask_pos;
+	u8 blue_mask_size;
+	u8 reserved_mask_pos;
+	u8 reserved_mask_size;
 };
 
 /* A device, additionally with information from coreboot. */
@@ -80,6 +89,7 @@ struct coreboot_device {
 		struct lb_cbmem_ref cbmem_ref;
 		struct lb_cbmem_entry cbmem_entry;
 		struct lb_framebuffer framebuffer;
+		struct lb_pld_mm_interface_info mm_info;
 		DECLARE_FLEX_ARRAY(u8, raw);
 	};
 };
@@ -112,8 +122,8 @@ void coreboot_driver_unregister(struct coreboot_driver *driver);
  * boilerplate.  Each module may only use this macro once, and
  * calling it replaces module_init() and module_exit()
  */
-#define module_coreboot_driver(__coreboot_driver) \
+#define module_coreboot_driver(__coreboot_driver)                  \
 	module_driver(__coreboot_driver, coreboot_driver_register, \
-			coreboot_driver_unregister)
+		      coreboot_driver_unregister)
 
 #endif /* __COREBOOT_TABLE_H */
drivers/firmware/google/mm_info.c new file +63 -0

63 lines not on this page · raw message

drivers/firmware/google/mm_payload.h new file +58 -0

58 lines not on this page · raw message

Signature · 1 line
2.49.0
#2 lore raw

Re: [PATCH v1 1/3] firmware: coreboot: support for parsing SMM related informations from coreboot tables

Hi,

Quoted 3 lines · Michal Gorlas

coreboot exposes (S)MM related data in the coreboot table. Extends existing interface, with structure corresponding to (S)MM data, and adds parser. Parser exposes this data to the modules executed later.

I don't think I have much opinion or knowledge about this feature, so I'd probably defer to someone actually involved in the coreboot project (Julius?) for some of that.

But a few cursory thoughts on the driver mechanics:

Quoted 16 lines
---
 drivers/firmware/google/Kconfig          | 12 +++++
 drivers/firmware/google/Makefile         |  3 ++
 drivers/firmware/google/coreboot_table.h | 34 ++++++++-----
 drivers/firmware/google/mm_info.c        | 63 ++++++++++++++++++++++++
 drivers/firmware/google/mm_payload.h     | 58 ++++++++++++++++++++++
 5 files changed, 158 insertions(+), 12 deletions(-)
 create mode 100644 drivers/firmware/google/mm_info.c
 create mode 100644 drivers/firmware/google/mm_payload.h
drivers/firmware/google/Kconfig +0 -0
index 41b78f5cb735..5d918c076f25 100644

drivers/firmware/google/Kconfig config GOOGLE_VPD · line 86

Quoted 6 lines
drivers/firmware/google/Kconfig +3 -0
@@ -81,4 +81,16 @@ config GOOGLE_VPD
 	  This option enables the kernel to expose the content of Google VPD
 	  under /sys/firmware/vpd.
 
+config COREBOOT_PAYLOAD_MM
+	tristate "SMI handling in Linux (LinuxBootSMM)"
+	depends on GOOGLE_COREBOOT_TABLE

This all looks highly X86-specific, so you probably need 'depends on X86'.

Quoted 17 lines
drivers/firmware/google/Kconfig +9 -0
+	help
+	  Enables support for SMI handling by Linux-owned code.
+	  coreboot reserves region for payload-owned SMI handler, the Linux
+	  driver prepares its SMI handler outside of SMRAM, and lets coreboot
+	  know where the handler is placed by issuing an SMI. On this SMI, the
+	  handler is being placed in SMRAM and all supported SMIs from that point
+	  on are handled by Linux-owned SMI handler.
+	  If in doubt, say N.
+
 endif # GOOGLE_FIRMWARE
drivers/firmware/google/coreboot_table.h +0 -0
index bb6f0f7299b4..e0b087933c5a 100644

drivers/firmware/google/coreboot_table.h void coreboot_driver_unregister(struct coreboot_driver *driver); · line 127

Quoted 8 lines
drivers/firmware/google/coreboot_table.h +2 -2
@@ -112,8 +122,8 @@ void coreboot_driver_unregister(struct coreboot_driver *driver);
  * boilerplate.  Each module may only use this macro once, and
  * calling it replaces module_init() and module_exit()
  */
-#define module_coreboot_driver(__coreboot_driver) \
+#define module_coreboot_driver(__coreboot_driver)                  \
 	module_driver(__coreboot_driver, coreboot_driver_register, \
-			coreboot_driver_unregister)
+		      coreboot_driver_unregister)

You're making arbitrary whitespace changes in this hunk. Try to avoid that, please.

Quoted 25 lines
drivers/firmware/google/coreboot_table.h +0 -0
 #endif /* __COREBOOT_TABLE_H */
drivers/firmware/google/mm_info.c new file +17 -0
new file mode 100644
index 000000000000..55bcdc8b8d53
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * mm_info.c
+ *
+ * Driver for exporting MM payload information from coreboot table.
+ *
+ * Copyright 2025 9elements gmbh
+ * Copyright 2025 Michal Gorlas <[email protected]>
+ */
+
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+
+#include "coreboot_table.h"
+#include "mm_payload.h"
+

drivers/firmware/google/mm_info.c line 27

Quoted 10 lines
drivers/firmware/google/mm_info.c new file +10 -0
+static struct lb_pld_mm_interface_info *mm_cbtable_info;
+struct mm_info *mm_info;
+
+static int mm_driver_probe(struct coreboot_device *dev)
+{
+	mm_cbtable_info = &dev->mm_info;
+	if (mm_cbtable_info->tag != LB_TAG_PLD_MM_INTERFACE_INFO)
+		return -ENXIO;
+
+	mm_info = kmalloc(sizeof(*mm_info), GFP_KERNEL);

Error handling? (Needs a NULL check.)

And might as well use devm_*() (e.g., devm_kzalloc()); then you can drop mm_driver_remove().

drivers/firmware/google/mm_info.c line 35

Quoted 8 lines
drivers/firmware/google/mm_info.c new file +8 -0
+	mm_info->revision = mm_cbtable_info->revision;
+	mm_info->requires_long_mode_call =
+		mm_cbtable_info->requires_long_mode_call;
+	mm_info->register_mm_entry_command =
+		mm_cbtable_info->register_mm_entry_command;
+	return 0;
+}
+EXPORT_SYMBOL(mm_info);

Why non-GPL? IIUC, EXPORT_SYMBOL_GPL() is the usual default.

Or, I suspect you don't actually need two separate modules, so you probably don't need this EXPORT at all.

drivers/firmware/google/mm_info.c line 42

Quoted 7 lines
drivers/firmware/google/mm_info.c new file +7 -0
+
+static void mm_driver_remove(struct coreboot_device *dev)
+{
+	if (mm_info)
+		kfree(mm_info);
+}
+

...

Brian

#3 lore raw

Re: [PATCH v1 1/3] firmware: coreboot: support for parsing SMM related informations from coreboot tables

Hi,
Thanks for taking your time to go over the patches.

Quoted 4 lines · Brian Norris

This all looks highly X86-specific, so you probably need 'depends on X86'.

Indeed, this was also why CI build was failed.

Quoted 4 lines
Quoted 4 lines
drivers/firmware/google/coreboot_table.h +0 -0
@@ -112,8 +122,8 @@ void coreboot_driver_unregister(struct coreboot_driver *driver);
  * boilerplate.  Each module may only use this macro once, and
  * calling it replaces module_init() and module_exit()
  */
Quoted 9 lines

drivers/firmware/google/coreboot_table.h void coreboot_driver_unregister(struct coreboot_driver *driver); · line 127

Quoted 5 lines
drivers/firmware/google/coreboot_table.h +2 -2
-#define module_coreboot_driver(__coreboot_driver) \
+#define module_coreboot_driver(__coreboot_driver)                  \
 	module_driver(__coreboot_driver, coreboot_driver_register, \
-			coreboot_driver_unregister)
+		      coreboot_driver_unregister)

You're making arbitrary whitespace changes in this hunk. Try to avoid that, please.

Sure, will do. It came from a style warning when running scripts/checkpatch.pl. I thought it could be useful to fix it on the same go.

Quoted 52 lines
Quoted 25 lines
drivers/firmware/google/coreboot_table.h +0 -0
 #endif /* __COREBOOT_TABLE_H */
drivers/firmware/google/mm_info.c new file +17 -0
new file mode 100644
index 000000000000..55bcdc8b8d53
@@ -0,0 +1,63 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * mm_info.c
+ *
+ * Driver for exporting MM payload information from coreboot table.
+ *
+ * Copyright 2025 9elements gmbh
+ * Copyright 2025 Michal Gorlas <[email protected]>
+ */
+
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+
+#include "coreboot_table.h"
+#include "mm_payload.h"
+

drivers/firmware/google/mm_info.c line 27

Quoted 10 lines
drivers/firmware/google/mm_info.c new file +10 -0
+static struct lb_pld_mm_interface_info *mm_cbtable_info;
+struct mm_info *mm_info;
+
+static int mm_driver_probe(struct coreboot_device *dev)
+{
+	mm_cbtable_info = &dev->mm_info;
+	if (mm_cbtable_info->tag != LB_TAG_PLD_MM_INTERFACE_INFO)
+		return -ENXIO;
+
+	mm_info = kmalloc(sizeof(*mm_info), GFP_KERNEL);

Error handling? (Needs a NULL check.)

And might as well use devm_*() (e.g., devm_kzalloc()); then you can drop mm_driver_remove().

drivers/firmware/google/mm_info.c line 35

Quoted 8 lines
drivers/firmware/google/mm_info.c new file +8 -0
+	mm_info->revision = mm_cbtable_info->revision;
+	mm_info->requires_long_mode_call =
+		mm_cbtable_info->requires_long_mode_call;
+	mm_info->register_mm_entry_command =
+		mm_cbtable_info->register_mm_entry_command;
+	return 0;
+}
+EXPORT_SYMBOL(mm_info);

Why non-GPL? IIUC, EXPORT_SYMBOL_GPL() is the usual default.

Quoted 3 lines

Or, I suspect you don't actually need two separate modules, so you probably don't need this EXPORT at all.

Yep these two definetely can be merged into one module. Will do that in v2 series.

Best,
Michal

#4 lore raw

Re: [PATCH v1 1/3] firmware: coreboot: support for parsing SMM related informations from coreboot tables

Quoted 15 lines · Michal Gorlas
Quoted 4 lines · Brian Norris
Quoted 4 lines
drivers/firmware/google/coreboot_table.h +0 -0
@@ -112,8 +122,8 @@ void coreboot_driver_unregister(struct coreboot_driver *driver);
  * boilerplate.  Each module may only use this macro once, and
  * calling it replaces module_init() and module_exit()
  */
Quoted 9 lines

drivers/firmware/google/coreboot_table.h void coreboot_driver_unregister(struct coreboot_driver *driver); · line 127

Quoted 5 lines
drivers/firmware/google/coreboot_table.h +2 -2
-#define module_coreboot_driver(__coreboot_driver) \
+#define module_coreboot_driver(__coreboot_driver)                  \
 	module_driver(__coreboot_driver, coreboot_driver_register, \
-			coreboot_driver_unregister)
+		      coreboot_driver_unregister)

You're making arbitrary whitespace changes in this hunk. Try to avoid that, please.

Quoted 3 lines

Sure, will do. It came from a style warning when running scripts/checkpatch.pl. I thought it could be useful to fix it on the same go.

That's odd, I don't see any such warning. Anyway, typically I'd expect such things not to be lumped together under the "separate your changes" guidance of Documentation/process/submitting-patches.rst (if they're worth changing at all), although that may not be a hard and fast rule.

Brian

#5 lore raw

Re: [PATCH v1 1/3] firmware: coreboot: support for parsing SMM related informations from coreboot tables

Quoted 16 lines · Brian Norris
Quoted 15 lines · Michal Gorlas
Quoted 13 lines · Brian Norris

drivers/firmware/google/coreboot_table.h void coreboot_driver_unregister(struct coreboot_driver *driver); · line 127

Quoted 9 lines
drivers/firmware/google/coreboot_table.h +2 -2
@@ -112,8 +122,8 @@ void coreboot_driver_unregister(struct coreboot_driver *driver);
  * boilerplate.  Each module may only use this macro once, and
  * calling it replaces module_init() and module_exit()
  */
-#define module_coreboot_driver(__coreboot_driver) \
+#define module_coreboot_driver(__coreboot_driver)                  \
 	module_driver(__coreboot_driver, coreboot_driver_register, \
-			coreboot_driver_unregister)
+		      coreboot_driver_unregister)

You're making arbitrary whitespace changes in this hunk. Try to avoid that, please.

Quoted 8 lines
Quoted 3 lines

Sure, will do. It came from a style warning when running scripts/checkpatch.pl. I thought it could be useful to fix it on the same go.

That's odd, I don't see any such warning. Anyway, typically I'd expect such things not to be lumped together under the "separate your changes" guidance of Documentation/process/submitting-patches.rst (if they're worth changing at all), although that may not be a hard and fast rule.

My bad, the whitespace were not a consequence of checkpatch.pl complaints, but rather running clang-format on coreboot_table.h on a clean tree:

* $ clang-format -i drivers/firmware/google/coreboot_table.h
* $ git diff
* diff --git a/drivers/firmware/google/coreboot_table.h b/drivers/firmware/google/coreboot_table.h
* index bb6f0f7299b4..3d933c657535 100644
* --- a/drivers/firmware/google/coreboot_table.h
* +++ b/drivers/firmware/google/coreboot_table.h
* @@ -61,15 +61,15 @@ struct lb_framebuffer {

 *         u32 x_resolution;
 *         u32 y_resolution;
 *         u32 bytes_per_line;
 * -       u8  bits_per_pixel;
 * -       u8  red_mask_pos;
 * -       u8  red_mask_size;
 * -       u8  green_mask_pos;
 * -       u8  green_mask_size;
 * -       u8  blue_mask_pos;
 * -       u8  blue_mask_size;
 * -       u8  reserved_mask_pos;
 * -       u8  reserved_mask_size;
 * +       u8 bits_per_pixel;
 * +       u8 red_mask_pos;
 * +       u8 red_mask_size;
 * +       u8 green_mask_pos;
 * +       u8 green_mask_size;
 * +       u8 blue_mask_pos;
 * +       u8 blue_mask_size;
 * +       u8 reserved_mask_pos;
 * +       u8 reserved_mask_size;
 *  };
 * 
 *  /* A device, additionally with information from coreboot. */
 * @@ -112,8 +112,8 @@ void coreboot_driver_unregister(struct coreboot_driver *driver);
 *   * boilerplate.  Each module may only use this macro once, and
 *   * calling it replaces module_init() and module_exit()
 *   */

* -#define module_coreboot_driver(__coreboot_driver) \
* +#define module_coreboot_driver(__coreboot_driver) \
* module_driver(__coreboot_driver, coreboot_driver_register, \
* - coreboot_driver_unregister)
* + coreboot_driver_unregister)
*
* #endif /* __COREBOOT_TABLE_H */

Anyway, I am not sure if it is even worth changing, its rather cosmetic. I removed these changes in v2.

Best,
Michal

#6 lore raw

PATCH 2/3 firmware: coreboot: loader for Linux-owned SMI handler

In reply to Michal Gorlas

Places a blob with Linux-owned SMI handler in the lower 4GB of memory, calculates entry points for the it and triggers SMI to coreboot's SMI handler informing it where to look for Linux-owned SMI handler.

---
 drivers/firmware/google/Makefile    |   9 ++
 drivers/firmware/google/mm_blob.S   |  20 +++
 drivers/firmware/google/mm_loader.c | 186 ++++++++++++++++++++++++++++
 3 files changed, 215 insertions(+)
 create mode 100644 drivers/firmware/google/mm_blob.S
 create mode 100644 drivers/firmware/google/mm_loader.c
drivers/firmware/google/Makefile +9 -0
index d2a690e8379d..eab5a62d7500 100644
@@ -15,3 +15,12 @@ obj-$(CONFIG_GOOGLE_VPD)		+= vpd-sysfs.o
 
 # LinuxBootSMM related.
 obj-$(CONFIG_COREBOOT_PAYLOAD_MM)		+= mm_info.o
+payload-mm-$(CONFIG_COREBOOT_PAYLOAD_MM)	:= mm_loader.o mm_blob.o
+
+subdir-						:= mm_handler
+obj-$(CONFIG_COREBOOT_PAYLOAD_MM)		+= payload-mm.o
+
+$(obj)/mm_blob.o: $(obj)/mm_handler/handler.bin
+
+$(obj)/mm_handler/handler.bin: FORCE
+	$(Q)$(MAKE) $(build)=$(obj)/mm_handler $@
drivers/firmware/google/mm_blob.S new file +20 -0
new file mode 100644
index 000000000000..87557d67c47b
@@ -0,0 +1,20 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Derived from rmpiggy.S.
+ *
+ * Wrapper script for the MM payload binary as a transport object
+ * before copying to SMRAM memory.
+ */
+#include <linux/linkage.h>
+#include <asm/page_types.h>
+
+	.section ".init.data","aw"
+
+	.balign PAGE_SIZE
+
+SYM_DATA_START(mm_blob)
+	.incbin	"drivers/firmware/google/mm_handler/handler.bin"
+SYM_DATA_END_LABEL(mm_blob, SYM_L_GLOBAL, mm_blob_end)
+
+SYM_DATA_START(mm_relocs)
+	.incbin	"drivers/firmware/google/mm_handler/handler.relocs"
+SYM_DATA_END(mm_relocs)
drivers/firmware/google/mm_loader.c new file +186 -0

186 lines not on this page · raw message

Signature · 1 line
2.49.0
#7 lore raw

Re: [PATCH v1 2/3] firmware: coreboot: loader for Linux-owned SMI handler

Quoted 9 lines · Michal Gorlas

Places a blob with Linux-owned SMI handler in the lower 4GB of memory, calculates entry points for the it and triggers SMI to coreboot's SMI handler informing it where to look for Linux-owned SMI handler.

---
 drivers/firmware/google/Makefile    |   9 ++
 drivers/firmware/google/mm_blob.S   |  20 +++
 drivers/firmware/google/mm_loader.c | 186 ++++++++++++++++++++++++++++

...

Quoted 3 lines
drivers/firmware/google/mm_loader.c new file +0 -0
@@ -0,0 +1,186 @@

...

drivers/firmware/google/mm_loader.c line 80

Quoted 9 lines
drivers/firmware/google/mm_loader.c new file +9 -0
+static int register_entry_point(struct mm_info *data, uint32_t entry_point)
+{
+	u64 cmd;
+	u8 status;
+
+	cmd = data->register_mm_entry_command |
+	      (PAYLOAD_MM_REGISTER_ENTRY << 8);
+	status = trigger_smi(cmd, entry_point, 5);
+	pr_info(DRIVER_NAME ": %s: SMI returned %x\n", __func__, status);

Don't print this kind of debug stuff at INFO level. If you need it, use KERN_DEBUG.

Once this gets attached to a proper device/driver, you probably want dev_dbg(), if anything.

drivers/firmware/google/mm_loader.c line 137

Quoted 7 lines
drivers/firmware/google/mm_loader.c new file +5 -0
+
+	return status;
+}
+
 
 
+	/* At this point relocations are done and we can do some cool

/*
* Multiline comment style is like this.
* i.e., start with "/*" on its own line.
* You got this right most of the time.
*/

Quoted 8 lines
drivers/firmware/google/mm_loader.c new file +8 -0
+	 * pointer arithmetics to help coreboot determine correct entry
+	 * point based on offsets.
+	 */
+	entry32_offset = mm_header->mm_entry_32 - (unsigned long)shared_buffer;
+	entry64_offset = mm_header->mm_entry_64 - (unsigned long)shared_buffer;
+
+	mm_header->mm_entry_32 = entry32_offset;
+	mm_header->mm_entry_64 = entry64_offset;

drivers/firmware/google/mm_loader.c line 155

Quoted 10 lines
drivers/firmware/google/mm_loader.c new file +10 -0
+
+	return (unsigned long)shared_buffer;
+}
+
+static int __init mm_loader_init(void)
+{
+	u32 entry_point;
+
+	if (!mm_info)
+		return -ENOMEM;

Hmm, so you have two modules, mm_info and mm_loader. mm_loader depends on mm_info, but doesn't actually express that dependency. Can you just merge mm_loader into mm_info or vice versa? Or at least, pass the necessary data directly between the two, not as some implicit ordering like this.

drivers/firmware/google/mm_loader.c line 167

Quoted 12 lines
drivers/firmware/google/mm_loader.c new file +12 -0
+
+	entry_point = place_handler();
+
+	if (register_entry_point(mm_info, entry_point)) {
+		pr_warn(DRIVER_NAME ": registering entry point for MM payload failed.\n");
+		kfree(mm_info);
+		mm_info = NULL;
+		free_pages((unsigned long)shared_buffer, get_order(blob_size));
+		return -1;
+	}
+
+	mdelay(100);

Why the delay? At least use a comment to tell us. And if it's really needed, use msleep(), not mdelay(). scripts/checkpatch.pl should have warned you. And, please use scripts/checkpatch.pl if you aren't already ;)

drivers/firmware/google/mm_loader.c line 162

Quoted 3 lines
drivers/firmware/google/mm_loader.c new file +3 -0
+
+	kfree(mm_info);
+	mm_info = NULL;

This is odd and racy, having one module free data provided by another, where that other module might also free it. Hopefully this gets simplified if you manage to combine the modules, like I suggest.

drivers/firmware/google/mm_loader.c line 179

Quoted 9 lines
drivers/firmware/google/mm_loader.c new file +9 -0
+	free_pages((unsigned long)shared_buffer, get_order(blob_size));
+
+	return 0;
+}
+
+static void __exit mm_loader_exit(void)
+{
+	pr_info(DRIVER_NAME ": DONE\n");
+}

Remove this function. We don't do prints like this.

Brian

Quoted 10 lines
drivers/firmware/google/mm_loader.c new file +7 -0
+
+module_init(mm_loader_init);
+module_exit(mm_loader_exit);
+
+MODULE_AUTHOR("Michal Gorlas <[email protected]>");
+MODULE_DESCRIPTION("MM Payload loader - installs Linux-owned SMI handler");
+MODULE_LICENSE("GPL v2");
Signature · 1 line
2.49.0
#8 lore raw

Re: [PATCH v1 2/3] firmware: coreboot: loader for Linux-owned SMI handler

Quoted 16 lines · Brian Norris

drivers/firmware/google/mm_loader.c line 80

Quoted 9 lines
drivers/firmware/google/mm_loader.c new file +9 -0
+static int register_entry_point(struct mm_info *data, uint32_t entry_point)
+{
+	u64 cmd;
+	u8 status;
+
+	cmd = data->register_mm_entry_command |
+	      (PAYLOAD_MM_REGISTER_ENTRY << 8);
+	status = trigger_smi(cmd, entry_point, 5);
+	pr_info(DRIVER_NAME ": %s: SMI returned %x\n", __func__, status);

Don't print this kind of debug stuff at INFO level. If you need it, use KERN_DEBUG.

Once this gets attached to a proper device/driver, you probably want dev_dbg(), if anything.

...

Quoted 10 lines

drivers/firmware/google/mm_loader.c line 137

Quoted 3 lines
drivers/firmware/google/mm_loader.c new file +1 -0
+	/* At this point relocations are done and we can do some cool

/*
* Multiline comment style is like this.
* i.e., start with "/*" on its own line.
* You got this right most of the time.
*/

Got it.

Quoted 16 lines
Quoted 16 lines
drivers/firmware/google/mm_loader.c new file +16 -0
+	 * pointer arithmetics to help coreboot determine correct entry
+	 * point based on offsets.
+	 */
+	entry32_offset = mm_header->mm_entry_32 - (unsigned long)shared_buffer;
+	entry64_offset = mm_header->mm_entry_64 - (unsigned long)shared_buffer;
+
+	mm_header->mm_entry_32 = entry32_offset;
+	mm_header->mm_entry_64 = entry64_offset;
+
+	return (unsigned long)shared_buffer;
+}
+
+static int __init mm_loader_init(void)
+{
+	u32 entry_point;
+
Quoted 9 lines

drivers/firmware/google/mm_loader.c line 155

Quoted 2 lines
drivers/firmware/google/mm_loader.c new file +2 -0
+	if (!mm_info)
+		return -ENOMEM;

Hmm, so you have two modules, mm_info and mm_loader. mm_loader depends on mm_info, but doesn't actually express that dependency. Can you just merge mm_loader into mm_info or vice versa? Or at least, pass the necessary data directly between the two, not as some implicit ordering like this.

Yep, will do that. As long as there is only one cbtable entry (and I think this will stay like this), mm_info can be part of mm_loader.

Quoted 9 lines
Quoted 9 lines
drivers/firmware/google/mm_loader.c new file +9 -0
+
+	entry_point = place_handler();
+
+	if (register_entry_point(mm_info, entry_point)) {
+		pr_warn(DRIVER_NAME ": registering entry point for MM payload failed.\n");
+		kfree(mm_info);
+		mm_info = NULL;
+		free_pages((unsigned long)shared_buffer, get_order(blob_size));
+		return -1;
Quoted 9 lines

drivers/firmware/google/mm_loader.c line 167

Quoted 3 lines
drivers/firmware/google/mm_loader.c new file +3 -0
+	}
+
+	mdelay(100);

Why the delay? At least use a comment to tell us. And if it's really needed, use msleep(), not mdelay(). scripts/checkpatch.pl should have warned you. And, please use scripts/checkpatch.pl if you aren't already ;)

Long story short, SMIs on real hardware like to take longer from time to time, and the delay was a "safeguard". It is probably not the proper way to handle it, but locking here was not helpful at all, lock was released regardless of CPU being still in SMM context (I assume due to SMIs being invisible to whatever runs in ring-0). Have to admit though, that 100ms is a consequence of trial and error. I would actually use some on advice how to handle this properly. scripts/checkpatch.pl was not complaining about it. It only gave me:

WARNING: quoted string split across lines #57: FILE: drivers/firmware/google/mm_loader.c:57:
+ ".return_not_changed:"
+ "movq %%rcx, %[status]\n\t"

total: 0 errors, 1 warnings, 0 checks, 186 lines checked

Quoted 8 lines

drivers/firmware/google/mm_loader.c line 162

Quoted 3 lines
drivers/firmware/google/mm_loader.c new file +3 -0
+
+	kfree(mm_info);
+	mm_info = NULL;

This is odd and racy, having one module free data provided by another, where that other module might also free it. Hopefully this gets simplified if you manage to combine the modules, like I suggest.

Yep, got it.

Best,
Michal

#9 lore raw

Re: [PATCH v1 2/3] firmware: coreboot: loader for Linux-owned SMI handler

Quoted 9 lines · Michal Gorlas
Quoted 7 lines · Brian Norris

drivers/firmware/google/mm_loader.c line 167

Quoted 1 line
drivers/firmware/google/mm_loader.c new file +1 -0
+	mdelay(100);

Why the delay? At least use a comment to tell us. And if it's really needed, use msleep(), not mdelay(). scripts/checkpatch.pl should have warned you. And, please use scripts/checkpatch.pl if you aren't already ;)

Quoted 7 lines

Long story short, SMIs on real hardware like to take longer from time to time, and the delay was a "safeguard". It is probably not the proper way to handle it, but locking here was not helpful at all, lock was released regardless of CPU being still in SMM context (I assume due to SMIs being invisible to whatever runs in ring-0). Have to admit though, that 100ms is a consequence of trial and error. I would actually use some on advice how to handle this properly.

Sorry, I don't have any advice here at the moment.

Quoted 9 lines

scripts/checkpatch.pl was not complaining
about it. It only gave me:

WARNING: quoted string split across lines #57: FILE: drivers/firmware/google/mm_loader.c:57:

drivers/firmware/google/mm_loader.c new file +2 -0
+		     ".return_not_changed:"
+		     "movq	%%rcx, %[status]\n\t"

total: 0 errors, 1 warnings, 0 checks, 186 lines checked

I must have either misread or misremembered checkpatch's behavior. Possibly both. It has various other delay-realted warnings that point you at the kerneldoc comments for mdelay() and msleep() though, and the mdelay() comments say:

* Please double check, whether mdelay() is the right way to go or whether a
* refactoring of the code is the better variant to be able to use msleep()
* instead.

Brian

#10 lore raw

Re: [PATCH v1 2/3] firmware: coreboot: loader for Linux-owned SMI handler

Quoted 8 lines · Brian Norris

I must have either misread or misremembered checkpatch's behavior. Possibly both. It has various other delay-realted warnings that point you at the kerneldoc comments for mdelay() and msleep() though, and the mdelay() comments say:

* Please double check, whether mdelay() is the right way to go or whether a
* refactoring of the code is the better variant to be able to use msleep()
* instead.

Okay, will check if msleep() has the same effects in case SMI takes too long.

Best,
Michal

#11 lore raw

Re: [PATCH v1 2/3] firmware: coreboot: loader for Linux-owned SMI handler

In reply to Michal Gorlas
kernel test robot noticed the following build errors:

Hi Michal,

kernel test robot noticed the following build errors:

[auto build test ERROR on chrome-platform/for-next]
[also build test ERROR on chrome-platform/for-firmware-next linus/master v6.16-rc1 next-20250612] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Michal-Gorlas/firmware-coreboot-support-for-parsing-SMM-related-informations-from-coreboot-tables/20250612-221612
base:   https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next
patch link:    https://lore.kernel.org/r/6cfb5bae79c153c54da298c396adb8a28b5e785a.1749734094.git.michal.gorlas%409elements.com
patch subject: [PATCH v1 2/3] firmware: coreboot: loader for Linux-owned SMI handler
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20250613/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250613/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

drivers/firmware/google/mm_loader.c: In function 'place_handler':

>> drivers/firmware/google/mm_loader.c:105:9: error: implicit declaration of function 'wbinvd' [-Wimplicit-function-declaration]
     105 |         wbinvd();
         |         ^~~~~~

vim +/wbinvd +105 drivers/firmware/google/mm_loader.c

    84	
    85	static u32 __init place_handler(void)
    86	{
    87		/*
    88		 * The handler (aka MM blob) has to be placed in low 4GB of the memory.
    89		 * This is because we can not assume that coreboot will be in long mode
    90		 * while trying to copy the blob to SMRAM. Even if so, (can be checked by
    91		 * reading cb_data->mm_info.requires_long_mode_call), it would make our life
    92		 * way too complicated (e.g. no need for shared page table).
    93		 */
    94		size_t entry32_offset;
    95		size_t entry64_offset;
    96		u16 real_mode_seg;
    97		const u32 *rel;
    98		u32 count;
    99		unsigned long phys_base;
   100	
   101		blob_size = mm_payload_size_needed();
   102		shared_buffer = (void *)__get_free_pages(GFP_DMA32, get_order(blob_size));
   103	
   104		memcpy(shared_buffer, mm_blob, blob_size);
 > 105		wbinvd();

106
107 /*
108 * Based on arch/x86/realmode/init.c
109 * The sole purpose of doing relocations is to be able to calculate the offsets
110 * for entry points. While the absolute addresses are not valid anymore after the
111 * blob is copied to SMRAM, the distances between sections stay the same, so we
112 * can still calculate the correct entry point based on coreboot's bitness.
113 */
114 phys_base = __pa(shared_buffer);
115 real_mode_seg = phys_base >> 4;
116 rel = (u32 *)mm_relocs;
117
118 /* 16-bit segment relocations. */
119 count = *rel++;
120 while (count--) {
121 u16 *seg = (u16 *)(shared_buffer + *rel++);
122 *seg = real_mode_seg;
123 }
124
125 /* 32-bit linear relocations. */
126 count = *rel++;
127 while (count--) {
128 u32 *ptr = (u32 *)(shared_buffer + *rel++);
129 *ptr += phys_base;
130 }
131
132 mm_header = (struct mm_header *)shared_buffer;
133
134 mm_header->mm_signature = REALMODE_END_SIGNATURE;
135 mm_header->mm_blob_size = mm_payload_size_needed();
136
137 /* At this point relocations are done and we can do some cool
138 * pointer arithmetics to help coreboot determine correct entry
139 * point based on offsets.
140 */
141 entry32_offset = mm_header->mm_entry_32 - (unsigned long)shared_buffer;
142 entry64_offset = mm_header->mm_entry_64 - (unsigned long)shared_buffer;
143
144 mm_header->mm_entry_32 = entry32_offset;
145 mm_header->mm_entry_64 = entry64_offset;
146
147 return (unsigned long)shared_buffer;
148 }
149

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#12 lore raw

PATCH 3/3 firmware: coreboot: Linux-owned SMI handler to be loaded by coreboot

In reply to Michal Gorlas

Compiled in similar fashion to the realmode trampolines for x86. Currently supported are two SMIs: ACPI enable and disable. After being placed in SMRAM, this handler takes over handling of the supported SMIs from coreboot.

---
 drivers/firmware/google/mm_handler/Makefile   |  51 ++
 .../firmware/google/mm_handler/handler.lds.S  |  46 ++
 .../firmware/google/mm_handler/mm_handler.S   | 510 ++++++++++++++++++
 .../firmware/google/mm_handler/mm_handler.h   |  21 +
 .../firmware/google/mm_handler/mm_header.S    |  19 +
 5 files changed, 647 insertions(+)
 create mode 100644 drivers/firmware/google/mm_handler/Makefile
 create mode 100644 drivers/firmware/google/mm_handler/handler.lds.S
 create mode 100644 drivers/firmware/google/mm_handler/mm_handler.S
 create mode 100644 drivers/firmware/google/mm_handler/mm_handler.h
 create mode 100644 drivers/firmware/google/mm_handler/mm_header.S
drivers/firmware/google/mm_handler/Makefile new file +51 -0
new file mode 100644
index 000000000000..c0069e88f51d
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: GPL-2.0
+
+## Based on realmode/rm/Makefile
+
+always-y := handler.bin handler.relocs
+
+handler-y			+= mm_header.o
+handler-y			+= mm_handler.o
+
+targets	+= $(handler-y)
+
+REALMODE_OBJS = $(addprefix $(obj)/,$(handler-y))
+
+sed-pasyms := -n -r -e 's/^([0-9a-fA-F]+) [ABCDGRSTVW] (.+)$$/pa_\2 = \2;/p'
+
+quiet_cmd_pasyms = PASYMS  $@
+      cmd_pasyms = $(NM) $(real-prereqs) | sed $(sed-pasyms) | sort | uniq > $@
+
+targets += pasyms.h
+$(obj)/pasyms.h: $(REALMODE_OBJS) FORCE
+	$(call if_changed,pasyms)
+
+targets += handler.lds
+$(obj)/handler.lds: $(obj)/pasyms.h
+
+LDFLAGS_handler.elf := -m elf_i386 --emit-relocs -T
+CPPFLAGS_handler.lds += -P -C -I$(objtree)/$(obj)
+
+targets += handler.elf
+$(obj)/handler.elf: $(obj)/handler.lds $(REALMODE_OBJS) FORCE
+	$(call if_changed,ld)
+
+OBJCOPYFLAGS_handler.bin := -O binary
+
+targets += handler.bin
+$(obj)/handler.bin: $(obj)/handler.elf $(obj)/handler.relocs FORCE
+	$(call if_changed,objcopy)
+
+quiet_cmd_relocs = RELOCS  $@
+      cmd_relocs = arch/x86/tools/relocs --realmode $< > $@
+
+targets += handler.relocs
+$(obj)/handler.relocs: $(obj)/handler.elf FORCE
+	$(call if_changed,relocs)
+
+# ---------------------------------------------------------------------------
+
+KBUILD_CFLAGS	:= $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
+		   -I$(srctree)/arch/x86/boot
+KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__
+KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
drivers/firmware/google/mm_handler/handler.lds.S new file +46 -0

46 lines not on this page · raw message

drivers/firmware/google/mm_handler/mm_handler.S new file +510 -0

510 lines not on this page · raw message

drivers/firmware/google/mm_handler/mm_handler.h new file +21 -0
new file mode 100644
index 000000000000..4f32f84371d5
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Derived from arch/x86/include/realmode.h
+ */
+
+#ifndef _MM_HANDLER_H
+#define _MM_HANDLER_H
+
+#define REALMODE_END_SIGNATURE	0x65a22c82
+
+/*
+ * These macros correspond to the arguments
+ * passed by coreboot's SMI handler. Depending
+ * on which one is passed in rdi or esp + x, handler
+ * will jump to the appropriate section.
+ */
+#define MM_ACPI_ENABLE		1
+#define MM_ACPI_DISABLE		0
+#define MM_STORE		2
+
+#endif /* _MM_HANDLER_H */
drivers/firmware/google/mm_handler/mm_header.S new file +19 -0
new file mode 100644
index 000000000000..342cd60492f8
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * MM blob header; this should match mm_payload.h
+ */
+
+#include <linux/linkage.h>
+#include <asm/page_types.h>
+#include <asm/segment.h>
+
+	.section ".header", "a"
+
+	.balign	16
+SYM_DATA_START(mm_header)
+	.long	pa_text_start
+	.long	pa_mm_entry_32
+	.long	pa_mm_entry_64
+	.long	pa_mm_signature
+	.long	pa_mm_blob_size
+SYM_DATA_END(mm_header)
Signature · 1 line
2.49.0
#13 lore raw

Re: [PATCH v1 3/3] firmware: coreboot: Linux-owned SMI handler to be loaded by coreboot

Quoted 5 lines · Michal Gorlas

Compiled in similar fashion to the realmode trampolines for x86. Currently supported are two SMIs: ACPI enable and disable. After being placed in SMRAM, this handler takes over handling of the supported SMIs from coreboot.

Quoted 12 lines
---
 drivers/firmware/google/mm_handler/Makefile   |  51 ++
 .../firmware/google/mm_handler/handler.lds.S  |  46 ++
 .../firmware/google/mm_handler/mm_handler.S   | 510 ++++++++++++++++++
 .../firmware/google/mm_handler/mm_handler.h   |  21 +
 .../firmware/google/mm_handler/mm_header.S    |  19 +
 5 files changed, 647 insertions(+)
 create mode 100644 drivers/firmware/google/mm_handler/Makefile
 create mode 100644 drivers/firmware/google/mm_handler/handler.lds.S
 create mode 100644 drivers/firmware/google/mm_handler/mm_handler.S
 create mode 100644 drivers/firmware/google/mm_handler/mm_handler.h
 create mode 100644 drivers/firmware/google/mm_handler/mm_header.S

I'm not reviewing most of this patch right now (for one, I don't speak x86), but for starters, I think you need to add a .gitignore file in here somewhere. After building your code, I see these untracked files:

drivers/firmware/google/mm_handler/handler.lds drivers/firmware/google/mm_handler/handler.relocs drivers/firmware/google/mm_handler/pasyms.h

Brian

#14 lore raw

Re: [PATCH v1 3/3] firmware: coreboot: Linux-owned SMI handler to be loaded by coreboot

In reply to Michal Gorlas
kernel test robot noticed the following build errors:

Hi Michal,

kernel test robot noticed the following build errors:

[auto build test ERROR on chrome-platform/for-next]
[also build test ERROR on chrome-platform/for-firmware-next linus/master v6.16-rc1 next-20250613] [If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Michal-Gorlas/firmware-coreboot-support-for-parsing-SMM-related-informations-from-coreboot-tables/20250612-221612
base:   https://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux.git for-next
patch link:    https://lore.kernel.org/r/410d4d62b031d0e751e1933cf746540d5cb1682c.1749734094.git.michal.gorlas%409elements.com
patch subject: [PATCH v1 3/3] firmware: coreboot: Linux-owned SMI handler to be loaded by coreboot
config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20250613/[email protected]/config)
compiler: sh4-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250613/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> drivers/firmware/google/mm_handler/mm_header.S:7:10: fatal error: asm/page_types.h: No such file or directory
       7 | #include <asm/page_types.h>
         |          ^~~~~~~~~~~~~~~~~~
   compilation terminated.
--
>> drivers/firmware/google/mm_handler/mm_handler.S:11:10: fatal error: asm/pgtable_types.h: No such file or directory
      11 | #include <asm/pgtable_types.h>
         |          ^~~~~~~~~~~~~~~~~~~~~

compilation terminated.

vim +7 drivers/firmware/google/mm_handler/mm_header.S

   > 7	#include <asm/page_types.h>
Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki