]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
x86/platform/UV: Move blade local processor ID to the per cpu info struct
authorMike Travis <travis@sgi.com>
Fri, 29 Apr 2016 21:54:14 +0000 (16:54 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 27 Feb 2017 01:23:59 +0000 (17:23 -0800)
Orabug: 25477822

Move references to blade local processor ID to the new per cpu info
structs.  Create an access function that makes this move, and other
potential moves opaque to callers of this function.  Define a flag
that indicates to callers in external GPL modules that this function
replaces any local definition.  This allows calling source code to be
built for both pre-UV4 kernels as well as post-UV4 kernels.

Tested-by: John Estabrook <estabrook@sgi.com>
Tested-by: Gary Kroening <gfk@sgi.com>
Tested-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Reviewed-by: Dimitri Sivanich <sivanich@sgi.com>
Cc: Andrew Banman <abanman@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russ Anderson <rja@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160429215404.644173122@asylum.americas.sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
(cherry picked from commit 5627a8251f7861175b193a44dc3d8cb478d1135a)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/include/asm/uv/uv_hub.h
arch/x86/kernel/apic/x2apic_uv_x.c
arch/x86/platform/uv/tlb_uv.c
arch/x86/platform/uv/uv_time.c

index b8c5a6198ca130afb096dcefd39ee12f6635dcfd..4a6f02ae18ae88e0dc6744a73f49d6d9fa821f8d 100644 (file)
@@ -159,7 +159,6 @@ struct uv_hub_info_s {
        unsigned short          pnode_mask;
        unsigned short          coherency_domain_number;
        unsigned short          numa_blade_id;
-       unsigned char           blade_processor_id;
        unsigned char           m_val;
        unsigned char           n_val;
 };
@@ -572,9 +571,16 @@ extern short uv_possible_blades;
 /* Blade-local cpu number of current cpu. Numbered 0 .. <# cpus on the blade> */
 static inline int uv_blade_processor_id(void)
 {
-       return uv_hub_info->blade_processor_id;
+       return uv_cpu_info->blade_cpu_id;
 }
 
+/* Blade-local cpu number of cpu N. Numbered 0 .. <# cpus on the blade> */
+static inline int uv_cpu_blade_processor_id(int cpu)
+{
+       return uv_cpu_info_per(cpu)->blade_cpu_id;
+}
+#define _uv_cpu_blade_processor_id 1   /* indicate function available */
+
 /* Blade number of current cpu. Numnbered 0 .. <#blades -1> */
 static inline int uv_numa_blade_id(void)
 {
index e59490b72057fbfdd40c74c7f32e0a9fe509255d..31b81b4274db24371691305db0297a751d23e321 100644 (file)
@@ -1052,12 +1052,12 @@ void __init uv_system_init(void)
 
                uv_cpu_hub_info(cpu)->numa_blade_id = blade;
                uv_cpu_hub_info(cpu)->pnode = pnode;
-               uv_cpu_hub_info(cpu)->blade_processor_id = lcpu;
                uv_node_to_blade[nodeid] = blade;
                uv_cpu_to_blade[cpu] = blade;
 
                /* Initialize per cpu info list */
                uv_cpu_info_per(cpu)->p_uv_hub_info = uv_cpu_hub_info(cpu);
+               uv_cpu_info_per(cpu)->blade_cpu_id = lcpu;
                uv_cpu_info_per(cpu)->scir.offset = uv_scir_offset(apicid);
        }
 
index 534ab944b9477dd11168d89febb72c629cf317f1..fdb4d42b4ce50c57ac4933c6aa3604dfa12ab9cd 100644 (file)
@@ -2040,7 +2040,8 @@ static int scan_sock(struct socket_desc *sdp, struct uvhub_desc *bdp,
                        return 1;
                }
                bcp->uvhub_master = *hmasterp;
-               bcp->uvhub_cpu = uv_cpu_hub_info(cpu)->blade_processor_id;
+               bcp->uvhub_cpu = uv_cpu_blade_processor_id(cpu);
+
                if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) {
                        printk(KERN_EMERG "%d cpus per uvhub invalid\n",
                                bcp->uvhub_cpu);
index a244237f3cfa834af62fb81eabed244548a50f90..ddbf7c088288098bb52117d54b16b2ab0ba7af93 100644 (file)
@@ -166,7 +166,7 @@ static __init int uv_rtc_allocate_timers(void)
        for_each_present_cpu(cpu) {
                int nid = cpu_to_node(cpu);
                int bid = uv_cpu_to_blade_id(cpu);
-               int bcpu = uv_cpu_hub_info(cpu)->blade_processor_id;
+               int bcpu = uv_cpu_blade_processor_id(cpu);
                struct uv_rtc_timer_head *head = blade_info[bid];
 
                if (!head) {
@@ -227,7 +227,7 @@ static int uv_rtc_set_timer(int cpu, u64 expires)
        int pnode = uv_cpu_to_pnode(cpu);
        int bid = uv_cpu_to_blade_id(cpu);
        struct uv_rtc_timer_head *head = blade_info[bid];
-       int bcpu = uv_cpu_hub_info(cpu)->blade_processor_id;
+       int bcpu = uv_cpu_blade_processor_id(cpu);
        u64 *t = &head->cpu[bcpu].expires;
        unsigned long flags;
        int next_cpu;
@@ -263,7 +263,7 @@ static int uv_rtc_unset_timer(int cpu, int force)
        int pnode = uv_cpu_to_pnode(cpu);
        int bid = uv_cpu_to_blade_id(cpu);
        struct uv_rtc_timer_head *head = blade_info[bid];
-       int bcpu = uv_cpu_hub_info(cpu)->blade_processor_id;
+       int bcpu = uv_cpu_blade_processor_id(cpu);
        u64 *t = &head->cpu[bcpu].expires;
        unsigned long flags;
        int rc = 0;