summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2022-04-26 17:50:54 +0000
committerSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>2022-07-13 17:27:26 -0500
commit6f94122fc885c967ee582076bfcc910c27a2eac2 (patch)
tree24c5a5429d25436ea866115fedf7c187d55beeee /include
parent91bda2dfb5cbdd4b2e934db7acdcbcacabc9d735 (diff)
downloadcachepc-linux-6f94122fc885c967ee582076bfcc910c27a2eac2.tar.gz
cachepc-linux-6f94122fc885c967ee582076bfcc910c27a2eac2.zip
x86/fault: Add support to dump RMP entry on fault
When SEV-SNP is enabled globally, a write from the host goes through the RMP check. If the hardware encounters the check failure, then it raises the #PF (with RMP set). Dump the RMP entry at the faulting pfn to help the debug. Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/sev.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/sev.h b/include/linux/sev.h
index 1a68842789e1..734b13a69c54 100644
--- a/include/linux/sev.h
+++ b/include/linux/sev.h
@@ -16,6 +16,7 @@ int snp_lookup_rmpentry(u64 pfn, int *level);
int psmash(u64 pfn);
int rmp_make_private(u64 pfn, u64 gpa, enum pg_level level, int asid, bool immutable);
int rmp_make_shared(u64 pfn, enum pg_level level);
+void dump_rmpentry(u64 pfn);
#else
static inline int snp_lookup_rmpentry(u64 pfn, int *level) { return 0; }
static inline int psmash(u64 pfn) { return -ENXIO; }
@@ -25,6 +26,7 @@ static inline int rmp_make_private(u64 pfn, u64 gpa, enum pg_level level, int as
return -ENODEV;
}
static inline int rmp_make_shared(u64 pfn, enum pg_level level) { return -ENODEV; }
+static inline void dump_rmpentry(u64 pfn) { }
#endif /* CONFIG_AMD_MEM_ENCRYPT */
#endif /* __LINUX_SEV_H */