Changeset 0fd9b35 in mainline
- Timestamp:
- 2011-12-30T18:30:47Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 41deb2a
- Parents:
- aaa6af2
- Location:
- kernel/arch/ia64
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia64/include/mm/frame.h
raaa6af2 r0fd9b35 43 43 #include <typedefs.h> 44 44 45 extern uintptr_t end_of_identity; 46 45 47 extern void frame_low_arch_init(void); 46 48 extern void frame_high_arch_init(void); -
kernel/arch/ia64/src/mm/frame.c
raaa6af2 r0fd9b35 51 51 #define MINCONF 1 52 52 53 uintptr_t end_of_identity = -1ULL; 54 53 55 static void frame_common_arch_init(bool low) 54 56 { … … 102 104 frame_mark_unavailable(ADDR2PFN(KERNEL_RESERVED_AREA_BASE), 103 105 SIZE2FRAMES(KERNEL_RESERVED_AREA_SIZE)); 106 107 /* PA2KA will work only on low-memory. */ 108 end_of_identity = PA2KA(config.physmem_end - FRAME_SIZE) + PAGE_SIZE; 104 109 } 105 110 -
kernel/arch/ia64/src/mm/tlb.c
raaa6af2 r0fd9b35 467 467 } 468 468 469 static bool is_kernel_fault(uintptr_t va) 470 { 471 region_register_t rr; 472 473 rr.word = rr_read(VA2VRN(va)); 474 rid_t rid = rr.map.rid; 475 return (RID2ASID(rid) == ASID_KERNEL) && (VA2VRN(va) == VRN_KERNEL); 476 } 477 469 478 /** Instruction TLB fault handler for faults with VHPT turned off. 470 479 * … … 480 489 va = istate->cr_ifa; /* faulting address */ 481 490 491 ASSERT(!is_kernel_fault(va)); 492 482 493 t = page_mapping_find(AS, va, true); 483 494 if (t) { … … 567 578 { 568 579 if (istate->cr_isr.sp) { 569 /* Speculative load. Deffer the exception570 until a more clever approach can be used.571 572 Currently if we try to find the mapping573 for the speculative load while in the kernel,574 we might introduce a livelock because of575 the possibly invalid values of the address.*/580 /* 581 * Speculative load. Deffer the exception until a more clever 582 * approach can be used. Currently if we try to find the 583 * mapping for the speculative load while in the kernel, we 584 * might introduce a livelock because of the possibly invalid 585 * values of the address. 586 */ 576 587 istate->cr_ipsr.ed = true; 577 588 return; … … 579 590 580 591 uintptr_t va = istate->cr_ifa; /* faulting address */ 581 582 region_register_t rr; 583 rr.word = rr_read(VA2VRN(va)); 584 rid_t rid = rr.map.rid; 585 if (RID2ASID(rid) == ASID_KERNEL) { 586 if (VA2VRN(va) == VRN_KERNEL) { 592 as_t *as = AS; 593 594 if (is_kernel_fault(va)) { 595 if (va < end_of_identity) { 587 596 /* 588 * Provide KA2PA(identity) mapping for faulting piece of 589 * kernel address space. 597 * Create kernel identity mapping for low memory. 590 598 */ 591 599 dtlb_kernel_mapping_insert(va, KA2PA(va), false, 0); 592 600 return; 601 } else { 602 as = AS_KERNEL; 593 603 } 594 604 } 595 605 596 606 597 pte_t *entry = page_mapping_find( AS, va, true);607 pte_t *entry = page_mapping_find(as, va, true); 598 608 if (entry) { 599 609 /* … … 641 651 uintptr_t va; 642 652 pte_t *t; 653 as_t *as = AS; 643 654 644 655 va = istate->cr_ifa; /* faulting address */ 645 656 646 t = page_mapping_find(AS, va, true); 657 if (is_kernel_fault(va)) 658 as = AS_KERNEL; 659 660 t = page_mapping_find(as, va, true); 647 661 ASSERT((t) && (t->p)); 648 662 if ((t) && (t->p) && (t->w)) { … … 674 688 675 689 va = istate->cr_ifa; /* faulting address */ 690 691 ASSERT(!is_kernel_fault(va)); 676 692 677 693 t = page_mapping_find(AS, va, true); … … 703 719 uintptr_t va; 704 720 pte_t *t; 721 as_t *as = AS; 705 722 706 723 va = istate->cr_ifa; /* faulting address */ 707 724 708 t = page_mapping_find(AS, va, true); 725 if (is_kernel_fault(va)) 726 as = AS_KERNEL; 727 728 t = page_mapping_find(as, va, true); 709 729 ASSERT((t) && (t->p)); 710 730 if ((t) && (t->p)) { … … 736 756 737 757 va = istate->cr_ifa; /* faulting address */ 758 759 ASSERT(!is_kernel_fault(va)); 738 760 739 761 /* … … 763 785 va = istate->cr_ifa; /* faulting address */ 764 786 787 ASSERT(!is_kernel_fault(va)); 788 765 789 t = page_mapping_find(AS, va, true); 766 790 ASSERT(t);
Note:
See TracChangeset
for help on using the changeset viewer.