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

target/riscv: prevent the fence.i from triggering the exception #898

Closed
wants to merge 1 commit into from

Conversation

wxjstz
Copy link
Contributor

@wxjstz wxjstz commented Aug 1, 2023

On platforms that do not support Zifencei, executing fence.i will trigger an exception, this patch eliminates the impact of the exception

Change-Id: I459cff096374064fdb6e18a9d95170510ae1f32e

On platforms that do not support Zifencei, executing fence.i will
trigger an exception, this patch eliminates the impact of the
exception

Change-Id: I459cff096374064fdb6e18a9d95170510ae1f32e
Signed-off-by: Xiang W <[email protected]>
@wxjstz
Copy link
Contributor Author

wxjstz commented Aug 1, 2023

please review it @timsifive @TommyMurphyTM1234

@wxjstz
Copy link
Contributor Author

wxjstz commented Aug 1, 2023

The patch requires progbufsize > 1, is this a issue?

Copy link
Collaborator

@MarekVCodasip MarekVCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch. I am afraid this is not a proper solution. The exceptions don't trigger in program buffer. There is therefore no reason to change the mtvec. Also, it is not mandatory to have program buffer memory mapped, therefore info->program_address does not have to be a meaningful value.

The exception caused by unsupported fence.i should not have any adverse effect. So there should be no need to handle it in a special way.

I do agree that with the separation of the fences into two program buffer executions. This will make it compatible with targets where progbufsize == 1

@wxjstz
Copy link
Contributor Author

wxjstz commented Aug 8, 2023

The exceptions don't trigger in program buffer

why? Can you tell me which spce this information comes from?

@MarekVCodasip
Copy link
Collaborator

why? Can you tell me which spce this information comes from?

Alright. It is a bit more general. They don't trigger in debug mode in general.

https://github.com/riscv/riscv-debug-spec/blob/master/riscv-debug-stable.pdf its currently on page 50 in section 4.1

@wxjstz
Copy link
Contributor Author

wxjstz commented Aug 8, 2023

why? Can you tell me which spce this information comes from?

Alright. It is a bit more general. They don't trigger in debug mode in general.

https://github.com/riscv/riscv-debug-spec/blob/master/riscv-debug-stable.pdf its currently on page 50 in section 4.1

Thank you!

@wxjstz wxjstz closed this Aug 8, 2023
@MarekVCodasip
Copy link
Collaborator

MarekVCodasip commented Aug 8, 2023

Don't close this, separating the two fences into two separate program buffer executions is still good and useful as not all targets implementing the program buffer have to have a progbufsize > 1

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

Successfully merging this pull request may close these issues.

2 participants