24
24
#include <asm/uv/uv.h>
25
25
#include <asm/apic.h>
26
26
27
- static DEFINE_PER_CPU (int , x2apic_extra_bits ) ;
28
-
29
27
static enum uv_system_type uv_system_type ;
30
28
static int uv_hubbed_system ;
31
29
static int uv_hubless_system ;
@@ -40,16 +38,14 @@ static u8 oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1];
40
38
static struct {
41
39
unsigned int apicid_shift ;
42
40
unsigned int apicid_mask ;
43
- unsigned int socketid_shift ; /* aka pnode_shift for UV1/2 /3 */
41
+ unsigned int socketid_shift ; /* aka pnode_shift for UV2 /3 */
44
42
unsigned int pnode_mask ;
45
43
unsigned int gpa_shift ;
46
44
unsigned int gnode_shift ;
47
45
} uv_cpuid ;
48
46
49
47
static int uv_min_hub_revision_id ;
50
48
51
- unsigned int uv_apicid_hibits ;
52
-
53
49
static struct apic apic_x2apic_uv_x ;
54
50
static struct uv_hub_info_s uv_hub_info_node0 ;
55
51
@@ -139,12 +135,8 @@ static void __init uv_tsc_check_sync(void)
139
135
/* Accommodate different UV arch BIOSes */
140
136
mmr = uv_early_read_mmr (UVH_TSC_SYNC_MMR );
141
137
mmr_shift =
142
- is_uv1_hub () ? 0 :
143
138
is_uv2_hub () ? UVH_TSC_SYNC_SHIFT_UV2K : UVH_TSC_SYNC_SHIFT ;
144
- if (mmr_shift )
145
- sync_state = (mmr >> mmr_shift ) & UVH_TSC_SYNC_MASK ;
146
- else
147
- sync_state = 0 ;
139
+ sync_state = (mmr >> mmr_shift ) & UVH_TSC_SYNC_MASK ;
148
140
149
141
switch (sync_state ) {
150
142
case UVH_TSC_SYNC_VALID :
@@ -223,21 +215,6 @@ static void __init early_get_apic_socketid_shift(void)
223
215
pr_info ("UV: socketid_shift:%d pnode_mask:0x%x\n" , uv_cpuid .socketid_shift , uv_cpuid .pnode_mask );
224
216
}
225
217
226
- /*
227
- * Add an extra bit as dictated by bios to the destination apicid of
228
- * interrupts potentially passing through the UV HUB. This prevents
229
- * a deadlock between interrupts and IO port operations.
230
- */
231
- static void __init uv_set_apicid_hibit (void )
232
- {
233
- union uv1h_lb_target_physical_apic_id_mask_u apicid_mask ;
234
-
235
- if (is_uv1_hub ()) {
236
- apicid_mask .v = uv_early_read_mmr (UV1H_LB_TARGET_PHYSICAL_APIC_ID_MASK );
237
- uv_apicid_hibits = apicid_mask .s1 .bit_enables & UV_APICID_HIBIT_MASK ;
238
- }
239
- }
240
-
241
218
static void __init uv_stringify (int len , char * to , char * from )
242
219
{
243
220
/* Relies on 'to' being NULL chars so result will be NULL terminated */
@@ -280,36 +257,25 @@ static int __init uv_acpi_madt_oem_check(char *_oem_id, char *_oem_table_id)
280
257
281
258
/*
282
259
* Determine UV arch type.
283
- * SGI: UV100/1000
284
260
* SGI2: UV2000/3000
285
261
* SGI3: UV300 (truncated to 4 chars because of different varieties)
286
262
* SGI4: UV400 (truncated to 4 chars because of different varieties)
287
263
*/
288
- uv_hub_info -> hub_revision =
289
- !strncmp (oem_id , "SGI4" , 4 ) ? UV4_HUB_REVISION_BASE :
290
- !strncmp (oem_id , "SGI3" , 4 ) ? UV3_HUB_REVISION_BASE :
291
- !strcmp (oem_id , "SGI2" ) ? UV2_HUB_REVISION_BASE :
292
- !strcmp (oem_id , "SGI" ) ? UV1_HUB_REVISION_BASE : 0 ;
293
-
294
- if (uv_hub_info -> hub_revision == 0 )
295
- goto badbios ;
296
-
297
- switch (uv_hub_info -> hub_revision ) {
298
- case UV4_HUB_REVISION_BASE :
264
+ if (!strncmp (oem_id , "SGI4" , 4 )) {
265
+ uv_hub_info -> hub_revision = UV4_HUB_REVISION_BASE ;
299
266
uv_hubbed_system = 0x11 ;
300
- break ;
301
267
302
- case UV3_HUB_REVISION_BASE :
268
+ } else if (!strncmp (oem_id , "SGI3" , 4 )) {
269
+ uv_hub_info -> hub_revision = UV3_HUB_REVISION_BASE ;
303
270
uv_hubbed_system = 0x9 ;
304
- break ;
305
271
306
- case UV2_HUB_REVISION_BASE :
272
+ } else if (!strcmp (oem_id , "SGI2" )) {
273
+ uv_hub_info -> hub_revision = UV2_HUB_REVISION_BASE ;
307
274
uv_hubbed_system = 0x5 ;
308
- break ;
309
275
310
- case UV1_HUB_REVISION_BASE :
311
- uv_hubbed_system = 0x3 ;
312
- break ;
276
+ } else {
277
+ uv_hub_info -> hub_revision = 0 ;
278
+ goto badbios ;
313
279
}
314
280
315
281
pnodeid = early_get_pnodeid ();
@@ -323,14 +289,6 @@ static int __init uv_acpi_madt_oem_check(char *_oem_id, char *_oem_table_id)
323
289
uv_system_type = UV_X2APIC ;
324
290
uv_apic = 0 ;
325
291
326
- } else if (!strcmp (oem_table_id , "UVH" )) {
327
- /* Only UV1 systems: */
328
- uv_system_type = UV_NON_UNIQUE_APIC ;
329
- x86_platform .legacy .warm_reset = 0 ;
330
- __this_cpu_write (x2apic_extra_bits , pnodeid << uvh_apicid .s .pnode_shift );
331
- uv_set_apicid_hibit ();
332
- uv_apic = 1 ;
333
-
334
292
} else if (!strcmp (oem_table_id , "UVL" )) {
335
293
/* Only used for very small systems: */
336
294
uv_system_type = UV_LEGACY_APIC ;
@@ -347,7 +305,7 @@ static int __init uv_acpi_madt_oem_check(char *_oem_id, char *_oem_table_id)
347
305
348
306
badbios :
349
307
pr_err ("UV: OEM_ID:%s OEM_TABLE_ID:%s\n" , oem_id , oem_table_id );
350
- pr_err ("Current BIOS not supported, update kernel and/ or BIOS\n" );
308
+ pr_err ("Current UV Type or BIOS not supported \n" );
351
309
BUG ();
352
310
}
353
311
@@ -545,7 +503,6 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
545
503
int pnode ;
546
504
547
505
pnode = uv_apicid_to_pnode (phys_apicid );
548
- phys_apicid |= uv_apicid_hibits ;
549
506
550
507
val = (1UL << UVH_IPI_INT_SEND_SHFT ) |
551
508
(phys_apicid << UVH_IPI_INT_APIC_ID_SHFT ) |
@@ -576,7 +533,7 @@ static void uv_send_IPI_one(int cpu, int vector)
576
533
dmode = dest_Fixed ;
577
534
578
535
val = (1UL << UVH_IPI_INT_SEND_SHFT ) |
579
- (( apicid | uv_apicid_hibits ) << UVH_IPI_INT_APIC_ID_SHFT ) |
536
+ (apicid << UVH_IPI_INT_APIC_ID_SHFT ) |
580
537
(dmode << UVH_IPI_INT_DELIVERY_MODE_SHFT ) |
581
538
(vector << UVH_IPI_INT_VECTOR_SHFT );
582
539
@@ -634,22 +591,16 @@ static void uv_init_apic_ldr(void)
634
591
635
592
static u32 apic_uv_calc_apicid (unsigned int cpu )
636
593
{
637
- return apic_default_calc_apicid (cpu ) | uv_apicid_hibits ;
594
+ return apic_default_calc_apicid (cpu );
638
595
}
639
596
640
- static unsigned int x2apic_get_apic_id (unsigned long x )
597
+ static unsigned int x2apic_get_apic_id (unsigned long id )
641
598
{
642
- unsigned int id ;
643
-
644
- WARN_ON (preemptible () && num_online_cpus () > 1 );
645
- id = x | __this_cpu_read (x2apic_extra_bits );
646
-
647
599
return id ;
648
600
}
649
601
650
602
static u32 set_apic_id (unsigned int id )
651
603
{
652
- /* CHECKME: Do we need to mask out the xapic extra bits? */
653
604
return id ;
654
605
}
655
606
@@ -721,11 +672,6 @@ static struct apic apic_x2apic_uv_x __ro_after_init = {
721
672
.safe_wait_icr_idle = native_safe_x2apic_wait_icr_idle ,
722
673
};
723
674
724
- static void set_x2apic_extra_bits (int pnode )
725
- {
726
- __this_cpu_write (x2apic_extra_bits , pnode << uvh_apicid .s .pnode_shift );
727
- }
728
-
729
675
#define UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_LENGTH 3
730
676
#define DEST_SHIFT UVH_RH_GAM_ALIAS210_REDIRECT_CONFIG_0_MMR_DEST_BASE_SHFT
731
677
@@ -920,32 +866,23 @@ static __init void map_mmioh_high(int min_pnode, int max_pnode)
920
866
return ;
921
867
}
922
868
923
- if (is_uv1_hub ()) {
924
- mmr = UV1H_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR ;
925
- shift = UV1H_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR_BASE_SHFT ;
926
- mmioh .v = uv_read_local_mmr (mmr );
927
- enable = !!mmioh .s1 .enable ;
928
- base = mmioh .s1 .base ;
929
- m_io = mmioh .s1 .m_io ;
930
- n_io = mmioh .s1 .n_io ;
931
- } else if (is_uv2_hub ()) {
869
+ if (is_uv2_hub ()) {
932
870
mmr = UV2H_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR ;
933
871
shift = UV2H_RH_GAM_MMIOH_OVERLAY_CONFIG_MMR_BASE_SHFT ;
934
872
mmioh .v = uv_read_local_mmr (mmr );
935
873
enable = !!mmioh .s2 .enable ;
936
874
base = mmioh .s2 .base ;
937
875
m_io = mmioh .s2 .m_io ;
938
876
n_io = mmioh .s2 .n_io ;
939
- } else {
940
- return ;
941
- }
942
877
943
- if (enable ) {
944
- max_pnode &= (1 << n_io ) - 1 ;
945
- pr_info ("UV: base:0x%lx shift:%d N_IO:%d M_IO:%d max_pnode:0x%x\n" , base , shift , m_io , n_io , max_pnode );
946
- map_high ("MMIOH" , base , shift , m_io , max_pnode , map_uc );
947
- } else {
948
- pr_info ("UV: MMIOH disabled\n" );
878
+ if (enable ) {
879
+ max_pnode &= (1 << n_io ) - 1 ;
880
+ pr_info ("UV: base:0x%lx shift:%d N_IO:%d M_IO:%d max_pnode:0x%x\n" ,
881
+ base , shift , m_io , n_io , max_pnode );
882
+ map_high ("MMIOH" , base , shift , m_io , max_pnode , map_uc );
883
+ } else {
884
+ pr_info ("UV: MMIOH disabled\n" );
885
+ }
949
886
}
950
887
}
951
888
@@ -1081,9 +1018,6 @@ void uv_cpu_init(void)
1081
1018
return ;
1082
1019
1083
1020
uv_hub_info -> nr_online_cpus ++ ;
1084
-
1085
- if (get_uv_system_type () == UV_NON_UNIQUE_APIC )
1086
- set_x2apic_extra_bits (uv_hub_info -> pnode );
1087
1021
}
1088
1022
1089
1023
struct mn {
@@ -1114,9 +1048,6 @@ static void get_mn(struct mn *mnp)
1114
1048
} else if (is_uv2_hub ()) {
1115
1049
mnp -> m_val = m_n_config .s2 .m_skt ;
1116
1050
mnp -> n_lshift = mnp -> m_val == 40 ? 40 : 39 ;
1117
- } else if (is_uv1_hub ()) {
1118
- mnp -> m_val = m_n_config .s1 .m_skt ;
1119
- mnp -> n_lshift = mnp -> m_val ;
1120
1051
}
1121
1052
mnp -> m_shift = mnp -> m_val ? 64 - mnp -> m_val : 0 ;
1122
1053
}
@@ -1318,7 +1249,7 @@ static void __init build_socket_tables(void)
1318
1249
size_t bytes ;
1319
1250
1320
1251
if (!gre ) {
1321
- if (is_uv1_hub () || is_uv2_hub () || is_uv3_hub ()) {
1252
+ if (is_uv2_hub () || is_uv3_hub ()) {
1322
1253
pr_info ("UV: No UVsystab socket table, ignoring\n" );
1323
1254
return ;
1324
1255
}
@@ -1500,8 +1431,7 @@ static void __init uv_system_init_hub(void)
1500
1431
unsigned short min_pnode = 9999 , max_pnode = 0 ;
1501
1432
char * hub = is_uv4_hub () ? "UV400" :
1502
1433
is_uv3_hub () ? "UV300" :
1503
- is_uv2_hub () ? "UV2000/3000" :
1504
- is_uv1_hub () ? "UV100/1000" : NULL ;
1434
+ is_uv2_hub () ? "UV2000/3000" : NULL ;
1505
1435
1506
1436
if (!hub ) {
1507
1437
pr_err ("UV: Unknown/unsupported UV hub\n" );
0 commit comments