Skip to content

Commit 95328de

Browse files
swahlhpeKAGA-KOKO
authored andcommitted
x86/platform/uv: Remove support for UV1 platform from uv_tlb
UV1 is not longer supported. Signed-off-by: Steve Wahl <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8b3c9b1 commit 95328de

File tree

1 file changed

+32
-207
lines changed

1 file changed

+32
-207
lines changed

arch/x86/platform/uv/tlb_uv.c

Lines changed: 32 additions & 207 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@
2323

2424
static struct bau_operations ops __ro_after_init;
2525

26-
/* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */
27-
static const int timeout_base_ns[] = {
28-
20,
29-
160,
30-
1280,
31-
10240,
32-
81920,
33-
655360,
34-
5242880,
35-
167772160
36-
};
37-
3826
static int timeout_us;
3927
static bool nobau = true;
4028
static int nobau_perm;
@@ -510,70 +498,6 @@ static inline void end_uvhub_quiesce(struct bau_control *hmaster)
510498
atom_asr(-1, (struct atomic_short *)&hmaster->uvhub_quiesce);
511499
}
512500

513-
static unsigned long uv1_read_status(unsigned long mmr_offset, int right_shift)
514-
{
515-
unsigned long descriptor_status;
516-
517-
descriptor_status = uv_read_local_mmr(mmr_offset);
518-
descriptor_status >>= right_shift;
519-
descriptor_status &= UV_ACT_STATUS_MASK;
520-
return descriptor_status;
521-
}
522-
523-
/*
524-
* Wait for completion of a broadcast software ack message
525-
* return COMPLETE, RETRY(PLUGGED or TIMEOUT) or GIVEUP
526-
*/
527-
static int uv1_wait_completion(struct bau_desc *bau_desc,
528-
struct bau_control *bcp, long try)
529-
{
530-
unsigned long descriptor_status;
531-
cycles_t ttm;
532-
u64 mmr_offset = bcp->status_mmr;
533-
int right_shift = bcp->status_index;
534-
struct ptc_stats *stat = bcp->statp;
535-
536-
descriptor_status = uv1_read_status(mmr_offset, right_shift);
537-
/* spin on the status MMR, waiting for it to go idle */
538-
while ((descriptor_status != DS_IDLE)) {
539-
/*
540-
* Our software ack messages may be blocked because
541-
* there are no swack resources available. As long
542-
* as none of them has timed out hardware will NACK
543-
* our message and its state will stay IDLE.
544-
*/
545-
if (descriptor_status == DS_SOURCE_TIMEOUT) {
546-
stat->s_stimeout++;
547-
return FLUSH_GIVEUP;
548-
} else if (descriptor_status == DS_DESTINATION_TIMEOUT) {
549-
stat->s_dtimeout++;
550-
ttm = get_cycles();
551-
552-
/*
553-
* Our retries may be blocked by all destination
554-
* swack resources being consumed, and a timeout
555-
* pending. In that case hardware returns the
556-
* ERROR that looks like a destination timeout.
557-
*/
558-
if (cycles_2_us(ttm - bcp->send_message) < timeout_us) {
559-
bcp->conseccompletes = 0;
560-
return FLUSH_RETRY_PLUGGED;
561-
}
562-
563-
bcp->conseccompletes = 0;
564-
return FLUSH_RETRY_TIMEOUT;
565-
} else {
566-
/*
567-
* descriptor_status is still BUSY
568-
*/
569-
cpu_relax();
570-
}
571-
descriptor_status = uv1_read_status(mmr_offset, right_shift);
572-
}
573-
bcp->conseccompletes++;
574-
return FLUSH_COMPLETE;
575-
}
576-
577501
/*
578502
* UV2 could have an extra bit of status in the ACTIVATION_STATUS_2 register.
579503
* But not currently used.
@@ -852,24 +776,6 @@ static void record_send_stats(cycles_t time1, cycles_t time2,
852776
}
853777
}
854778

855-
/*
856-
* Because of a uv1 hardware bug only a limited number of concurrent
857-
* requests can be made.
858-
*/
859-
static void uv1_throttle(struct bau_control *hmaster, struct ptc_stats *stat)
860-
{
861-
spinlock_t *lock = &hmaster->uvhub_lock;
862-
atomic_t *v;
863-
864-
v = &hmaster->active_descriptor_count;
865-
if (!atomic_inc_unless_ge(lock, v, hmaster->max_concurr)) {
866-
stat->s_throttles++;
867-
do {
868-
cpu_relax();
869-
} while (!atomic_inc_unless_ge(lock, v, hmaster->max_concurr));
870-
}
871-
}
872-
873779
/*
874780
* Handle the completion status of a message send.
875781
*/
@@ -899,50 +805,30 @@ static int uv_flush_send_and_wait(struct cpumask *flush_mask,
899805
{
900806
int seq_number = 0;
901807
int completion_stat = 0;
902-
int uv1 = 0;
903808
long try = 0;
904809
unsigned long index;
905810
cycles_t time1;
906811
cycles_t time2;
907812
struct ptc_stats *stat = bcp->statp;
908813
struct bau_control *hmaster = bcp->uvhub_master;
909-
struct uv1_bau_msg_header *uv1_hdr = NULL;
910814
struct uv2_3_bau_msg_header *uv2_3_hdr = NULL;
911815

912-
if (bcp->uvhub_version == UV_BAU_V1) {
913-
uv1 = 1;
914-
uv1_throttle(hmaster, stat);
915-
}
916-
917816
while (hmaster->uvhub_quiesce)
918817
cpu_relax();
919818

920819
time1 = get_cycles();
921-
if (uv1)
922-
uv1_hdr = &bau_desc->header.uv1_hdr;
923-
else
924-
/* uv2 and uv3 */
925-
uv2_3_hdr = &bau_desc->header.uv2_3_hdr;
820+
uv2_3_hdr = &bau_desc->header.uv2_3_hdr;
926821

927822
do {
928823
if (try == 0) {
929-
if (uv1)
930-
uv1_hdr->msg_type = MSG_REGULAR;
931-
else
932-
uv2_3_hdr->msg_type = MSG_REGULAR;
824+
uv2_3_hdr->msg_type = MSG_REGULAR;
933825
seq_number = bcp->message_number++;
934826
} else {
935-
if (uv1)
936-
uv1_hdr->msg_type = MSG_RETRY;
937-
else
938-
uv2_3_hdr->msg_type = MSG_RETRY;
827+
uv2_3_hdr->msg_type = MSG_RETRY;
939828
stat->s_retry_messages++;
940829
}
941830

942-
if (uv1)
943-
uv1_hdr->sequence = seq_number;
944-
else
945-
uv2_3_hdr->sequence = seq_number;
831+
uv2_3_hdr->sequence = seq_number;
946832
index = (1UL << AS_PUSH_SHIFT) | bcp->uvhub_cpu;
947833
bcp->send_message = get_cycles();
948834

@@ -1162,7 +1048,6 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
11621048
address = TLB_FLUSH_ALL;
11631049

11641050
switch (bcp->uvhub_version) {
1165-
case UV_BAU_V1:
11661051
case UV_BAU_V2:
11671052
case UV_BAU_V3:
11681053
bau_desc->payload.uv1_2_3.address = address;
@@ -1300,7 +1185,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_uv_bau_message)
13001185
if (bcp->uvhub_version == UV_BAU_V2)
13011186
process_uv2_message(&msgdesc, bcp);
13021187
else
1303-
/* no error workaround for uv1 or uv3 */
1188+
/* no error workaround for uv3 */
13041189
bau_process_message(&msgdesc, bcp, 1);
13051190

13061191
msg++;
@@ -1350,12 +1235,7 @@ static void __init enable_timeouts(void)
13501235
mmr_image &= ~((unsigned long)0xf << SOFTACK_PSHIFT);
13511236
mmr_image |= (SOFTACK_TIMEOUT_PERIOD << SOFTACK_PSHIFT);
13521237
write_mmr_misc_control(pnode, mmr_image);
1353-
/*
1354-
* UV1:
1355-
* Subsequent reversals of the timebase bit (3) cause an
1356-
* immediate timeout of one or all INTD resources as
1357-
* indicated in bits 2:0 (7 causes all of them to timeout).
1358-
*/
1238+
13591239
mmr_image |= (1L << SOFTACK_MSHIFT);
13601240
if (is_uv2_hub()) {
13611241
/* do not touch the legacy mode bit */
@@ -1711,14 +1591,12 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode)
17111591
{
17121592
int i;
17131593
int cpu;
1714-
int uv1 = 0;
17151594
unsigned long gpa;
17161595
unsigned long m;
17171596
unsigned long n;
17181597
size_t dsize;
17191598
struct bau_desc *bau_desc;
17201599
struct bau_desc *bd2;
1721-
struct uv1_bau_msg_header *uv1_hdr;
17221600
struct uv2_3_bau_msg_header *uv2_3_hdr;
17231601
struct bau_control *bcp;
17241602

@@ -1733,8 +1611,6 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode)
17331611
gpa = uv_gpa(bau_desc);
17341612
n = uv_gpa_to_gnode(gpa);
17351613
m = ops.bau_gpa_to_offset(gpa);
1736-
if (is_uv1_hub())
1737-
uv1 = 1;
17381614

17391615
/* the 14-bit pnode */
17401616
write_mmr_descriptor_base(pnode,
@@ -1746,37 +1622,15 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode)
17461622
*/
17471623
for (i = 0, bd2 = bau_desc; i < (ADP_SZ * ITEMS_PER_DESC); i++, bd2++) {
17481624
memset(bd2, 0, sizeof(struct bau_desc));
1749-
if (uv1) {
1750-
uv1_hdr = &bd2->header.uv1_hdr;
1751-
uv1_hdr->swack_flag = 1;
1752-
/*
1753-
* The base_dest_nasid set in the message header
1754-
* is the nasid of the first uvhub in the partition.
1755-
* The bit map will indicate destination pnode numbers
1756-
* relative to that base. They may not be consecutive
1757-
* if nasid striding is being used.
1758-
*/
1759-
uv1_hdr->base_dest_nasid =
1760-
UV_PNODE_TO_NASID(base_pnode);
1761-
uv1_hdr->dest_subnodeid = UV_LB_SUBNODEID;
1762-
uv1_hdr->command = UV_NET_ENDPOINT_INTD;
1763-
uv1_hdr->int_both = 1;
1764-
/*
1765-
* all others need to be set to zero:
1766-
* fairness chaining multilevel count replied_to
1767-
*/
1768-
} else {
1769-
/*
1770-
* BIOS uses legacy mode, but uv2 and uv3 hardware always
1771-
* uses native mode for selective broadcasts.
1772-
*/
1773-
uv2_3_hdr = &bd2->header.uv2_3_hdr;
1774-
uv2_3_hdr->swack_flag = 1;
1775-
uv2_3_hdr->base_dest_nasid =
1776-
UV_PNODE_TO_NASID(base_pnode);
1777-
uv2_3_hdr->dest_subnodeid = UV_LB_SUBNODEID;
1778-
uv2_3_hdr->command = UV_NET_ENDPOINT_INTD;
1779-
}
1625+
/*
1626+
* BIOS uses legacy mode, but uv2 and uv3 hardware always
1627+
* uses native mode for selective broadcasts.
1628+
*/
1629+
uv2_3_hdr = &bd2->header.uv2_3_hdr;
1630+
uv2_3_hdr->swack_flag = 1;
1631+
uv2_3_hdr->base_dest_nasid = UV_PNODE_TO_NASID(base_pnode);
1632+
uv2_3_hdr->dest_subnodeid = UV_LB_SUBNODEID;
1633+
uv2_3_hdr->command = UV_NET_ENDPOINT_INTD;
17801634
}
17811635
for_each_present_cpu(cpu) {
17821636
if (pnode != uv_blade_to_pnode(uv_cpu_to_blade_id(cpu)))
@@ -1861,7 +1715,7 @@ static void __init init_uvhub(int uvhub, int vector, int base_pnode)
18611715
* The below initialization can't be in firmware because the
18621716
* messaging IRQ will be determined by the OS.
18631717
*/
1864-
apicid = uvhub_to_first_apicid(uvhub) | uv_apicid_hibits;
1718+
apicid = uvhub_to_first_apicid(uvhub);
18651719
write_mmr_data_config(pnode, ((apicid << 32) | vector));
18661720
}
18671721

@@ -1874,33 +1728,20 @@ static int calculate_destination_timeout(void)
18741728
{
18751729
unsigned long mmr_image;
18761730
int mult1;
1877-
int mult2;
1878-
int index;
18791731
int base;
18801732
int ret;
1881-
unsigned long ts_ns;
1882-
1883-
if (is_uv1_hub()) {
1884-
mult1 = SOFTACK_TIMEOUT_PERIOD & BAU_MISC_CONTROL_MULT_MASK;
1885-
mmr_image = uv_read_local_mmr(UVH_AGING_PRESCALE_SEL);
1886-
index = (mmr_image >> BAU_URGENCY_7_SHIFT) & BAU_URGENCY_7_MASK;
1887-
mmr_image = uv_read_local_mmr(UVH_TRANSACTION_TIMEOUT);
1888-
mult2 = (mmr_image >> BAU_TRANS_SHIFT) & BAU_TRANS_MASK;
1889-
ts_ns = timeout_base_ns[index];
1890-
ts_ns *= (mult1 * mult2);
1891-
ret = ts_ns / 1000;
1892-
} else {
1893-
/* same destination timeout for uv2 and uv3 */
1894-
/* 4 bits 0/1 for 10/80us base, 3 bits of multiplier */
1895-
mmr_image = uv_read_local_mmr(UVH_LB_BAU_MISC_CONTROL);
1896-
mmr_image = (mmr_image & UV_SA_MASK) >> UV_SA_SHFT;
1897-
if (mmr_image & (1L << UV2_ACK_UNITS_SHFT))
1898-
base = 80;
1899-
else
1900-
base = 10;
1901-
mult1 = mmr_image & UV2_ACK_MASK;
1902-
ret = mult1 * base;
1903-
}
1733+
1734+
/* same destination timeout for uv2 and uv3 */
1735+
/* 4 bits 0/1 for 10/80us base, 3 bits of multiplier */
1736+
mmr_image = uv_read_local_mmr(UVH_LB_BAU_MISC_CONTROL);
1737+
mmr_image = (mmr_image & UV_SA_MASK) >> UV_SA_SHFT;
1738+
if (mmr_image & (1L << UV2_ACK_UNITS_SHFT))
1739+
base = 80;
1740+
else
1741+
base = 10;
1742+
mult1 = mmr_image & UV2_ACK_MASK;
1743+
ret = mult1 * base;
1744+
19041745
return ret;
19051746
}
19061747

@@ -2039,9 +1880,7 @@ static int scan_sock(struct socket_desc *sdp, struct uvhub_desc *bdp,
20391880
bcp->cpus_in_socket = sdp->num_cpus;
20401881
bcp->socket_master = *smasterp;
20411882
bcp->uvhub = bdp->uvhub;
2042-
if (is_uv1_hub())
2043-
bcp->uvhub_version = UV_BAU_V1;
2044-
else if (is_uv2_hub())
1883+
if (is_uv2_hub())
20451884
bcp->uvhub_version = UV_BAU_V2;
20461885
else if (is_uv3_hub())
20471886
bcp->uvhub_version = UV_BAU_V3;
@@ -2123,7 +1962,7 @@ static int __init init_per_cpu(int nuvhubs, int base_part_pnode)
21231962
struct uvhub_desc *uvhub_descs;
21241963
unsigned char *uvhub_mask = NULL;
21251964

2126-
if (is_uv3_hub() || is_uv2_hub() || is_uv1_hub())
1965+
if (is_uv3_hub() || is_uv2_hub())
21271966
timeout_us = calculate_destination_timeout();
21281967

21291968
uvhub_descs = kcalloc(nuvhubs, sizeof(struct uvhub_desc), GFP_KERNEL);
@@ -2151,17 +1990,6 @@ static int __init init_per_cpu(int nuvhubs, int base_part_pnode)
21511990
return 1;
21521991
}
21531992

2154-
static const struct bau_operations uv1_bau_ops __initconst = {
2155-
.bau_gpa_to_offset = uv_gpa_to_offset,
2156-
.read_l_sw_ack = read_mmr_sw_ack,
2157-
.read_g_sw_ack = read_gmmr_sw_ack,
2158-
.write_l_sw_ack = write_mmr_sw_ack,
2159-
.write_g_sw_ack = write_gmmr_sw_ack,
2160-
.write_payload_first = write_mmr_payload_first,
2161-
.write_payload_last = write_mmr_payload_last,
2162-
.wait_completion = uv1_wait_completion,
2163-
};
2164-
21651993
static const struct bau_operations uv2_3_bau_ops __initconst = {
21661994
.bau_gpa_to_offset = uv_gpa_to_offset,
21671995
.read_l_sw_ack = read_mmr_sw_ack,
@@ -2206,8 +2034,6 @@ static int __init uv_bau_init(void)
22062034
ops = uv2_3_bau_ops;
22072035
else if (is_uv2_hub())
22082036
ops = uv2_3_bau_ops;
2209-
else if (is_uv1_hub())
2210-
ops = uv1_bau_ops;
22112037

22122038
nuvhubs = uv_num_possible_blades();
22132039
if (nuvhubs < 2) {
@@ -2228,7 +2054,7 @@ static int __init uv_bau_init(void)
22282054
}
22292055

22302056
/* software timeouts are not supported on UV4 */
2231-
if (is_uv3_hub() || is_uv2_hub() || is_uv1_hub())
2057+
if (is_uv3_hub() || is_uv2_hub())
22322058
enable_timeouts();
22332059

22342060
if (init_per_cpu(nuvhubs, uv_base_pnode)) {
@@ -2251,8 +2077,7 @@ static int __init uv_bau_init(void)
22512077
val = 1L << 63;
22522078
write_gmmr_activation(pnode, val);
22532079
mmr = 1; /* should be 1 to broadcast to both sockets */
2254-
if (!is_uv1_hub())
2255-
write_mmr_data_broadcast(pnode, mmr);
2080+
write_mmr_data_broadcast(pnode, mmr);
22562081
}
22572082
}
22582083

0 commit comments

Comments
 (0)