tlb.cc (7912:a9f05ab40763) tlb.cc (7933:e00ef55a2c49)
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)));
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 if ((inUser && !entry->user) ||
638 (mode == Write && !entry->writable)) {
637 CR0 cr0 = tc->readMiscRegNoEffect(MISCREG_CR0);
638 bool badWrite = (!entry->writable && (inUser || cr0.wp));
639 if ((inUser && !entry->user) || (mode == Write && badWrite)) {
639 // The page must have been present to get into the TLB in
640 // the first place. We'll assume the reserved bits are
641 // fine even though we're not checking them.
642 return new PageFault(vaddr, true, mode, inUser, false);
643 }
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 }
644 if (storeCheck && !entry->writable) {
645 if (storeCheck && badWrite) {
645 // This would fault if this were a write, so return a page
646 // fault that reflects that happening.
647 return new PageFault(vaddr, true, Write, inUser, false);
648 }
649
650
651 DPRINTF(TLB, "Entry found with paddr %#x, "
652 "doing protection checks.\n", entry->paddr);

--- 100 unchanged lines hidden ---
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 ---