From 49a2d54e1aada7d2edeef48a113401a3e05aaec4 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 20 Nov 2011 05:10:05 -0800 Subject: X86: Fix the constant detecting three byte opcodes in the predecoder. --HG-- extra : rebase_source : b64c3d2348cb73177024695fb6e205d51bf1cda9 --- src/arch/x86/predecoder.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch') diff --git a/src/arch/x86/predecoder.cc b/src/arch/x86/predecoder.cc index 429b91687..a4aa93b48 100644 --- a/src/arch/x86/predecoder.cc +++ b/src/arch/x86/predecoder.cc @@ -186,7 +186,7 @@ namespace X86ISA DPRINTF(Predecoder, "Found two byte opcode.\n"); emi.opcode.prefixA = nextByte; } - else if(emi.opcode.num == 2 && (nextByte == 0x38 || nextByte == 0x3F)) + else if(emi.opcode.num == 2 && (nextByte == 0x38 || nextByte == 0x3A)) { nextState = OpcodeState; DPRINTF(Predecoder, "Found three byte opcode.\n"); -- cgit v1.2.3 From e7d0c999a140949e165b75961c4a32a01c7562ce Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Sun, 27 Nov 2011 22:00:58 -0500 Subject: SPARC: Isolate FP operations enough to prevent code/rounding mode reordering. --HG-- extra : rebase_source : ee79ab89c5a707c1294f38abb84c60f8ef64196c --- src/arch/sparc/isa/formats/basic.isa | 66 ++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 15 deletions(-) (limited to 'src/arch') diff --git a/src/arch/sparc/isa/formats/basic.isa b/src/arch/sparc/isa/formats/basic.isa index bef8af2cd..47c9cbd0d 100644 --- a/src/arch/sparc/isa/formats/basic.isa +++ b/src/arch/sparc/isa/formats/basic.isa @@ -33,6 +33,11 @@ def template BasicExecDeclare {{ Fault execute(%(CPU_exec_context)s *, Trace::InstRecord *) const; }}; +def template DoFpOpDeclare {{ + Fault doFpOp(%(CPU_exec_context)s *, Trace::InstRecord *) + const M5_NO_INLINE; +}}; + // Definitions of execute methods that panic. def template BasicExecPanic {{ Fault @@ -57,6 +62,21 @@ def template BasicDeclare {{ }; }}; +// Basic instruction class declaration template. +def template FpBasicDeclare {{ + /** + * Static instruction class for "%(mnemonic)s". + */ + class %(class_name)s : public %(base_class)s + { + public: + // Constructor. + %(class_name)s(ExtMachInst machInst); + %(BasicExecDeclare)s + %(DoFpOpDeclare)s + }; +}}; + // Basic instruction class declaration template. def template BasicDeclareWithMnemonic {{ /** @@ -110,6 +130,22 @@ def template BasicExecute {{ } }}; +def template DoFpOpExecute {{ + Fault + %(class_name)s::doFpOp(%(CPU_exec_context)s *xc, + Trace::InstRecord *traceData) const + { + Fault fault = NoFault; + %(op_decl)s; + %(op_rd)s; + %(fp_code)s; + if (fault == NoFault) { + %(op_wb)s; + } + return fault; + } +}}; + // Basic decode template. def template BasicDecode {{ return new %(class_name)s(machInst); @@ -131,9 +167,9 @@ def format BasicOperate(code, *flags) {{ }}; def format FpBasic(code, *flags) {{ - fp_code = """ + exec_code = """ Fsr |= bits(Fsr,4,0) << 5; - Fsr = insertBits(Fsr,4,0,0); + Fsr = insertBits(Fsr, 4, 0, 0); int newrnd = M5_FE_TONEAREST; switch (Fsr<31:30>) { case 0: newrnd = M5_FE_TONEAREST; break; @@ -143,18 +179,18 @@ def format FpBasic(code, *flags) {{ } int oldrnd = m5_fegetround(); m5_fesetround(newrnd); + __asm__ __volatile__("" ::: "memory"); + fault = doFpOp(xc, traceData); + __asm__ __volatile__("" ::: "memory"); + m5_fesetround(oldrnd); + return fault; """ - - fp_code += code - - - fp_code += """ - m5_fesetround(oldrnd); -""" - fp_code = filterDoubles(fp_code) - iop = InstObjParams(name, Name, 'SparcStaticInst', fp_code, flags) - header_output = BasicDeclare.subst(iop) - decoder_output = BasicConstructor.subst(iop) - decode_block = BasicDecode.subst(iop) - exec_output = BasicExecute.subst(iop) + fp_code = filterDoubles(code) + iop = InstObjParams(name, Name, 'SparcStaticInst', + { "code" : exec_code, "fp_code" : fp_code }, flags) + header_output = FpBasicDeclare.subst(iop) + decoder_output = BasicConstructor.subst(iop) + decode_block = BasicDecode.subst(iop) + exec_output = BasicExecute.subst(iop) + exec_output += DoFpOpExecute.subst(iop) }}; -- cgit v1.2.3 From 87b66c9ae3a27021135979f491e650f7be6d20a7 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 28 Nov 2011 04:35:55 -0500 Subject: SPARC: Minor style fix. I forgot to fix this as well per Ali's feedback. --HG-- extra : rebase_source : e70d031cb5f91e2212a1a73ea1769bf0549b826c --- src/arch/sparc/isa/formats/basic.isa | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch') diff --git a/src/arch/sparc/isa/formats/basic.isa b/src/arch/sparc/isa/formats/basic.isa index 47c9cbd0d..915e34564 100644 --- a/src/arch/sparc/isa/formats/basic.isa +++ b/src/arch/sparc/isa/formats/basic.isa @@ -168,7 +168,7 @@ def format BasicOperate(code, *flags) {{ def format FpBasic(code, *flags) {{ exec_code = """ - Fsr |= bits(Fsr,4,0) << 5; + Fsr |= bits(Fsr, 4, 0) << 5; Fsr = insertBits(Fsr, 4, 0, 0); int newrnd = M5_FE_TONEAREST; switch (Fsr<31:30>) { -- cgit v1.2.3 From 93fb460faded99c640ff0d7273611932a9ebc46c Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 1 Dec 2011 00:17:14 -0500 Subject: X86: Fix a bad segmentation check for the stack segment. --HG-- extra : rebase_source : 755f4f6eae52f88ed516a1f1ac9e2565725d89c1 --- src/arch/x86/isa/microops/regop.isa | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/arch') diff --git a/src/arch/x86/isa/microops/regop.isa b/src/arch/x86/isa/microops/regop.isa index a6e0564ba..bc139a609 100644 --- a/src/arch/x86/isa/microops/regop.isa +++ b/src/arch/x86/isa/microops/regop.isa @@ -1335,16 +1335,15 @@ let {{ if (selector.si || selector.ti) { if (!desc.p) { fault = new StackFault(selector); - } - } else { - if ((m5reg.submode != SixtyFourBitMode || - m5reg.cpl == 3) || - !(desc.s == 1 && - desc.type.codeOrData == 0 && desc.type.w) || + } else if (!(desc.s == 1 && desc.type.codeOrData == 0 && + desc.type.w) || (desc.dpl != m5reg.cpl) || (selector.rpl != m5reg.cpl)) { fault = new GeneralProtection(selector); } + } else if (m5reg.submode != SixtyFourBitMode || + m5reg.cpl == 3) { + fault = new GeneralProtection(selector); } break; case SegIretCheck: -- cgit v1.2.3 From 5901c5223f2e9280aa6f2307288b6a5dc554df83 Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Thu, 1 Dec 2011 00:15:22 -0800 Subject: ARM: Add IsSerializeAfter and IsNonSpeculative flag to the syscall instruction . Squashes the subsequent instructions in O3 pipe after the service call, so that they see the effect of the system call when re-executed. This isn't really an issue with FS mode, but can show up in SE mode. --HG-- extra : rebase_source : 613a69fe1d9834261e25a8cd340aa6b47578e1fe --- src/arch/arm/isa/insts/misc.isa | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/arch') diff --git a/src/arch/arm/isa/insts/misc.isa b/src/arch/arm/isa/insts/misc.isa index 2cf54fcdb..870f037d0 100644 --- a/src/arch/arm/isa/insts/misc.isa +++ b/src/arch/arm/isa/insts/misc.isa @@ -49,7 +49,8 @@ let {{ svcIop = InstObjParams("svc", "Svc", "PredOp", { "code": svcCode, - "predicate_test": predicateTest }, ["IsSyscall"]) + "predicate_test": predicateTest }, + ["IsSyscall", "IsNonSpeculative", "IsSerializeAfter"]) header_output = BasicDeclare.subst(svcIop) decoder_output = BasicConstructor.subst(svcIop) exec_output = PredOpExecute.subst(svcIop) -- cgit v1.2.3 From fa753c14549a768f0b8475e4e183acbdc394c248 Mon Sep 17 00:00:00 2001 From: Mitchell Hayenga Date: Thu, 1 Dec 2011 00:15:22 -0800 Subject: Device: Make changes necessary to support a coherent page walker cache. Adds the flag 'recvSnoops' which enables pagewalkers using DmaPorts, to properly configure snoops. --HG-- extra : rebase_source : 64207bef62c3268ddff2236ee4adae873812325f --- src/arch/arm/table_walker.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch') diff --git a/src/arch/arm/table_walker.cc b/src/arch/arm/table_walker.cc index 62b22472b..b2ab010c0 100644 --- a/src/arch/arm/table_walker.cc +++ b/src/arch/arm/table_walker.cc @@ -99,7 +99,7 @@ TableWalker::getPort(const std::string &if_name, int idx) System *sys = params()->sys; Tick minb = params()->min_backoff; Tick maxb = params()->max_backoff; - port = new DmaPort(this, sys, minb, maxb); + port = new DmaPort(this, sys, minb, maxb, true); return port; } return NULL; -- cgit v1.2.3