summaryrefslogtreecommitdiff
path: root/src/include/device
diff options
context:
space:
mode:
authorRobert Zieba <robertzieba@google.com>2022-09-07 16:25:15 -0600
committerMartin L Roth <gaumless@gmail.com>2023-03-05 15:31:07 +0000
commitac8c378777d861000d82eea1c7439f16dcd45797 (patch)
tree58dafb5dd844410cec91e56c6f7ec5c8defd8fd5 /src/include/device
parentf1a4cffc88d8a5490c444f41b60eaaf544399998 (diff)
cpu/x86/smm: Add PCI resource store functionality
In certain cases data within protected memmory areas like SMRAM could be leaked or modified if an attacker remaps PCI BARs to point within that area. Add support to the existing SMM runtime to allow storing PCI resources in SMRAM and then later retrieving them. BRANCH=guybrush BUG=b:186792595 TEST=builds Signed-off-by: Robert Zieba <robertzieba@google.com> Change-Id: I23fb1e935dd1b89f1cc5c834cc2025f0fe5fda37 Reviewed-on: https://review.coreboot.org/c/coreboot/+/67931 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Diffstat (limited to 'src/include/device')
-rw-r--r--src/include/device/pci_def.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/device/pci_def.h b/src/include/device/pci_def.h
index 69ff79d91a..aa53909d1e 100644
--- a/src/include/device/pci_def.h
+++ b/src/include/device/pci_def.h
@@ -590,4 +590,8 @@
#define PCI_DEV2DEVFN(sdev) (((sdev)>>12) & 0xff)
#define PCI_DEV2SEGBUS(sdev) (((sdev)>>20) & 0xfff)
+/* Fields from within the device's class value. */
+#define PCI_CLASS_GET_DEVICE(c) (c >> 8)
+#define PCI_CLASS_GET_PROG(c) (c & 0xff)
+
#endif /* PCI_DEF_H */