diff options
| -rw-r--r-- | arch/parisc/include/asm/spinlock.h | 4 | ||||
| -rw-r--r-- | arch/parisc/kernel/entry.S | 43 | ||||
| -rw-r--r-- | arch/parisc/kernel/syscall.S | 16 |
3 files changed, 39 insertions, 24 deletions
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h index 8a63515f03bf..197d2247e4db 100644 --- a/arch/parisc/include/asm/spinlock.h +++ b/arch/parisc/include/asm/spinlock.h | |||
| @@ -37,7 +37,11 @@ static inline void arch_spin_unlock(arch_spinlock_t *x) | |||
| 37 | volatile unsigned int *a; | 37 | volatile unsigned int *a; |
| 38 | 38 | ||
| 39 | a = __ldcw_align(x); | 39 | a = __ldcw_align(x); |
| 40 | #ifdef CONFIG_SMP | ||
| 41 | (void) __ldcw(a); | ||
| 42 | #else | ||
| 40 | mb(); | 43 | mb(); |
| 44 | #endif | ||
| 41 | *a = 1; | 45 | *a = 1; |
| 42 | } | 46 | } |
| 43 | 47 | ||
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index d5eb19efa65b..5796524a3137 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S | |||
| @@ -471,8 +471,9 @@ | |||
| 471 | nop | 471 | nop |
| 472 | LDREG 0(\ptp),\pte | 472 | LDREG 0(\ptp),\pte |
| 473 | bb,<,n \pte,_PAGE_PRESENT_BIT,3f | 473 | bb,<,n \pte,_PAGE_PRESENT_BIT,3f |
| 474 | LDCW 0(\tmp),\tmp1 | ||
| 474 | b \fault | 475 | b \fault |
| 475 | stw,ma \spc,0(\tmp) | 476 | stw \spc,0(\tmp) |
| 476 | 99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP) | 477 | 99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP) |
| 477 | #endif | 478 | #endif |
| 478 | 2: LDREG 0(\ptp),\pte | 479 | 2: LDREG 0(\ptp),\pte |
| @@ -481,20 +482,22 @@ | |||
| 481 | .endm | 482 | .endm |
| 482 | 483 | ||
| 483 | /* Release pa_tlb_lock lock without reloading lock address. */ | 484 | /* Release pa_tlb_lock lock without reloading lock address. */ |
| 484 | .macro tlb_unlock0 spc,tmp | 485 | .macro tlb_unlock0 spc,tmp,tmp1 |
| 485 | #ifdef CONFIG_SMP | 486 | #ifdef CONFIG_SMP |
| 486 | 98: or,COND(=) %r0,\spc,%r0 | 487 | 98: or,COND(=) %r0,\spc,%r0 |
| 487 | stw,ma \spc,0(\tmp) | 488 | LDCW 0(\tmp),\tmp1 |
| 489 | or,COND(=) %r0,\spc,%r0 | ||
| 490 | stw \spc,0(\tmp) | ||
| 488 | 99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP) | 491 | 99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP) |
| 489 | #endif | 492 | #endif |
| 490 | .endm | 493 | .endm |
| 491 | 494 | ||
| 492 | /* Release pa_tlb_lock lock. */ | 495 | /* Release pa_tlb_lock lock. */ |
| 493 | .macro tlb_unlock1 spc,tmp | 496 | .macro tlb_unlock1 spc,tmp,tmp1 |
| 494 | #ifdef CONFIG_SMP | 497 | #ifdef CONFIG_SMP |
| 495 | 98: load_pa_tlb_lock \tmp | 498 | 98: load_pa_tlb_lock \tmp |
| 496 | 99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP) | 499 | 99: ALTERNATIVE(98b, 99b, ALT_COND_NO_SMP, INSN_NOP) |
| 497 | tlb_unlock0 \spc,\tmp | 500 | tlb_unlock0 \spc,\tmp,\tmp1 |
| 498 | #endif | 501 | #endif |
| 499 | .endm | 502 | .endm |
| 500 | 503 | ||
| @@ -1177,7 +1180,7 @@ dtlb_miss_20w: | |||
| 1177 | 1180 | ||
| 1178 | idtlbt pte,prot | 1181 | idtlbt pte,prot |
| 1179 | 1182 | ||
| 1180 | tlb_unlock1 spc,t0 | 1183 | tlb_unlock1 spc,t0,t1 |
| 1181 | rfir | 1184 | rfir |
| 1182 | nop | 1185 | nop |
| 1183 | 1186 | ||
| @@ -1203,7 +1206,7 @@ nadtlb_miss_20w: | |||
| 1203 | 1206 | ||
| 1204 | idtlbt pte,prot | 1207 | idtlbt pte,prot |
| 1205 | 1208 | ||
| 1206 | tlb_unlock1 spc,t0 | 1209 | tlb_unlock1 spc,t0,t1 |
| 1207 | rfir | 1210 | rfir |
| 1208 | nop | 1211 | nop |
| 1209 | 1212 | ||
| @@ -1237,7 +1240,7 @@ dtlb_miss_11: | |||
| 1237 | 1240 | ||
| 1238 | mtsp t1, %sr1 /* Restore sr1 */ | 1241 | mtsp t1, %sr1 /* Restore sr1 */ |
| 1239 | 1242 | ||
| 1240 | tlb_unlock1 spc,t0 | 1243 | tlb_unlock1 spc,t0,t1 |
| 1241 | rfir | 1244 | rfir |
| 1242 | nop | 1245 | nop |
| 1243 | 1246 | ||
| @@ -1270,7 +1273,7 @@ nadtlb_miss_11: | |||
| 1270 | 1273 | ||
| 1271 | mtsp t1, %sr1 /* Restore sr1 */ | 1274 | mtsp t1, %sr1 /* Restore sr1 */ |
| 1272 | 1275 | ||
| 1273 | tlb_unlock1 spc,t0 | 1276 | tlb_unlock1 spc,t0,t1 |
| 1274 | rfir | 1277 | rfir |
| 1275 | nop | 1278 | nop |
| 1276 | 1279 | ||
| @@ -1299,7 +1302,7 @@ dtlb_miss_20: | |||
| 1299 | 1302 | ||
| 1300 | idtlbt pte,prot | 1303 | idtlbt pte,prot |
| 1301 | 1304 | ||
| 1302 | tlb_unlock1 spc,t0 | 1305 | tlb_unlock1 spc,t0,t1 |
| 1303 | rfir | 1306 | rfir |
| 1304 | nop | 1307 | nop |
| 1305 | 1308 | ||
| @@ -1327,7 +1330,7 @@ nadtlb_miss_20: | |||
| 1327 | 1330 | ||
| 1328 | idtlbt pte,prot | 1331 | idtlbt pte,prot |
| 1329 | 1332 | ||
| 1330 | tlb_unlock1 spc,t0 | 1333 | tlb_unlock1 spc,t0,t1 |
| 1331 | rfir | 1334 | rfir |
| 1332 | nop | 1335 | nop |
| 1333 | 1336 | ||
| @@ -1434,7 +1437,7 @@ itlb_miss_20w: | |||
| 1434 | 1437 | ||
| 1435 | iitlbt pte,prot | 1438 | iitlbt pte,prot |
| 1436 | 1439 | ||
| 1437 | tlb_unlock1 spc,t0 | 1440 | tlb_unlock1 spc,t0,t1 |
| 1438 | rfir | 1441 | rfir |
| 1439 | nop | 1442 | nop |
| 1440 | 1443 | ||
| @@ -1458,7 +1461,7 @@ naitlb_miss_20w: | |||
| 1458 | 1461 | ||
| 1459 | iitlbt pte,prot | 1462 | iitlbt pte,prot |
| 1460 | 1463 | ||
| 1461 | tlb_unlock1 spc,t0 | 1464 | tlb_unlock1 spc,t0,t1 |
| 1462 | rfir | 1465 | rfir |
| 1463 | nop | 1466 | nop |
| 1464 | 1467 | ||
| @@ -1492,7 +1495,7 @@ itlb_miss_11: | |||
| 1492 | 1495 | ||
| 1493 | mtsp t1, %sr1 /* Restore sr1 */ | 1496 | mtsp t1, %sr1 /* Restore sr1 */ |
| 1494 | 1497 | ||
| 1495 | tlb_unlock1 spc,t0 | 1498 | tlb_unlock1 spc,t0,t1 |
| 1496 | rfir | 1499 | rfir |
| 1497 | nop | 1500 | nop |
| 1498 | 1501 | ||
| @@ -1516,7 +1519,7 @@ naitlb_miss_11: | |||
| 1516 | 1519 | ||
| 1517 | mtsp t1, %sr1 /* Restore sr1 */ | 1520 | mtsp t1, %sr1 /* Restore sr1 */ |
| 1518 | 1521 | ||
| 1519 | tlb_unlock1 spc,t0 | 1522 | tlb_unlock1 spc,t0,t1 |
| 1520 | rfir | 1523 | rfir |
| 1521 | nop | 1524 | nop |
| 1522 | 1525 | ||
| @@ -1546,7 +1549,7 @@ itlb_miss_20: | |||
| 1546 | 1549 | ||
| 1547 | iitlbt pte,prot | 1550 | iitlbt pte,prot |
| 1548 | 1551 | ||
| 1549 | tlb_unlock1 spc,t0 | 1552 | tlb_unlock1 spc,t0,t1 |
| 1550 | rfir | 1553 | rfir |
| 1551 | nop | 1554 | nop |
| 1552 | 1555 | ||
| @@ -1566,7 +1569,7 @@ naitlb_miss_20: | |||
| 1566 | 1569 | ||
| 1567 | iitlbt pte,prot | 1570 | iitlbt pte,prot |
| 1568 | 1571 | ||
| 1569 | tlb_unlock1 spc,t0 | 1572 | tlb_unlock1 spc,t0,t1 |
| 1570 | rfir | 1573 | rfir |
| 1571 | nop | 1574 | nop |
| 1572 | 1575 | ||
| @@ -1596,7 +1599,7 @@ dbit_trap_20w: | |||
| 1596 | 1599 | ||
| 1597 | idtlbt pte,prot | 1600 | idtlbt pte,prot |
| 1598 | 1601 | ||
| 1599 | tlb_unlock0 spc,t0 | 1602 | tlb_unlock0 spc,t0,t1 |
| 1600 | rfir | 1603 | rfir |
| 1601 | nop | 1604 | nop |
| 1602 | #else | 1605 | #else |
| @@ -1622,7 +1625,7 @@ dbit_trap_11: | |||
| 1622 | 1625 | ||
| 1623 | mtsp t1, %sr1 /* Restore sr1 */ | 1626 | mtsp t1, %sr1 /* Restore sr1 */ |
| 1624 | 1627 | ||
| 1625 | tlb_unlock0 spc,t0 | 1628 | tlb_unlock0 spc,t0,t1 |
| 1626 | rfir | 1629 | rfir |
| 1627 | nop | 1630 | nop |
| 1628 | 1631 | ||
| @@ -1642,7 +1645,7 @@ dbit_trap_20: | |||
| 1642 | 1645 | ||
| 1643 | idtlbt pte,prot | 1646 | idtlbt pte,prot |
| 1644 | 1647 | ||
| 1645 | tlb_unlock0 spc,t0 | 1648 | tlb_unlock0 spc,t0,t1 |
| 1646 | rfir | 1649 | rfir |
| 1647 | nop | 1650 | nop |
| 1648 | #endif | 1651 | #endif |
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S index 4f77bd9be66b..e2b4c8d81275 100644 --- a/arch/parisc/kernel/syscall.S +++ b/arch/parisc/kernel/syscall.S | |||
| @@ -640,7 +640,9 @@ cas_action: | |||
| 640 | sub,<> %r28, %r25, %r0 | 640 | sub,<> %r28, %r25, %r0 |
| 641 | 2: stw %r24, 0(%r26) | 641 | 2: stw %r24, 0(%r26) |
| 642 | /* Free lock */ | 642 | /* Free lock */ |
| 643 | sync | 643 | #ifdef CONFIG_SMP |
| 644 | LDCW 0(%sr2,%r20), %r1 /* Barrier */ | ||
| 645 | #endif | ||
| 644 | stw %r20, 0(%sr2,%r20) | 646 | stw %r20, 0(%sr2,%r20) |
| 645 | #if ENABLE_LWS_DEBUG | 647 | #if ENABLE_LWS_DEBUG |
| 646 | /* Clear thread register indicator */ | 648 | /* Clear thread register indicator */ |
| @@ -655,7 +657,9 @@ cas_action: | |||
| 655 | 3: | 657 | 3: |
| 656 | /* Error occurred on load or store */ | 658 | /* Error occurred on load or store */ |
| 657 | /* Free lock */ | 659 | /* Free lock */ |
| 658 | sync | 660 | #ifdef CONFIG_SMP |
| 661 | LDCW 0(%sr2,%r20), %r1 /* Barrier */ | ||
| 662 | #endif | ||
| 659 | stw %r20, 0(%sr2,%r20) | 663 | stw %r20, 0(%sr2,%r20) |
| 660 | #if ENABLE_LWS_DEBUG | 664 | #if ENABLE_LWS_DEBUG |
| 661 | stw %r0, 4(%sr2,%r20) | 665 | stw %r0, 4(%sr2,%r20) |
| @@ -857,7 +861,9 @@ cas2_action: | |||
| 857 | 861 | ||
| 858 | cas2_end: | 862 | cas2_end: |
| 859 | /* Free lock */ | 863 | /* Free lock */ |
| 860 | sync | 864 | #ifdef CONFIG_SMP |
| 865 | LDCW 0(%sr2,%r20), %r1 /* Barrier */ | ||
| 866 | #endif | ||
| 861 | stw %r20, 0(%sr2,%r20) | 867 | stw %r20, 0(%sr2,%r20) |
| 862 | /* Enable interrupts */ | 868 | /* Enable interrupts */ |
| 863 | ssm PSW_SM_I, %r0 | 869 | ssm PSW_SM_I, %r0 |
| @@ -868,7 +874,9 @@ cas2_end: | |||
| 868 | 22: | 874 | 22: |
| 869 | /* Error occurred on load or store */ | 875 | /* Error occurred on load or store */ |
| 870 | /* Free lock */ | 876 | /* Free lock */ |
| 871 | sync | 877 | #ifdef CONFIG_SMP |
| 878 | LDCW 0(%sr2,%r20), %r1 /* Barrier */ | ||
| 879 | #endif | ||
| 872 | stw %r20, 0(%sr2,%r20) | 880 | stw %r20, 0(%sr2,%r20) |
| 873 | ssm PSW_SM_I, %r0 | 881 | ssm PSW_SM_I, %r0 |
| 874 | ldo 1(%r0),%r28 | 882 | ldo 1(%r0),%r28 |
