aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-gru/grufault.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc/sgi-gru/grufault.c')
-rw-r--r--drivers/misc/sgi-gru/grufault.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c
index a78aa798d50b..7d757e9c42f0 100644
--- a/drivers/misc/sgi-gru/grufault.c
+++ b/drivers/misc/sgi-gru/grufault.c
@@ -303,7 +303,7 @@ static int gru_try_dropin(struct gru_thread_state *gts,
303 struct gru_tlb_fault_handle *tfh, 303 struct gru_tlb_fault_handle *tfh,
304 struct gru_instruction_bits *cbk) 304 struct gru_instruction_bits *cbk)
305{ 305{
306 int pageshift = 0, asid, write, ret, atomic = !cbk; 306 int pageshift = 0, asid, write, ret, atomic = !cbk, indexway;
307 unsigned long gpa = 0, vaddr = 0; 307 unsigned long gpa = 0, vaddr = 0;
308 308
309 /* 309 /*
@@ -333,6 +333,7 @@ static int gru_try_dropin(struct gru_thread_state *gts,
333 write = (tfh->cause & TFHCAUSE_TLB_MOD) != 0; 333 write = (tfh->cause & TFHCAUSE_TLB_MOD) != 0;
334 vaddr = tfh->missvaddr; 334 vaddr = tfh->missvaddr;
335 asid = tfh->missasid; 335 asid = tfh->missasid;
336 indexway = tfh->indexway;
336 if (asid == 0) 337 if (asid == 0)
337 goto failnoasid; 338 goto failnoasid;
338 339
@@ -361,11 +362,12 @@ static int gru_try_dropin(struct gru_thread_state *gts,
361 gru_cb_set_istatus_active(cbk); 362 gru_cb_set_istatus_active(cbk);
362 tfh_write_restart(tfh, gpa, GAA_RAM, vaddr, asid, write, 363 tfh_write_restart(tfh, gpa, GAA_RAM, vaddr, asid, write,
363 GRU_PAGESIZE(pageshift)); 364 GRU_PAGESIZE(pageshift));
364 STAT(tlb_dropin);
365 gru_dbg(grudev, 365 gru_dbg(grudev,
366 "%s: tfh 0x%p, vaddr 0x%lx, asid 0x%x, ps %d, gpa 0x%lx\n", 366 "%s: gid %d, gts 0x%p, tfh 0x%p, vaddr 0x%lx, asid 0x%x, indexway 0x%x,"
367 ret ? "non-atomic" : "atomic", tfh, vaddr, asid, 367 " rw %d, ps %d, gpa 0x%lx\n",
368 pageshift, gpa); 368 atomic ? "atomic" : "non-atomic", gts->ts_gru->gs_gid, gts, tfh, vaddr, asid,
369 indexway, write, pageshift, gpa);
370 STAT(tlb_dropin);
369 return 0; 371 return 0;
370 372
371failnoasid: 373failnoasid:
@@ -460,12 +462,14 @@ static irqreturn_t gru_intr(int chiplet, int blade)
460 dmap.fault_bits[0], dmap.fault_bits[1]); 462 dmap.fault_bits[0], dmap.fault_bits[1]);
461 463
462 for_each_cbr_in_tfm(cbrnum, dmap.fault_bits) { 464 for_each_cbr_in_tfm(cbrnum, dmap.fault_bits) {
465 STAT(intr_cbr);
463 complete(gru->gs_blade->bs_async_wq); 466 complete(gru->gs_blade->bs_async_wq);
464 gru_dbg(grudev, "gid %d, cbr_done %d, done %d\n", 467 gru_dbg(grudev, "gid %d, cbr_done %d, done %d\n",
465 gru->gs_gid, cbrnum, gru->gs_blade->bs_async_wq->done); 468 gru->gs_gid, cbrnum, gru->gs_blade->bs_async_wq->done);
466 } 469 }
467 470
468 for_each_cbr_in_tfm(cbrnum, imap.fault_bits) { 471 for_each_cbr_in_tfm(cbrnum, imap.fault_bits) {
472 STAT(intr_tfh);
469 tfh = get_tfh_by_index(gru, cbrnum); 473 tfh = get_tfh_by_index(gru, cbrnum);
470 prefetchw(tfh); /* Helps on hdw, required for emulator */ 474 prefetchw(tfh); /* Helps on hdw, required for emulator */
471 475
@@ -551,7 +555,6 @@ int gru_handle_user_call_os(unsigned long cb)
551 int ucbnum, cbrnum, ret = -EINVAL; 555 int ucbnum, cbrnum, ret = -EINVAL;
552 556
553 STAT(call_os); 557 STAT(call_os);
554 gru_dbg(grudev, "address 0x%lx\n", cb);
555 558
556 /* sanity check the cb pointer */ 559 /* sanity check the cb pointer */
557 ucbnum = get_cb_number((void *)cb); 560 ucbnum = get_cb_number((void *)cb);
@@ -561,6 +564,7 @@ int gru_handle_user_call_os(unsigned long cb)
561 gts = gru_find_lock_gts(cb); 564 gts = gru_find_lock_gts(cb);
562 if (!gts) 565 if (!gts)
563 return -EINVAL; 566 return -EINVAL;
567 gru_dbg(grudev, "address 0x%lx, gid %d, gts 0x%p\n", cb, gts->ts_gru ? gts->ts_gru->gs_gid : -1, gts);
564 568
565 if (ucbnum >= gts->ts_cbr_au_count * GRU_CBR_AU_SIZE) 569 if (ucbnum >= gts->ts_cbr_au_count * GRU_CBR_AU_SIZE)
566 goto exit; 570 goto exit;
@@ -603,11 +607,11 @@ int gru_get_exception_detail(unsigned long arg)
603 if (copy_from_user(&excdet, (void __user *)arg, sizeof(excdet))) 607 if (copy_from_user(&excdet, (void __user *)arg, sizeof(excdet)))
604 return -EFAULT; 608 return -EFAULT;
605 609
606 gru_dbg(grudev, "address 0x%lx\n", excdet.cb);
607 gts = gru_find_lock_gts(excdet.cb); 610 gts = gru_find_lock_gts(excdet.cb);
608 if (!gts) 611 if (!gts)
609 return -EINVAL; 612 return -EINVAL;
610 613
614 gru_dbg(grudev, "address 0x%lx, gid %d, gts 0x%p\n", excdet.cb, gts->ts_gru ? gts->ts_gru->gs_gid : -1, gts);
611 ucbnum = get_cb_number((void *)excdet.cb); 615 ucbnum = get_cb_number((void *)excdet.cb);
612 if (ucbnum >= gts->ts_cbr_au_count * GRU_CBR_AU_SIZE) { 616 if (ucbnum >= gts->ts_cbr_au_count * GRU_CBR_AU_SIZE) {
613 ret = -EINVAL; 617 ret = -EINVAL;