Skip to content

Commit 567e479

Browse files
committed
Merge branches 'sched-urgent-for-linus', 'perf-urgent-for-linus' and 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/accounting, proc: Fix /proc/stat interrupts sum * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: tracepoints/module: Fix disabling tracepoints with taint CRAP or OOT x86/kprobes: Add arch/x86/tools/insn_sanity to .gitignore x86/kprobes: Fix typo transferred from Intel manual * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, syscall: Need __ARCH_WANT_SYS_IPC for 32 bits x86, tsc: Fix SMI induced variation in quick_pit_calibrate() x86, opcode: ANDN and Group 17 in x86-opcode-map.txt x86/kconfig: Move the ZONE_DMA entry under a menu x86/UV2: Add accounting for BAU strong nacks x86/UV2: Ack BAU interrupt earlier x86/UV2: Remove stale no-resources test for UV2 BAU x86/UV2: Work around BAU bug x86/UV2: Fix BAU destination timeout initialization x86/UV2: Fix new UV2 hardware by using native UV2 broadcast mode x86: Get rid of dubious one-bit signed bitfield
4 parents 99d1edc + f7e6746 + 6eadf10 + 4f2f81a commit 567e479

File tree

9 files changed

+444
-104
lines changed

9 files changed

+444
-104
lines changed

arch/x86/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
boot/compressed/vmlinux
22
tools/test_get_len
3+
tools/insn_sanity
34

arch/x86/Kconfig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,6 @@ config HAVE_LATENCYTOP_SUPPORT
125125
config MMU
126126
def_bool y
127127

128-
config ZONE_DMA
129-
bool "DMA memory allocation support" if EXPERT
130-
default y
131-
help
132-
DMA memory allocation support allows devices with less than 32-bit
133-
addressing to allocate within the first 16MB of address space.
134-
Disable if no such devices will be used.
135-
136-
If unsure, say Y.
137-
138128
config SBUS
139129
bool
140130

@@ -255,6 +245,16 @@ source "kernel/Kconfig.freezer"
255245

256246
menu "Processor type and features"
257247

248+
config ZONE_DMA
249+
bool "DMA memory allocation support" if EXPERT
250+
default y
251+
help
252+
DMA memory allocation support allows devices with less than 32-bit
253+
addressing to allocate within the first 16MB of address space.
254+
Disable if no such devices will be used.
255+
256+
If unsure, say Y.
257+
258258
source "kernel/time/Kconfig"
259259

260260
config SMP

arch/x86/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# include <asm/unistd_32.h>
88
# define __ARCH_WANT_IPC_PARSE_VERSION
99
# define __ARCH_WANT_STAT64
10+
# define __ARCH_WANT_SYS_IPC
1011
# define __ARCH_WANT_SYS_OLD_MMAP
1112
# define __ARCH_WANT_SYS_OLD_SELECT
1213

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

Lines changed: 99 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
* UV2: Bit 19 selects between
6666
* (0): 10 microsecond timebase and
6767
* (1): 80 microseconds
68-
* we're using 655us, similar to UV1: 65 units of 10us
68+
* we're using 560us, similar to UV1: 65 units of 10us
6969
*/
7070
#define UV1_INTD_SOFT_ACK_TIMEOUT_PERIOD (9UL)
7171
#define UV2_INTD_SOFT_ACK_TIMEOUT_PERIOD (15UL)
@@ -167,6 +167,7 @@
167167
#define FLUSH_RETRY_TIMEOUT 2
168168
#define FLUSH_GIVEUP 3
169169
#define FLUSH_COMPLETE 4
170+
#define FLUSH_RETRY_BUSYBUG 5
170171

