Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PARISC] fix TLB fault path on PA2.0 narrow systems

commit 5e185581d7c46ddd33cd9c01106d1fc86efb9376
Author: James Bottomley <JBottomley@Parallels.com>

[PARISC] fix PA1.1 oops on boot

Didn't quite fix the crash on boot. It moved it from PA1.1 processors to
PA2.0 narrow kernels. The final fix is to make sure the [id]tlb_miss_20 paths
also work. Even on narrow systems, these paths require using the wide
instructions becuase the tlb insertion format is wide. Fix this by
conditioning the dep[wd],z on whether we're being called from _11 or _20[w]
paths.

Tested-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

+17 -13
+17 -13
arch/parisc/kernel/entry.S
··· 552 552 * entry (identifying the physical page) and %r23 up with 553 553 * the from tlb entry (or nothing if only a to entry---for 554 554 * clear_user_page_asm) */ 555 - .macro do_alias spc,tmp,tmp1,va,pte,prot,fault 555 + .macro do_alias spc,tmp,tmp1,va,pte,prot,fault,patype 556 556 cmpib,COND(<>),n 0,\spc,\fault 557 557 ldil L%(TMPALIAS_MAP_START),\tmp 558 558 #if defined(CONFIG_64BIT) && (TMPALIAS_MAP_START >= 0x80000000) ··· 581 581 */ 582 582 cmpiclr,= 0x01,\tmp,%r0 583 583 ldi (_PAGE_DIRTY|_PAGE_READ|_PAGE_WRITE),\prot 584 - #ifdef CONFIG_64BIT 584 + .ifc \patype,20 585 585 depd,z \prot,8,7,\prot 586 - #else 586 + .else 587 + .ifc \patype,11 587 588 depw,z \prot,8,7,\prot 588 - #endif 589 + .else 590 + .error "undefined PA type to do_alias" 591 + .endif 592 + .endif 589 593 /* 590 594 * OK, it is in the temp alias region, check whether "from" or "to". 591 595 * Check "subtle" note in pacache.S re: r23/r26. ··· 1193 1189 nop 1194 1190 1195 1191 dtlb_check_alias_20w: 1196 - do_alias spc,t0,t1,va,pte,prot,dtlb_fault 1192 + do_alias spc,t0,t1,va,pte,prot,dtlb_fault,20 1197 1193 1198 1194 idtlbt pte,prot 1199 1195 ··· 1217 1213 nop 1218 1214 1219 1215 nadtlb_check_alias_20w: 1220 - do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate 1216 + do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,20 1221 1217 1222 1218 idtlbt pte,prot 1223 1219 ··· 1249 1245 nop 1250 1246 1251 1247 dtlb_check_alias_11: 1252 - do_alias spc,t0,t1,va,pte,prot,dtlb_fault 1248 + do_alias spc,t0,t1,va,pte,prot,dtlb_fault,11 1253 1249 1254 1250 idtlba pte,(va) 1255 1251 idtlbp prot,(va) ··· 1281 1277 nop 1282 1278 1283 1279 nadtlb_check_alias_11: 1284 - do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate 1280 + do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,11 1285 1281 1286 1282 idtlba pte,(va) 1287 1283 idtlbp prot,(va) ··· 1308 1304 nop 1309 1305 1310 1306 dtlb_check_alias_20: 1311 - do_alias spc,t0,t1,va,pte,prot,dtlb_fault 1307 + do_alias spc,t0,t1,va,pte,prot,dtlb_fault,20 1312 1308 1313 1309 idtlbt pte,prot 1314 1310 ··· 1334 1330 nop 1335 1331 1336 1332 nadtlb_check_alias_20: 1337 - do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate 1333 + do_alias spc,t0,t1,va,pte,prot,nadtlb_emulate,20 1338 1334 1339 1335 idtlbt pte,prot 1340 1336 ··· 1461 1457 nop 1462 1458 1463 1459 naitlb_check_alias_20w: 1464 - do_alias spc,t0,t1,va,pte,prot,naitlb_fault 1460 + do_alias spc,t0,t1,va,pte,prot,naitlb_fault,20 1465 1461 1466 1462 iitlbt pte,prot 1467 1463 ··· 1515 1511 nop 1516 1512 1517 1513 naitlb_check_alias_11: 1518 - do_alias spc,t0,t1,va,pte,prot,itlb_fault 1514 + do_alias spc,t0,t1,va,pte,prot,itlb_fault,11 1519 1515 1520 1516 iitlba pte,(%sr0, va) 1521 1517 iitlbp prot,(%sr0, va) ··· 1561 1557 nop 1562 1558 1563 1559 naitlb_check_alias_20: 1564 - do_alias spc,t0,t1,va,pte,prot,naitlb_fault 1560 + do_alias spc,t0,t1,va,pte,prot,naitlb_fault,20 1565 1561 1566 1562 iitlbt pte,prot 1567 1563