Skip to content

Commit 88bc1de

Browse files
committed
Merge tag 'x86-platform-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 platform updates from Ingo Molnar: "This tree cleans up various aspects of the UV platform support code, it removes unnecessary functions and cleans up the rest" * tag 'x86-platform-2020-06-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apic/uv: Remove code for unused distributed GRU mode x86/platform/uv: Remove the unused _uv_cpu_blade_processor_id() macro x86/platform/uv: Unexport uv_apicid_hibits x86/platform/uv: Remove _uv_hub_info_check() x86/platform/uv: Simplify uv_send_IPI_one() x86/platform/uv: Mark uv_min_hub_revision_id static x86/platform/uv: Mark is_uv_hubless() static x86/platform/uv: Remove the UV*_HUB_IS_SUPPORTED macros x86/platform/uv: Unexport symbols only used by x2apic_uv_x.c x86/platform/uv: Unexport sn_coherency_id x86/platform/uv: Remove the uv_partition_coherence_id() macro x86/platform/uv: Mark uv_bios_call() and uv_bios_call_irqsave() static
2 parents 0a319ef + 33649bf commit 88bc1de

File tree

7 files changed

+22
-157
lines changed

7 files changed

+22
-157
lines changed

arch/x86/include/asm/uv/bios.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,6 @@ enum uv_memprotect {
123123
UV_MEMPROT_ALLOW_RW
124124
};
125125

126-
/*
127-
* bios calls have 6 parameters
128-
*/
129-
extern s64 uv_bios_call(enum uv_bios_cmd, u64, u64, u64, u64, u64);
130-
extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64);
131-
132126
extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *, long *);
133127
extern s64 uv_bios_freq_base(u64, u64 *);
134128
extern int uv_bios_mq_watchlist_alloc(unsigned long, unsigned int,
@@ -146,7 +140,6 @@ extern long sn_partition_id;
146140
extern long sn_coherency_id;
147141
extern long sn_region_size;
148142
extern long system_serial_number;
149-
#define uv_partition_coherence_id() (sn_coherency_id)
150143

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

arch/x86/include/asm/uv/uv.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ static inline bool is_early_uv_system(void)
3131
}
3232
extern int is_uv_system(void);
3333
extern int is_uv_hubbed(int uvtype);
34-
extern int is_uv_hubless(int uvtype);
3534
extern void uv_cpu_init(void);
3635
extern void uv_nmi_init(void);
3736
extern void uv_system_init(void);
@@ -44,7 +43,6 @@ static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; }
4443
static inline bool is_early_uv_system(void) { return 0; }
4544
static inline int is_uv_system(void) { return 0; }
4645
static inline int is_uv_hubbed(int uv) { return 0; }
47-
static inline int is_uv_hubless(int uv) { return 0; }
4846
static inline void uv_cpu_init(void) { }
4947
static inline void uv_system_init(void) { }
5048
static inline const struct cpumask *

arch/x86/include/asm/uv/uv_hub.h

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -219,20 +219,6 @@ static inline struct uv_hub_info_s *uv_cpu_hub_info(int cpu)
219219
return (struct uv_hub_info_s *)uv_cpu_info_per(cpu)->p_uv_hub_info;
220220
}
221221

222-
#define UV_HUB_INFO_VERSION 0x7150
223-
extern int uv_hub_info_version(void);
224-
static inline int uv_hub_info_check(int version)
225-
{
226-
if (uv_hub_info_version() == version)
227-
return 0;
228-
229-
pr_crit("UV: uv_hub_info version(%x) mismatch, expecting(%x)\n",
230-
uv_hub_info_version(), version);
231-
232-
BUG(); /* Catastrophic - cannot continue on unknown UV system */
233-
}
234-
#define _uv_hub_info_check() uv_hub_info_check(UV_HUB_INFO_VERSION)
235-
236222
/*
237223
* HUB revision ranges for each UV HUB architecture.
238224
* This is a software convention - NOT the hardware revision numbers in
@@ -244,51 +230,32 @@ static inline int uv_hub_info_check(int version)
244230
#define UV4_HUB_REVISION_BASE 7
245231
#define UV4A_HUB_REVISION_BASE 8 /* UV4 (fixed) rev 2 */
246232

