ARM TLB: Fix bug in memAttrs getting a bogus thread context
This commit is contained in:
parent
6b00c7fa22
commit
2bad5138e4
3 changed files with 7 additions and 5 deletions
|
@ -150,8 +150,9 @@ TableWalker::walk(RequestPtr _req, ThreadContext *_tc, uint8_t _cid, TLB::Mode _
|
|||
}
|
||||
|
||||
void
|
||||
TableWalker::memAttrs(TlbEntry &te, uint8_t texcb, bool s)
|
||||
TableWalker::memAttrs(ThreadContext *tc, TlbEntry &te, uint8_t texcb, bool s)
|
||||
{
|
||||
// Note: tc local variable is hiding tc class variable
|
||||
DPRINTF(TLBVerbose, "memAttrs texcb:%d s:%d\n", texcb, s);
|
||||
te.shareable = false; // default value
|
||||
bool outer_shareable = false;
|
||||
|
@ -221,6 +222,7 @@ TableWalker::memAttrs(TlbEntry &te, uint8_t texcb, bool s)
|
|||
panic("More than 32 states for 5 bits?\n");
|
||||
}
|
||||
} else {
|
||||
assert(tc);
|
||||
PRRR prrr = tc->readMiscReg(MISCREG_PRRR);
|
||||
NMRR nmrr = tc->readMiscReg(MISCREG_NMRR);
|
||||
DPRINTF(TLBVerbose, "memAttrs PRRR:%08x NMRR:%08x\n", prrr, nmrr);
|
||||
|
@ -415,7 +417,7 @@ TableWalker::doL1Descriptor()
|
|||
te.ap = l1Desc.ap();
|
||||
te.domain = l1Desc.domain();
|
||||
te.asid = contextId;
|
||||
memAttrs(te, l1Desc.texcb(), l1Desc.shareable());
|
||||
memAttrs(tc, te, l1Desc.texcb(), l1Desc.shareable());
|
||||
|
||||
DPRINTF(TLB, "Inserting Section Descriptor into TLB\n");
|
||||
DPRINTF(TLB, " - N%d pfn:%#x size: %#x global:%d valid: %d\n",
|
||||
|
@ -510,7 +512,7 @@ TableWalker::doL2Descriptor()
|
|||
te.xn = l2Desc.xn();
|
||||
te.ap = l2Desc.ap();
|
||||
te.domain = l1Desc.domain();
|
||||
memAttrs(te, l2Desc.texcb(), l2Desc.shareable());
|
||||
memAttrs(tc, te, l2Desc.texcb(), l2Desc.shareable());
|
||||
|
||||
if (!delayed) {
|
||||
tc = NULL;
|
||||
|
|
|
@ -313,7 +313,7 @@ class TableWalker : public MemObject
|
|||
TLB::Translation *_trans, bool timing);
|
||||
|
||||
void setTlb(TLB *_tlb) { tlb = _tlb; }
|
||||
void memAttrs(TlbEntry &te, uint8_t texcb, bool s);
|
||||
void memAttrs(ThreadContext *tc, TlbEntry &te, uint8_t texcb, bool s);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -387,7 +387,7 @@ TLB::translateFs(RequestPtr req, ThreadContext *tc, Mode mode,
|
|||
|
||||
// Set memory attributes
|
||||
TlbEntry temp_te;
|
||||
tableWalker->memAttrs(temp_te, 0, 1);
|
||||
tableWalker->memAttrs(tc, temp_te, 0, 1);
|
||||
temp_te.shareable = true;
|
||||
DPRINTF(TLBVerbose, "(No MMU) setting memory attributes: shareable:\
|
||||
%d, innerAttrs: %d, outerAttrs: %d\n", temp_te.shareable,
|
||||
|
|
Loading…
Reference in a new issue