summaryrefslogtreecommitdiff
path: root/arch/s390/kernel/os_info.c
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@linux.ibm.com>2022-01-27 16:28:49 +0300
committerAlexander Gordeev <agordeev@linux.ibm.com>2024-04-17 14:38:01 +0300
commit88702793c5b4ef127a1f57d76920a80f70d081a7 (patch)
tree1e1648660fb58804d59aadf22783fffe6e9ce005 /arch/s390/kernel/os_info.c
parent5fb50fa66ab94141c0692dc5043ed30e6159a81b (diff)
downloadlinux-88702793c5b4ef127a1f57d76920a80f70d081a7.tar.xz
s390/os_info: Introduce value entries
Introduce entries that do not reference any data in memory, but rather provide values. Set the size of such entries to zero and do not compute checksum for them, since there is no data which integrity needs to be checked. The integrity of the value entries itself is still covered by the os_info checksum. Reserve the lowest unused entry index OS_INFO_RESERVED for future use - presumably for the number of entries present. That could later be used by user level tools. The existing tools would not notice any difference. Acked-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/kernel/os_info.c')
-rw-r--r--arch/s390/kernel/os_info.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/arch/s390/kernel/os_info.c b/arch/s390/kernel/os_info.c
index a801e6bd5341..3800824f8466 100644
--- a/arch/s390/kernel/os_info.c
+++ b/arch/s390/kernel/os_info.c
@@ -43,9 +43,9 @@ void os_info_crashkernel_add(unsigned long base, unsigned long size)
}
/*
- * Add OS info entry and update checksum
+ * Add OS info data entry and update checksum
*/
-void os_info_entry_add(int nr, void *ptr, u64 size)
+void os_info_entry_add_data(int nr, void *ptr, u64 size)
{
os_info.entry[nr].addr = __pa(ptr);
os_info.entry[nr].size = size;
@@ -54,6 +54,17 @@ void os_info_entry_add(int nr, void *ptr, u64 size)
}
/*
+ * Add OS info value entry and update checksum
+ */
+void os_info_entry_add_val(int nr, u64 value)
+{
+ os_info.entry[nr].val = value;
+ os_info.entry[nr].size = 0;
+ os_info.entry[nr].csum = 0;
+ os_info.csum = os_info_csum(&os_info);
+}
+
+/*
* Initialize OS info structure and set lowcore pointer
*/
void __init os_info_init(void)