pagetable_walker.cc (11793:ef606668d247) pagetable_walker.cc (12749:223c83ed9979)
1/*
2 * Copyright (c) 2012 ARM Limited
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

--- 54 unchanged lines hidden (view full) ---

63#include "debug/PageTableWalker.hh"
64#include "mem/packet_access.hh"
65#include "mem/request.hh"
66
67namespace X86ISA {
68
69Fault
70Walker::start(ThreadContext * _tc, BaseTLB::Translation *_translation,
1/*
2 * Copyright (c) 2012 ARM Limited
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

--- 54 unchanged lines hidden (view full) ---

63#include "debug/PageTableWalker.hh"
64#include "mem/packet_access.hh"
65#include "mem/request.hh"
66
67namespace X86ISA {
68
69Fault
70Walker::start(ThreadContext * _tc, BaseTLB::Translation *_translation,
71 RequestPtr _req, BaseTLB::Mode _mode)
71 const RequestPtr &_req, BaseTLB::Mode _mode)
72{
73 // TODO: in timing mode, instead of blocking when there are other
74 // outstanding requests, see if this request can be coalesced with
75 // another one (i.e. either coalesce or start walk)
76 WalkerState * newState = new WalkerState(this, _translation, _req);
77 newState->initState(_tc, _mode, sys->isTimingMode());
78 if (currStates.size()) {
79 assert(newState->isTiming());

--- 429 unchanged lines hidden (view full) ---

509 if (!functional)
510 walker->tlb->insert(entry.vaddr, entry);
511 endWalk();
512 } else {
513 PacketPtr oldRead = read;
514 //If we didn't return, we're setting up another read.
515 Request::Flags flags = oldRead->req->getFlags();
516 flags.set(Request::UNCACHEABLE, uncacheable);
72{
73 // TODO: in timing mode, instead of blocking when there are other
74 // outstanding requests, see if this request can be coalesced with
75 // another one (i.e. either coalesce or start walk)
76 WalkerState * newState = new WalkerState(this, _translation, _req);
77 newState->initState(_tc, _mode, sys->isTimingMode());
78 if (currStates.size()) {
79 assert(newState->isTiming());

--- 429 unchanged lines hidden (view full) ---

509 if (!functional)
510 walker->tlb->insert(entry.vaddr, entry);
511 endWalk();
512 } else {
513 PacketPtr oldRead = read;
514 //If we didn't return, we're setting up another read.
515 Request::Flags flags = oldRead->req->getFlags();
516 flags.set(Request::UNCACHEABLE, uncacheable);
517 RequestPtr request =
518 new Request(nextRead, oldRead->getSize(), flags, walker->masterId);
517 RequestPtr request = std::make_shared<Request>(
518 nextRead, oldRead->getSize(), flags, walker->masterId);
519 read = new Packet(request, MemCmd::ReadReq);
520 read->allocate();
521 // If we need to write, adjust the read packet to write the modified
522 // value back to memory.
523 if (doWrite) {
524 write = oldRead;
525 write->set<uint64_t>(pte);
526 write->cmd = MemCmd::WriteReq;
527 } else {
528 write = NULL;
519 read = new Packet(request, MemCmd::ReadReq);
520 read->allocate();
521 // If we need to write, adjust the read packet to write the modified
522 // value back to memory.
523 if (doWrite) {
524 write = oldRead;
525 write->set<uint64_t>(pte);
526 write->cmd = MemCmd::WriteReq;
527 } else {
528 write = NULL;
529 delete oldRead->req;
530 delete oldRead;
531 }
532 }
533 return fault;
534}
535
536void
537Walker::WalkerState::endWalk()
538{
539 nextState = Ready;
529 delete oldRead;
530 }
531 }
532 return fault;
533}
534
535void
536Walker::WalkerState::endWalk()
537{
538 nextState = Ready;
540 delete read->req;
541 delete read;
542 read = NULL;
543}
544
545void
546Walker::WalkerState::setupWalk(Addr vaddr)
547{
548 VAddr addr = vaddr;

--- 30 unchanged lines hidden (view full) ---

579 }
580
581 nextState = Ready;
582 entry.vaddr = vaddr;
583
584 Request::Flags flags = Request::PHYSICAL;
585 if (cr3.pcd)
586 flags.set(Request::UNCACHEABLE);
539 delete read;
540 read = NULL;
541}
542
543void
544Walker::WalkerState::setupWalk(Addr vaddr)
545{
546 VAddr addr = vaddr;

--- 30 unchanged lines hidden (view full) ---

577 }
578
579 nextState = Ready;
580 entry.vaddr = vaddr;
581
582 Request::Flags flags = Request::PHYSICAL;
583 if (cr3.pcd)
584 flags.set(Request::UNCACHEABLE);
587 RequestPtr request = new Request(topAddr, dataSize, flags,
588 walker->masterId);
585
586 RequestPtr request = std::make_shared<Request>(
587 topAddr, dataSize, flags, walker->masterId);
588
589 read = new Packet(request, MemCmd::ReadReq);
590 read->allocate();
591}
592
593bool
594Walker::WalkerState::recvPacket(PacketPtr pkt)
595{
596 assert(pkt->isResponse());

--- 127 unchanged lines hidden ---
589 read = new Packet(request, MemCmd::ReadReq);
590 read->allocate();
591}
592
593bool
594Walker::WalkerState::recvPacket(PacketPtr pkt)
595{
596 assert(pkt->isResponse());

--- 127 unchanged lines hidden ---