summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2017-10-20 14:18:00 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-11-15 14:16:57 +0000
commit053bb85b3220986f56fbbd24bd5bc7c04dea4ce6 (patch)
treee77da701e5f245253b48b9f4ac9fae4d6e35e802 /src/arch
parentef0490081fa7ebcda2e1c7adccb05b3a14014cf1 (diff)
downloadgem5-053bb85b3220986f56fbbd24bd5bc7c04dea4ce6.tar.xz
arch-arm: Removing FlushPipe fault, using SquashAfter
This Patch is removing the FlushPipe ArmFault, which was used for flushing the pipeline in favour of the general IsSquashAfter StaticInstr flag. Using a fault was preventing tracers from tracing barriers like ISB and from adding them to the instruction count Change-Id: I176e9254eca904694f2f611eb486c55e50ec61ff Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com> Reviewed-on: https://gem5-review.googlesource.com/5361 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/faults.cc21
-rw-r--r--src/arch/arm/faults.hh10
-rw-r--r--src/arch/arm/insts/pseudo.cc12
-rw-r--r--src/arch/arm/isa/insts/misc.isa7
-rw-r--r--src/arch/arm/isa/insts/misc64.isa11
5 files changed, 15 insertions, 46 deletions
diff --git a/src/arch/arm/faults.cc b/src/arch/arm/faults.cc
index 740d71d02..ef9d05a13 100644
--- a/src/arch/arm/faults.cc
+++ b/src/arch/arm/faults.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012-2014, 2016 ARM Limited
+ * Copyright (c) 2010, 2012-2014, 2016-2017 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -278,11 +278,6 @@ template<> ArmFault::FaultVals ArmFaultVals<SystemError>::vals = {
"SError", 0x000, 0x180, 0x380, 0x580, 0x780, MODE_SVC,
0, 0, 0, 0, false, true, true, EC_SERROR, FaultStat()
};
-template<> ArmFault::FaultVals ArmFaultVals<FlushPipe>::vals = {
- // Some dummy values
- "Pipe Flush", 0x000, 0x000, 0x000, 0x000, 0x000, MODE_SVC,
- 0, 0, 0, 0, false, true, true, EC_UNKNOWN, FaultStat()
-};
template<> ArmFault::FaultVals ArmFaultVals<ArmSev>::vals = {
// Some dummy values
"ArmSev Flush", 0x000, 0x000, 0x000, 0x000, 0x000, MODE_SVC,
@@ -1399,19 +1394,6 @@ SystemError::routeToHyp(ThreadContext *tc) const
}
void
-FlushPipe::invoke(ThreadContext *tc, const StaticInstPtr &inst) {
- DPRINTF(Faults, "Invoking FlushPipe Fault\n");
-
- // Set the PC to the next instruction of the faulting instruction.
- // Net effect is simply squashing all instructions behind and
- // start refetching from the next instruction.
- PCState pc = tc->pcState();
- assert(inst);
- inst->advancePC(pc);
- tc->pcState(pc);
-}
-
-void
ArmSev::invoke(ThreadContext *tc, const StaticInstPtr &inst) {
DPRINTF(Faults, "Invoking ArmSev Fault\n");
if (!FullSystem)
@@ -1443,7 +1425,6 @@ template class ArmFaultVals<SecureMonitorTrap>;
template class ArmFaultVals<PCAlignmentFault>;
template class ArmFaultVals<SPAlignmentFault>;
template class ArmFaultVals<SystemError>;
-template class ArmFaultVals<FlushPipe>;
template class ArmFaultVals<ArmSev>;
template class AbortFault<PrefetchAbort>;
template class AbortFault<DataAbort>;
diff --git a/src/arch/arm/faults.hh b/src/arch/arm/faults.hh
index 8d72dee91..de5061bed 100644
--- a/src/arch/arm/faults.hh
+++ b/src/arch/arm/faults.hh
@@ -546,15 +546,6 @@ class SystemError : public ArmFaultVals<SystemError>
};
// A fault that flushes the pipe, excluding the faulting instructions
-class FlushPipe : public ArmFaultVals<FlushPipe>
-{
- public:
- FlushPipe() {}
- void invoke(ThreadContext *tc, const StaticInstPtr &inst =
- StaticInst::nullStaticInstPtr) override;
-};
-
-// A fault that flushes the pipe, excluding the faulting instructions
class ArmSev : public ArmFaultVals<ArmSev>
{
public:
@@ -592,7 +583,6 @@ template<> ArmFault::FaultVals ArmFaultVals<SecureMonitorTrap>::vals;
template<> ArmFault::FaultVals ArmFaultVals<PCAlignmentFault>::vals;
template<> ArmFault::FaultVals ArmFaultVals<SPAlignmentFault>::vals;
template<> ArmFault::FaultVals ArmFaultVals<SystemError>::vals;
-template<> ArmFault::FaultVals ArmFaultVals<FlushPipe>::vals;
template<> ArmFault::FaultVals ArmFaultVals<ArmSev>::vals;
diff --git a/src/arch/arm/insts/pseudo.cc b/src/arch/arm/insts/pseudo.cc
index ab38e29ea..aa3d93d6e 100644
--- a/src/arch/arm/insts/pseudo.cc
+++ b/src/arch/arm/insts/pseudo.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014,2016 ARM Limited
+ * Copyright (c) 2014,2016-2017 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -190,6 +190,9 @@ McrMrcMiscInst::McrMrcMiscInst(const char *_mnemonic, ExtMachInst _machInst,
flags[IsNonSpeculative] = true;
iss = _iss;
miscReg = _miscReg;
+
+ if (miscReg == MISCREG_DCCMVAC)
+ flags[IsSquashAfter] = true;
}
Fault
@@ -207,12 +210,9 @@ McrMrcMiscInst::execute(ExecContext *xc, Trace::InstRecord *traceData) const
if (hypTrap) {
return std::make_shared<HypervisorTrap>(machInst, iss,
EC_TRAPPED_CP15_MCR_MRC);
- }
-
- if (miscReg == MISCREG_DCCMVAC)
- return std::make_shared<FlushPipe>();
- else
+ } else {
return NoFault;
+ }
}
std::string
diff --git a/src/arch/arm/isa/insts/misc.isa b/src/arch/arm/isa/insts/misc.isa
index 4681d50a9..b42c9f9dd 100644
--- a/src/arch/arm/isa/insts/misc.isa
+++ b/src/arch/arm/isa/insts/misc.isa
@@ -1070,12 +1070,11 @@ let {{
return std::make_shared<HypervisorTrap>(machInst, imm,
EC_TRAPPED_CP15_MCR_MRC);
}
- fault = std::make_shared<FlushPipe>();
'''
isbIop = InstObjParams("isb", "Isb", "ImmOp",
{"code": isbCode,
"predicate_test": predicateTest},
- ['IsSerializeAfter'])
+ ['IsSerializeAfter', 'IsSquashAfter'])
header_output += ImmOpDeclare.subst(isbIop)
decoder_output += ImmOpConstructor.subst(isbIop)
exec_output += PredOpExecute.subst(isbIop)
@@ -1087,12 +1086,12 @@ let {{
return std::make_shared<HypervisorTrap>(machInst, imm,
EC_TRAPPED_CP15_MCR_MRC);
}
- fault = std::make_shared<FlushPipe>();
'''
dsbIop = InstObjParams("dsb", "Dsb", "ImmOp",
{"code": dsbCode,
"predicate_test": predicateTest},
- ['IsMemBarrier', 'IsSerializeAfter'])
+ ['IsMemBarrier', 'IsSerializeAfter',
+ 'IsSquashAfter'])
header_output += ImmOpDeclare.subst(dsbIop)
decoder_output += ImmOpConstructor.subst(dsbIop)
exec_output += PredOpExecute.subst(dsbIop)
diff --git a/src/arch/arm/isa/insts/misc64.isa b/src/arch/arm/isa/insts/misc64.isa
index 08902abe8..ac9f0a960 100644
--- a/src/arch/arm/isa/insts/misc64.isa
+++ b/src/arch/arm/isa/insts/misc64.isa
@@ -139,16 +139,15 @@ let {{
decoder_output += BasicConstructor64.subst(unknown64Iop)
exec_output += BasicExecute.subst(unknown64Iop)
- isbIop = InstObjParams("isb", "Isb64", "ArmStaticInst",
- "fault = std::make_shared<FlushPipe>();",
- ['IsSerializeAfter'])
+ isbIop = InstObjParams("isb", "Isb64", "ArmStaticInst", "",
+ ['IsSerializeAfter', 'IsSquashAfter'])
header_output += BasicDeclare.subst(isbIop)
decoder_output += BasicConstructor64.subst(isbIop)
exec_output += BasicExecute.subst(isbIop)
- dsbIop = InstObjParams("dsb", "Dsb64", "ArmStaticInst",
- "fault = std::make_shared<FlushPipe>();",
- ['IsMemBarrier', 'IsSerializeAfter'])
+ dsbIop = InstObjParams("dsb", "Dsb64", "ArmStaticInst", "",
+ ['IsMemBarrier', 'IsSerializeAfter',
+ 'IsSquashAfter'])
header_output += BasicDeclare.subst(dsbIop)
decoder_output += BasicConstructor64.subst(dsbIop)
exec_output += BasicExecute.subst(dsbIop)