171172
/*
172173
* tuning the action when the numalink network is extremely delayed
@@ -235,10 +236,10 @@ struct bau_msg_payload {
235236

236237

237238
/*
238-
* Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor)
239+
* UV1 Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor)
239240
* see table 4.2.3.0.1 in broacast_assist spec.
240241
*/
241-
struct bau_msg_header {
242+
struct uv1_bau_msg_header {
242243
unsigned int dest_subnodeid:6; /* must be 0x10, for the LB */
243244
/* bits 5:0 */
244245
unsigned int base_dest_nasid:15; /* nasid of the first bit */
@@ -317,20 +318,88 @@ struct bau_msg_header {
317318
/* bits 127:107 */
318319
};
319320

321+
/*
322+
* UV2 Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor)
323+
* see figure 9-2 of harp_sys.pdf
324+
*/
325+
struct uv2_bau_msg_header {
326+
unsigned int base_dest_nasid:15; /* nasid of the first bit */
327+
/* bits 14:0 */ /* in uvhub map */
328+
unsigned int dest_subnodeid:5; /* must be 0x10, for the LB */
329+
/* bits 19:15 */
330+
unsigned int rsvd_1:1; /* must be zero */
331+
/* bit 20 */
332+
/* Address bits 59:21 */
333+
/* bits 25:2 of address (44:21) are payload */
334+
/* these next 24 bits become bytes 12-14 of msg */
335+
/* bits 28:21 land in byte 12 */
336+
unsigned int replied_to:1; /* sent as 0 by the source to
337+
byte 12 */
338+
/* bit 21 */
339+
unsigned int msg_type:3; /* software type of the
340+
message */
341+
/* bits 24:22 */
342+
unsigned int canceled:1; /* message canceled, resource
343+
is to be freed*/
344+
/* bit 25 */
345+
unsigned int payload_1:3; /* not currently used */
346+
/* bits 28:26 */
347+
348+
/* bits 36:29 land in byte 13 */
349+
unsigned int payload_2a:3; /* not currently used */
350+
unsigned int payload_2b:5; /* not currently used */
351+
/* bits 36:29 */
352+
353+
/* bits 44:37 land in byte 14 */
354+
unsigned int payload_3:8; /* not currently used */
355+
/* bits 44:37 */
356+
357+
unsigned int rsvd_2:7; /* reserved */
358+
/* bits 51:45 */
359+
unsigned int swack_flag:1; /* software acknowledge flag */
360+
/* bit 52 */
361+
unsigned int rsvd_3a:3; /* must be zero */
362+
unsigned int rsvd_3b:8; /* must be zero */
363+
unsigned int rsvd_3c:8; /* must be zero */
364+
unsigned int rsvd_3d:3; /* must be zero */
365+
/* bits 74:53 */
366+
unsigned int fairness:3; /* usually zero */
367+
/* bits 77:75 */
368+
369+
unsigned int sequence:16; /* message sequence number */
370+
/* bits 93:78 Suppl_A */
371+
unsigned int chaining:1; /* next descriptor is part of
372+
this activation*/
373+
/* bit 94 */
374+
unsigned int multilevel:1; /* multi-level multicast
375+
format */
376+
/* bit 95 */
377+
unsigned int rsvd_4:24; /* ordered / source node /
378+
source subnode / aging
379+
must be zero */
380+
/* bits 119:96 */
381+
unsigned int command:8; /* message type */
382+
/* bits 127:120 */
383+
};
384+
320385
/*
321386
* The activation descriptor:
322387
* The format of the message to send, plus all accompanying control
323388
* Should be 64 bytes
324389
*/
325390
struct bau_desc {
326-
struct pnmask distribution;
391+
struct pnmask distribution;
327392
/*
328393
* message template, consisting of header and payload:
329394
*/
330-
struct bau_msg_header header;
331-
struct bau_msg_payload payload;
395+
union bau_msg_header {
396+
struct uv1_bau_msg_header uv1_hdr;
397+
struct uv2_bau_msg_header uv2_hdr;
398+
} header;
399+
400+
struct bau_msg_payload payload;
332401
};
333-
/*
402+
/* UV1:
334403
* -payload-- ---------header------
335404
* bytes 0-11 bits 41-56 bits 58-81
336405
* A B (2) C (3)
@@ -340,6 +409,16 @@ struct bau_desc {
340409
* bytes 0-11 bytes 12-14 bytes 16-17 (byte 15 filled in by hw as vector)
341410
* ------------payload queue-----------
342411
*/
412+
/* UV2:
413+
* -payload-- ---------header------
414+
* bytes 0-11 bits 70-78 bits 21-44
415+
* A B (2) C (3)
416+
*
417+
* A/B/C are moved to:
418+
* A C B
419+
* bytes 0-11 bytes 12-14 bytes 16-17 (byte 15 filled in by hw as vector)
420+
* ------------payload queue-----------
421+
*/
343422

344423
/*
345424
* The payload queue on the destination side is an array of these.
@@ -385,7 +464,6 @@ struct bau_pq_entry {
385464
struct msg_desc {
386465
struct bau_pq_entry *msg;
387466
int msg_slot;
388-
int swack_slot;
389467
struct bau_pq_entry *queue_first;
390468
struct bau_pq_entry *queue_last;
391469
};
@@ -405,6 +483,7 @@ struct ptc_stats {
405483
requests */
406484
unsigned long s_stimeout; /* source side timeouts */
407485
unsigned long s_dtimeout; /* destination side timeouts */
486+
unsigned long s_strongnacks; /* number of strong nack's */
408487
unsigned long s_time; /* time spent in sending side */
409488
unsigned long s_retriesok; /* successful retries */
410489
unsigned long s_ntargcpu; /* total number of cpu's
@@ -439,6 +518,9 @@ struct ptc_stats {
439518
unsigned long s_retry_messages; /* retry broadcasts */
440519
unsigned long s_bau_reenabled; /* for bau enable/disable */
441520
unsigned long s_bau_disabled; /* for bau enable/disable */
521+
unsigned long s_uv2_wars; /* uv2 workaround, perm. busy */
522+
unsigned long s_uv2_wars_hw; /* uv2 workaround, hiwater */
523+
unsigned long s_uv2_war_waits; /* uv2 workaround, long waits */
442524
/* destination statistics */
443525
unsigned long d_alltlb; /* times all tlb's on this
444526
cpu were flushed */
@@ -511,9 +593,12 @@ struct bau_control {
511593
short osnode;
512594
short uvhub_cpu;
513595
short uvhub;
596+
short uvhub_version;
514597
short cpus_in_socket;
515598
short cpus_in_uvhub;
516599
short partition_base_pnode;
600+
short using_desc; /* an index, like uvhub_cpu */
601+
unsigned int inuse_map;
517602
unsigned short message_number;
518603
unsigned short uvhub_quiesce;
519604
short socket_acknowledge_count[DEST_Q_SIZE];
@@ -531,6 +616,7 @@ struct bau_control {
531616
int cong_response_us;
532617
int cong_reps;
533618
int cong_period;
619+
unsigned long clocks_per_100_usec;
534620
cycles_t period_time;
535621
long period_requests;
536622
struct hub_and_pnode *thp;
@@ -591,6 +677,11 @@ static inline void write_mmr_sw_ack(unsigned long mr)
591677
uv_write_local_mmr(UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE_ALIAS, mr);
592678
}
593679

680+
static inline void write_gmmr_sw_ack(int pnode, unsigned long mr)
681+
{
682+
write_gmmr(pnode, UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE_ALIAS, mr);
683+
}
684+
594685
static inline unsigned long read_mmr_sw_ack(void)
595686
{
596687
return read_lmmr(UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE);

arch/x86/kernel/tsc.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,15 @@ static inline int pit_verify_msb(unsigned char val)
290290
static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *deltap)
291291
{
292292
int count;
293-
u64 tsc = 0;
293+
u64 tsc = 0, prev_tsc = 0;
294294

295295
for (count = 0; count < 50000; count++) {
296296
if (!pit_verify_msb(val))
297297
break;
298+
prev_tsc = tsc;
298299
tsc = get_cycles();
299300
}
300-
*deltap = get_cycles() - tsc;
301+
*deltap = get_cycles() - prev_tsc;
301302
*tscp = tsc;
302303

303304
/*
@@ -311,9 +312,9 @@ static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *de
311312
* How many MSB values do we want to see? We aim for
312313
* a maximum error rate of 500ppm (in practice the
313314
* real error is much smaller), but refuse to spend
314-
* more than 25ms on it.
315+
* more than 50ms on it.
315316
*/
316-
#define MAX_QUICK_PIT_MS 25
317+
#define MAX_QUICK_PIT_MS 50
317318
#define MAX_QUICK_PIT_ITERATIONS (MAX_QUICK_PIT_MS * PIT_TICK_RATE / 1000 / 256)
318319

319320
static unsigned long quick_pit_calibrate(void)
@@ -383,15 +384,12 @@ static unsigned long quick_pit_calibrate(void)
383384
*
384385
* As a result, we can depend on there not being
385386
* any odd delays anywhere, and the TSC reads are
386-
* reliable (within the error). We also adjust the
387-
* delta to the middle of the error bars, just
388-
* because it looks nicer.
387+
* reliable (within the error).
389388
*
390389
* kHz = ticks / time-in-seconds / 1000;
391390
* kHz = (t2 - t1) / (I * 256 / PIT_TICK_RATE) / 1000
392391
* kHz = ((t2 - t1) * PIT_TICK_RATE) / (I * 256 * 1000)
393392
*/
394-
delta += (long)(d2 - d1)/2;
395393
delta *= PIT_TICK_RATE;
396394
do_div(delta, i*256*1000);
397395
printk("Fast TSC calibration using PIT\n");

arch/x86/lib/x86-opcode-map.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ ab: STOS/W/D/Q Yv,rAX
219219
ac: LODS/B AL,Xb
220220
ad: LODS/W/D/Q rAX,Xv
221221
ae: SCAS/B AL,Yb
222-
af: SCAS/W/D/Q rAX,Xv
222+
# Note: The May 2011 Intel manual shows Xv for the second parameter of the
223+
# next instruction but Yv is correct
224+
af: SCAS/W/D/Q rAX,Yv
223225
# 0xb0 - 0xbf
224226
b0: MOV AL/R8L,Ib
225227
b1: MOV CL/R9L,Ib
@@ -729,8 +731,8 @@ de: VAESDEC Vdq,Hdq,Wdq (66),(v1)
729731
df: VAESDECLAST Vdq,Hdq,Wdq (66),(v1)
730732
f0: MOVBE Gy,My | MOVBE Gw,Mw (66) | CRC32 Gd,Eb (F2)
731733
f1: MOVBE My,Gy | MOVBE Mw,Gw (66) | CRC32 Gd,Ey (F2)
732-
f3: ANDN Gy,By,Ey (v)
733-
f4: Grp17 (1A)
734+
f2: ANDN Gy,By,Ey (v)
735+
f3: Grp17 (1A)
734736
f5: BZHI Gy,Ey,By (v) | PEXT Gy,By,Ey (F3),(v) | PDEP Gy,By,Ey (F2),(v)
735737
f6: MULX By,Gy,rDX,Ey (F2),(v)
736738
f7: BEXTR Gy,Ey,By (v) | SHLX Gy,Ey,By (66),(v) | SARX Gy,Ey,By (F3),(v) | SHRX Gy,Ey,By (F2),(v)

0 commit comments

Comments
 (0)