Changeset 567807b1 in mainline for arch/ia64/src/mm/tlb.c
- Timestamp:
- 2006-05-24T17:03:29Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8d6bc2d5
- Parents:
- 82da5f5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia64/src/mm/tlb.c
r82da5f5 r567807b1 430 430 { 431 431 region_register rr; 432 rid_t rid; 432 433 __address va; 433 434 pte_t *t; 434 435 435 436 va = istate->cr_ifa; /* faulting address */ 437 rr.word = rr_read(VA2VRN(va)); 438 rid = rr.map.rid; 439 436 440 page_table_lock(AS, true); 437 441 t = page_mapping_find(AS, va); … … 448 452 */ 449 453 page_table_unlock(AS, true); 450 if (as_page_fault(va, istate) == AS_PF_FAULT) {451 panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, istate->cr_ifa, rr.map.rid, istate->cr_iip);454 if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) { 455 panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip); 452 456 } 453 457 } … … 494 498 */ 495 499 page_table_unlock(AS, true); 496 if (as_page_fault(va, istate) == AS_PF_FAULT) {500 if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) { 497 501 panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip); 498 502 } … … 519 523 void data_dirty_bit_fault(__u64 vector, istate_t *istate) 520 524 { 525 region_register rr; 526 rid_t rid; 527 __address va; 521 528 pte_t *t; 529 530 va = istate->cr_ifa; /* faulting address */ 531 rr.word = rr_read(VA2VRN(va)); 532 rid = rr.map.rid; 522 533 523 534 page_table_lock(AS, true); 524 t = page_mapping_find(AS, istate->cr_ifa); 535 t = page_mapping_find(AS, va); 536 ASSERT(t && t->p); 537 if (t && t->p && t->w) { 538 /* 539 * Update the Dirty bit in page tables and reinsert 540 * the mapping into DTC. 541 */ 542 t->d = true; 543 dtc_pte_copy(t); 544 } else { 545 if (as_page_fault(va, PF_ACCESS_WRITE, istate) == AS_PF_FAULT) { 546 panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip); 547 t->d = true; 548 dtc_pte_copy(t); 549 } 550 } 551 page_table_unlock(AS, true); 552 } 553 554 /** Instruction access bit fault handler. 555 * 556 * @param vector Interruption vector. 557 * @param istate Structure with saved interruption state. 558 */ 559 void instruction_access_bit_fault(__u64 vector, istate_t *istate) 560 { 561 region_register rr; 562 rid_t rid; 563 __address va; 564 pte_t *t; 565 566 va = istate->cr_ifa; /* faulting address */ 567 rr.word = rr_read(VA2VRN(va)); 568 rid = rr.map.rid; 569 570 page_table_lock(AS, true); 571 t = page_mapping_find(AS, va); 572 ASSERT(t && t->p); 573 if (t && t->p && t->x) { 574 /* 575 * Update the Accessed bit in page tables and reinsert 576 * the mapping into ITC. 577 */ 578 t->a = true; 579 itc_pte_copy(t); 580 } else { 581 if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) { 582 panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip); 583 t->a = true; 584 itc_pte_copy(t); 585 } 586 } 587 page_table_unlock(AS, true); 588 } 589 590 /** Data access bit fault handler. 591 * 592 * @param vector Interruption vector. 593 * @param istate Structure with saved interruption state. 594 */ 595 void data_access_bit_fault(__u64 vector, istate_t *istate) 596 { 597 region_register rr; 598 rid_t rid; 599 __address va; 600 pte_t *t; 601 602 va = istate->cr_ifa; /* faulting address */ 603 rr.word = rr_read(VA2VRN(va)); 604 rid = rr.map.rid; 605 606 page_table_lock(AS, true); 607 t = page_mapping_find(AS, va); 525 608 ASSERT(t && t->p); 526 609 if (t && t->p) { 527 610 /* 528 * Update the Dirtybit in page tables and reinsert611 * Update the Accessed bit in page tables and reinsert 529 612 * the mapping into DTC. 530 613 */ 531 t-> d= true;614 t->a = true; 532 615 dtc_pte_copy(t); 616 } else { 617 if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) { 618 panic("%s: va=%p, rid=%d, iip=%p\n", __FUNCTION__, va, rid, istate->cr_iip); 619 t->a = true; 620 itc_pte_copy(t); 621 } 533 622 } 534 623 page_table_unlock(AS, true); 535 624 } 536 625 537 /** Instruction access bit fault handler.626 /** Page not present fault handler. 538 627 * 539 628 * @param vector Interruption vector. 540 629 * @param istate Structure with saved interruption state. 541 630 */ 542 void instruction_access_bit_fault(__u64 vector, istate_t *istate)543 {544 pte_t *t;545 546 page_table_lock(AS, true);547 t = page_mapping_find(AS, istate->cr_ifa);548 ASSERT(t && t->p);549 if (t && t->p) {550 /*551 * Update the Accessed bit in page tables and reinsert552 * the mapping into ITC.553 */554 t->a = true;555 itc_pte_copy(t);556 }557 page_table_unlock(AS, true);558 }559 560 /** Data access bit fault handler.561 *562 * @param vector Interruption vector.563 * @param istate Structure with saved interruption state.564 */565 void data_access_bit_fault(__u64 vector, istate_t *istate)566 {567 pte_t *t;568 569 page_table_lock(AS, true);570 t = page_mapping_find(AS, istate->cr_ifa);571 ASSERT(t && t->p);572 if (t && t->p) {573 /*574 * Update the Accessed bit in page tables and reinsert575 * the mapping into DTC.576 */577 t->a = true;578 dtc_pte_copy(t);579 }580 page_table_unlock(AS, true);581 }582 583 /** Page not present fault handler.584 *585 * @param vector Interruption vector.586 * @param istate Structure with saved interruption state.587 */588 631 void page_not_present(__u64 vector, istate_t *istate) 589 632 { 590 633 region_register rr; 634 rid_t rid; 591 635 __address va; 592 636 pte_t *t; 593 637 594 638 va = istate->cr_ifa; /* faulting address */ 639 rr.word = rr_read(VA2VRN(va)); 640 rid = rr.map.rid; 641 595 642 page_table_lock(AS, true); 596 643 t = page_mapping_find(AS, va); … … 609 656 } else { 610 657 page_table_unlock(AS, true); 611 if (as_page_fault(va, istate) == AS_PF_FAULT) {612 panic("%s: va=%p, rid=%d\n", __FUNCTION__, va, r r.map.rid);613 } 614 } 615 } 658 if (as_page_fault(va, PF_ACCESS_READ, istate) == AS_PF_FAULT) { 659 panic("%s: va=%p, rid=%d\n", __FUNCTION__, va, rid); 660 } 661 } 662 }
Note:
See TracChangeset
for help on using the changeset viewer.