1/* 2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 620 unchanged lines hidden (view full) --- 629 entry = insert(alignedVaddr, newEntry); 630 } 631 DPRINTF(TLB, "Miss was serviced.\n"); 632#endif 633 } 634 // Do paging protection checks. 635 bool inUser = (m5Reg.cpl == 3 && 636 !(flags & (CPL0FlagBit << FlagShift))); |
637 CR0 cr0 = tc->readMiscRegNoEffect(MISCREG_CR0); 638 bool badWrite = (!entry->writable && (inUser || cr0.wp)); 639 if ((inUser && !entry->user) || (mode == Write && badWrite)) { |
640 // The page must have been present to get into the TLB in 641 // the first place. We'll assume the reserved bits are 642 // fine even though we're not checking them. 643 return new PageFault(vaddr, true, mode, inUser, false); 644 } |
645 if (storeCheck && badWrite) { |
646 // This would fault if this were a write, so return a page 647 // fault that reflects that happening. 648 return new PageFault(vaddr, true, Write, inUser, false); 649 } 650 651 652 DPRINTF(TLB, "Entry found with paddr %#x, " 653 "doing protection checks.\n", entry->paddr); --- 100 unchanged lines hidden --- |