Skip to contentSkip to conversation

x86 BIOS interface for partitioning and system serial number on SGI UV

PATCH In review Russ Anderson 2 participants 2 messages Jul 31, 2008 – Aug 5, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86 BIOS interface for partitioning and system serial number on SGI UV

x86 BIOS interface for partitioning and system serial number on SGI UV

---
 arch/x86/kernel/Makefile         |    2 
 arch/x86/kernel/bios_uv.c        |   87 +++++++++++++++++++++++++-
 arch/x86/kernel/genx2apic_uv_x.c |    8 +-
 arch/x86/kernel/tlb_uv.c         |    5 +
 arch/x86/kernel/uv_proc_fs.c     |  122 +++++++++++++++++++++++++++++++++++++
 include/asm-x86/uv/bios.h        |  127 ++++++++++++++++++++++++++++++++++-----
 6 files changed, 326 insertions(+), 25 deletions(-)
arch/x86/kernel/tlb_uv.c +4 -1
Index: linux/arch/x86/kernel/tlb_uv.c
===================================================================
@@ -14,6 +14,7 @@
 #include <asm/uv/uv_mmrs.h>
 #include <asm/uv/uv_hub.h>
 #include <asm/uv/uv_bau.h>
+#include <asm/uv/bios.h>
 #include <asm/genapic.h>
 #include <asm/idle.h>
 #include <asm/tsc.h>
@@ -565,7 +566,9 @@ static int __init uv_ptc_init(void)
 	if (!is_uv_system())
 		return 0;
 
-	if (!proc_mkdir("sgi_uv", NULL))
+	if (!sgi_uv_dir)
+		sgi_uv_dir = proc_mkdir("sgi_uv", NULL);
+	if (!sgi_uv_dir)
 		return -EINVAL;
 
 	proc_uv_ptc = create_proc_entry(UV_PTC_BASENAME, 0444, NULL);
arch/x86/kernel/uv_proc_fs.c new file +122 -0

122 lines not on this page · raw message

arch/x86/kernel/Makefile +1 -1
Index: linux/arch/x86/kernel/Makefile
===================================================================
@@ -104,7 +104,7 @@ obj-$(CONFIG_OLPC)		+= olpc.o
 # 64 bit specific files
 ifeq ($(CONFIG_X86_64),y)
         obj-y				+= genapic_64.o genapic_flat_64.o genx2apic_uv_x.o tlb_uv.o
-	obj-y				+= bios_uv.o
+	obj-y				+= bios_uv.o uv_proc_fs.o
         obj-y				+= genx2apic_cluster.o
         obj-y				+= genx2apic_phys.o
         obj-$(CONFIG_X86_PM_TIMER)	+= pmtimer_64.o
arch/x86/kernel/bios_uv.c +82 -5

113 lines not on this page · raw message

arch/x86/kernel/genx2apic_uv_x.c +6 -2
Index: linux/arch/x86/kernel/genx2apic_uv_x.c
===================================================================
@@ -344,7 +344,7 @@ static __init void uv_rtc_init(void)
 	long status, ticks_per_sec, drift;
 
 	status =
-	    x86_bios_freq_base(BIOS_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec,
+	    uv_bios_freq_base(BIOS_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec,
 					&drift);
 	if (status != 0 || ticks_per_sec < 100000) {
 		printk(KERN_WARNING
@@ -410,6 +410,10 @@ static __init void uv_system_init(void)
 	gnode_upper = (((unsigned long)node_id.s.node_id) &
 		       ~((1 << n_val) - 1)) << m_val;
 
+	uv_bios_get_sn_info(0, &uv_type, &uv_nasid_bitmask,
+			    &uv_nasid_shift, &uv_system_size,
+			    &uv_sharing_domain_size, &sn_partition_id,
+			    &uv_coherency_id, &uv_region_size);
 	uv_rtc_init();
 
 	for_each_present_cpu(cpu) {
@@ -431,7 +435,7 @@ static __init void uv_system_init(void)
 		uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1;
 		uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper;
 		uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base;
-		uv_cpu_hub_info(cpu)->coherency_domain_number = 0;/* ZZZ */
+		uv_cpu_hub_info(cpu)->coherency_domain_number = uv_coherency_id;
 		uv_node_to_blade[nid] = blade;
 		uv_cpu_to_blade[cpu] = blade;
 		max_pnode = max(pnode, max_pnode);
include/asm-x86/uv/bios.h +111 -16

156 lines not on this page · raw message

Signature · 2 lines
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          [email protected]
#1 lore raw
Quoted 45 lines · Russ Anderson

x86 BIOS interface for partitioning and system serial number on SGI UV

arch/x86/kernel/uv_proc_fs.c new file +40 -0
+static int licenseID_show(struct seq_file *s, void *p)
+{
+	seq_printf(s, "0x%llx\n", sn_partition_serial_number_val());
+	return 0;
+}
+
+static int licenseID_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, licenseID_show, NULL);
+}
+
+static int coherence_id_show(struct seq_file *s, void *p)
+{
+	seq_printf(s, "%d\n", partition_coherence_id());
+
+	return 0;
+}
+
+static int coherence_id_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, coherence_id_show, NULL);
+}
+
+static const struct file_operations proc_partition_id_fops = {
+	.open		= partition_id_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+
+static const struct file_operations proc_system_sn_fops = {
+	.open		= system_serial_number_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+
+static const struct file_operations proc_license_id_fops = {
+	.open		= licenseID_open,
+	.read		= seq_read,

arch/x86/kernel/uv_proc_fs.c line 100

Quoted 10 lines
arch/x86/kernel/uv_proc_fs.c new file +10 -0
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};
+
+static const struct file_operations proc_coherence_id_fops = {
+	.open		= coherence_id_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= single_release,
+};

...serial numbers do not belong to /proc. Plus I'm not sure if stuff like licenseIDs even belongs to Linux. What is it good for?

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html