247-
/* WARNING: UVx_HUB_IS_SUPPORTED defines are deprecated and will be removed */
248233
static inline int is_uv1_hub(void)
249234
{
250-
#ifdef UV1_HUB_IS_SUPPORTED
251235
return is_uv_hubbed(uv(1));
252-
#else
253-
return 0;
254-
#endif
255236
}
256237

257238
static inline int is_uv2_hub(void)
258239
{
259-
#ifdef UV2_HUB_IS_SUPPORTED
260240
return is_uv_hubbed(uv(2));
261-
#else
262-
return 0;
263-
#endif
264241
}
265242

266243
static inline int is_uv3_hub(void)
267244
{
268-
#ifdef UV3_HUB_IS_SUPPORTED
269245
return is_uv_hubbed(uv(3));
270-
#else
271-
return 0;
272-
#endif
273246
}
274247

275248
/* First test "is UV4A", then "is UV4" */
276249
static inline int is_uv4a_hub(void)
277250
{
278-
#ifdef UV4A_HUB_IS_SUPPORTED
279251
if (is_uv_hubbed(uv(4)))
280252
return (uv_hub_info->hub_revision == UV4A_HUB_REVISION_BASE);
281-
#endif
282253
return 0;
283254
}
284255

285256
static inline int is_uv4_hub(void)
286257
{
287-
#ifdef UV4_HUB_IS_SUPPORTED
288258
return is_uv_hubbed(uv(4));
289-
#else
290-
return 0;
291-
#endif
292259
}
293260

294261
static inline int is_uvx_hub(void)
@@ -692,7 +659,6 @@ static inline int uv_cpu_blade_processor_id(int cpu)
692659
{
693660
return uv_cpu_info_per(cpu)->blade_cpu_id;
694661
}
695-
#define _uv_cpu_blade_processor_id 1 /* indicate function available */
696662

697663
/* Blade number to Node number (UV1..UV4 is 1:1) */
698664
static inline int uv_blade_to_node(int blade)
@@ -856,26 +822,6 @@ static inline void uv_set_cpu_scir_bits(int cpu, unsigned char value)
856822
}
857823

858824
extern unsigned int uv_apicid_hibits;
859-
static unsigned long uv_hub_ipi_value(int apicid, int vector, int mode)
860-
{
861-
apicid |= uv_apicid_hibits;
862-
return (1UL << UVH_IPI_INT_SEND_SHFT) |
863-
((apicid) << UVH_IPI_INT_APIC_ID_SHFT) |
864-
(mode << UVH_IPI_INT_DELIVERY_MODE_SHFT) |
865-
(vector << UVH_IPI_INT_VECTOR_SHFT);
866-
}
867-
868-
static inline void uv_hub_send_ipi(int pnode, int apicid, int vector)
869-
{
870-
unsigned long val;
871-
unsigned long dmode = dest_Fixed;
872-
873-
if (vector == NMI_VECTOR)
874-
dmode = dest_NMI;
875-
876-
val = uv_hub_ipi_value(apicid, vector, dmode);
877-
uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
878-
}
879825

880826
/*
881827
* Get the minimum revision number of the hub chips within the partition.

arch/x86/include/asm/uv/uv_mmrs.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,6 @@
9999
#define UV3_HUB_PART_NUMBER_X 0x4321
100100
#define UV4_HUB_PART_NUMBER 0x99a1
101101

102-
/* Compat: Indicate which UV Hubs are supported. */
103-
#define UV1_HUB_IS_SUPPORTED 1
104-
#define UV2_HUB_IS_SUPPORTED 1
105-
#define UV3_HUB_IS_SUPPORTED 1
106-
#define UV4_HUB_IS_SUPPORTED 1
107-
#define UV4A_HUB_IS_SUPPORTED 1
108-
109102
/* Error function to catch undefined references */
110103
extern unsigned long uv_undefined(char *str);
111104

