@@ -30,8 +30,6 @@ static enum uv_system_type uv_system_type;
3030static int uv_hubbed_system ;
3131static int uv_hubless_system ;
3232static u64 gru_start_paddr , gru_end_paddr ;
33- static u64 gru_dist_base , gru_first_node_paddr = -1LL , gru_last_node_paddr ;
34- static u64 gru_dist_lmask , gru_dist_umask ;
3533static union uvh_apicid uvh_apicid ;
3634
3735/* Unpack OEM/TABLE ID's to be NULL terminated strings */
@@ -48,11 +46,9 @@ static struct {
4846 unsigned int gnode_shift ;
4947} uv_cpuid ;
5048
51- int uv_min_hub_revision_id ;
52- EXPORT_SYMBOL_GPL (uv_min_hub_revision_id );
49+ static int uv_min_hub_revision_id ;
5350
5451unsigned int uv_apicid_hibits ;
55- EXPORT_SYMBOL_GPL (uv_apicid_hibits );
5652
5753static struct apic apic_x2apic_uv_x ;
5854static struct uv_hub_info_s uv_hub_info_node0 ;
@@ -85,20 +81,7 @@ static unsigned long __init uv_early_read_mmr(unsigned long addr)
8581
8682static inline bool is_GRU_range (u64 start , u64 end )
8783{
88- if (gru_dist_base ) {
89- u64 su = start & gru_dist_umask ; /* Upper (incl pnode) bits */
90- u64 sl = start & gru_dist_lmask ; /* Base offset bits */
91- u64 eu = end & gru_dist_umask ;
92- u64 el = end & gru_dist_lmask ;
93-
94- /* Must reside completely within a single GRU range: */
95- return (sl == gru_dist_base && el == gru_dist_base &&
96- su >= gru_first_node_paddr &&
97- su <= gru_last_node_paddr &&
98- eu == su );
99- } else {
100- return start >= gru_start_paddr && end <= gru_end_paddr ;
101- }
84+ return start >= gru_start_paddr && end <= gru_end_paddr ;
10285}
10386
10487static bool uv_is_untracked_pat_range (u64 start , u64 end )
@@ -385,11 +368,10 @@ int is_uv_hubbed(int uvtype)
385368}
386369EXPORT_SYMBOL_GPL (is_uv_hubbed );
387370
388- int is_uv_hubless (int uvtype )
371+ static int is_uv_hubless (int uvtype )
389372{
390373 return (uv_hubless_system & uvtype );
391374}
392- EXPORT_SYMBOL_GPL (is_uv_hubless );
393375
394376void * * __uv_hub_info_list ;
395377EXPORT_SYMBOL_GPL (__uv_hub_info_list );
@@ -417,12 +399,6 @@ static __initdata struct uv_gam_range_s *_gr_table;
417399
418400#define SOCK_EMPTY ((unsigned short)~0)
419401
420- extern int uv_hub_info_version (void )
421- {
422- return UV_HUB_INFO_VERSION ;
423- }
424- EXPORT_SYMBOL (uv_hub_info_version );
425-
426402/* Default UV memory block size is 2GB */
427403static unsigned long mem_block_size __initdata = (2UL << 30 );
428404
@@ -590,12 +566,21 @@ static int uv_wakeup_secondary(int phys_apicid, unsigned long start_rip)
590566
591567static void uv_send_IPI_one (int cpu , int vector )
592568{
593- unsigned long apicid ;
594- int pnode ;
569+ unsigned long apicid = per_cpu (x86_cpu_to_apicid , cpu );
570+ int pnode = uv_apicid_to_pnode (apicid );
571+ unsigned long dmode , val ;
572+
573+ if (vector == NMI_VECTOR )
574+ dmode = dest_NMI ;
575+ else
576+ dmode = dest_Fixed ;
577+
578+ val = (1UL << UVH_IPI_INT_SEND_SHFT ) |
579+ ((apicid | uv_apicid_hibits ) << UVH_IPI_INT_APIC_ID_SHFT ) |
580+ (dmode << UVH_IPI_INT_DELIVERY_MODE_SHFT ) |
581+ (vector << UVH_IPI_INT_VECTOR_SHFT );
595582
596- apicid = per_cpu (x86_cpu_to_apicid , cpu );
597- pnode = uv_apicid_to_pnode (apicid );
598- uv_hub_send_ipi (pnode , apicid , vector );
583+ uv_write_global_mmr64 (pnode , UVH_IPI_INT , val );
599584}
600585
601586static void uv_send_IPI_mask (const struct cpumask * mask , int vector )
@@ -797,42 +782,6 @@ static __init void map_high(char *id, unsigned long base, int pshift, int bshift
797782 init_extra_mapping_wb (paddr , bytes );
798783}
799784
800- static __init void map_gru_distributed (unsigned long c )
801- {
802- union uvh_rh_gam_gru_overlay_config_mmr_u gru ;
803- u64 paddr ;
804- unsigned long bytes ;
805- int nid ;
806-
807- gru .v = c ;
808-
809- /* Only base bits 42:28 relevant in dist mode */
810- gru_dist_base = gru .v & 0x000007fff0000000UL ;
811- if (!gru_dist_base ) {
812- pr_info ("UV: Map GRU_DIST base address NULL\n" );
813- return ;
814- }
815-
816- bytes = 1UL << UVH_RH_GAM_GRU_OVERLAY_CONFIG_MMR_BASE_SHFT ;
817- gru_dist_lmask = ((1UL << uv_hub_info -> m_val ) - 1 ) & ~(bytes - 1 );
818- gru_dist_umask = ~((1UL << uv_hub_info -> m_val ) - 1 );
819- gru_dist_base &= gru_dist_lmask ; /* Clear bits above M */
820-
821- for_each_online_node (nid ) {
822- paddr = ((u64 )uv_node_to_pnode (nid ) << uv_hub_info -> m_val ) |
823- gru_dist_base ;
824- init_extra_mapping_wb (paddr , bytes );
825- gru_first_node_paddr = min (paddr , gru_first_node_paddr );
826- gru_last_node_paddr = max (paddr , gru_last_node_paddr );
827- }
828-
829- /* Save upper (63:M) bits of address only for is_GRU_range */
830- gru_first_node_paddr &= gru_dist_umask ;
831- gru_last_node_paddr &= gru_dist_umask ;
832-
833- pr_debug ("UV: Map GRU_DIST base 0x%016llx 0x%016llx - 0x%016llx\n" , gru_dist_base , gru_first_node_paddr , gru_last_node_paddr );
834- }
835-
836785static __init void map_gru_high (int max_pnode )
837786{
838787 union uvh_rh_gam_gru_overlay_config_mmr_u gru ;
@@ -846,12 +795,6 @@ static __init void map_gru_high(int max_pnode)
846795 return ;
847796 }
848797
849- /* Only UV3 has distributed GRU mode */
850- if (is_uv3_hub () && gru .s3 .mode ) {
851- map_gru_distributed (gru .v );
852- return ;
853- }
854-
855798 base = (gru .v & mask ) >> shift ;
856799 map_high ("GRU" , base , shift , shift , max_pnode , map_wb );
857800 gru_start_paddr = ((u64 )base << shift );
0 commit comments