Re: [gem5-dev] Exception in Speculated Instruction?

2017-03-11 Thread Steve Reinhardt
It may be that it's the split request test that's broken... it would be interesting to check whether wrapping around to address 0 is the correct behavior or not. At least in some old segmented addressing modes on x86, I believe that the system did support address wraparound (not so much

Re: [gem5-dev] Exception in Speculated Instruction?

2017-03-11 Thread Alec Roelke
I think I've found the problem; it has less to do with split memory requests and more to do with integer overflow (register a1's value of -1 should have tipped me off earlier). Basically, splitRequest() only checks if the request crosses a cache boundary by testing if the address of the last byte

Re: [gem5-dev] Exception in Speculated Instruction?

2017-03-10 Thread Gabe Black
If your ISA doesn't support unaligned accesses, the page table code should return a fault (architectural or made up) and return that. If it does and you're not expecting one that's a different story since it indicates some other bit of code isn't doing it's job, for instance not splitting up an

Re: [gem5-dev] Exception in Speculated Instruction?

2017-03-10 Thread Steve Reinhardt
I haven't looked at the source directly to see how much of the unaligned access code is in x86-specific code vs. generic code, and I don't remember off the top of my head. I'm glad to hear that the splitRequest() call is in the generic part of the code. The symptom that you're getting implies

Re: [gem5-dev] Exception in Speculated Instruction?

2017-03-10 Thread Alec Roelke
There used to be a problem that looked similar to this one where an ld instruction would cross a cache line, and to fix that I was advised to look at the splitRequest() function for help. In doing so, I found that initiateMemRead() in BaseDynInst already calls it if the ISA supports unaligned

Re: [gem5-dev] Exception in Speculated Instruction?

2017-03-10 Thread Steve Reinhardt
Have you looked at how x86 supports unaligned accesses? The gem5 memory system does not support them natively; you have to check if your access is unaligned, and issue two requests to the cache for the two halves to guarantee there are no cache line or page crossings within a single request.

Re: [gem5-dev] Exception in Speculated Instruction?

2017-03-10 Thread Alec Roelke
I get an assertion failure: build/RISCV/mem/page_table.cc:190: Fault PageTableBase::translate(RequestPtr): Assertion `pageAlign(req->getVaddr() + req->getSize() - 1) == pageAlign(req->getVaddr())' failed. I can't tell from my debug trace (with Exec and Commit flags on) if this is happening

Re: [gem5-dev] Exception in Speculated Instruction?

2017-03-10 Thread Steve Reinhardt
The instruction should be marked as causing a fault, but the fault action should not be invoked until the instruction is committed. Because it's a mis-speculated instruction, it will never be committed, so the fault should never be observed. I'm not sure what you mean by "crashes", so I'm not sure

[gem5-dev] Exception in Speculated Instruction?

2017-03-10 Thread Alec Roelke
Hello Everyone, I'm trying to debug RISC-V running on the O3 model, and I've encountered a problem where the CPU tries to speculatively execute a load instruction (which is actually along a branch that ends up not being taken) in which the data crosses a page boundary and causes a fault. The