1/* 2 * Copyright (c) 2007-2008 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use of this software in source and binary forms, 6 * with or without modification, are permitted provided that the 7 * following conditions are met: 8 * --- 183 unchanged lines hidden (view full) --- 192 delayedResponse = false; 193 Addr vaddr = req->getVaddr(); 194 DPRINTF(TLB, "Translating vaddr %#x.\n", vaddr); 195 uint32_t flags = req->getFlags(); 196 bool storeCheck = flags & StoreCheck; 197 198 int seg = flags & SegmentFlagMask; 199 |
200 // If this is true, we're dealing with a request to read an internal 201 // value. 202 if (seg == SEGMENT_REG_MS) { 203 DPRINTF(TLB, "Addresses references internal memory.\n"); 204 Addr prefix = (vaddr >> 3) & IntAddrPrefixMask; 205 if (prefix == IntAddrPrefixCPUID) { 206 panic("CPUID memory space not yet implemented!\n"); 207 } else if (prefix == IntAddrPrefixMSR) { --- 363 unchanged lines hidden (view full) --- 571 if (!(seg == SEGMENT_REG_TSG || seg == SYS_SEGMENT_REG_IDTR || 572 seg == SEGMENT_REG_HS || seg == SEGMENT_REG_LS || 573 seg == SEGMENT_REG_MS) 574 && !tc->readMiscRegNoEffect(MISCREG_SEG_SEL(seg))) 575 return new GeneralProtection(0); 576 bool expandDown = false; 577 SegAttr attr = tc->readMiscRegNoEffect(MISCREG_SEG_ATTR(seg)); 578 if (seg >= SEGMENT_REG_ES && seg <= SEGMENT_REG_HS) { |
579 if (!attr.writable && (mode == Write || storeCheck)) |
580 return new GeneralProtection(0); 581 if (!attr.readable && mode == Read) 582 return new GeneralProtection(0); 583 expandDown = attr.expandDown; 584 585 } 586 Addr base = tc->readMiscRegNoEffect(MISCREG_SEG_BASE(seg)); 587 Addr limit = tc->readMiscRegNoEffect(MISCREG_SEG_LIMIT(seg)); --- 59 unchanged lines hidden (view full) --- 647 !(flags & (CPL0FlagBit << FlagShift))); 648 if ((inUser && !entry->user) || 649 (mode == Write && !entry->writable)) { 650 // The page must have been present to get into the TLB in 651 // the first place. We'll assume the reserved bits are 652 // fine even though we're not checking them. 653 return new PageFault(vaddr, true, mode, inUser, false); 654 } |
655 if (storeCheck && !entry->writable) { 656 // This would fault if this were a write, so return a page 657 // fault that reflects that happening. 658 return new PageFault(vaddr, true, Write, inUser, false); 659 } |
660 661 662 DPRINTF(TLB, "Entry found with paddr %#x, " 663 "doing protection checks.\n", entry->paddr); 664 Addr paddr = entry->paddr | (vaddr & (entry->size-1)); 665 DPRINTF(TLB, "Translated %#x -> %#x.\n", vaddr, paddr); 666 req->setPaddr(paddr); 667 } else { --- 88 unchanged lines hidden --- |