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

Vectored xTVEC/xTCC mode address may need checking #110

Open
tariqkurd-repo opened this issue Aug 21, 2023 · 4 comments
Open

Vectored xTVEC/xTCC mode address may need checking #110

tariqkurd-repo opened this issue Aug 21, 2023 · 4 comments

Comments

@tariqkurd-repo
Copy link

When programming xTVEC/xTCC the core does a representability check with the final legalised write value (specifically after legalising the MODE field).

However, when in vectored interrupt mode, the handler address is MTCC.address+4*CAUSE.
Standard interrupt numbers go up to 11, but platform defined ones can have higher numbers.
What do we do about ensuring that the resulting cap with the updated address is representable? Is there any realistic danger that it could be unrepresentable?

I'd prefer not to do a CSetAddr on the address after knowing the interrupt cause, I think it's more useful to do an improved check on writing, e.g. bounds of the maximum range of vectored addresses.

@tariqkurd-repo tariqkurd-repo changed the title Vectored xTVEC/xTCC mode may needs checking Vectored xTVEC/xTCC mode address may need checking Aug 21, 2023
@jrtc27
Copy link
Member

jrtc27 commented Aug 21, 2023

Morello does a representability check there

@jrtc27
Copy link
Member

jrtc27 commented Aug 21, 2023

(CapSetValue is their function that does a CSetAddr, due to their awful nomenclature around the address)
image

@jrtc27
Copy link
Member

jrtc27 commented Aug 21, 2023

Of course, depending on the number of interrupt sources you have, and what XLEN is, you may know that you can never go unrepresentable. You can surely specialise the representability check based on bounding how far out of bounds you could possibly be, too.

@tariqkurd-repo
Copy link
Author

interesting, thanks. I guess either a representability or bounds check on write covers the case.

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

No branches or pull requests

2 participants