Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrent HPTW access fault with IFU bus fetch #845

Open
rosethompson opened this issue Jun 19, 2024 · 2 comments
Open

Concurrent HPTW access fault with IFU bus fetch #845

rosethompson opened this issue Jun 19, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@rosethompson
Copy link
Contributor

Issue #412 exposed a bug in Wally with a concurrent I$ miss and DTLB miss. The HPTW makes a request which generates an access fault during an inflight I$ bus request. This Trapped during a bus access violating the atomic nature of the bus request.
A simulation solution was to suppress the fault in trap.sv...

assign TrapM = (ExceptionM & ~CommittedF) | InterruptM; // *** RT: review this additional ~CommittedF with DH and update priv chapter.

However this creates the potential hazard of missing exceptions. This warrants careful review and a better solution.

Ideally we allow the exception and find a way to either delay it or abort the ifu transaction.

Probably need to record the exception during the walk. Abort the walk. Wait for the ifu to finish, then replay the exception and take the trap.

Could also think more deeply about the entire exception architecture.

@rosethompson rosethompson self-assigned this Sep 12, 2024
@rosethompson
Copy link
Contributor Author

Confirmed this is a bug. I extended the hptwAccessFault.S test to create the specific condition above and the HPTW walks the page table multiple times while the IFU stalls the CPU. Fortunately it still produces the same exception, but it is wasting power and cycles.

@rosethompson
Copy link
Contributor Author

I have several thoughts about how to fix this.

  1. Easy. We an ignore since the bug is only performance.
  2. Simple. Use CommittedF to keep the hptw FSM in the Fault state. Some extra work is required to keep asserting the exception. I don't like that CommittedF or StallF now has to come into the hptw.
  3. Hard. The underlying problem is the IFU is performing a bus read while the hptw running. If it generates an exception, PCNextF needs to immediately point to the trap handler. We could decouple the bus controller from PCF/PCNextF. This would allow us to update PCF on a trap and still finish the bus transaction. We'd have to keep holding the CPU stalled during the trap which requires changing some PC muxes. Another advantage of this version is it would allow us to remove CommittedF from the TrapM logic for both exceptions and interrupts.

I think for now we should ignore the problem since it's just a performance bug, but do option 3 as we build the Wally enhancements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant