2020-11-28 04:05:05

by Mike Travis

[permalink] [raw]
Subject: [PATCH v2 1/5] x86/platform/uv: Add kernel interfaces for obtaining system info.

Add kernel interfaces used to obtain info for the uv_sysfs driver
to display.

Signed-off-by: Mike Travis <[email protected]>
Reviewed-by: Steve Wahl <[email protected]>
---
arch/x86/include/asm/uv/bios.h | 2 ++
arch/x86/kernel/apic/x2apic_uv_x.c | 12 ++++++++++++
2 files changed, 14 insertions(+)

diff --git a/arch/x86/include/asm/uv/bios.h b/arch/x86/include/asm/uv/bios.h
index 01ba080887b3..1b6455f881f9 100644
--- a/arch/x86/include/asm/uv/bios.h
+++ b/arch/x86/include/asm/uv/bios.h
@@ -200,6 +200,8 @@ extern long sn_partition_id;
extern long sn_coherency_id;
extern long sn_region_size;
extern long system_serial_number;
+extern ssize_t uv_get_archtype(char *buf, int len);
+extern int uv_get_hubless_system(void);

extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 1b98f8c12b96..48746031b39a 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -502,6 +502,18 @@ enum uv_system_type get_uv_system_type(void)
return uv_system_type;
}

+int uv_get_hubless_system(void)
+{
+ return uv_hubless_system;
+}
+EXPORT_SYMBOL_GPL(uv_get_hubless_system);
+
+ssize_t uv_get_archtype(char *buf, int len)
+{
+ return scnprintf(buf, len, "%s/%s", uv_archtype, oem_table_id);
+}
+EXPORT_SYMBOL_GPL(uv_get_archtype);
+
int is_uv_system(void)
{
return uv_system_type != UV_NONE;
--
2.21.0


2020-12-07 22:41:24

by tip-bot2 for Haifeng Xu

[permalink] [raw]
Subject: [tip: x86/platform] x86/platform/uv: Add kernel interfaces for obtaining system info

The following commit has been merged into the x86/platform branch of tip:

Commit-ID: a67fffb017aed93fca42ce7aa5b6aaf54ff912ad
Gitweb: https://git.kernel.org/tip/a67fffb017aed93fca42ce7aa5b6aaf54ff912ad
Author: Mike Travis <[email protected]>
AuthorDate: Fri, 27 Nov 2020 21:42:23 -06:00
Committer: Borislav Petkov <[email protected]>
CommitterDate: Mon, 07 Dec 2020 19:44:54 +01:00

x86/platform/uv: Add kernel interfaces for obtaining system info

Add kernel interfaces used to obtain info for the uv_sysfs driver
to display.

Signed-off-by: Mike Travis <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Reviewed-by: Steve Wahl <[email protected]>
Acked-by: Hans de Goede <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
---
arch/x86/include/asm/uv/bios.h | 2 ++
arch/x86/kernel/apic/x2apic_uv_x.c | 12 ++++++++++++
2 files changed, 14 insertions(+)

diff --git a/arch/x86/include/asm/uv/bios.h b/arch/x86/include/asm/uv/bios.h
index 01ba080..1b6455f 100644
--- a/arch/x86/include/asm/uv/bios.h
+++ b/arch/x86/include/asm/uv/bios.h
@@ -200,6 +200,8 @@ extern long sn_partition_id;
extern long sn_coherency_id;
extern long sn_region_size;
extern long system_serial_number;
+extern ssize_t uv_get_archtype(char *buf, int len);
+extern int uv_get_hubless_system(void);

extern struct kobject *sgi_uv_kobj; /* /sys/firmware/sgi_uv */

diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index 1b98f8c..4874603 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -502,6 +502,18 @@ enum uv_system_type get_uv_system_type(void)
return uv_system_type;
}

+int uv_get_hubless_system(void)
+{
+ return uv_hubless_system;
+}
+EXPORT_SYMBOL_GPL(uv_get_hubless_system);
+
+ssize_t uv_get_archtype(char *buf, int len)
+{
+ return scnprintf(buf, len, "%s/%s", uv_archtype, oem_table_id);
+}
+EXPORT_SYMBOL_GPL(uv_get_archtype);
+
int is_uv_system(void)
{
return uv_system_type != UV_NONE;