Skip to content

Commit cfa6091

Browse files
cpwickmanIngo Molnar
authored andcommitted
x86, UV, BAU: Extend for more than 16 cpus per socket
Fix a hard-coded limit of a maximum of 16 cpu's per socket. The UV Broadcast Assist Unit code initializes by scanning the cpu topology of the system and assigning a master cpu for each socket and UV hub. That scan had an assumption of a limit of 16 cpus per socket. With Westmere we are going over that limit. The UV hub hardware will allow up to 32. If the scan finds the system has gone over that limit it returns an error and we print a warning and fall back to doing TLB shootdowns without the BAU. Signed-off-by: Cliff Wickman <[email protected]> Cc: <[email protected]> # .37.x LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
1 parent d8850ba commit cfa6091

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,22 @@
2626
* BAU_SB_DESCRIPTOR_BASE register, set 1 is located at BASE + 512,
2727
* set 2 is at BASE + 2*512, set 3 at BASE + 3*512, and so on.
2828
*
29-
* We will use 31 sets, one for sending BAU messages from each of the 32
29+
* We will use one set for sending BAU messages from each of the
3030
* cpu's on the uvhub.
3131
*
3232
* TLB shootdown will use the first of the 8 descriptors of each set.
3333
* Each of the descriptors is 64 bytes in size (8*64 = 512 bytes in a set).
3434
*/
3535

36+
#define MAX_CPUS_PER_UVHUB 64
37+
#define MAX_CPUS_PER_SOCKET 32
38+
#define UV_ADP_SIZE 64 /* hardware-provided max. */
39+
#define UV_CPUS_PER_ACT_STATUS 32 /* hardware-provided max. */
3640
#define UV_ITEMS_PER_DESCRIPTOR 8
3741
/* the 'throttle' to prevent the hardware stay-busy bug */
3842
#define MAX_BAU_CONCURRENT 3
39-
#define UV_CPUS_PER_ACT_STATUS 32
4043
#define UV_ACT_STATUS_MASK 0x3
4144
#define UV_ACT_STATUS_SIZE 2
42-
#define UV_ADP_SIZE 32
4345
#define UV_DISTRIBUTION_SIZE 256
4446
#define UV_SW_ACK_NPENDING 8
4547
#define UV_NET_ENDPOINT_INTD 0x38
@@ -100,7 +102,6 @@
100102
* number of destination side software ack resources
101103
*/
102104
#define DEST_NUM_RESOURCES 8
103-
#define MAX_CPUS_PER_NODE 32
104105
/*
105106
* completion statuses for sending a TLB flush message
106107
*/

arch/x86/platform/uv/tlb_uv.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,7 +1341,7 @@ uv_activation_descriptor_init(int node, int pnode)
13411341

13421342
/*
13431343
* each bau_desc is 64 bytes; there are 8 (UV_ITEMS_PER_DESCRIPTOR)
1344-
* per cpu; and up to 32 (UV_ADP_SIZE) cpu's per uvhub
1344+
* per cpu; and one per cpu on the uvhub (UV_ADP_SIZE)
13451345
*/
13461346
bau_desc = kmalloc_node(sizeof(struct bau_desc) * UV_ADP_SIZE
13471347
* UV_ITEMS_PER_DESCRIPTOR, GFP_KERNEL, node);
@@ -1490,7 +1490,7 @@ calculate_destination_timeout(void)
14901490
/*
14911491
* initialize the bau_control structure for each cpu
14921492
*/
1493-
static void __init uv_init_per_cpu(int nuvhubs)
1493+
static int __init uv_init_per_cpu(int nuvhubs)
14941494
{
14951495
int i;
14961496
int cpu;
@@ -1507,7 +1507,7 @@ static void __init uv_init_per_cpu(int nuvhubs)
15071507
struct bau_control *smaster = NULL;
15081508
struct socket_desc {
15091509
short num_cpus;
1510-
short cpu_number[16];
1510+
short cpu_number[MAX_CPUS_PER_SOCKET];
15111511
};
15121512
struct uvhub_desc {
15131513
unsigned short socket_mask;
@@ -1540,6 +1540,10 @@ static void __init uv_init_per_cpu(int nuvhubs)
15401540
sdp = &bdp->socket[socket];
15411541
sdp->cpu_number[sdp->num_cpus] = cpu;
15421542
sdp->num_cpus++;
1543+
if (sdp->num_cpus > MAX_CPUS_PER_SOCKET) {
1544+
printk(KERN_EMERG "%d cpus per socket invalid\n", sdp->num_cpus);
1545+
return 1;
1546+
}
15431547
}
15441548
for (uvhub = 0; uvhub < nuvhubs; uvhub++) {
15451549
if (!(*(uvhub_mask + (uvhub/8)) & (1 << (uvhub%8))))
@@ -1570,6 +1574,12 @@ static void __init uv_init_per_cpu(int nuvhubs)
15701574
bcp->uvhub_master = hmaster;
15711575
bcp->uvhub_cpu = uv_cpu_hub_info(cpu)->
15721576
blade_processor_id;
1577+
if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) {
1578+
printk(KERN_EMERG
1579+
"%d cpus per uvhub invalid\n",
1580+
bcp->uvhub_cpu);
1581+
return 1;
1582+
}
15731583
}
15741584
nextsocket:
15751585
socket++;
@@ -1595,6 +1605,7 @@ static void __init uv_init_per_cpu(int nuvhubs)
15951605
bcp->congested_reps = congested_reps;
15961606
bcp->congested_period = congested_period;
15971607
}
1608+
return 0;
15981609
}
15991610

16001611
/*
@@ -1625,7 +1636,10 @@ static int __init uv_bau_init(void)
16251636
spin_lock_init(&disable_lock);
16261637
congested_cycles = microsec_2_cycles(congested_response_us);
16271638

1628-
uv_init_per_cpu(nuvhubs);
1639+
if (uv_init_per_cpu(nuvhubs)) {
1640+
nobau = 1;
1641+
return 0;
1642+
}
16291643

16301644
uv_partition_base_pnode = 0x7fffffff;
16311645
for (uvhub = 0; uvhub < nuvhubs; uvhub++)

0 commit comments

Comments
 (0)