From 95ad0282740ea01983e623b4d2e4a882375e0942 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Fri, 9 Jan 2026 09:59:31 -0600 Subject: [PATCH] drivers/smmstore: Use lookup_store() for memory-mapped reads The smmstore_lookup_region() function was using fmap_locate_area_as_rdev_rw() directly, which only provides direct SPI access. This bypassed the optimized lookup_store() function that uses incoherent_rdev to enable memory-mapped reads via the read-only device while keeping direct SPI writes via the read-write device. Change smmstore_lookup_region() to call lookup_store() instead, enabling memory-mapped reads for the public API and matching the behavior of the internal implementation. This improves read performance for EFI options and other consumers of the SMMSTORE region device. It also fixes an issue where direct SPI reads were crossing 4k page boundaries on older platforms (Broadwell and earlier) causing them to fail and the fallback option to be used, leading to a disconnect between the user-selected option and device beahvior. TEST=build/boot google/guado, verify all CFR options work properly and no errors in cbmem. Change-Id: I34947be932ede19a3fe896fe0da6373035fe6db7 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/90717 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/drivers/smmstore/store.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/smmstore/store.c b/src/drivers/smmstore/store.c index 35887b3c7f..fa4c1e1b51 100644 --- a/src/drivers/smmstore/store.c +++ b/src/drivers/smmstore/store.c @@ -134,7 +134,7 @@ int smmstore_lookup_region(struct region_device *rstore) if (!done) { done = 1; - if (fmap_locate_area_as_rdev_rw(SMMSTORE_REGION, &rdev)) { + if (lookup_store(&rdev)) { printk(BIOS_WARNING, "smm store: Unable to find SMM store FMAP region '%s'\n", SMMSTORE_REGION);