arch/x86/kernel/apic/x2apic_uv_x.c

Lines changed: 17 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ static enum uv_system_type uv_system_type;
3030
static int uv_hubbed_system;
3131
static int uv_hubless_system;
3232
static 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;
3533
static 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

5451
unsigned int uv_apicid_hibits;
55-
EXPORT_SYMBOL_GPL(uv_apicid_hibits);
5652

5753
static struct apic apic_x2apic_uv_x;
5854
static 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

8682
static 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

10487
static bool uv_is_untracked_pat_range(u64 start, u64 end)
@@ -385,11 +368,10 @@ int is_uv_hubbed(int uvtype)
385368
}
386369
EXPORT_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

394376
void **__uv_hub_info_list;
395377
EXPORT_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 */
427403
static 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

591567
static 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

601586
static 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-
836785
static __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);

arch/x86/platform/uv/bios_uv.c

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ static s64 __uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
4545
return ret;
4646
}
4747

48-
s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
48+
static s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4,
49+
u64 a5)
4950
{
5051
s64 ret;
5152

@@ -57,10 +58,9 @@ s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
5758

5859
return ret;
5960
}
60-
EXPORT_SYMBOL_GPL(uv_bios_call);
6161

62-
s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
63-
u64 a4, u64 a5)
62+
static s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
63+
u64 a4, u64 a5)
6464
{
6565
unsigned long bios_flags;
6666
s64 ret;
@@ -77,18 +77,13 @@ s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
7777
return ret;
7878
}
7979

80-
8180
long sn_partition_id;
8281
EXPORT_SYMBOL_GPL(sn_partition_id);
8382
long sn_coherency_id;
84-
EXPORT_SYMBOL_GPL(sn_coherency_id);
8583
long sn_region_size;
8684
EXPORT_SYMBOL_GPL(sn_region_size);
8785
long system_serial_number;
88-
EXPORT_SYMBOL_GPL(system_serial_number);
8986
int uv_type;
90-
EXPORT_SYMBOL_GPL(uv_type);
91-
9287

9388
s64 uv_bios_get_sn_info(int fc, int *uvtype, long *partid, long *coher,
9489
long *region, long *ssn)
@@ -115,7 +110,6 @@ s64 uv_bios_get_sn_info(int fc, int *uvtype, long *partid, long *coher,
115110
*ssn = v1;
116111
return ret;
117112
}
118-
EXPORT_SYMBOL_GPL(uv_bios_get_sn_info);
119113

120114
int
121115
uv_bios_mq_watchlist_alloc(unsigned long addr, unsigned int mq_size,
@@ -166,7 +160,6 @@ s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second)
166160
return uv_bios_call(UV_BIOS_FREQ_BASE, clock_type,
167161
(u64)ticks_per_second, 0, 0, 0);
168162
}
169-
EXPORT_SYMBOL_GPL(uv_bios_freq_base);
170163

171164
/*
172165
* uv_bios_set_legacy_vga_target - Set Legacy VGA I/O Target
@@ -185,7 +178,6 @@ int uv_bios_set_legacy_vga_target(bool decode, int domain, int bus)
185178
return uv_bios_call(UV_BIOS_SET_LEGACY_VGA_TARGET,
186179
(u64)decode, (u64)domain, (u64)bus, 0, 0);
187180
}
188-
EXPORT_SYMBOL_GPL(uv_bios_set_legacy_vga_target);
189181

190182
int uv_bios_init(void)
191183
{

arch/x86/platform/uv/uv_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static ssize_t partition_id_show(struct kobject *kobj,
2121
static ssize_t coherence_id_show(struct kobject *kobj,
2222
struct kobj_attribute *attr, char *buf)
2323
{
24-
return snprintf(buf, PAGE_SIZE, "%ld\n", uv_partition_coherence_id());
24+
return snprintf(buf, PAGE_SIZE, "%ld\n", sn_coherency_id);
2525
}
2626

2727
static struct kobj_attribute partition_id_attr =

0 commit comments

Comments
 (0)