25
25
#include <asm/traps.h>
26
26
#include <asm/thread_info.h>
27
27
#include <asm/alternative.h>
28
+ #include <asm/spinlock_types.h>
28
29
29
30
#include <linux/linkage.h>
30
31
#include <linux/pgtable.h>
406
407
LDREG 0 (\ptp),\pte
407
408
bb,<,n \pte,_PAGE_PRESENT_BIT,3f
408
409
b \fault
409
- stw \spc ,0 (\tmp)
410
+ stw \tmp1 ,0 (\tmp)
410
411
99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP)
411
412
#endif
412
413
2: LDREG 0 (\ptp),\pte
415
416
.endm
416
417
417
418
/* Release page_table_lock without reloading lock address.
418
- Note that the values in the register spc are limited to
419
- NR_SPACE_IDS (262144). Thus, the stw instruction always
420
- stores a nonzero value even when register spc is 64 bits.
421
419
We use an ordered store to ensure all prior accesses are
422
420
performed prior to releasing the lock. */
423
- .macro ptl_unlock0 spc,tmp
421
+ .macro ptl_unlock0 spc,tmp,tmp2
424
422
#ifdef CONFIG_TLB_PTLOCK
425
- 98: or ,COND(=) %r0,\spc,%r0
426
- stw,ma \spc,0 (\tmp)
423
+ 98: ldi __ARCH_SPIN_LOCK_UNLOCKED_VAL, \tmp2
424
+ or ,COND(=) %r0,\spc,%r0
425
+ stw,ma \tmp2,0 (\tmp)
427
426
99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP)
428
427
#endif
429
428
.endm
430
429
431
430
/* Release page_table_lock. */
432
- .macro ptl_unlock1 spc,tmp
431
+ .macro ptl_unlock1 spc,tmp,tmp2
433
432
#ifdef CONFIG_TLB_PTLOCK
434
433
98: get_ptl \tmp
435
- ptl_unlock0 \spc,\tmp
434
+ ptl_unlock0 \spc,\tmp,\tmp2
436
435
99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP)
437
436
#endif
438
437
.endm
@@ -1125,7 +1124,7 @@ dtlb_miss_20w:
1125
1124
1126
1125
idtlbt pte,prot
1127
1126
1128
- ptl_unlock1 spc,t0
1127
+ ptl_unlock1 spc,t0,t1
1129
1128
rfir
1130
1129
nop
1131
1130
@@ -1151,7 +1150,7 @@ nadtlb_miss_20w:
1151
1150
1152
1151
idtlbt pte,prot
1153
1152
1154
- ptl_unlock1 spc,t0
1153
+ ptl_unlock1 spc,t0,t1
1155
1154
rfir
1156
1155
nop
1157
1156
@@ -1185,7 +1184,7 @@ dtlb_miss_11:
1185
1184
1186
1185
mtsp t1, %sr1 /* Restore sr1 */
1187
1186
1188
- ptl_unlock1 spc,t0
1187
+ ptl_unlock1 spc,t0,t1
1189
1188
rfir
1190
1189
nop
1191
1190
@@ -1218,7 +1217,7 @@ nadtlb_miss_11:
1218
1217
1219
1218
mtsp t1, %sr1 /* Restore sr1 */
1220
1219
1221
- ptl_unlock1 spc,t0
1220
+ ptl_unlock1 spc,t0,t1
1222
1221
rfir
1223
1222
nop
1224
1223
@@ -1247,7 +1246,7 @@ dtlb_miss_20:
1247
1246
1248
1247
idtlbt pte,prot
1249
1248
1250
- ptl_unlock1 spc,t0
1249
+ ptl_unlock1 spc,t0,t1
1251
1250
rfir
1252
1251
nop
1253
1252
@@ -1275,7 +1274,7 @@ nadtlb_miss_20:
1275
1274
1276
1275
idtlbt pte,prot
1277
1276
1278
- ptl_unlock1 spc,t0
1277
+ ptl_unlock1 spc,t0,t1
1279
1278
rfir
1280
1279
nop
1281
1280
@@ -1320,7 +1319,7 @@ itlb_miss_20w:
1320
1319
1321
1320
iitlbt pte,prot
1322
1321
1323
- ptl_unlock1 spc,t0
1322
+ ptl_unlock1 spc,t0,t1
1324
1323
rfir
1325
1324
nop
1326
1325
@@ -1344,7 +1343,7 @@ naitlb_miss_20w:
1344
1343
1345
1344
iitlbt pte,prot
1346
1345
1347
- ptl_unlock1 spc,t0
1346
+ ptl_unlock1 spc,t0,t1
1348
1347
rfir
1349
1348
nop
1350
1349
@@ -1378,7 +1377,7 @@ itlb_miss_11:
1378
1377
1379
1378
mtsp t1, %sr1 /* Restore sr1 */
1380
1379
1381
- ptl_unlock1 spc,t0
1380
+ ptl_unlock1 spc,t0,t1
1382
1381
rfir
1383
1382
nop
1384
1383
@@ -1402,7 +1401,7 @@ naitlb_miss_11:
1402
1401
1403
1402
mtsp t1, %sr1 /* Restore sr1 */
1404
1403
1405
- ptl_unlock1 spc,t0
1404
+ ptl_unlock1 spc,t0,t1
1406
1405
rfir
1407
1406
nop
1408
1407
@@ -1432,7 +1431,7 @@ itlb_miss_20:
1432
1431
1433
1432
iitlbt pte,prot
1434
1433
1435
- ptl_unlock1 spc,t0
1434
+ ptl_unlock1 spc,t0,t1
1436
1435
rfir
1437
1436
nop
1438
1437
@@ -1452,7 +1451,7 @@ naitlb_miss_20:
1452
1451
1453
1452
iitlbt pte,prot
1454
1453
1455
- ptl_unlock1 spc,t0
1454
+ ptl_unlock1 spc,t0,t1
1456
1455
rfir
1457
1456
nop
1458
1457
@@ -1482,7 +1481,7 @@ dbit_trap_20w:
1482
1481
1483
1482
idtlbt pte,prot
1484
1483
1485
- ptl_unlock0 spc,t0
1484
+ ptl_unlock0 spc,t0,t1
1486
1485
rfir
1487
1486
nop
1488
1487
#else
@@ -1508,7 +1507,7 @@ dbit_trap_11:
1508
1507
1509
1508
mtsp t1, %sr1 /* Restore sr1 */
1510
1509
1511
- ptl_unlock0 spc,t0
1510
+ ptl_unlock0 spc,t0,t1
1512
1511
rfir
1513
1512
nop
1514
1513
@@ -1528,7 +1527,7 @@ dbit_trap_20:
1528
1527
1529
1528
idtlbt pte,prot
1530
1529
1531
- ptl_unlock0 spc,t0
1530
+ ptl_unlock0 spc,t0,t1
1532
1531
rfir
1533
1532
nop
1534
1533
#endif
0 commit comments